phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: tts admin.php,1.2,1.2.2.1 index.php,1.43.2.1,1.4


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] CVS: tts admin.php,1.2,1.2.2.1 index.php,1.43.2.1,1.43.2.2 newticket.php,1.31.2.1,1.31.2.2 viewticket_details.php,1.42.2.1,1.42.2.2
Date: Fri, 25 Jan 2002 17:00:55 -0500

Update of /cvsroot/phpgroupware/tts
In directory subversions:/tmp/cvs-serv22020

Modified Files:
      Tag: Version-0_9_14-branch
        admin.php index.php newticket.php viewticket_details.php 
Log Message:
Merged in patchs from wiredtri to fix emailing tickets, and group access


Index: admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/admin.php,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -r1.2 -r1.2.2.1
*** admin.php   24 Sep 2001 16:12:00 -0000      1.2
--- admin.php   25 Jan 2002 22:00:52 -0000      1.2.2.1
***************
*** 72,75 ****
--- 72,77 ----
                Header('Location: ' . 
$GLOBALS['phpgw']->link('/admin/index.php'));
        }
+ $after= $GLOBALS['phpgw']->config->config_data['mailnotification'];
+ echo "after: $after <br>";
  
        $GLOBALS['phpgw']->common->phpgw_header();

Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/index.php,v
retrieving revision 1.43.2.1
retrieving revision 1.43.2.2
diff -C2 -r1.43.2.1 -r1.43.2.2
*** index.php   23 Jan 2002 19:24:56 -0000      1.43.2.1
--- index.php   25 Jan 2002 22:00:52 -0000      1.43.2.2
***************
*** 135,139 ****
        $GLOBALS['phpgw']->template->set_var('tts_head_ticket', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_id',$order,'/tts/index.php',lang('Ticket').'
 #'));
        $GLOBALS['phpgw']->template->set_var('tts_head_prio', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_priority',$order,'/tts/index.php',lang('Prio')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_group',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_category',$order,'/tts/index.php',lang('Group'))
 );
        $GLOBALS['phpgw']->template->set_var('tts_head_assignedto', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_assignedto',$order,'/tts/index.php',lang('Assigned
 to')));
        $GLOBALS['phpgw']->template->set_var('tts_head_openedby', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_owner',$order,'/tts/index.php',lang('Opened
 by')));
--- 135,140 ----
        $GLOBALS['phpgw']->template->set_var('tts_head_ticket', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_id',$order,'/tts/index.php',lang('Ticket').'
 #'));
        $GLOBALS['phpgw']->template->set_var('tts_head_prio', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_priority',$order,'/tts/index.php',lang('Prio')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_group',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_group',$order,'/tts/index.php',lang('Group')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_category',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_category',$order,'/tts/index.php',lang('Category')));
        $GLOBALS['phpgw']->template->set_var('tts_head_assignedto', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_assignedto',$order,'/tts/index.php',lang('Assigned
 to')));
        $GLOBALS['phpgw']->template->set_var('tts_head_openedby', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_owner',$order,'/tts/index.php',lang('Opened
 by')));
***************
*** 199,207 ****
                        if (! $ticket_read)
                        {
!                               
$GLOBALS['phpgw']->template->parse('tts_ticket_id','tts_ticket_id_unread');
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->parse('tts_ticket_id','tts_ticket_id_read');
                        }
  
--- 200,208 ----
                        if (! $ticket_read)
                        {
!                               
$GLOBALS['phpgw']->template->fp('tts_ticket_id','tts_ticket_id_unread');
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->fp('tts_ticket_id','tts_ticket_id_read');
                        }
  
***************
*** 210,215 ****
                        
$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr );
  
!                       $cat_name = 
$phpgw->categories->id2name($GLOBALS['phpgw']->db->f('ticket_category'));
                        
$GLOBALS['phpgw']->template->set_var('row_category',$cat_name);
  
                        
$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', 
$GLOBALS['phpgw']->db->f('ticket_assignedto')?$phpgw->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')):lang('None'));
--- 211,220 ----
                        
$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr );
  
!                       $cat_name   = 
$phpgw->categories->id2name($GLOBALS['phpgw']->db->f('ticket_category'));
                        
$GLOBALS['phpgw']->template->set_var('row_category',$cat_name);
+ 
+                       $group_name = 
$phpgw->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_group'));
+                       $group_name = ($group_name ? $group_name : '--');
+                       
$GLOBALS['phpgw']->template->set_var('row_group',$group_name);
  
                        
$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', 
$GLOBALS['phpgw']->db->f('ticket_assignedto')?$phpgw->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')):lang('None'));

Index: newticket.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/newticket.php,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -C2 -r1.31.2.1 -r1.31.2.2
*** newticket.php       24 Jan 2002 19:45:34 -0000      1.31.2.1
--- newticket.php       25 Jan 2002 22:00:52 -0000      1.31.2.2
***************
*** 29,32 ****
--- 29,34 ----
        include('../header.inc.php');
  
+         $GLOBALS['phpgw']->config->read_repository();
+ 
        if ($cancel)
        {
***************
*** 38,42 ****
                $phpgw->db->query("insert into phpgw_tts_tickets 
(ticket_group,ticket_priority,ticket_owner,"
                        . 
"ticket_assignedto,ticket_subject,ticket_category,ticket_billable_hours,"
!                       . "ticket_billable_rate,ticket_status,ticket_details) 
values ('0','"
                        . $ticket['priority'] . "','"
                        . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
--- 40,45 ----
                $phpgw->db->query("insert into phpgw_tts_tickets 
(ticket_group,ticket_priority,ticket_owner,"
                        . 
"ticket_assignedto,ticket_subject,ticket_category,ticket_billable_hours,"
!                       . "ticket_billable_rate,ticket_status,ticket_details) 
values ('"
!                         . $ticket['group'] . "','"
                        . $ticket['priority'] . "','"
                        . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
***************
*** 53,57 ****
                $historylog->add('O',$ticket_id,' ','');
  
!               if ($GLOBALS['phpgw_info']['server']['tts_mailticket'])
                {
                        mail_ticket($ticket_id);
--- 56,61 ----
                $historylog->add('O',$ticket_id,' ','');
  
!               if ($GLOBALS['phpgw']->config->config_data['mailnotification'])
! 
                {
                        mail_ticket($ticket_id);
***************
*** 88,91 ****
--- 92,96 ----
                        'newticket'   => 'newticket.tpl'
                ));
+                 
$GLOBALS['phpgw']->template->set_block('newticket','options_select');
                $GLOBALS['phpgw']->template->set_block('newticket','form');
  
***************
*** 122,132 ****
                unset($s);
                $groups = CreateObject('phpgwapi.accounts');
!               $group_list = $groups->get_list('groups');
                while (list($key,$entry) = each($group_list))
                {
!                       $s .= '<option value="' . $entry['account_id'] . '" ' . 
$entry_selected[$entry['account_lid']]
!                               . '>' . $entry['account_lid'] . '</option>';
                }
-               $GLOBALS['phpgw']->template->set_var('value_group','<select 
name="ticket[group]">' . $s . '</select>');
  
                $s = '<select name="ticket[category]">' . 
$GLOBALS['phpgw']->categories->formated_list('select','',$group,True) . 
'</select>';
--- 127,141 ----
                unset($s);
                $groups = CreateObject('phpgwapi.accounts');
!                 $group_list=Array();
!                 
$group_list=$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
! 
                while (list($key,$entry) = each($group_list))
                {
!                         $GLOBALS['phpgw']->template->set_var('optionname', 
$entry['account_name']);
!                         $GLOBALS['phpgw']->template->set_var('optionvalue', 
$entry['account_id']);
!                         
$GLOBALS['phpgw']->template->set_var('optionselected', $tag);
!                         
$GLOBALS['phpgw']->template->parse('options_group','options_select',true);
! 
                }
  
                $s = '<select name="ticket[category]">' . 
$GLOBALS['phpgw']->categories->formated_list('select','',$group,True) . 
'</select>';

Index: viewticket_details.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/viewticket_details.php,v
retrieving revision 1.42.2.1
retrieving revision 1.42.2.2
diff -C2 -r1.42.2.1 -r1.42.2.2
*** viewticket_details.php      24 Jan 2002 19:45:34 -0000      1.42.2.1
--- viewticket_details.php      25 Jan 2002 22:00:52 -0000      1.42.2.2
***************
*** 16,19 ****
--- 16,20 ----
                'enable_nextmatchs_class' => True,
                'enable_categories_class' => True,
+               'enable_config_class' => True,
                'currentapp'              => 'tts'
        );
***************
*** 28,31 ****
--- 29,35 ----
        include('../header.inc.php');
  
+       $GLOBALS['phpgw']->config->read_repository();
+ 
+ 
        $GLOBALS['phpgw']->historylog = 
createobject('phpgwapi.historylog','tts');
        $GLOBALS['phpgw']->historylog->types = array(
***************
*** 38,42 ****
                'S' => 'Subject changed',
                'B' => 'Billing rate',
!               'H' => 'Billing hours'
        );
  
--- 42,47 ----
                'S' => 'Subject changed',
                'B' => 'Billing rate',
!               'H' => 'Billing hours',
!               'G' => 'Group ownership changed'
        );
  
***************
*** 66,69 ****
--- 71,75 ----
                $ticket['priority']       = 
$GLOBALS['phpgw']->db->f('ticket_priority');
                $ticket['owner']          = 
$GLOBALS['phpgw']->db->f('ticket_owner');
+               $ticket['group']          = 
$GLOBALS['phpgw']->db->f('ticket_group');
  
                
$GLOBALS['phpgw']->template->set_file('viewticket','viewticket_details.tpl');
***************
*** 75,79 ****
                $GLOBALS['phpgw']->template->set_block('viewticket','form');
  
!               $messages = 
$GLOBALS['phpgw']->session->appsession('messages','tts');
                if ($messages)
                {
--- 81,85 ----
                $GLOBALS['phpgw']->template->set_block('viewticket','form');
  
!               $messages .= 
$GLOBALS['phpgw']->session->appsession('messages','tts');
                if ($messages)
                {
***************
*** 93,99 ****
                // Choose the correct priority to display
                $priority_selected[$ticket['priority']] = ' selected';
!               $priority_comment[1]=' - '.lang('Lowest'); 
!               $priority_comment[5]=' - '.lang('Medium'); 
!               $priority_comment[10]=' - '.lang('Highest'); 
  
                for ($i=1; $i<=10; $i++)
--- 99,105 ----
                // Choose the correct priority to display
                $priority_selected[$ticket['priority']] = ' selected';
!               $priority_comment[1]  = ' - '.lang('Lowest'); 
!               $priority_comment[5]  = ' - '.lang('Medium'); 
!               $priority_comment[10] = ' - '.lang('Highest'); 
  
                for ($i=1; $i<=10; $i++)
***************
*** 127,130 ****
--- 133,137 ----
                // Figure out when it was opened and last closed
                $history_array = 
$GLOBALS['phpgw']->historylog->return_array(array(),array('X','O'),'','',$ticket_id);
+ 
                while (is_array($history_array) && list(,$value) = 
each($history_array))
                {
***************
*** 141,161 ****
  
                // group
! /*
!               $groups = $accounts;
!               $group_list = $groups->get_list('groups');
                while (list($key,$entry) = each($group_list))
                {
                        $tag = '';
!                       if ($entry['account_lid'] == $ticket['groups'])
                        {
                                $tag = 'selected';
                        }
!                       $GLOBALS['phpgw']->template->set_var('optionname', 
$entry['account_lid']);
                        $GLOBALS['phpgw']->template->set_var('optionvalue', 
$entry['account_id']);
                        $GLOBALS['phpgw']->template->set_var('optionselected', 
$tag);
                        
$GLOBALS['phpgw']->template->parse('options_group','options_select',true);
                }
! */
!               
$GLOBALS['phpgw']->template->set_var('options_category',$GLOBALS['phpgw']->categories->formated_list('select','',$ticket['category'],True));
  
                $ticket_status[$ticket['status']] = ' selected';
--- 148,169 ----
  
                // group
! 
!               $group_list = array();
!               $group_list = 
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
! 
                while (list($key,$entry) = each($group_list))
                {
                        $tag = '';
!                       if ($entry['account_id'] == $ticket['group'])
                        {
                                $tag = 'selected';
                        }
!                       $GLOBALS['phpgw']->template->set_var('optionname', 
$entry['account_name']);
                        $GLOBALS['phpgw']->template->set_var('optionvalue', 
$entry['account_id']);
                        $GLOBALS['phpgw']->template->set_var('optionselected', 
$tag);
                        
$GLOBALS['phpgw']->template->parse('options_group','options_select',true);
                }
! 
!               
$GLOBALS['phpgw']->template->set_var('options_category',$GLOBALS['phpgw']->categories->formated_list('select','',$ticket['category'],$ticket['category'],True));
  
                $ticket_status[$ticket['status']] = ' selected';
***************
*** 197,201 ****
                $GLOBALS['phpgw']->template->set_var('lang_old_value',lang('Old 
Value'));
  
!               $history_array = 
$GLOBALS['phpgw']->historylog->return_array(array('C','O'),array(),'','',$ticket_id);
                while (is_array($history_array) && list(,$value) = 
each($history_array))
                {
--- 205,209 ----
                $GLOBALS['phpgw']->template->set_var('lang_old_value',lang('Old 
Value'));
  
!               $history_array = 
$GLOBALS['phpgw']->historylog->return_array(array('C'),array(),'','',$ticket_id);
                while (is_array($history_array) && list(,$value) = 
each($history_array))
                {
***************
*** 216,219 ****
--- 224,228 ----
                                case 'H': $type = lang('Billable hours 
changed'); break;
                                case 'B': $type = lang('Billable rate 
changed'); break;
+                               case 'G': $type = lang('Group ownership 
changed'); break;
                                default: break;
                        }
***************
*** 247,250 ****
--- 256,269 ----
                                
$GLOBALS['phpgw']->template->set_var('value_old_value',$GLOBALS['phpgw']->categories->id2name($value['old_value']));
                        }
+                       else if ($value['status'] == 'G')
+                       {
+                               $s = 
$GLOBALS['phpgw']->accounts->id2name($value['new_value']);
+                               $s = ($s ? $s : '--');
+                               
$GLOBALS['phpgw']->template->set_var('value_new_value',$s);
+ 
+                               
$GLOBALS['phpgw']->accounts->id2name($value['old_value']);
+                               $s = ($s ? $s : '--');
+                               
$GLOBALS['phpgw']->template->set_var('value_old_value',$s);
+                       }
                        else if ($value['status'] != 'O' && $value['new_value'])
                        {
***************
*** 290,294 ****
  
                $GLOBALS['phpgw']->template->set_var('lang_group', 
lang('Group'));
!               
$GLOBALS['phpgw']->template->set_var('value_group',$GLOBALS['phpgw']->accounts->id2name($phpgw->db->f('ticket_group')));
  
                
$GLOBALS['phpgw']->template->set_var('lang_billable_hours',lang('Billable 
hours'));
--- 309,315 ----
  
                $GLOBALS['phpgw']->template->set_var('lang_group', 
lang('Group'));
!               $s = $GLOBALS['phpgw']->accounts->id2name($ticket['group']);
!               $s = ($s ? $s : '--');
!               $GLOBALS['phpgw']->template->set_var('value_group',$s);
  
                
$GLOBALS['phpgw']->template->set_var('lang_billable_hours',lang('Billable 
hours'));
***************
*** 342,345 ****
--- 363,367 ----
                $old_billable_hours = 
$GLOBALS['phpgw']->db->f('ticket_billable_hours');
                $old_billable_rate = 
$GLOBALS['phpgw']->db->f('ticket_billable_rate');
+               $old_group   = $GLOBALS['phpgw']->db->f('ticket_group');
  
                $GLOBALS['phpgw']->db->transaction_begin();
***************
*** 357,369 ****
                ** B - Billing rate
                ** H - Billing hours
                */
  
                if ($old_status != $ticket['status'])
                {
!                       $fields_updated = True;
!                       
$GLOBALS['phpgw']->historylog->add($ticket['status'],$ticket_id,$ticket['status'],$old_status);
  
!                       $GLOBALS['phpgw']->db->query("update phpgw_tts_tickets 
set ticket_status='"
!                               . $ticket['status'] . "' where 
ticket_id='$ticket_id'",__LINE__,__FILE__);
                }
  
--- 379,409 ----
                ** B - Billing rate
                ** H - Billing hours
+               ** G - Group
                */
  
                if ($old_status != $ticket['status'])
                {
!                       //only allow assigned-to or admin members to close 
tickets
!                       if (($GLOBALS['phpgw_info']['user']['account_id'] == 
$oldassigned) ||
!                               
($GLOBALS['phpgw']->acl->get_specific_rights('Admins','phpgw_group')))
!                       {
!                               $fields_updated = True;
!                               
$GLOBALS['phpgw']->historylog->add($ticket['status'],$ticket_id,$ticket['status'],$old_status);
! 
!                               $GLOBALS['phpgw']->db->query("update 
phpgw_tts_tickets set ticket_status='"
!                                       . $ticket['status'] . "' where 
ticket_id='$ticket_id'",__LINE__,__FILE__);
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->session->appsession('messages','tts',lang('You can only 
close a ticket if it is assigned to you.'));
!                       }
!               }
  
!               if ($old_group != $ticket['group'])
!               {
!                       $fields_updated = True;
!                       $GLOBALS['phpgw']->db->query("update phpgw_tts_tickets 
set ticket_group='" . $ticket['group']
!                               . "' where 
ticket_id='$ticket_id'",__LINE__,__FILE__);
!                       
$GLOBALS['phpgw']->historylog->add('G',$ticket_id,$ticket['group'],$old_group);
                }
  
***************
*** 416,423 ****
                        $GLOBALS['phpgw']->db->transaction_commit();
  
-                       if ($GLOBALS['phpgw_info']['server']['tts_mailticket'])
-                       {
-                               mail_ticket($ticket_id);
-                       }
                }
                else
--- 456,459 ----
***************
*** 430,433 ****
--- 466,475 ----
                {
                        
$GLOBALS['phpgw']->session->appsession('messages','tts',lang('Ticket has been 
updated'));
+ 
+                       if 
($GLOBALS['phpgw']->config->config_data['mailnotification'])
+ 
+                       {
+                               mail_ticket($ticket_id);
+                       } 
                }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]