[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16656] reopen tickets if new note is added
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16656] reopen tickets if new note is added |
Date: |
Sat, 29 Apr 2017 13:20:45 -0400 (EDT) |
Revision: 16656
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16656
Author: sigurdne
Date: 2017-04-29 13:20:45 -0400 (Sat, 29 Apr 2017)
Log Message:
-----------
reopen tickets if new note is added
Modified Paths:
--------------
trunk/helpdesk/inc/class.botts.inc.php
trunk/helpdesk/inc/class.sotts.inc.php
trunk/helpdesk/inc/class.uitts.inc.php
trunk/helpdesk/inc/hook_config.inc.php
trunk/helpdesk/templates/base/config.tpl
trunk/phpgwapi/templates/base/css/base.css
trunk/property/inc/class.botts.inc.php
trunk/property/inc/class.uitts.inc.php
trunk/property/templates/base/css/base.css
Modified: trunk/helpdesk/inc/class.botts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.botts.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/helpdesk/inc/class.botts.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -775,7 +775,6 @@
$ticket = $this->so->read_single($id);
- $address_element =
$this->get_address_element($ticket['location_code']);
$history_values =
$this->historylog->return_array(array(),array('O'),'history_timestamp','DESC',$id);
$entry_date =
$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime'],$this->dateformat);
@@ -813,20 +812,9 @@
//-----------from--------
// build body
- $body = '';
- $body .= '<a href ="http://' .
$GLOBALS['phpgw_info']['server']['hostname'] .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'helpdesk.uitts.view', 'id' => $id)).'">' . lang('Ticket').' #' .$id
.'</a>'."\n";
+ $body = '<a href ="http://' .
$GLOBALS['phpgw_info']['server']['hostname'] .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'helpdesk.uitts.view', 'id' => $id)).'">' . lang('Ticket').' #' .$id
.'</a>'."\n";
$body .= lang('Date Opened').': '.$entry_date."\n";
$body .= lang('Category').': '.
$this->get_category_name($ticket['cat_id']) ."\n";
-// $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'])
{
@@ -840,54 +828,84 @@
}
}
$body .= lang('Assigned To').':
'.$GLOBALS['phpgw']->accounts->id2name($ticket['assignedto'])."\n";
- $body .= lang('Priority').': '.$ticket['priority']."\n";
- if($group_name)
+
if(empty($this->config->config_data['disable_priority']))
{
+ $body .= lang('Priority').':
'.$ticket['priority']."\n";
+ }
+
+
if(empty($this->config->config_data['tts_disable_groupassign_on_add']))
+ {
$body .= lang('Group').': '. $group_name ."\n";
}
+
$body .= lang('Opened By').': '. $ticket['user_name']
."\n\n";
- if($get_message)
+ if($timestampclosed)
{
- $body .= lang('First Note Added').":\n";
- $body .=
stripslashes(strip_tags($ticket['details']))."\n\n";
+ $body .= lang('Date Closed').':
'.$timestampclosed."\n\n";
}
+ $body = nl2br($body);
-
/**************************************************************\
- * Display additional notes
*
-
\**************************************************************/
- if($fields_updated)
+ if($get_message)
{
- $i=1;
+ $i = 1;
+ $lang_date = lang('date');
+ $lang_user = lang('user');
+ $lang_note = lang('note');
+ $table_content = <<<HTML
+ <thead>
+ <tr>
+ <th>
+ #
+ </th>
+ <th>
+ {$lang_date}
+ </th>
+ <th>
+ {$lang_user}
+ </th>
+ <th>
+ {$lang_note}
+ </th>
+ </tr>
+ </thead>
+HTML;
+ $table_content .=
"<tr><td>{$i}</td><td>{$entry_date}</td><td>{$ticket['user_name']}</td><td>{$ticket['details']}</td></tr>";
- $history_array =
$this->historylog->return_array(array(),array('C'),'','',$id);
+ $history_array =
$this->historylog->return_array(array(), array('C'), 'history_id', 'DESC', $id);
- foreach($history_array as $value)
+ foreach ($history_array as $value)
{
- if($get_message)
- {
- $body .= lang('Date') . ':
'.$GLOBALS['phpgw']->common->show_date($value['datetime'])."\n";
- $body .= lang('User') . ':
'.$value['owner']."\n";
- $body .=lang('Note').': '.
nl2br(stripslashes($value['new_value']))."\n\n";
- }
$i++;
+ $_date =
$GLOBALS['phpgw']->common->show_date($value['datetime']);
+ $_note =
stripslashes($value['new_value']);
+ $table_content .=
"<tr><td>{$i}</td><td>{$_date}</td><td>{$value['owner']}</td><td>{$_note}</td></tr>";
}
- $subject.= "-" .$i;
- }
-
/**************************************************************\
- * Display record history
*
-
\**************************************************************/
+ $body.= "<table class='pure-table
pure-table-bordered pure-table-striped'>{$table_content}</table>";
- if($timestampclosed)
- {
- $body .= lang('Date Closed').':
'.$timestampclosed."\n\n";
+ $subject .= "::{$i}";
}
-
if($get_message)
{
return array('subject' => $subject, 'body' =>
$body);
}
+ $css = file_get_contents(PHPGW_SERVER_ROOT .
"/phpgwapi/templates/pure/css/pure-min.css");
+ $html = <<<HTML
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <style TYPE="text/css">
+ <!--{$css}-->
+ </style>
+ </head>
+ <body>
+ {$body}
+ </body>
+</html>
+HTML;
+
$members = array();
if(
isset($this->config->config_data['groupnotification']) &&
$this->config->config_data['groupnotification']==1 && $ticket['group_id'] )
@@ -1009,13 +1027,12 @@
if($toarray)
{
$to = implode(';',$toarray);
- $body = nl2br($body);
if
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) &&
$GLOBALS['phpgw_info']['server']['smtp_server'])
{
try
{
- $rc = $this->send->msg('email',
$to, $subject, stripslashes($body), '', $cc,
$bcc,$current_user_address,$GLOBALS['phpgw_info']['user']['fullname'],'html');
+ $rc = $this->send->msg('email',
$to, $subject, $html, '', $cc,
$bcc,$current_user_address,$GLOBALS['phpgw_info']['user']['fullname'],'html');
}
catch (phpmailerException $e)
{
Modified: trunk/helpdesk/inc/class.sotts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sotts.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/helpdesk/inc/class.sotts.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -114,9 +114,10 @@
$sort = isset($data['sort']) &&
$data['sort'] ? $data['sort']:'DESC';
$order =
isset($data['order'])?$data['order']:'';
$cat_id = isset($data['cat_id']) &&
$data['cat_id'] ? $data['cat_id']:0;
- $allrows =
isset($data['allrows'])?$data['allrows']:'';
$start_date = isset($data['start_date']) &&
$data['start_date'] ? (int)$data['start_date'] : 0;
$end_date = isset($data['end_date']) &&
$data['end_date'] ? (int)$data['end_date'] : 0;
+ $results = isset($data['results']) &&
$data['results'] ? (int)$data['results'] : 0;
+ $allrows = $results == -1 ? true : false;
$dry_run = isset($data['dry_run']) ?
$data['dry_run'] : '';
$new = isset($data['new']) ?
$data['new'] : '';
$location_code = isset($data['location_code']) ?
$data['location_code'] : '';
@@ -347,7 +348,7 @@
if(!$allrows)
{
- $this->db2->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
+ $this->db2->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__, $results);
}
else
{
@@ -899,6 +900,20 @@
$_history_id =
$this->db->get_last_insert_id('phpgw_history_log', 'history_id');
$this->db->query("UPDATE phpgw_history_log SET
publish = 1 WHERE history_id = $_history_id", __LINE__, __FILE__);
unset($_history_id);
+
+ $check_old_custom = (int)trim($old_status, 'C');
+ $this->db->query("SELECT * from
phpgw_helpdesk_status WHERE id = {$check_old_custom}", __LINE__, __FILE__);
+ $this->db->next_record();
+ $old_closed = $this->db->f('closed');
+ if ($old_status == 'X' || $old_closed)
+ {
+ $config =
CreateObject('phpgwapi.config', 'helpdesk')->read();
+ $new_status =
!empty($config['reopen_status']) ? $config['reopen_status'] : '0';
+ $this->fields_updated[] = 'status';
+ $this->historylog->add('R', $id,
$new_status, $old_status);
+ $this->db->query("UPDATE
phpgw_helpdesk_tickets SET status='{$new_status}' WHERE id= {$id}", __LINE__,
__FILE__);
+ $this->db->query("UPDATE
phpgw_helpdesk_tickets SET priority = 1 WHERE id = {$id}", __LINE__, __FILE__);
+ }
}
$value_set = array();
@@ -980,6 +995,7 @@
if (($this->db->f('closed') ||
$ticket['status'] == 'X') && ($old_status != 'X' && !$old_closed))
{
+ $this->db->query("UPDATE
phpgw_helpdesk_tickets SET priority = 0 WHERE id = {$id}", __LINE__, __FILE__);
$location_id =
$GLOBALS['phpgw']->locations->get_id('helpdesk', '.ticket');
// at controller
if
(isset($GLOBALS['phpgw_info']['user']['apps']['controller']))
Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/helpdesk/inc/class.uitts.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -179,11 +179,7 @@
}
}
- /**
- * Fetch data from $this->bo based on parametres
- * @return array
- */
- public function query()
+ function get_params()
{
$search = phpgw::get_var('search');
$order = phpgw::get_var('order');
@@ -207,7 +203,7 @@
'vendor_id' => $this->bo->vendor_id,
'district_id' => $this->bo->district_id,
'part_of_town_id' => $this->bo->part_of_town_id,
- 'allrows' => $this->bo->allrows,
+ //'allrows' => $this->bo->allrows,
'start_date' => $this->bo->start_date,
'end_date' => $this->bo->end_date,
'location_code' => $this->bo->location_code,
@@ -217,8 +213,20 @@
'ecodimb' => $this->bo->ecodimb,
'branch_id' => phpgw::get_var('branch_id'),
'order_dim1' => phpgw::get_var('order_dim1'),
+ 'check_date_type' =>
phpgw::get_var('check_date_type', 'int'),
);
+ return $params;
+ }
+
+ /**
+ * Fetch data from $this->bo based on parametres
+ * @return array
+ */
+ public function query()
+ {
+ $params = $this->get_params();
+
$values = $this->bo->read($params);
if ($values)
@@ -266,24 +274,92 @@
function _print()
{
- if(!$this->acl_read)
+ if (!$this->acl_read)
{
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'helpdesk.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'property.uilocation.stop',
+ 'perm' => 1, 'acl_location' =>
$this->acl_location));
}
$GLOBALS['phpgw_info']['flags']['noheader'] = true;
$GLOBALS['phpgw_info']['flags']['nofooter'] = true;
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
- $id = phpgw::get_var('id', 'int');
+ $id = phpgw::get_var('id', 'int');
- $ticket = $this->bo->mail_ticket($id,
$fields_updated=true, $receipt = array(),$location_code='', $get_message =
true);
+ $ticket_html = $this->bo->mail_ticket($id,
$fields_updated = true, $receipt = array(), $location_code = '', $get_message =
true);
- $html =
"<html><head><title>{$ticket['subject']}</title></head>";
- $html .= "<body>";
- $html .= $ticket['subject'] . '</br></br>';
- $html .= nl2br($ticket['body']);
- $html .= "</body></html>";
+ $ticket = $this->bo->read_single($id);
+ $content_files = array();
+
+ $lang_files = lang('files');
+
+ $files = '';
+ if($ticket['files'])
+ {
+ $files = <<<HTML
+
+ <br/>
+ <table class='pure-table pure-table-bordered
pure-table-striped'>
+ <thead>
+ <tr>
+ <th>
+ #
+ </th>
+ <th>
+
{$lang_files}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+HTML;
+
+ $i=1;
+ foreach ($ticket['files'] as $_entry)
+ {
+ $files .= <<<HTML
+
+ <tr>
+ <td>
+ {$i}
+ </td>
+ <td>
+ {$_entry['name']}
+ </td>
+ </tr>
+HTML;
+ $i++;
+ }
+ $files .= <<<HTML
+
+ </tbody>
+ </table>
+
+HTML;
+
+ }
+
+ $lang_print = lang('print');
+
+ $html = <<<HTML
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>{$ticket_html['subject']}</title>
+ <link
href="{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/pure/css/pure-min.css"
type="text/css" rel="StyleSheet">
+ </head>
+ <body>
+ <script type="text/javascript">
+
document.write("<form><input type=button "
+
+"value=\"{$lang_print}\" onClick=\"window.print();\"></form>");
+ </script>
+ <H2>{$ticket_html['subject']}</H2>
+ {$ticket_html['body']}
+ {$files}
+ </body>
+ </html>
+HTML;
+
echo $html;
}
Modified: trunk/helpdesk/inc/hook_config.inc.php
===================================================================
--- trunk/helpdesk/inc/hook_config.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/helpdesk/inc/hook_config.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -26,7 +26,36 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+ /**
+ * Get HTML listbox with workorder reopen status that are to be set
when invoice is processed
+ *
+ * @param $config
+ * @return string HTML checkboxes to be placed in a table
+ */
+ function reopen_status( $config )
+ {
+ $status_entries = execMethod('helpdesk.botts.get_status_list');
+ $status_assigned = isset($config['reopen_status']) ?
$config['reopen_status'] : array();
+
+ $out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+ foreach ($status_entries as $status)
+ {
+ $selected = '';
+ if ($status_assigned == $status['id'])
+ {
+ $selected = ' selected = "selected"';
+ }
+
+ $out .= <<<HTML
+ <option
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+ }
+
+ return $out;
+ }
+
+
/**
* Get HTML checkbox with groups that are candidates for simplified tts
interface
*
Modified: trunk/helpdesk/templates/base/config.tpl
===================================================================
--- trunk/helpdesk/templates/base/config.tpl 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/helpdesk/templates/base/config.tpl 2017-04-29 17:20:45 UTC (rev
16656)
@@ -40,6 +40,14 @@
{lang_default}: {lang_Open}</td>
<td><input name="newsettings[tts_lang_open]"
value="{value_tts_lang_open}"></td>
</tr>
+ <tr>
+ <td>{lang_reopen_status}:</td>
+ <td>
+ <select
name="newsettings[reopen_status]">
+ {hook_reopen_status}
+ </select>
+ </td>
+ <tr>
<tr class="pure-table-odd">
<td >{lang_TTS_disable_assign_to_user_on_add}:</td>
<td>
Modified: trunk/phpgwapi/templates/base/css/base.css
===================================================================
--- trunk/phpgwapi/templates/base/css/base.css 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/phpgwapi/templates/base/css/base.css 2017-04-29 17:20:45 UTC (rev
16656)
@@ -1,3 +1,17 @@
+.priority1
+{
+ background-color: #dababa !important;
+}
+
+.priority2
+{
+ background-color: #dadada !important;
+}
+
+.priority3
+{
+
+}
/*
body, div, input, p, select, textarea
{
Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/property/inc/class.botts.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -110,7 +110,7 @@
}
else
{
- $this->simple = true;
+ $this->simple = true;
}
break;
}
@@ -1255,8 +1255,8 @@
//-----------from--------
// build body
- $body = '';
- $body .= '<a href ="' .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uitts.view',
+
+ $body = '<a href ="' .
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uitts.view',
'id' => $id), false, true) . '">' .
lang('Ticket') . ' #' . $id . '</a>' . "\n";
$body .= lang('Date Opened') . ': ' . $entry_date .
"\n";
$body .= lang('Category') . ': ' .
$this->get_category_name($ticket['cat_id']) . "\n";
@@ -1288,12 +1288,12 @@
$body .= lang('Group') . ': ' . $group_name .
"\n";
}
+ $body .= lang('Opened By') . ': ' .
$ticket['user_name'] . "\n\n";
+
if ($timestampclosed)
{
$body .= lang('Date Closed') . ': ' .
$timestampclosed . "\n\n";
}
-
- $body .= lang('Opened By') . ': ' .
$ticket['user_name'] . "\n\n";
$body = nl2br($body);
$i = 1;
@@ -1332,16 +1332,29 @@
$body.= "<table class='pure-table pure-table-bordered
pure-table-striped'>{$table_content}</table>";
$subject .= "::{$i}";
-
- // $body .= lang('First Note Added') . ":\n";
-
- // $body .= stripslashes(strip_tags($ticket['details'])) .
"\n\n";
-
if ($get_message)
{
return array('subject' => $subject, 'body' =>
$body);
}
+ $css = file_get_contents(PHPGW_SERVER_ROOT .
"/phpgwapi/templates/pure/css/pure-min.css");
+
+ $html = <<<HTML
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <style TYPE="text/css">
+ <!--{$css}-->
+ </style>
+ </head>
+ <body>
+ {$body}
+ </body>
+</html>
+HTML;
+
+
$members = array();
if
(isset($this->config->config_data['groupnotification']) &&
$this->config->config_data['groupnotification'] == 2)
@@ -1461,7 +1474,7 @@
{
try
{
- $rc = $this->send->msg('email',
$to, $subject, stripslashes($body), '', $cc, $bcc, $current_user_address,
$GLOBALS['phpgw_info']['user']['fullname'], 'html');
+ $rc = $this->send->msg('email',
$to, $subject, $html, '', $cc, $bcc, $current_user_address,
$GLOBALS['phpgw_info']['user']['fullname'], 'html');
}
catch (phpmailerException $e)
{
@@ -1821,7 +1834,7 @@
}
/**
- *
+ *
* @param type $ecodimb
* @param type $amount
* @param type $order_id
@@ -1996,7 +2009,7 @@
}
/**
- *
+ *
* @param array $supervisors
* @param int $order_id
* @return array
@@ -2112,7 +2125,7 @@
'approved_time' =>
$GLOBALS['phpgw']->common->show_date($approvals[0]['action_performed'],
$dateformat),
'is_user' =>
$supervisor_id == $this->account ? true : false
);
-
+
unset($prefs);
}
}
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/property/inc/class.uitts.inc.php 2017-04-29 17:20:45 UTC (rev
16656)
@@ -245,9 +245,7 @@
document.write("<form><input type=button "
+"value=\"{$lang_print}\" onClick=\"window.print();\"></form>");
</script>
-
-
- {$ticket['subject']}<br/><br/>
+ <H2>{$ticket['subject']}</H2>
{$ticket['body']}
</body>
</html>
Modified: trunk/property/templates/base/css/base.css
===================================================================
--- trunk/property/templates/base/css/base.css 2017-04-28 18:05:20 UTC (rev
16655)
+++ trunk/property/templates/base/css/base.css 2017-04-29 17:20:45 UTC (rev
16656)
@@ -1,23 +1,4 @@
-.priority1
-{
-/* background-color: #da7a7a !important;*/
- background-color: #dababa !important;
-
-}
-
-.priority2
-{
-/* background-color: #dababa !important;*/
- background-color: #dadada !important;
-
-}
-
-.priority3
-{
-
-}
-
/*
* Conflicts with portico
body, div, input, p, select, textarea
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16656] reopen tickets if new note is added,
sigurdne <=