summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ca67f6e)
raw | patch | inline | side by side (parent: ca67f6e)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 17:41:24 +0000 (17:41 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 17:41:24 +0000 (17:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15478 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/systems/admin/systems/class_componentGeneric.inc | patch | blob | history | |
gosa-plugins/systems/admin/systems/component.tpl | patch | blob | history |
diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc
index b3ff77e38c4df28568bca1ea8d2d5cb9496def74..35ed070d6fafe8f362690faab43c9bec26605dcf 100644 (file)
var $objectclasses= array("top", "device", "ipHost", "ieee802Device");
var $netConfigDNS;
var $view_logged = FALSE;
+ var $baseSelector;
function componentGeneric (&$config, $dn= NULL, $parent= NULL)
{
$this->orig_base = $this->base;
$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);
}
/* Fill templating stuff */
$smarty= get_smarty();
- $smarty->assign("bases", $this->config->idepartments);
+ $smarty->assign("usePrototype", "true");
/* Set acls */
$tmp = $this->plInfo();
$smarty->assign($name."ACL",$this->getacl($name));
}
- $smarty->assign("bases", $this->get_allowed_bases());
-
/* Assign attributes */
foreach ($this->attributes as $attr){
$smarty->assign("$attr", $this->$attr);
}
- $smarty->assign("base_select", $this->base);
+ $smarty->assign("base", $this->baseSelector->render());
/* Show main page */
$str = $this->netConfigDNS->execute();
$this->netConfigDNS->save_object();
- /* Set new base if allowed */
- $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;
}
}
+
}
diff --git a/gosa-plugins/systems/admin/systems/component.tpl b/gosa-plugins/systems/admin/systems/component.tpl
index cc84e5335e96a326d313b867c36feec3051d8b18..8cb5154527d505be64be1bd1debd8f79ac2d9ee0 100644 (file)
<td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
<td>
{render acl=$baseACL}
- <select id="base" size="1" name="base" title="{t}Choose subtree to place component in{/t}">
- {html_options options=$bases selected=$base_select}
- </select>
+ {$base}
{/render}
-{render acl=$baseACL disable_picture='images/lists/folder_grey.png'}
- <input type="image" name="chooseBase" src="images/lists/folder.png" class="center" title="{t}Select a base{/t}">
-{/render}
-
</td>
</tr>
</table>