From: hickert Date: Mon, 22 May 2006 07:37:17 +0000 (+0000) Subject: Added ACLs for FonMacros && Added baseselect dialog X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=542aef73c27e3714d46656bd297ec2c7df3f43b1;p=gosa.git Added ACLs for FonMacros && Added baseselect dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3481 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 9adf21534..cabcb9a8b 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -103,6 +103,33 @@ class macro extends plugin _("This 'dn' is no phone macro.").""; return ($display); } + + /* Base select dialog */ + $once = true; + foreach($_POST as $name => $value){ + if(preg_match("/^chooseBase/",$name) && $once){ + $once = false; + $this->dialog = new baseSelectDialog($this->config,$this->allowedBasesToMoveTo()); + $this->dialog->setCurrentBase($this->base); + } + } + + /* Dialog handling */ + if(is_object($this->dialog)){ + /* Must be called before save_object */ + $this->dialog->save_object(); + + if($this->dialog->isClosed()){ + $this->dialog = false; + }elseif($this->dialog->isSelected()){ + $this->base = $this->dialog->isSelected(); + $this->dialog= false; + }else{ + return($this->dialog->execute()); + } + } + + /* Fill templating stuff */ $smarty= get_smarty(); @@ -111,6 +138,7 @@ class macro extends plugin /* Assign all vars to Smarty */ foreach($this->attributes as $ar){ $smarty->assign($ar, $this->$ar); + $smarty->assign($ar."ACL", chkacl($this->acl,$ar)); } /* Checkboxes */ $smarty->assign("base_select", $this->base); diff --git a/plugins/gofon/macro/generic.tpl b/plugins/gofon/macro/generic.tpl index f3a3096e5..07ab79fe0 100755 --- a/plugins/gofon/macro/generic.tpl +++ b/plugins/gofon/macro/generic.tpl @@ -4,12 +4,12 @@ - + @@ -19,10 +19,15 @@
{$must}
{$must} - +
{$must} - {html_options options=$bases selected=$base_select} - + + {if $baseACL == ""} + + {else} + + {/if}
@@ -35,12 +40,12 @@ - + - {t}Visible for user{/t} + {t}Visible for user{/t} @@ -51,7 +56,7 @@
{t}Macro text{/t}
- +