phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: tts/inc functions.inc.php,1.37,1.38 class.bo.inc


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: tts/inc functions.inc.php,1.37,1.38 class.bo.inc.php,1.4,1.5
Date: Sat, 22 Jun 2002 21:08:16 -0400

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

Modified Files:
        functions.inc.php class.bo.inc.php 
Log Message:
GNU Patch #337.

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/inc/functions.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** functions.inc.php   30 Dec 2001 09:38:16 -0000      1.37
--- functions.inc.php   23 Jun 2002 01:08:13 -0000      1.38
***************
*** 32,62 ****
  
                
!               if ($GLOBALS['phpgw']->config->config_data['mailnotification']) 
{
                
                        $GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
        
!                       $GLOBALS['phpgw']->db->query('select 
t_id,t_category,t_detail,t_priority,t_user,t_assignedto,'
!                               . "t_timestamp_opened, t_timestamp_closed, 
t_subject from phpgw_tts_tickets where t_id='$ticket_id'");
                        $GLOBALS['phpgw']->db->next_record();
-     
-                       $group = $GLOBALS['phpgw']->db->f('t_category');
                        
                        // build subject
!                       $subject = '[TTS #'.$ticket_id.' '.$group.'] 
'.(!$GLOBALS['phpgw']->db->f('t_timestamp_closed')?'Updated':'Closed').': 
'.$GLOBALS['phpgw']->db->f('t_subject');
  
                        // build body
                        $body  = '';
!                       $body .= 'TTS #'.$ticket_id."\n\n";
!                       $body .= 'Subject: 
'.$GLOBALS['phpgw']->db->f('t_subject')."\n\n";
!                       $body .= 'Assigned To: 
'.$GLOBALS['phpgw']->db->f('t_assignedto')."\n\n";
!                       $body .= 'Priority: 
'.$GLOBALS['phpgw']->db->f('t_priority')."\n\n";
!                       $body .= 'Group: '.$group."\n\n";
!                       $body .= 'Opened By: 
'.$GLOBALS['phpgw']->db->f('t_user')."\n";
!                       $body .= 'Date Opened: 
'.$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('t_timestamp_opened'))."\n\n";
                        if($GLOBALS['phpgw']->db->f('t_timestamp_closed'))
                        {
!                               $body .= 'Date Closed: 
'.$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('t_timestamp_closed'))."\n\n";
                        }
!                       $body .= 
stripslashes(strip_tags($GLOBALS['phpgw']->db->f('t_detail')))."\n\n.";
                        
                        if 
($GLOBALS['phpgw']->config->config_data['groupnotification']) 
--- 32,79 ----
  
                
!               if ($GLOBALS['phpgw']->config->config_data['mailnotification'])
!               {
!                       $db2 = $GLOBALS['phpgw']->db;
                
                        $GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
        
!                       $GLOBALS['phpgw']->db->query('SELECT * FROM 
phpgw_tts_tickets WHERE ticket_id='.$ticket_id,__LINE__,__FILE__);
                        $GLOBALS['phpgw']->db->next_record();
                        
+                       $db2->query('SELECT * FROM phpgw_tts_views WHERE 
view_id='.$ticket_id,__LINE__,__FILE);
+                       $db2->next_record();
+ 
+                       $group = $GLOBALS['phpgw']->db->f('ticket_category');
+ 
+                       $stat = $GLOBALS['phpgw']->db->f('ticket_status');
+                       $status = array(
+                               'R' => 'Re-opened',
+                               'X' => 'Closed',
+                               'O' => 'Opened',
+                               'A' => 'Re-assigned',
+                               'P' => 'Priority changed',
+                               'T' => 'Category changed',
+                               'S' => 'Subject changed',
+                               'B' => 'Billing rate',
+                               'H' => 'Billing hours'
+                       );
+ 
                        // build subject
!                       $subject = '['.lang('Ticket').' #'.$ticket_id.' 
'.$group.'] '.lang($status[$stat]).': 
'.$GLOBALS['phpgw']->db->f('ticket_subject');
  
                        // build body
                        $body  = '';
!                       $body .= lang('Ticket').' #'.$ticket_id."\n";
!                       $body .= lang('Subject').': 
'.$GLOBALS['phpgw']->db->f('ticket_subject')."\n";
!                       $body .= lang('Assigned To').': 
'.$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto'))."\n";
!                       $body .= lang('Priority').': 
'.$GLOBALS['phpgw']->db->f('ticket_priority')."\n";
!                       $body .= lang('Group').': '.$group_name."\n";
!                       $body .= lang('Opened By').': 
'.$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_owner'))."\n\n";
!                       $body .= lang('Latest Note Added').":\n";
                        if($GLOBALS['phpgw']->db->f('t_timestamp_closed'))
                        {
!                               $body .= lang('Date Closed').': 
'.$GLOBALS['phpgw']->common->show_date($GLOBALS['phpgw']->db->f('t_timestamp_closed'))."\n\n";
                        }
