[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6659] frontend: configurable categories availlable t
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6659] frontend: configurable categories availlable to frontend users |
Date: |
Wed, 08 Dec 2010 20:28:57 +0000 |
Revision: 6659
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6659
Author: sigurdne
Date: 2010-12-08 20:28:56 +0000 (Wed, 08 Dec 2010)
Log Message:
-----------
frontend: configurable categories availlable to frontend users
Modified Paths:
--------------
trunk/frontend/inc/hook_config.inc.php
trunk/frontend/templates/base/config.tpl
Modified: trunk/frontend/inc/hook_config.inc.php
===================================================================
--- trunk/frontend/inc/hook_config.inc.php 2010-12-08 19:27:20 UTC (rev
6658)
+++ trunk/frontend/inc/hook_config.inc.php 2010-12-08 20:28:56 UTC (rev
6659)
@@ -165,3 +165,29 @@
return $cat_select;
}
+ /**
+ * Get HTML checkbox with categories that are candidates for frontend
ticket cat
+ *
+ * @param $config
+ * @return string options for selectbox
+ */
+ function tts_frontend_cat($config)
+ {
+ $cats = CreateObject('phpgwapi.categories', -1, 'property',
'.ticket');
+ $cats->supress_info = true;
+ $values = $cats->return_sorted_array(0, false, '', '', '',
$globals = true, '', $use_acl = false);
+ $tts_frontend_cat_selected = isset($config['tts_frontend_cat'])
? $config['tts_frontend_cat'] : array();
+ $out = '';
+ foreach ( $values as $entry)
+ {
+ $checked = '';
+ if ( in_array($entry['id'], $tts_frontend_cat_selected))
+ {
+ $checked = ' checked';
+ }
+ $out .= <<<HTML
+ <tr><td><input type="checkbox"
name="newsettings[tts_frontend_cat][]" value="{$entry['id']}"
{$checked}><label>{$entry['name']}</label></td></tr>
+HTML;
+ }
+ return $out;
+ }
Modified: trunk/frontend/templates/base/config.tpl
===================================================================
--- trunk/frontend/templates/base/config.tpl 2010-12-08 19:27:20 UTC (rev
6658)
+++ trunk/frontend/templates/base/config.tpl 2010-12-08 20:28:56 UTC (rev
6659)
@@ -46,6 +46,16 @@
</td>
</tr>
<tr class="row_off">
+ <td>{lang_ticket_frontend_category}:</td>
+ <td>
+ <!--to be able to blank the setting - need an empty value-->
+ <input type = 'hidden' name="newsettings[tts_frontend_cat][]"
value="">
+ <table>
+{hook_tts_frontend_cat}
+ </table>
+ </td>
+ </tr>
+ <tr class="row_off">
<td>{lang_ticket_default_category}:</td>
<td>
<select name="newsettings[tts_default_cat]">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6659] frontend: configurable categories availlable to frontend users,
Sigurd Nes <=