phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.uiworkorder.inc.php, 1.39, 1


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.uiworkorder.inc.php, 1.39, 1.40 class.boworkorder.inc.php, 1.15, 1.16 class.soworkorder.inc.php, 1.25, 1.26 class.soproject.inc.php, 1.37, 1.38 class.boproject.inc.php, 1.15, 1.16 class.botts.inc.php, 1.19, 1.20 class.sotts2.inc.php, 1.5, 1.6 class.sotts.inc.php, 1.26, 1.27 class.uitts.inc.php, 1.36, 1.37
Date: Mon, 15 Sep 2003 14:28:46 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv24356/inc

Modified Files:
        class.uiworkorder.inc.php class.boworkorder.inc.php 
        class.soworkorder.inc.php class.soproject.inc.php 
        class.boproject.inc.php class.botts.inc.php 
        class.sotts2.inc.php class.sotts.inc.php class.uitts.inc.php 
Log Message:
no message

Index: class.uiworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiworkorder.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** class.uiworkorder.inc.php   11 Sep 2003 13:59:47 -0000      1.39
--- class.uiworkorder.inc.php   15 Sep 2003 18:28:43 -0000      1.40
***************
*** 459,463 ****
                                                
$receipt['message'][]=array('msg'=>lang('%1 is 
notified',$values['mail_address']));
                                        }
- 
                                }
                        }
--- 459,462 ----
***************
*** 470,474 ****
                                        $values['project_id']=$project_id;
                                }
!                               $project        = 
$this->boproject->read_single($values['project_id']);
  
                                if 
(!$this->bocommon->check_perms($project['grants'],PHPGW_ACL_EDIT))
--- 469,473 ----
                                        $values['project_id']=$project_id;
                                }
!                               $project        = 
$this->boproject->read_single_mini($values['project_id']);
  
                                if 
(!$this->bocommon->check_perms($project['grants'],PHPGW_ACL_EDIT))
***************
*** 492,497 ****
                                        
$values['charge_tenant']=$project['charge_tenant'];
                                }
- 
- //_debug_array($values);
                        }
  
--- 491,494 ----

Index: class.boworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boworkorder.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.boworkorder.inc.php   11 Sep 2003 13:59:47 -0000      1.15
--- class.boworkorder.inc.php   15 Sep 2003 18:28:43 -0000      1.16
***************
*** 328,332 ****
                        $workorder['start_date']                = 
$GLOBALS['phpgw']->common->show_date($workorder['start_date'],$dateformat);
                        $workorder['end_date']                  = 
$GLOBALS['phpgw']->common->show_date($workorder['end_date'],$dateformat);
!                       $vendor                                                 
= 
$this->contacts->read_single_entry($workorder['vendor_id'],array('org_name'=>'org_name','email'=>'email'));
                        $workorder['vendor_name']               = 
$vendor[0]['org_name'];
                        $workorder['vendor_email']              = 
$vendor[0]['email'];
--- 328,332 ----
                        $workorder['start_date']                = 
$GLOBALS['phpgw']->common->show_date($workorder['start_date'],$dateformat);
                        $workorder['end_date']                  = 
$GLOBALS['phpgw']->common->show_date($workorder['end_date'],$dateformat);
!                       $vendor                                                 
= 
$this->contacts->read_single_entry((int)$workorder['vendor_id'],array('org_name'=>'org_name','email'=>'email'));
                        $workorder['vendor_name']               = 
$vendor[0]['org_name'];
                        $workorder['vendor_email']              = 
$vendor[0]['email'];

Index: class.soworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soworkorder.inc.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** class.soworkorder.inc.php   11 Sep 2003 13:59:47 -0000      1.25
--- class.soworkorder.inc.php   15 Sep 2003 18:28:43 -0000      1.26
***************
*** 518,521 ****
--- 518,527 ----
                        $value_set      = 
$this->bocommon->validate_db_update($value_set);
  