!                       $body .= 
stripslashes(strip_tags($GLOBALS['phpgw']->db->f('t_details')))."\n\n.";
                        
                        if 
($GLOBALS['phpgw']->config->config_data['groupnotification']) 
***************
*** 70,74 ****
                        {
                                // add owner to recipients
!                               $members[] = array('account_id' => 
$GLOBALS['phpgw']->accounts->name2id($GLOBALS['phpgw']->db->f('t_user')), 
'account_name' => $GLOBALS['phpgw']->db->f('t_user'));
                        }
  
--- 87,92 ----
                        {
                                // add owner to recipients
! //                            $members[] = array('account_id' => 
$GLOBALS['phpgw']->accounts->name2id($GLOBALS['phpgw']->db->f('t_user')), 
'account_name' => $GLOBALS['phpgw']->db->f('t_user'));
!                               $members[] = array('account_id' => 
$GLOBALS['phpgw']->db->f('ticket_owner'), 'account_name' => 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_owner')));
                        }
  
***************
*** 76,80 ****
                        {
                                // add assigned to recipients
!                               $members[] = array('account_id' => 
$GLOBALS['phpgw']->accounts->name2id($GLOBALS['phpgw']->db->f('t_assignedto')), 
'account_name' => $GLOBALS['phpgw']->db->f('t_assignedto'));
                        }
  
--- 94,99 ----
                        {
                                // add assigned to recipients
! //                            $members[] = array('account_id' => 
$GLOBALS['phpgw']->accounts->name2id($GLOBALS['phpgw']->db->f('t_assignedto')), 
'account_name' => $GLOBALS['phpgw']->db->f('t_assignedto'));
!                               $members[] = array('account_id' => 
$GLOBALS['phpgw']->db->f('ticket_assignedto'), 'account_name' => 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')));
                        }
  
***************
*** 89,93 ****
  //                                    $prefs = $pref->read_repository();
  //                                    $prefs = 
$phpgw->common->create_emailpreferences($prefs,$members[$i]['account_id']);
!                                       $toarray[] = $prefs['email']['address'];
                                        // echo '<br>'.$toarray[$i];
  //                                    unset($pref);
--- 108,112 ----
  //                                    $prefs = $pref->read_repository();
  //                                    $prefs = 
$phpgw->common->create_emailpreferences($prefs,$members[$i]['account_id']);
!                                       $toarray[$prefs['email']['address']] = 
$prefs['email']['address'];
                                        // echo '<br>'.$toarray[$i];
  //                                    unset($pref);
***************
*** 100,104 ****
                        else
                        {
!                               $to = $toarray[0];
                        }
      
--- 119,123 ----
                        else
                        {
!                               $to = current($toarray);
                        }
      
***************
*** 106,115 ****
                        if (!$rc)
                        {
!                               echo  'Your message could <B>not</B> be 
sent!<BR>'."\n"
!                                       . 'The mail server returned:<BR>'
                                        . "err_code: 
'".$GLOBALS['phpgw']->send->err['code']."';<BR>"
                                        . "err_msg: 
'".htmlspecialchars($GLOBALS['phpgw']->send->err['msg'])."';<BR>\n"
                                        . "err_desc: 
'".$GLOBALS['phpgw']->err['desc']."'.<P>\n"
!                                       . 'To go back to the msg list, click <a 
href="'.$GLOBALS['phpgw']->link('/tts/index.php','cd=13').'">here</a>';
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
--- 125,134 ----
                        if (!$rc)
                        {
!                               echo  lang('Your message could <B>not</B> be 
sent!<BR>')."\n"
!                                       . lang('The mail server 
returned').':<BR>'
                                        . "err_code: 
'".$GLOBALS['phpgw']->send->err['code']."';<BR>"
                                        . "err_msg: 
'".htmlspecialchars($GLOBALS['phpgw']->send->err['msg'])."';<BR>\n"
                                        . "err_desc: 
'".$GLOBALS['phpgw']->err['desc']."'.<P>\n"
!                                       . lang('To go back to the tts index, 
click <a href= x >here</a>',$GLOBALS['phpgw']->link('/tts/index.php','cd=13'));
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/inc/class.bo.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bo.inc.php    23 Dec 2001 22:41:18 -0000      1.4
--- class.bo.inc.php    23 Jun 2002 01:08:13 -0000      1.5
***************
*** 466,470 ****
                                        {
                                                $prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences($members[$i]['account_id']);
!                                               $toarray[] = 
$prefs['email']['address'];
                                        }
                                }
--- 466,470 ----
                                        {
                                                $prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences($members[$i]['account_id']);
!                                               
$toarray[$prefs['email']['address']] = $prefs['email']['address'];
                                        }
                                }
***************
*** 476,480 ****
                                else
                                {
!                                       $to = $toarray[0];
                                }
  
--- 476,480 ----
                                else
                                {
!                                       $to = current($toarray);
                                }
  




reply via email to

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