summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 584a608)
raw | patch | inline | side by side (parent: 584a608)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Mar 2010 16:16:30 +0000 (16:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 Mar 2010 16:16:30 +0000 (16:16 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16387 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/ihtml/themes/modern/userFilterEditor.tpl b/gosa-core/ihtml/themes/modern/userFilterEditor.tpl
index 2d94578cdce293e238e432b7942467c4fa77140f..e014ab3f5bf7b6eee9a82e83965bb18b2e1bc7b1 100644 (file)
<input type='text' name='name' id='name' value='{$name}'>
</td>
</tr>
+ <tr>
+ <td>
+ <label for='parent'>{t}parent{/t}</label>
+ </td>
+ <td>
+ <select name='parent'>
+ {html_options values=$fixedFilters output=$fixedFilters selected=$parent}
+ </select>
+ </td>
+ </tr>
<tr>
<td>
<label for='description'>{t}Description{/t}</label>
index 46e1aec4482625845e980e0059c85dd04440ed99..aa161799542df1eeec925e11984c431bb4d86c0a 100644 (file)
*/
static function explodeFilterString($filter)
{
- list($categories, $name, $description, $filter, $flags) = split(";", $filter);
+ list($parent,$categories, $name, $description, $filter, $flags) = split(";", $filter);
// Ensure that we no empty category in our category list.
if(empty($categories)){
// build up filter entry.
$tmp = array(
+ 'parent' => $parent,
'name' => $name,
'categories' => $categories,
'description' => base64_decode($description),
foreach($this->filters as $name => $filter){
$data[$name] = array('data' =>
array(
+ $filter['parent'],
$filter['name'],
$filter['description'],
implode(", ",$filter['categories']),
// Build up new list of filters
$attrs = array();
foreach($this->filters as $filter){
- $tmp = implode(',', $filter['categories']).";";
+ $tmp = $filter['parent'].";";
+ $tmp.= implode(',', $filter['categories']).";";
$tmp.= $filter['name'].";";
$tmp.= base64_encode($filter['description']).";";
$tmp.= base64_encode($filter['filter']).";";
diff --git a/gosa-core/include/class_userFilterEditor.inc b/gosa-core/include/class_userFilterEditor.inc
index 90eefe1c336bb4d51a1ebd4c908f3e9ff7d43272..998994a7d809214fa81b49ca27641ae5e5462953 100644 (file)
// The values
public $name = "";
public $description = "";
+ public $parent = "";
public $selectedCategories = array();
public $share = FALSE;
public $enabled = TRUE;
// The list of all categories mangaged by the current filter object.
// Used in the grop-down box.
public $availableCategories = array();
+ public $fixedFilters = array();
public $orig_name = "";
/*! \brief Instantiate the filter editing dialog.
* Parses the filter info into editable data.
*/
- function __construct($entry, $categories)
+ function __construct($entry, $categories, $fixedFilters)
{
$this->availableCategories = $categories;
+ $this->fixedFilters = $fixedFilters;
if($entry){
$this->entry = $entry;
+ $this->parent = $entry['parent'];
$this->name = $entry['name'];
$this->description = $entry['description'];
$this->filter = $entry['filter'];
{
plugin::execute();
$smarty = get_smarty();
+ $smarty->assign('parent', $this->parent);
$smarty->assign('name', htmlentities($this->name,ENT_COMPAT,'UTF-8'));
$smarty->assign('filter', htmlentities($this->filter,ENT_COMPAT,'UTF-8'));
$smarty->assign('share', $this->share);
$smarty->assign('description', htmlentities($this->description,ENT_COMPAT,'UTF-8'));
$smarty->assign('selectedCategories', $this->selectedCategories);
$smarty->assign('availableCategories', $this->availableCategories);
+ $smarty->assign('fixedFilters', $this->fixedFilters);
return($smarty->fetch(get_template_path('userFilterEditor.tpl', FALSE)));
}
if(isset($_POST['userFilterEditor'])){
// Get posted strings
- foreach(array('name','description') as $attr){
+ foreach(array('name','description', 'parent') as $attr){
if(isset($_POST[$attr])){
$this->$attr = get_post($attr);
}
function save()
{
$ret= array();
+ $ret['parent'] = $this->parent;
$ret['name'] = $this->name;
$ret['description'] = $this->description;
$ret['categories'] = $this->selectedCategories;