summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a98b491)
raw | patch | inline | side by side (parent: a98b491)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 17:48:50 +0000 (17:48 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 17:48:50 +0000 (17:48 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15479 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
index f584a00693c71a60307469f0975c243d69565922..9bc8b69f146fbdc9e226352502e57dc55ca9207b 100644 (file)
var $gotoGroupAdminPrinter ;
var $gotoGroupPrinter;
var $gotoUserPrinter ;
+ var $baseSelector;
/* attribute list for save action */
var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter", "macAddress",
}
$this->orig_cn = $this->cn;
$this->orig_base = $this->base;
+
+ /* 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);
}
function set_acl_base($base)
}
$smarty= get_smarty();
+ $smarty->assign("usePrototype", "true");
/* Assign acls */
$tmp = $this->plInfo();
}
}
- /* Base select dialog */
- $once = true;
- foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){
- $once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
- $this->dialog->setCurrentBase($this->base);
- $this->baseSelection = true;
- }
- }
-
- /* Dialog handling for base select dialog
- * Check if base was selected, dialog aborted etc */
- if(is_object($this->dialog)){
-
- $this->dialog->save_object();
- if($this->baseSelection){
- if($this->dialog->isClosed()){
- $this->dialog = false;
- $this->baseSelection = 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;
- $this->baseSelection = false;
- }else{
- return($this->dialog->execute());
- }
- }
- }
-
- /* Fill templating stuff */
- $smarty->assign("bases", $this->get_allowed_bases());
- $smarty->assign("base_select", $this->base);
-
/* Assign attributes */
foreach ($this->attributes as $attr){
$smarty->assign("$attr", $this->$attr);
}
+ $smarty->assign("base", $this->baseSelector->render());
+
// Act on add user/grouo requests
if(isset($_POST['AddUser'])){
$this->userSelect = new userGroupSelect($this->config, get_userinfo());
$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;
}
}
+
}
/* Check supplied data */
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
index 07bb9cd6cde29ca57cb4c72309338cd563fc787e..a93579f8c188a2e2186c64216f75e9ac442b159a 100644 (file)
var $modes= array();
var $netConfigDNS;
+ var $baseSelector;
var $inheritTimeServer = true;
$this->orig_dn= $this->dn;
$this->orig_cn= $this->cn;
$this->orig_base= $this->base;
+
+ /* 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);
}
return($display);
}
- /* Base select dialog */
- $once = true;
- foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_writeable("base")){
- $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 new ntp Server to our list */
if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl_is_writeable("gotoNtpServer")){
$this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
/* Fill templating stuff */
$smarty= get_smarty();
+ $smarty->assign("usePrototype", "true");
/* Set acls */
$tmp = $this->plInfo();
$smarty->assign("cn", $this->cn);
$smarty->assign("description", $this->description);
$smarty->assign("l", $this->l);
- $smarty->assign("bases", $this->get_allowed_bases());
$smarty->assign("staticAddress", "");
$tmp = array();
$smarty->assign("gotoNtpServers", $ntpser);
/* Variables */
- foreach(array("base", "gotoMode", "gotoSyslogServer", "gotoNtpServer") as $val){
+ foreach(array("gotoMode", "gotoSyslogServer", "gotoNtpServer") as $val){
$smarty->assign($val."_select", $this->$val);
}
+ $smarty->assign("base", $this->baseSelector->render());
/* tell smarty the inherit checkbox state */
$smarty->assign("inheritTimeServer",$this->inheritTimeServer);
plugin::save_object();
$this->base = $base_tmp;
- /* 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;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/printer.tpl b/gosa-plugins/goto/admin/systems/goto/printer.tpl
index 4d63647c52f8dd64ff267a70a40d00d8d677de50..56e280513660fc9bba5f9de369d92cf7c73e5831 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 user in{/t}">
- {html_options options=$bases selected=$base_select}
- </select>
-{/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}">
+ {$base}
{/render}
</td>
</tr>
diff --git a/gosa-plugins/goto/admin/systems/goto/workstation.tpl b/gosa-plugins/goto/admin/systems/goto/workstation.tpl
index 6309ec7744a8028fa1948585d3bf0b2149295cf2..8e9a099972f26c039d800509d986a686b1aac2fc 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 group in{/t}">
- {html_options options=$bases selected=$base_select}
- </select>
-{/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}">
+ {$base}
{/render}
</td>
</tr>