phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/class.botts.inc.php, 1.1.1.2


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.botts.inc.php, 1.1.1.2
Date: Thu, 13 May 2004 20:08:02 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.botts.inc.php

date: 2004/05/13 18:08:02;  author: sigurdne;  state: Exp;  lines: +56 -7

Log Message:
no message
=====================================================================
Index: property/inc/class.botts.inc.php
diff -u property/inc/class.botts.inc.php:1.1.1.1 
property/inc/class.botts.inc.php:1.1.1.2
--- property/inc/class.botts.inc.php:1.1.1.1    Fri Apr 23 13:13:57 2004
+++ property/inc/class.botts.inc.php    Thu May 13 18:08:02 2004
@@ -72,6 +72,7 @@
                        $sort   = get_var('sort',array('POST','GET'));
                        $order  = get_var('order',array('POST','GET'));
                        $filter = get_var('filter',array('POST','GET'));
+                       $user_filter    = 
get_var('user_filter',array('POST','GET'));
                        $cat_id = get_var('cat_id',array('POST','GET'));
                        $district_id    = 
get_var('district_id',array('POST','GET'));
                        $allrows        = 
get_var('allrows',array('POST','GET'));
@@ -93,6 +94,10 @@
                        {
                                $this->filter = $filter;
                        }
+                       if(isset($user_filter))
+                       {
+                               $this->user_filter = $user_filter;
+                       }
                        if(isset($sort))
                        {
                                $this->sort = $sort;
@@ -131,6 +136,7 @@
                        $this->start    = $data['start'];
                        $this->query    = $data['query'];
                        $this->filter   = $data['filter'];
+                       $this->user_filter      = $data['user_filter'];
                        $this->sort             = $data['sort'];
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
@@ -313,7 +319,7 @@
                {
                        $tickets = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'filter' => $this->filter,'cat_id' => $this->cat_id,'district_id' => 
$this->district_id,
-                                                                               
        'allrows'=>$this->allrows));
+                                                                               
        'allrows'=>$this->allrows,'user_filter' => $this->user_filter));
                        $this->total_records = $this->so->total_records;
                        $entity = $this->so->get_origin_entity_type();
 
@@ -384,7 +390,7 @@
                                $solocation     = 
CreateObject($this->currentapp.'.solocation');
                                $ticket['location_data'] = 
$solocation->read_single($ticket['location_code']);
                        }
-
+//_debug_array($ticket['location_data']);
                        if($ticket['p_num'])
                        {
                                $soadmin_entity = 
CreateObject($this->currentapp.'.soadmin_entity');
@@ -576,6 +582,30 @@
 
                        $ticket = $this->so->read_single($id);
 
+                       if($ticket['location_code'])
+                       {
+
+                               $solocation             = 
CreateObject($this->currentapp.'.solocation');
+                               $soadmin_location       = 
CreateObject($this->currentapp.'.soadmin_location');
+                               $location_data          = 
$solocation->read_single($ticket['location_code']);
+
+                               
$type_id=count(explode('-',$ticket['location_code']));
+                               $fm_location_cols = 
$soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
+                               $i=0;
+                               if (isset($fm_location_cols) AND 
is_array($fm_location_cols))
+                               {
+                                       foreach($fm_location_cols as 
$location_entry)
+                                       {
+                                               
if($location_entry['lookup_form'])
+                                               {
+                                                       
$address_element[$i]['text']=$location_entry['input_text'];
+                                                       
$address_element[$i]['value']=$location_data[$location_entry['column_name']];
+                                               }
+                                               $i++;
+                                       }
+                               }
+                       }
+
                        $history_values = 
$this->historylog->return_array(array(),array('O'),'history_timestamp','DESC',$id);
                        $timestampopened = 
$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime'],$this->dateformat);
 
@@ -608,7 +638,7 @@
                        $group_name= 
$GLOBALS['phpgw']->accounts->id2name($ticket['group_id']);
 
                        // build subject
-                       $ticket['subject'] = '['.lang('Ticket').' #'.$id.'] : ' 
. $location_code .' ' .$this->get_category_name($ticket['cat_id']);
+                       $subject = '['.lang('Ticket').' #'.$id.'] : ' . 
$location_code .' ' .$this->get_category_name($ticket['cat_id']) . '; ' 
.$ticket['subject'];
 
 
                //      $prefs_user = 
$GLOBALS['phpgw']->preferences->create_email_preferences($ticket['user_id']);
@@ -645,6 +675,25 @@
 //                     $body .= lang('Subject').': '. $ticket['subject'] ."\n";
                        $body .= lang('Location').': '. 
$ticket['location_code'] ."\n";
                        $body .= lang('Address').': '. $ticket['address'] ."\n";
+                       if (isset($address_element) AND 
is_array($address_element))
+                       {
+                               foreach($address_element as $address_entry)
+                               {
+                                       $body .= $address_entry['text'].': '. 
$address_entry['value'] ."\n";
+                               }
+                       }
+
+                       if($ticket['tenant_id'])
+                       {
+                               
$tenant_data=$this->bocommon->read_single_tenant($ticket['tenant_id']);
+                               $body .= lang('Tenant').': '. 
$tenant_data['first_name'] . ' ' .$tenant_data['last_name'] ."\n";
+
+                               if($tenant_data['contact_phone'])
+                               {
+                                       $body .= lang('Contact phone').': '. 
$tenant_data['contact_phone'] ."\n";
+
+                               }
+                       }
                        $body .= lang('Assigned To').': 
'.$GLOBALS['phpgw']->accounts->id2name($ticket['assignedto'])."\n";
                        $body .= lang('Priority').': '.$ticket['priority']."\n";
                        if($group_name)
@@ -670,7 +719,7 @@
                                        $body .=lang('Note').': '. 
nl2br(stripslashes($value['new_value']))."\n\n";
                                        $i++;
                                }
-                               $ticket['subject'].= "-" .$i;
+                               $subject.= "-" .$i;
                        }
 
                        
/**************************************************************\
@@ -735,11 +784,11 @@
 
                        if ($mail_method=='smtp'):
                        {
-                               $rc = $this->send->msg('email', $to, 
$ticket['subject'], stripslashes($body), '', $cc, 
$bcc,$current_user_address,$current_user_name,'txt');
+                               $rc = $this->send->msg('email', $to, $subject, 
stripslashes($body), '', $cc, 
$bcc,$current_user_address,$current_user_name,'txt');
                        }
                        elseif ($mail_method=='sendmail'):
                        {
-                               $rc=    
@mail($to,$ticket['subject'],stripslashes($body), $headers);
+                               $rc=    @mail($to,$subject,stripslashes($body), 
$headers);
                        }
                        else:
                        {
@@ -754,7 +803,7 @@
                                $receipt['error'][] = array('msg'=> lang('The 
mail server returned'));
                                $receipt['error'][] = array('msg'=> 'From :' . 
$current_user_name . '<' . $current_user_address .'>');
                                $receipt['error'][] = array('msg'=> 'to: '.$to);
-                               $receipt['error'][] = array('msg'=> 'subject: 
'.$ticket['subject']);
+                               $receipt['error'][] = array('msg'=> 'subject: 
'.$subject);
                                $receipt['error'][] = array('msg'=> $body );
        //                      $receipt['error'][] = array('msg'=> 'cc: ' . 
$cc);
        //                      $receipt['error'][] = array('msg'=> 'bcc: 
'.$bcc);




reply via email to

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