fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15406] More on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [15406] More on helpdesk
Date: Wed, 3 Aug 2016 08:29:23 +0000 (UTC)

Revision: 15406
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15406
Author:   sigurdne
Date:     2016-08-03 08:29:22 +0000 (Wed, 03 Aug 2016)
Log Message:
-----------
More on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/class.botts.inc.php
    trunk/helpdesk/inc/class.sotts.inc.php
    trunk/helpdesk/inc/class.uitts.inc.php

Modified: trunk/helpdesk/inc/class.botts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.botts.inc.php      2016-08-03 08:29:02 UTC (rev 
15405)
+++ trunk/helpdesk/inc/class.botts.inc.php      2016-08-03 08:29:22 UTC (rev 
15406)
@@ -1007,7 +1007,7 @@
                        return $receipt;
                }
 
-               public function update_ticket( &$data, $id, $receipt = array(), 
$values_attribute = array() )
+               public function update_ticket( &$data, $id, $receipt = array(), 
$values_attribute = array() , $simple = false)
                {
                        if ($values_attribute && is_array($values_attribute))
                        {
@@ -1038,10 +1038,9 @@
                                }
                        }
 
-                       $receipt = $this->so->update_ticket($data, $id, 
$receipt, $values_attribute, $this->simple);
+                       $receipt = $this->so->update_ticket($data, $id, 
$receipt, $values_attribute, $simple);
                        $this->fields_updated = $this->so->fields_updated;
 
-
                        reset($custom_functions);
 
                        foreach ($custom_functions as $entry)

Modified: trunk/helpdesk/inc/class.sotts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sotts.inc.php      2016-08-03 08:29:02 UTC (rev 
15405)
+++ trunk/helpdesk/inc/class.sotts.inc.php      2016-08-03 08:29:22 UTC (rev 
15406)
@@ -829,6 +829,50 @@
                                                }
                                        }
                                }
+                               if ($ticket['assignedto'] && ( ($oldassigned != 
$ticket['assignedto']) && $ticket['assignedto'] != 'ignore'))
+                               {
+                                       $this->fields_updated[] = 'assignedto';
+
+                                       $value_set = array('assignedto' => 
$ticket['assignedto']);
+                                       $value_set = 
$this->db->validate_update($value_set);
+
+                                       $this->db->query("update 
phpgw_helpdesk_tickets set $value_set where id='$id'", __LINE__, __FILE__);
+                                       $this->historylog->add('A', $id, 
$ticket['assignedto'], $oldassigned);
+                               }
+
+                               if (($oldgroup_id != $ticket['group_id']) && 
$ticket['group_id'] != 'ignore')
+                               {
+                                       $this->fields_updated[] = 'group_id';
+
+                                       $value_set = array('group_id' => 
$ticket['group_id']);
+                                       $value_set = 
$this->db->validate_update($value_set);
+
+                                       $this->db->query("update 
phpgw_helpdesk_tickets set $value_set where id='$id'", __LINE__, __FILE__);
+                                       $this->historylog->add('G', $id, 
(int)$ticket['group_id'], $oldgroup_id);
+                               }
+
+                               if ($ticket['priority'] && $oldpriority != 
$ticket['priority'])
+                               {
+                                       $this->fields_updated[] = 'priority';
+                                       $this->db->query("update 
phpgw_helpdesk_tickets set priority='" . $ticket['priority']
+                                               . "' where id='$id'", __LINE__, 
__FILE__);
+                                       $this->historylog->add('P', $id, 
$ticket['priority'], $oldpriority);
+                               }
+
+                               if ($old_contact_id != $ticket['contact_id'])
+                               {
+                                       $contact_id = 
(int)$ticket['contact_id'];
+                                       $this->fields_updated[] = 'contact_id';
+                                       $this->db->query("update 
phpgw_helpdesk_tickets set contact_id={$contact_id} WHERE id=$id", __LINE__, 
__FILE__);
+                               }
+
+                               if ($ticket['cat_id'] && ( ($oldcat_id != 
$ticket['cat_id']) && $ticket['cat_id'] != 'ignore'))
+                               {
+                                       $this->fields_updated[] = 'cat_id';
+                                       $this->db->query("update 
phpgw_helpdesk_tickets set cat_id='" . $ticket['cat_id']
+                                               . "' where id='$id'", __LINE__, 
__FILE__);
+                                       $this->historylog->add('T', $id, 
$ticket['cat_id'], $oldcat_id);
+                               }
                        }
 
                        if (($old_note != $ticket['note']) && $ticket['note'])
@@ -840,6 +884,24 @@
                                unset($_history_id);
                        }
 
