From: cajus Date: Fri, 29 Jan 2010 14:44:16 +0000 (+0000) Subject: Added base selector to roles X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9379f58d5b101a8112f48a1257417c06ee529799;p=gosa.git Added base selector to roles git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15450 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc b/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc index b27fef306..518b0e17b 100644 --- a/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc +++ b/gosa-plugins/rolemanagement/admin/roleManagement/class_roleGeneric.inc @@ -52,6 +52,7 @@ class roleGeneric extends plugin { // var $objCacheLoaded = FALSE; + var $baseSelector; /* Initialize the class */ @@ -78,6 +79,12 @@ class roleGeneric extends plugin { $this->orig_base = $this->base; $this->orig_dn = $dn; $this->orig_cn = $this->cn; + + /* 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); } @@ -184,8 +191,8 @@ class roleGeneric extends plugin { // Get smarty instance and assign required variables. $smarty = get_smarty(); - $smarty->assign("bases", $tmp); - $smarty->assign("base_select",$this->base); + $smarty->assign("usePrototype", "true"); + $smarty->assign("base", $this->baseSelector->render()); $smarty->assign("members",$this->convert_list()); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); @@ -351,8 +358,16 @@ class roleGeneric extends plugin { function save_object() { plugin::save_object(); - if(isset($_POST['base'])){ - $this->base = get_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; + } } } diff --git a/gosa-plugins/rolemanagement/admin/roleManagement/roleGeneric.tpl b/gosa-plugins/rolemanagement/admin/roleManagement/roleGeneric.tpl index 3f74097fe..4e82a71a8 100644 --- a/gosa-plugins/rolemanagement/admin/roleManagement/roleGeneric.tpl +++ b/gosa-plugins/rolemanagement/admin/roleManagement/roleGeneric.tpl @@ -31,13 +31,7 @@
{render acl=$baseACL} - - {/render} - {render acl=$baseACL disable_picture='images/lists/folder_grey.png'} - + {$base} {/render}