From: hickert Date: Fri, 17 Sep 2010 13:32:33 +0000 (+0000) Subject: Enabled base selection for devices X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ae46768e092ece8f4ef6e36fa16ebb06835ac5e4;p=gosa.git Enabled base selection for devices git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19757 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl index d4a3e45e9..a722aa08e 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/Device.tpl @@ -22,6 +22,18 @@ {/render} + + +
+ {t}Base{/t} + + +
+ {render acl=$baseACL} + {$base} + {/render} + +
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc index a6a8a42fa..b333c5a42 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_Device.inc @@ -42,6 +42,12 @@ class Device extends plugin plugin::plugin($config, $dn); $this->base = $this->config->current['BASE']; $this->orig_dn = $this->dn; + + // Prepare the base selector + $this->baseSelector= new baseSelector($this->get_allowed_bases(), $this->base); + $this->baseSelector->setSubmitButton(false); + $this->baseSelector->setHeight(300); + $this->baseSelector->update(true); } @@ -77,7 +83,9 @@ class Device extends plugin // Assign just user names instead of the complete dn. $smarty->assign("owner_name", $this->getUserName($this->owner)); $smarty->assign("manager_name", $this->getUserName($this->manager)); + $smarty->assign("base", $this->baseSelector->render()); + // Assign attribute values foreach($this->attributes as $attr){ $smarty->assign($attr, $this->$attr); } @@ -193,6 +201,18 @@ class Device extends plugin // Regenerate a new uuid if(isset($_POST['reloadUUID'])) $this->deviceUUID = $this->genFakeUuid(); + + // Update the 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; + } + } + } @@ -253,6 +273,7 @@ class Device extends plugin "description" => _("Device"), "objectClass" => "Device")), "plProvidedAcls" => array( + "base" => _("Base"), "cn" => _("Name"), "serialNumber" => _("Serial number"), "seeAlso" => _("See also"),