From: cajus Date: Fri, 29 Jan 2010 16:58:08 +0000 (+0000) Subject: Updated blocklist base handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f6c11c28bb8c54f020f2082c20012bea01416f52;p=gosa.git Updated blocklist base handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15467 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc index c1701053b..e240bb63b 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc @@ -26,6 +26,7 @@ class blocklistGeneric extends plugin var $goFaxSBlocklist = array(); var $goFaxRBlocklist = array(); + var $baseSelector; function __construct($config,$dn = "new") @@ -73,6 +74,12 @@ class blocklistGeneric extends plugin $this->orig_base = $this->base; $this->orig_dn = $this->dn; + + /* Instanciate base selector */ + $this->baseSelector= new baseSelector($this->get_allowed_bases(), $this->base); + $this->baseSelector->setSubmitButton(false); + $this->baseSelector->setHeight(300); + $this->baseSelector->update(true); } public function execute() @@ -84,41 +91,6 @@ class blocklistGeneric extends plugin } - /************** - * 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,$this->get_allowed_bases()); - $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()){ - - /* A new base was selected, check if it is a valid one */ - $tmp = $this->get_allowed_bases(); - if(isset($tmp[$this->dialog->isSelected()])){ - $this->base = $this->dialog->isSelected(); - } - $this->dialog= false; - - }else{ - return($this->dialog->execute()); - } - } - - /*************** Add numer to blocklist ***************/ @@ -149,6 +121,7 @@ class blocklistGeneric extends plugin ***************/ $smarty = get_smarty(); + $smarty->assign("usePrototype", "true"); foreach($this->attributes as $name){ $smarty->assign($name,$this->$name); } @@ -159,8 +132,7 @@ class blocklistGeneric extends plugin $smarty->assign("goFaxBlocklist",$this->goFaxBlocklist); $smarty->assign("cnACL",$this->getacl("cn",$this->readonly)); $smarty->assign("typeACL",$this->getacl("type",$this->readonly)); - $smarty->assign("base",$this->base); - $smarty->assign("bases", $this->get_allowed_bases()); + $smarty->assign("base", $this->baseSelector->render()); $smarty->assign("types", array(BLOCK_LIST_SEND => _("send"), BLOCK_LIST_RECEIVE => _("receive"))); $smarty->assign("type", $this->type); $smarty->assign("dn", $this->dn); @@ -176,13 +148,18 @@ class blocklistGeneric extends plugin plugin::save_object(); $this->cn = $tmp_cn; - /* Save base, since this is no LDAP attribute */ - $tmp = $this->get_allowed_bases(); - if(isset($_POST['base'])){ - if(isset($tmp[$_POST['base']])){ - $this->base= $_POST['base']; + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; } } + + /* Save attrbutes */ $tmp = $this->attributes; $tmp[] = "type"; foreach($tmp as $attr){ diff --git a/gosa-plugins/gofax/gofax/blocklists/generic.tpl b/gosa-plugins/gofax/gofax/blocklists/generic.tpl index 917153847..02a8cbe95 100644 --- a/gosa-plugins/gofax/gofax/blocklists/generic.tpl +++ b/gosa-plugins/gofax/gofax/blocklists/generic.tpl @@ -17,13 +17,7 @@ {$must} {render acl=$baseACL} - -{/render} - -{render acl=$baseACL disable_picture='images/lists/folder_grey.png'} - + {$base} {/render}