+                       $this->db->query("SELECT status,budget FROM 
fm_workorder where id='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
+                       $this->db->next_record();
+ 
+                       $old_status = $this->db->f('status');
+                       $old_budget = $this->db->f('budget');
+ 
                        $this->db->transaction_begin();
  
***************
*** 524,532 ****
                        if($this->db->transaction_commit())
                        {
-                               $this->db->query("SELECT status,budget FROM 
fm_workorder where id='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
-                               $this->db->next_record();
- 
-                               $old_status = $this->db->f('status');
-                               $old_budget = $this->db->f('budget');
                                if ($old_status != $workorder['status'])
                                {
--- 530,533 ----

Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** class.soproject.inc.php     11 Sep 2003 13:59:47 -0000      1.37
--- class.soproject.inc.php     15 Sep 2003 18:28:43 -0000      1.38
***************
*** 646,649 ****
--- 646,655 ----
                        $this->db->transaction_begin();
  
+                       $this->db->query("SELECT status,category,coordinator 
FROM fm_project where id='" .$project['project_id']."'",__LINE__,__FILE__);
+                       $this->db->next_record();
+                       $old_status = $this->db->f('status');
+                       $old_categroy = (int)$this->db->f('category');
+                       $old_coordinator = (int)$this->db->f('coordinator');
+ 
                        $this->db->query("UPDATE fm_project set $value_set 
$vals WHERE id= '" . $project['project_id'] ."'",__LINE__,__FILE__);
  
***************
*** 678,688 ****
                                
$this->update_request_status($project['project_id'],$project['status'],$project['cat_id'],$project['coordinator']);
  
-                               $this->db->query("SELECT 
status,category,coordinator FROM fm_project where id='" 
.$project['project_id']."'",__LINE__,__FILE__);
- 
-                               $this->db->next_record();
- 
-                               $old_status = $this->db->f('status');
-                               $old_categroy = (int)$this->db->f('category');
-                               $old_coordinator = 
(int)$this->db->f('coordinator');
                                if ($old_status != $project['status'])
                                {
--- 684,687 ----

Index: class.boproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boproject.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.boproject.inc.php     11 Sep 2003 13:59:47 -0000      1.15
--- class.boproject.inc.php     15 Sep 2003 18:28:43 -0000      1.16
***************
*** 332,336 ****
                                
$project['workorder_budget'][$i]['budget']=number_format($workorder_data[$i]['budget'],
 2, ',', ' ');
                                
$project['workorder_budget'][$i]['calculation']=number_format($workorder_data[$i]['calculation']*$tax,
 2, ',', ' ');
!                               $vendor = 
$this->contacts->read_single_entry($workorder_data[$i]['vendor_id'],array('org_name'=>'org_name'));
                                $project['workorder_budget'][$i]['vendor_name'] 
= $vendor[0]['org_name'];
                        }
--- 332,336 ----
                                
$project['workorder_budget'][$i]['budget']=number_format($workorder_data[$i]['budget'],
 2, ',', ' ');
                                
$project['workorder_budget'][$i]['calculation']=number_format($workorder_data[$i]['calculation']*$tax,
 2, ',', ' ');
!                               $vendor = 
$this->contacts->read_single_entry((int)$workorder_data[$i]['vendor_id'],array('org_name'=>'org_name'));
                                $project['workorder_budget'][$i]['vendor_name'] 
= $vendor[0]['org_name'];
                        }
***************
*** 340,343 ****
--- 340,381 ----
                                $project['sum_workorder_calculation']= 
number_format($sum_workorder_calculation*$tax, 2, ',', ' ');
                        }
+ 
+                       if($project['location_code'])
+                       {
+                               $project['location_data'] 
=$this->solocation->read_single($project['location_code']);
+                       }
+ 
+                       if($project['equipment_id'])
+                       {
+                               $project['location_data']['equipment_id'] = 
$project['equipment_id'];
+                               $project['location_data']['equipment_type'] = 
$this->bocommon->get_equipment_type($project['equipment_id']);
+                       }
+ 
+                       if($project['tenant_id']>0)
+                       {
+                               
$tenant_data=$this->bocommon->read_single_tenant($project['tenant_id']);
+                               $project['location_data']['tenant_id']= 
$project['tenant_id'];
+                               $project['location_data']['contact_phone']= 
$tenant_data['contact_phone'];
+                               $project['location_data']['last_name']  = 
$tenant_data['last_name'];
+                               $project['location_data']['first_name'] = 
$tenant_data['first_name'];
+                       }
+                       else
+                       {
+                               unset($project['location_data']['tenant_id']);
+                               
unset($project['location_data']['contact_phone']);
+                               unset($project['location_data']['last_name']);
+                               unset($project['location_data']['first_name']);
+                       }
+ 
+ //_debug_array($project);
+                       return $project;
+               }
+ 
+               function read_single_mini($project_id)
+               {
+                       $project                                                
= $this->so->read_single($project_id);
+                       $dateformat                                             
= $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $project['start_date']                  = 
$GLOBALS['phpgw']->common->show_date($project['start_date'],$dateformat);
+                       $project['end_date']                    = 
$GLOBALS['phpgw']->common->show_date($project['end_date'],$dateformat);
  
                        if($project['location_code'])

Index: class.botts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.botts.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.botts.inc.php 7 Sep 2003 19:49:51 -0000       1.19
--- class.botts.inc.php 15 Sep 2003 18:28:43 -0000      1.20
***************
*** 386,389 ****
--- 386,390 ----
                                'O' => 'Opened',
                                'A' => 'Re-assigned',
+                               'G' => 'Re-assigned group',
                                'P' => 'Priority changed',
                                'T' => 'Category changed',
***************
*** 437,440 ****
--- 438,442 ----
                                        case 'O': $type = lang('Opened');    
break;
                                        case 'A': $type = lang('Re-assigned'); 
break;
+                                       case 'G': $type = lang('Re-assigned 
group'); break;
                                        case 'P': $type = lang('Priority 
changed'); break;
                                        case 'T': $type = lang('Category 
changed'); break;
***************
*** 452,456 ****
                                unset($type);
  
!                               if ($value['status'] == 'A')
                                {
                                        if (! $value['new_value'])
--- 454,458 ----
                                unset($type);
  
!                               if ($value['status'] == 'A' || $value['status'] 
== 'G')
                                {
                                        if (! $value['new_value'])
***************
*** 484,488 ****
                function add($ticket)
                {
- 
                        while (is_array($ticket['location']) && list(,$value) = 
each($ticket['location']))
                        {
--- 486,489 ----
***************
*** 538,541 ****
--- 539,543 ----
                                'O' => 'Opened',
                                'A' => 'Re-assigned',
+                               'G' => 'Re-assigned group',
                                'P' => 'Priority changed',
                                'T' => 'Category changed',
***************
*** 546,553 ****
  
  
!                       $group_name= 
$GLOBALS['phpgw']->accounts->id2name($ticket['group']);
  
                        // build subject
!                       $ticket['subject'] = '['.lang('Ticket').' #'.$id.' 
'.$group_name.'] '.lang($status[$stat]).': '.$ticket['subject'];
  
  
--- 548,555 ----
  
  
!                       $group_name= 
$GLOBALS['phpgw']->accounts->id2name($ticket['group_id']);
  
                        // build subject
!                       $ticket['subject'] = '['.lang('Ticket').' #'.$id.'] 
'.lang($status[$stat]).': '.$ticket['subject'];
  
  
***************
*** 588,592 ****
                        $body .= lang('Assigned To').': 
'.$GLOBALS['phpgw']->accounts->id2name($ticket['assignedto'])."\n";
                        $body .= lang('Priority').': '.$ticket['priority']."\n";
!               //      $body .= lang('Group').': '. $ticket['group_name'] 
."\n";
                        $body .= lang('Opened By').': '. $ticket['user_name'] 
."\n\n";
                        $body .= lang('First Note Added').":\n";
--- 590,597 ----
                        $body .= lang('Assigned To').': 
'.$GLOBALS['phpgw']->accounts->id2name($ticket['assignedto'])."\n";
                        $body .= lang('Priority').': '.$ticket['priority']."\n";
!                       if($group_name)
!                       {
!                               $body .= lang('Group').': '. $group_name ."\n";
!                       }
                        $body .= lang('Opened By').': '. $ticket['user_name'] 
."\n\n";
                        $body .= lang('First Note Added').":\n";
***************
*** 623,627 ****
                        {
                                // select group recipients
!                               $members  = 
$GLOBALS['phpgw']->accounts->member($ticket['group']);
                        }
  
--- 628,632 ----
                        {
                                // select group recipients
!                               $members  = 
$GLOBALS['phpgw']->accounts->member($ticket['group_id']);
                        }
  
***************
*** 698,702 ****
        //                      $receipt['error'][$errorcount++] = 
array('msg'=> 'cc: ' . $cc);
        //                      $receipt['error'][$errorcount++] = 
array('msg'=> 'bcc: '.$bcc);
!       //                      $receipt['error'][$errorcount++] = 
array('msg'=> 'group: '.$group);
                                $receipt['error'][$errorcount++] = 
array('msg'=> 'err_code: '.$this->send->err['code']);
                                $receipt['error'][$errorcount++] = 
array('msg'=> 'err_msg: '. htmlspecialchars($this->send->err['msg']));
--- 703,707 ----
        //                      $receipt['error'][$errorcount++] = 
array('msg'=> 'cc: ' . $cc);
        //                      $receipt['error'][$errorcount++] = 
array('msg'=> 'bcc: '.$bcc);
!                               $receipt['error'][$errorcount++] = 
array('msg'=> 'group: '.$group_name);
                                $receipt['error'][$errorcount++] = 
array('msg'=> 'err_code: '.$this->send->err['code']);
                                $receipt['error'][$errorcount++] = 
array('msg'=> 'err_msg: '. htmlspecialchars($this->send->err['msg']));

Index: class.sotts2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotts2.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.sotts2.inc.php        7 Sep 2003 19:49:51 -0000       1.5
--- class.sotts2.inc.php        15 Sep 2003 18:28:43 -0000      1.6
***************
*** 29,32 ****
--- 29,33 ----
  
                        $oldassigned            = $this->db->f('assignedto');
+                       $oldgroup_id            = $this->db->f('group_id');
                        $oldpriority            = $this->db->f('priority');
                        $oldcat_id                      = 
$this->db->f('cat_id');
***************
*** 36,39 ****
--- 37,41 ----
                        if($oldcat_id ==0){$oldcat_id ='';}
                        if($oldassigned ==0){$oldassigned ='';}
+                       if($oldgroup_id ==0){$oldgroup_id ='';}
  
                        // Figure out and last note
***************
*** 57,60 ****
--- 59,63 ----
                        ** C - Comment appended
                        ** A - Ticket assignment
+                       ** G - Ticket group assignment
                        ** P - Priority change
                        ** T - Category change
***************
*** 89,92 ****
--- 92,103 ----
                                        . "' where id='$id'",__LINE__,__FILE__);
                                
$this->historylog->add('A',$id,$ticket['assignedto'],$oldassigned);
+                       }
+ 
+                       if ($oldgroup_id != $ticket['group_id'])
+                       {
+                               $fields_updated = True;
+                               $this->db->query("update fm_tts_tickets set 
group_id='" . $ticket['group_id']
+                                       . "' where id='$id'",__LINE__,__FILE__);
+                               
$this->historylog->add('G',$id,$ticket['group_id'],$oldgroup_id);
                        }
  

Index: class.sotts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotts.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** class.sotts.inc.php 7 Aug 2003 16:08:59 -0000       1.26
--- class.sotts.inc.php 15 Sep 2003 18:28:43 -0000      1.27
***************
*** 20,26 ****
                        $this->config           = 
CreateObject('phpgwapi.config');
                        $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
!                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
! 
!                       $this->join                     = $this->socommon->join;
  
                        $this->grants   = 
$GLOBALS['phpgw']->session->appsession('grants_ticket',$this->currentapp);
--- 20,25 ----
                        $this->config           = 
CreateObject('phpgwapi.config');
                        $this->acl2             = 
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
!                       $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
!                       $this->join                     = $this->bocommon->join;
  
                        $this->grants   = 
$GLOBALS['phpgw']->session->appsession('grants_ticket',$this->currentapp);
***************
*** 176,179 ****
--- 175,179 ----
                                $ticket['assignedto']           = 
$this->db->f('assignedto');
                                $ticket['user_id']                      = 
$this->db->f('user_id');
+                               $ticket['group_id']                     = 
$this->db->f('group_id');
                                $ticket['status']                       = 
$this->db->f('status');
                                $ticket['cat_id']                       = 
$this->db->f('cat_id');
***************
*** 244,248 ****
                function add($ticket)
                {
- 
                        while (is_array($ticket['extra']) && 
list($input_name,$value) = each($ticket['extra']))
                        {
--- 244,247 ----
***************
*** 272,293 ****
                        }
  
                        $this->db->query("insert into fm_tts_tickets 
(priority,user_id,"
!                               . 
"assignedto,subject,cat_id,status,details,location_code,"
!                               . "address $cols) values ('"
!                               . $ticket['priority'] . "','"
!                               . $GLOBALS['phpgw_info']['user']['account_id'] 
. "','"
!                               . $ticket['assignedto'] . "','"
!                               . $this->db->db_addslashes($ticket['subject']) 
. "','"
!                               . $ticket['cat_id'] . "','O','"
!                               . $this->db->db_addslashes($ticket['details']) 
. "','"
!                               . $ticket['location_code'] . "','"
!                               . $address . "' $vals )",__LINE__,__FILE__);
  
                        $id = 
$this->db->get_last_insert_id('fm_tts_tickets','id');
-                       $this->historylog->add('O',$id,mktime(),'');
- 
                        if($ticket['extra']['contact_phone'])
                        {
                                $this->db->query("update fm_tenant set 
contact_phone='". $ticket['extra']['contact_phone']. "' where tenant_id='". 
$ticket['extra']['tenant_id']. "'",__LINE__,__FILE__);
                        }
  
--- 271,303 ----
                        }
  
+                       $values= array(
+                               $ticket['priority'],
+                               $GLOBALS['phpgw_info']['user']['account_id'],
+                               $ticket['assignedto'],
+                               $ticket['group_id'],
+                               $this->db->db_addslashes($ticket['subject']),
+                               $ticket['cat_id'],
+                               'O',
+                               $this->db->db_addslashes($ticket['details']),
+                               $ticket['location_code'],
+                               $address);
+ 
+                       $values = $this->bocommon->validate_db_insert($values);
+                       $this->db->transaction_begin();
+ 
                        $this->db->query("insert into fm_tts_tickets 
(priority,user_id,"
!                               . 
"assignedto,group_id,subject,cat_id,status,details,location_code,"
!                               . "address $cols)"
!                               . "VALUES ($values $vals )",__LINE__,__FILE__);
  
                        $id = 
$this->db->get_last_insert_id('fm_tts_tickets','id');
                        if($ticket['extra']['contact_phone'])
                        {
                                $this->db->query("update fm_tenant set 
contact_phone='". $ticket['extra']['contact_phone']. "' where tenant_id='". 
$ticket['extra']['tenant_id']. "'",__LINE__,__FILE__);
+                       }
+ 
+                       if($this->db->transaction_commit())
+                       {
+                               $this->historylog->add('O',$id,mktime(),'');
                        }
  

Index: class.uitts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uitts.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** class.uitts.inc.php 18 Jul 2003 09:34:54 -0000      1.36
--- class.uitts.inc.php 15 Sep 2003 18:28:43 -0000      1.37
***************
*** 260,264 ****
                        $GLOBALS['phpgw']->xslttpl->add_file(array('tts'));
  
- 
  //_debug_array($insert_record);
                        if ($values['save'])
--- 260,263 ----
***************
*** 344,347 ****
--- 343,350 ----
                                $values['assignedto']= 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault'];
                        }
+                       if(!$values['group_id'])
+                       {
+                               $values['group_id']= 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault'];
+                       }
  
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
***************
*** 357,360 ****
--- 360,368 ----
                                'user_list'                                     
        => $this->bocommon->get_user_list('select',$values['assignedto']),
  
+                               'lang_group'                                    
=> lang('Group'),
+                               'lang_no_group'                                 
=> lang('No group'),
+                               'group_list'                                    
=> $this->bocommon->get_group_list('select',$values['group_id']),
+                               'select_group_name'                             
=> 'values[group_id]',
+ 
                                'lang_priority'                                 
=> lang('Priority'),
                                'lang_priority_statustext'              => 
lang('Select the priority the selection belongs to.'),
***************
*** 554,557 ****
--- 562,570 ----
                                'select_user_name'                              
=> 'values[assignedto]',
                                'user_list'                                     
        => $this->bocommon->get_user_list('select',$ticket['assignedto']),
+ 
+                               'lang_group'                                    
=> lang('Group'),
+                               'lang_no_group'                                 
=> lang('No group'),
+                               'group_list'                                    
=> $this->bocommon->get_group_list('select',$ticket['group_id']),
+                               'select_group_name'                             
=> 'values[group_id]',
  
                                'lang_priority'                                 
=> lang('Priority'),





reply via email to

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