[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15466] tts
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15466] tts |
Date: |
Mon, 15 Aug 2016 17:36:10 +0000 (UTC) |
Revision: 15466
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15466
Author: sigurdne
Date: 2016-08-15 17:36:10 +0000 (Mon, 15 Aug 2016)
Log Message:
-----------
tts
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 2016-08-15 17:06:13 UTC (rev
15465)
+++ trunk/property/inc/class.uitts.inc.php 2016-08-15 17:36:10 UTC (rev
15466)
@@ -1398,6 +1398,25 @@
$tabs['add'] = array('label' => lang('Add'), 'link' =>
'#add');
$active_tab = 'add';
+ $fmttssimple_categories =
isset($this->bo->config->config_data['fmttssimple_categories']) ?
$this->bo->config->config_data['fmttssimple_categories'] : array();
+
+
+
+ $cat_select =
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
'use_acl' => $this->_category_acl, 'required' => true));
+
+ $_cat_list = array();
+ if(isset($fmttssimple_categories) &&
$fmttssimple_categories[1])
+ {
+ foreach ($cat_select['cat_list'] as $entry)
+ {
+ if(in_array($entry['cat_id'],
array_values($fmttssimple_categories)))
+ {
+ $_cat_list[] = $entry;
+ }
+ }
+ $cat_select['cat_list'] = $_cat_list;
+ }
+
$data = array
(
'my_groups' => json_encode($my_groups),
@@ -1442,8 +1461,7 @@
'lang_town_statustext' => lang('Select the part
of town the building belongs to. To do not use a part of town - select NO PART
OF TOWN'),
'lang_part_of_town' => lang('Part of town'),
'lang_no_part_of_town' => lang('No part of
town'),
- 'cat_select' =>
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
- 'selected' => $this->cat_id, 'use_acl'
=> $this->_category_acl, 'required' => true)),
+ 'cat_select' => $cat_select,
'pref_send_mail' =>
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification'])
?
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification']
: ''),
'fileupload' =>
(isset($this->bo->config->config_data['fmttsfileupload']) ?
$this->bo->config->config_data['fmttsfileupload'] : ''),
'tabs' =>
phpgwapi_jquery::tabview_generate($tabs, $active_tab)
Modified: trunk/property/inc/hook_config.inc.php
===================================================================
--- trunk/property/inc/hook_config.inc.php 2016-08-15 17:06:13 UTC (rev
15465)
+++ trunk/property/inc/hook_config.inc.php 2016-08-15 17:36:10 UTC (rev
15466)
@@ -76,7 +76,35 @@
}
return $out;
}
+ /**
+ * Get HTML checkbox with groups that are candidates for simplified tts
interface
+ *
+ * @param $config
+ * @return string HTML checkboxes to be placed in a table
+ */
+ function fmttssimple_categories( $config )
+ {
+ $cats = CreateObject('phpgwapi.categories', -1, 'property',
'.ticket');
+ $cats->supress_info = true;
+ $values = $cats->return_sorted_array(0, false, '', '', '',
$globals = true, '', $use_acl = false);
+ $cats_assigned = isset($config['fmttssimple_categories']) ?
$config['fmttssimple_categories'] : array();
+ $out = '';
+ foreach ($values as $key => $group)
+ {
+ $checked = '';
+ if (in_array($group['id'], $cats_assigned))
+ {
+ $checked = ' checked';
+ }
+
+ $out .= <<<HTML
+ <tr><td><input type="checkbox"
name="newsettings[fmttssimple_categories][]" value="{$group['id']}"
{$checked}><label>{$group['name']}</label></td></tr>
+HTML;
+ }
+ return $out;
+ }
+
/**
* Get HTML checkbox with groups that are candidates for the field
finnish date at tts
*
Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl 2016-08-15 17:06:13 UTC (rev
15465)
+++ trunk/property/templates/base/config.tpl 2016-08-15 17:36:10 UTC (rev
15466)
@@ -335,6 +335,16 @@
</table>
</td>
</tr>
+ <tr>
+ <td valign =
'top'>{lang_TTS_simplified_categories}:</td>
+ <td>
+ <!--to be able to blank the setting - need an
empty value-->
+ <input type = 'hidden'
name="newsettings[fmttssimple_categories][]" value="">
+ <table>
+ {hook_fmttssimple_categories}
+ </table>
+ </td>
+ </tr>
<tr class="pure-table-odd">
<td>{lang_Mail_Notification}:</td>
<td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15466] tts,
sigurdne <=