+                       $value_set = array();
+
+                       $data_attribute = 
$this->custom->prepare_for_db('phpgw_helpdesk_tickets', $values_attribute);
+
+                       if (isset($data_attribute['value_set']))
+                       {
+                               foreach ($data_attribute['value_set'] as 
$input_name => $value)
+                               {
+                                       $this->fields_updated[] = $input_name;
+                                       $value_set[$input_name] = $value;
+                               }
+                       }
+
+                       $value_set['modified_date'] = time();
+
+                       $value_set = $this->db->validate_update($value_set);
+                       $this->db->query("UPDATE phpgw_helpdesk_tickets SET 
$value_set WHERE id={$id}", __LINE__, __FILE__);
+
                        if (isset($this->fields_updated) && 
$this->fields_updated && $simple)
                        {
                                $receipt['message'][] = array('msg' => 
lang('Ticket1 has been updated'));
@@ -917,51 +979,7 @@
                                }
                        }
 
-                       if ($ticket['assignedto'] && ( ($oldassigned != 
$ticket['assignedto']) && $ticket['assignedto'] != 'ignore'))
-                       {
-                               $this->fields_updated[] = 'assignedto';
 
-                               $value_set = array('assignedto' => 
$ticket['assignedto']);
-                               $value_set = 
$this->db->validate_update($value_set);
-
-                               $this->db->query("update phpgw_helpdesk_tickets 
set $value_set where id='$id'", __LINE__, __FILE__);
-                               $this->historylog->add('A', $id, 
$ticket['assignedto'], $oldassigned);
-                       }
-
-                       if (($oldgroup_id != $ticket['group_id']) && 
$ticket['group_id'] != 'ignore')
-                       {
-                               $this->fields_updated[] = 'group_id';
-
-                               $value_set = array('group_id' => 
$ticket['group_id']);
-                               $value_set = 
$this->db->validate_update($value_set);
-
-                               $this->db->query("update phpgw_helpdesk_tickets 
set $value_set where id='$id'", __LINE__, __FILE__);
-                               $this->historylog->add('G', $id, 
(int)$ticket['group_id'], $oldgroup_id);
-                       }
-
-                       if ($ticket['priority'] && $oldpriority != 
$ticket['priority'])
-                       {
-                               $this->fields_updated[] = 'priority';
-                               $this->db->query("update phpgw_helpdesk_tickets 
set priority='" . $ticket['priority']
-                                       . "' where id='$id'", __LINE__, 
__FILE__);
-                               $this->historylog->add('P', $id, 
$ticket['priority'], $oldpriority);
-                       }
-
-                       if ($old_contact_id != $ticket['contact_id'])
-                       {
-                               $contact_id = (int)$ticket['contact_id'];
-                               $this->fields_updated[] = 'contact_id';
-                               $this->db->query("update phpgw_helpdesk_tickets 
set contact_id={$contact_id} WHERE id=$id", __LINE__, __FILE__);
-                       }
-
-                       if ($ticket['cat_id'] && ( ($oldcat_id != 
$ticket['cat_id']) && $ticket['cat_id'] != 'ignore'))
-                       {
-                               $this->fields_updated[] = 'cat_id';
-                               $this->db->query("update phpgw_helpdesk_tickets 
set cat_id='" . $ticket['cat_id']
-                                       . "' where id='$id'", __LINE__, 
__FILE__);
-                               $this->historylog->add('T', $id, 
$ticket['cat_id'], $oldcat_id);
-                       }
-
                        /*
                          if ($old_billable_rate != $ticket['billable_rate'])
                          {
@@ -983,127 +1001,15 @@
                        {
                                $ticket['billable_hours'] = 
(float)str_replace(',', '.', $ticket['billable_hours']);
                                $ticket['billable_hours'] += 
(float)$old_billable_hours;
-//                     }
-//                     if ((float)$old_billable_hours != 
$ticket['billable_hours'])
-//                     {
                                $this->db->query("UPDATE phpgw_helpdesk_tickets 
SET billable_hours='{$ticket['billable_hours']}'"
                                        . " WHERE id='{$id}'", __LINE__, 
__FILE__);
                                $this->historylog->add('H', $id, 
$ticket['billable_hours'], $old_billable_hours);
                                $receipt['message'][] = array('msg' => 
lang('billable hours has been updated'));
                        }
 
-                       if (isset($ticket['location']) && $ticket['location'])
-                       {
-                               $ticket['location_code'] = implode('-', 
$ticket['location']);
-                       }
 
-                       if (isset($ticket['location_code']) && 
$ticket['location_code'] && ($oldlocation_code != $ticket['location_code']))
-                       {
-                               $interlink = CreateObject('property.interlink');
-                               if ($interlink->get_relation('helpdesk', 
'.ticket', $id, 'origin') || $interlink->get_relation('helpdesk', '.ticket', 
$id, 'target'))
-                               {
-                                       $receipt['message'][] = array('msg' => 
lang('location could not be changed'));
-                               }
-                               else
-                               {
-                                       $value_set = array();
-
-                                       $_address = array();
-                                       if (isset($ticket['street_name']) && 
$ticket['street_name'])
-                                       {
-                                               $_address[] = 
"{$ticket['street_name']} {$ticket['street_number']}";
-                                       }
-
-                                       if (isset($ticket['location_name']) && 
$ticket['location_name'])
-                                       {
-                                               $_address[] = 
$ticket['location_name'];
-                                       }
-
-                                       if (isset($ticket['additional_info']) 
&& $ticket['additional_info'])
-                                       {
-                                               foreach 
($ticket['additional_info'] as $key => $value)
-                                               {
-                                                       if ($value)
-                                                       {
-                                                               $_address[] = 
"{$key}|{$value}";
-                                                       }
-                                               }
-                                       }
-
-
-                                       if (isset($ticket['extra']['p_num']) && 
$ticket['extra']['p_num'] && $ticket['extra']['p_entity_id'] && 
$ticket['extra']['p_cat_id'])
-                                       {
-                                               $entity = 
CreateObject('property.soadmin_entity');
-                                               $entity_category = 
$entity->read_single_category($ticket['extra']['p_entity_id'], 
$ticket['extra']['p_cat_id']);
-                                       }
-
-                                       if (isset($entity_category) && 
$entity_category)
-                                       {
-                                               $_address[] = 
"{$entity_category['name']}::{$ticket['extra']['p_num']}";
-                                       }
-
-                                       $address = 
$this->db->db_addslashes(implode('::', $_address));
-
-                                       unset($_address);
-
-                                       $value_set['address'] = $address;
-
-                                       if (isset($ticket['location_code']) && 
$ticket['location_code'])
-                                       {
-                                               $value_set['location_code'] = 
$ticket['location_code'];
-                                       }
-
-                                       $admin_location = 
CreateObject('property.soadmin_location');
-                                       $admin_location->read(false);
-
-                                       // Delete old values for location - in 
case of moving up in the hierarchy
-                                       $metadata = 
$this->db->metadata('phpgw_helpdesk_tickets');
-                                       for ($i = 1; $i < 
$admin_location->total_records + 1; $i++)
-                                       {
-                                               if (isset($metadata["loc{$i}"]))
-                                               {
-                                                       $value_set["loc{$i}"] = 
false;
-                                               }
-                                       }
-
-                                       if (isset($ticket['location']) && 
is_array($ticket['location']))
-                                       {
-                                               foreach ($ticket['location'] as 
$column => $value)
-                                               {
-                                                       $value_set[$column] = 
$value;
-                                               }
-                                       }
-
-
-                                       $value_set = 
$this->db->validate_update($value_set);
-
-                                       $this->db->query("UPDATE 
phpgw_helpdesk_tickets SET $value_set WHERE id={$id}", __LINE__, __FILE__);
-
-                                       $this->historylog->add('L', $id, 
$ticket['location_code'], $oldlocation_code);
-                                       $receipt['message'][] = array('msg' => 
lang('Location has been updated'));
-                               }
-                               unset($interlink);
-                       }
-
                        $value_set = array();
 
-                       $data_attribute = 
$this->custom->prepare_for_db('phpgw_helpdesk_tickets', $values_attribute);
-
-                       if (isset($data_attribute['value_set']))
-                       {
-                               foreach ($data_attribute['value_set'] as 
$input_name => $value)
-                               {
-                                       $value_set[$input_name] = $value;
-                               }
-                       }
-
-                       $value_set['modified_date'] = time();
-
-                       $value_set = $this->db->validate_update($value_set);
-                       $this->db->query("UPDATE phpgw_helpdesk_tickets SET 
$value_set WHERE id={$id}", __LINE__, __FILE__);
-
-                       $value_set = array();
-
                        if (isset($ticket['extra']) && 
is_array($ticket['extra']) && $ticket['extra'])
                        {
                                foreach ($ticket['extra'] as $column => $value)

Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php      2016-08-03 08:29:02 UTC (rev 
15405)
+++ trunk/helpdesk/inc/class.uitts.inc.php      2016-08-03 08:29:22 UTC (rev 
15406)
@@ -553,7 +553,7 @@
                                'list' => $values_combo_box[3]
                        );
 
-                       if(!$this->simple)
+                       if(!$this->_simple)
                        {
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
                                        'selected' => $this->cat_id, 'globals' 
=> true, 'use_acl' => $this->_category_acl));
@@ -751,119 +751,121 @@
                                'parameters' => json_encode($parameters)
                        );
 
-
-                       $jasper = execMethod('property.sojasper.read', 
array('location_id' => $GLOBALS['phpgw']->locations->get_id('helpdesk', 
$this->acl_location)));
-
-                       foreach ($jasper as $report)
+                       if(!$this->_simple)
                        {
-                               $data['datatable']['actions'][] = array
-                                       (
-                                       'my_name' => 'edit',
-                                       'text' => lang('open JasperReport %1 in 
new window', $report['title']),
-                                       'action' => 
$GLOBALS['phpgw']->link('/index.php', array
-                                               (
-                                               'menuaction' => 
'helpdesk.uijasper.view',
-                                               'jasper_id' => $report['id'],
-                                               'target' => '_blank'
-                                       )),
-                                       'parameters' => json_encode($parameters)
-                               );
-                       }
+                               $jasper = execMethod('property.sojasper.read', 
array('location_id' => $GLOBALS['phpgw']->locations->get_id('helpdesk', 
$this->acl_location)));
 
-                       if ($this->acl_delete)
-                       {
-                               $data['datatable']['actions'][] = array
-                                       (
-                                       'my_name' => 'delete',
-                                       'statustext' => lang('delete the 
ticket'),
-                                       'text' => lang('delete'),
-                                       'confirm_msg' => lang('do you really 
want to delete this ticket'),
-                                       'action' => 
$GLOBALS['phpgw']->link('/index.php', array
-                                               (
-                                               'menuaction' => 
'helpdesk.uitts.delete'
-                                       )),
-                                       'parameters' => json_encode($parameters)
-                               );
-                       }
-
-                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_status_link'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_status_link'] == 
'yes' && $this->acl_edit)
-                       {
-                               $status['X'] = array
-                                       (
-                                       'status' => lang('closed'),
-                               );
-                               $status['O'] = array
-                                       (
-                                       'status' => 
isset($this->bo->config->config_data['tts_lang_open']) && 
$this->bo->config->config_data['tts_lang_open'] ? 
$this->bo->config->config_data['tts_lang_open'] : lang('Open'),
-                               );
-
-                               $custom_status = $this->bo->get_custom_status();
-
-                               foreach ($custom_status as $custom)
+                               foreach ($jasper as $report)
                                {
-                                       $status["C{$custom['id']}"] = array
-                                               (
-                                               'status' => $custom['name'],
-                                       );
-                               }
-
-                               foreach ($status as $status_code => 
$status_info)
-                               {
                                        $data['datatable']['actions'][] = array
                                                (
-                                               'my_name' => 'status',
-                                               'statustext' => 
$status_info['status'],
-                                               'text' => lang('change to') . ' 
status:  ' . $status_info['status'],
-                                               'confirm_msg' => lang('do you 
really want to change the status to %1', $status_info['status']),
+                                               'my_name' => 'edit',
+                                               'text' => lang('open 
JasperReport %1 in new window', $report['title']),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
-                                                       'menuaction' => 
'helpdesk.uitts.edit_status',
-                                                       'edit_status' => true,
-                                                       'new_status' => 
$status_code,
-                                                       'second_display' => 
true,
-                                                       'sort' => $this->sort,
-                                                       'order' => $this->order,
-                                                       'cat_id' => 
$this->cat_id,
-                                                       'filter' => 
$this->filter,
-                                                       'user_filter' => 
$this->user_filter,
-                                                       'query' => $this->query,
-                                                       'district_id' => 
$this->district_id,
-                                                       'allrows' => 
$this->allrows,
-                                                       'delete' => 'dummy'// 
FIXME to trigger the json in property.js.
+                                                       'menuaction' => 
'helpdesk.uijasper.view',
+                                                       'jasper_id' => 
$report['id'],
+                                                       'target' => '_blank'
                                                )),
                                                'parameters' => 
json_encode($parameters)
                                        );
                                }
 
-                               $_priorities = $this->bo->get_priority_list();
-
-                               foreach ($_priorities as $_priority_info)
+                               if ($this->acl_delete)
                                {
                                        $data['datatable']['actions'][] = array
                                                (
-                                               'my_name' => 'priority',
-                                               'statustext' => 
$_priority_info['name'],
-                                               'text' => lang('change to') . ' 
' . lang('priority') . ':  ' . $_priority_info['name'],
-                                               'confirm_msg' => lang('do you 
really want to change the priority to %1', $_priority_info['name']),
+                                               'my_name' => 'delete',
+                                               'statustext' => lang('delete 
the ticket'),
+                                               'text' => lang('delete'),
+                                               'confirm_msg' => lang('do you 
really want to delete this ticket'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
-                                                       'menuaction' => 
'helpdesk.uitts.edit_priority',
-                                                       'edit_status' => true,
-                                                       'new_priority' => 
$_priority_info['id'],
-                                                       'second_display' => 
true,
-                                                       'sort' => $this->sort,
-                                                       'order' => $this->order,
-                                                       'cat_id' => 
$this->cat_id,
-                                                       'filter' => 
$this->filter,
-                                                       'user_filter' => 
$this->user_filter,
-                                                       'query' => $this->query,
-                                                       'district_id' => 
$this->district_id,
-                                                       'allrows' => 
$this->allrows,
-                                                       'delete' => 'dummy'// 
FIXME to trigger the json in property.js.
+                                                       'menuaction' => 
'helpdesk.uitts.delete'
                                                )),
                                                'parameters' => 
json_encode($parameters)
                                        );
                                }
+
+                               if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_status_link'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_status_link'] == 
'yes' && $this->acl_edit)
+                               {
+                                       $status['X'] = array
+                                               (
+                                               'status' => lang('closed'),
+                                       );
+                                       $status['O'] = array
+                                               (
+                                               'status' => 
isset($this->bo->config->config_data['tts_lang_open']) && 
$this->bo->config->config_data['tts_lang_open'] ? 
$this->bo->config->config_data['tts_lang_open'] : lang('Open'),
+                                       );
+
+                                       $custom_status = 
$this->bo->get_custom_status();
+
+                                       foreach ($custom_status as $custom)
+                                       {
+                                               $status["C{$custom['id']}"] = 
array
+                                                       (
+                                                       'status' => 
$custom['name'],
+                                               );
+                                       }
+
+                                       foreach ($status as $status_code => 
$status_info)
+                                       {
+                                               $data['datatable']['actions'][] 
= array
+                                                       (
+                                                       'my_name' => 'status',
+                                                       'statustext' => 
$status_info['status'],
+                                                       'text' => lang('change 
to') . ' status:  ' . $status_info['status'],
+                                                       'confirm_msg' => 
lang('do you really want to change the status to %1', $status_info['status']),
+                                                       'action' => 
$GLOBALS['phpgw']->link('/index.php', array
+                                                               (
+                                                               'menuaction' => 
'helpdesk.uitts.edit_status',
+                                                               'edit_status' 
=> true,
+                                                               'new_status' => 
$status_code,
+                                                               
'second_display' => true,
+                                                               'sort' => 
$this->sort,
+                                                               'order' => 
$this->order,
+                                                               'cat_id' => 
$this->cat_id,
+                                                               'filter' => 
$this->filter,
+                                                               'user_filter' 
=> $this->user_filter,
+                                                               'query' => 
$this->query,
+                                                               'district_id' 
=> $this->district_id,
+                                                               'allrows' => 
$this->allrows,
+                                                               'delete' => 
'dummy'// FIXME to trigger the json in property.js.
+                                                       )),
+                                                       'parameters' => 
json_encode($parameters)
+                                               );
+                                       }
+
+                                       $_priorities = 
$this->bo->get_priority_list();
+
+                                       foreach ($_priorities as 
$_priority_info)
+                                       {
+                                               $data['datatable']['actions'][] 
= array
+                                                       (
+                                                       'my_name' => 'priority',
+                                                       'statustext' => 
$_priority_info['name'],
+                                                       'text' => lang('change 
to') . ' ' . lang('priority') . ':  ' . $_priority_info['name'],
+                                                       'confirm_msg' => 
lang('do you really want to change the priority to %1', 
$_priority_info['name']),
+                                                       'action' => 
$GLOBALS['phpgw']->link('/index.php', array
+                                                               (
+                                                               'menuaction' => 
'helpdesk.uitts.edit_priority',
+                                                               'edit_status' 
=> true,
+                                                               'new_priority' 
=> $_priority_info['id'],
+                                                               
'second_display' => true,
+                                                               'sort' => 
$this->sort,
+                                                               'order' => 
$this->order,
+                                                               'cat_id' => 
$this->cat_id,
+                                                               'filter' => 
$this->filter,
+                                                               'user_filter' 
=> $this->user_filter,
+                                                               'query' => 
$this->query,
+                                                               'district_id' 
=> $this->district_id,
+                                                               'allrows' => 
$this->allrows,
+                                                               'delete' => 
'dummy'// FIXME to trigger the json in property.js.
+                                                       )),
+                                                       'parameters' => 
json_encode($parameters)
+                                               );
+                                       }
+                               }
                        }
 
                        if (count($data['datatable']['actions']) < 10)
@@ -1186,7 +1188,7 @@
                        $msgbox_data = (isset($receipt) ? 
$this->bocommon->msgbox_data($receipt) : '');
 
 
-                       if (!$this->simple && $this->_show_finnish_date)
+                       if (!$this->_simple && $this->_show_finnish_date)
                        {
                                
$GLOBALS['phpgw']->jqcal->add_listener('values_finnish_date');
                        }
@@ -1208,7 +1210,7 @@
                                'custom_attributes' => array('attributes' => 
$values['attributes']),
                                'lookup_functions' => 
isset($values['lookup_functions']) ? $values['lookup_functions'] : '',
                                'contact_data' => $contact_data,
-                               'simple' => $this->simple,
+                               'simple' => $this->_simple,
                                'show_finnish_date' => 
$this->_show_finnish_date,
                                'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => (isset($origin) ? 
$origin : ''),
@@ -1333,12 +1335,8 @@
 
                        $values = phpgw::get_var('values');
                        $values['contact_id'] = phpgw::get_var('contact', 
'int', 'POST');
-//                     $values['ecodimb'] = phpgw::get_var('ecodimb');
                        $values['vendor_id'] = phpgw::get_var('vendor_id', 
'int', 'POST');
                        $values['vendor_name'] = phpgw::get_var('vendor_name', 
'string', 'POST');
-//                     $values['b_account_id'] = 
phpgw::get_var('b_account_id', 'int', 'POST');
-//                     $values['b_account_name'] = 
phpgw::get_var('b_account_name', 'string', 'POST');
-
                        $values_attribute = phpgw::get_var('values_attribute');
 
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt', 'helpdesk');
@@ -1402,33 +1400,7 @@
                                }
 
 
-                               if ($access_order)
-                               {
-                                       //test for budget
-                                       $_ticket = $this->bo->read_single($id);
-                                       if (!$_ticket['budget'] && 
((isset($values['order_id']) && $values['order_id']) && 
(!isset($values['budget']) || !$values['budget'])))
-                                       {
-                                               $receipt['error'][] = 
array('msg' => lang('budget') . ': ' . lang('Missing value'));
-                                       }
-                                       unset($_ticket);
 
-                                       $sogeneric = 
CreateObject('property.sogeneric');
-                                       
$sogeneric->get_location_info('ticket_status', false);
-                                       $status_data = 
$sogeneric->read_single(array('id' => (int)ltrim($values['status'], 'C')), 
array());
-
-                                       if (isset($status_data['actual_cost']) 
&& $status_data['actual_cost'])
-                                       {
-                                               if (!$values['actual_cost'] || 
!abs($values['actual_cost']) > 0)
-                                               {
-                                                       $receipt['error'][] = 
array('msg' => lang('actual cost') . ': ' . lang('Missing value'));
-                                               }
-                                               else if 
(!is_numeric($values['actual_cost']))
-                                               {
-                                                       $receipt['error'][] = 
array('msg' => lang('budget') . ': ' . lang('Please enter a numeric value'));
-                                               }
-                                       }
-                               }
-
                                if (isset($values['takeover']) && 
$values['takeover'])
                                {
                                        $values['assignedto'] = $this->account;
@@ -1445,7 +1417,7 @@
                                  }
                                  }
                                 */
-                               $receipt = $this->bo->update_ticket($values, 
$id, $receipt, $values_attribute);
+                               $receipt = $this->bo->update_ticket($values, 
$id, $receipt, $values_attribute, $this->_simple);
 
                                if ((isset($values['send_mail']) && 
$values['send_mail']) || 
(isset($this->bo->config->config_data['mailnotification']) && 
$this->bo->config->config_data['mailnotification'] && $this->bo->fields_updated
                                        ) || 
(isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_notify_me'])
 && $GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_notify_me'] 
== 1 && $this->bo->fields_updated
@@ -1745,7 +1717,7 @@
                                'my_groups' => json_encode($my_groups),
                                'custom_attributes' => array('attributes' => 
$ticket['attributes']),
                                'lookup_functions' => 
isset($ticket['lookup_functions']) ? $ticket['lookup_functions'] : '',
-                               'simple' => $this->simple,
+                               'simple' => $this->_simple,
                                'send_response' => 
isset($this->bo->config->config_data['tts_send_response']) ? 
$this->bo->config->config_data['tts_send_response'] : '',
                                'disable_priority'      => 
isset($this->bo->config->config_data['disable_priority']) ? 
$this->bo->config->config_data['disable_priority'] : '',
                                'value_sms_phone' => $ticket['contact_phone'],




reply via email to

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