[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17022] property: alternative contact at location
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17022] property: alternative contact at location |
Date: |
Thu, 31 Aug 2017 13:35:57 -0400 (EDT) |
Revision: 17022
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17022
Author: sigurdne
Date: 2017-08-31 13:35:57 -0400 (Thu, 31 Aug 2017)
Log Message:
-----------
property: alternative contact at location
Modified Paths:
--------------
trunk/property/inc/class.uitts.inc.php
trunk/property/inc/hook_config.inc.php
trunk/property/templates/base/config.tpl
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2017-08-31 16:14:30 UTC (rev
17021)
+++ trunk/property/inc/class.uitts.inc.php 2017-08-31 17:35:57 UTC (rev
17022)
@@ -3612,6 +3612,22 @@
$user_email =
$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
$order_email_template =
$GLOBALS['phpgw_info']['user']['preferences']['property']['order_email_template'];
+ if
(!empty($this->bo->config->config_data['contact_at_location']))
+ {
+ $contact_at_location =
$this->bo->config->config_data['contact_at_location'];
+
+ $_responsible =
execMethod('property.boresponsible.get_responsible', array('location'=>
explode('-', $ticket['location_code']),
+ 'cat_id' => $ticket['cat_id']));
+
+ if($_responsible)
+ {
+ $prefs
= $this->bocommon->create_preferences('property', $_responsible);
+ $_responsible_name =
$GLOBALS['phpgw']->accounts->get($_responsible)->__toString();
+ $_responsible_email =
$prefs['email'];
+ $_responsible_cellphone =
$prefs['cellphone'];
+ }
+ }
+
$body = nl2br(str_replace(array
(
'__vendor_name__',
Modified: trunk/property/inc/hook_config.inc.php
===================================================================
--- trunk/property/inc/hook_config.inc.php 2017-08-31 16:14:30 UTC (rev
17021)
+++ trunk/property/inc/hook_config.inc.php 2017-08-31 17:35:57 UTC (rev
17022)
@@ -466,6 +466,32 @@
}
/**
+ * Get HTML options with roles for responsibilities that should be
listed in a listbox
+ *
+ * @param $config
+ * @return string HTML options to be placed in a select
+ */
+ function list_contact_at_location( $config )
+ {
+ $assigned = isset($config['contact_at_location']) ?
$config['contact_at_location'] : 0;
+
+ $entries = execMethod('property.bogeneric.get_list',
array('type' => 'responsibility_role',
+ 'selected' => $assigned));
+
+ $out = '<option value="">' . lang('none selected') .
'</option>' . "\n";
+ foreach ($entries as $entry)
+ {
+ $selected = $entry['selected'] ? ' selected =
"selected"' : '';
+
+ $out .= <<<HTML
+ <option
value='{$entry['id']}'{$selected}>{$entry['name']}</option>
+HTML;
+ }
+ return $out;
+ }
+
+
+ /**
* Get HTML checkbox with filter buildingpart
*
* @param $config
Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl 2017-08-31 16:14:30 UTC (rev
17021)
+++ trunk/property/templates/base/config.tpl 2017-08-31 17:35:57 UTC (rev
17022)
@@ -460,6 +460,14 @@
</td>
</tr>
<tr>
+ <td>{lang_TTS_order_contact_at_location}.</td>
+ <td>
+ <select
name="newsettings[contact_at_location]">
+ {hook_list_contact_at_location}
+ </select>
+ </td>
+ </tr>
+ <tr>
<td>{lang_send_response_TTS}.</td>
<td>
<select
name="newsettings[tts_send_response]">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17022] property: alternative contact at location,
sigurdne <=