From: hickert Date: Fri, 17 Sep 2010 13:28:36 +0000 (+0000) Subject: Added ability to add members X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=242f3de63a7274c3db9a63c30b17ec84e6dbeb9d;p=gosa.git Added ability to add members git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19756 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl b/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl index b59988f3c..efee6ed4b 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/InstallRecipe.tpl @@ -1,8 +1,26 @@ + + + + + + + + @@ -13,7 +31,6 @@ - @@ -32,7 +49,6 @@ - - - - - - - - - -
+ +
+ +
- + {$memberList} + +
@@ -51,19 +67,6 @@
- -
- -
@@ -77,3 +80,4 @@
+ diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc index 55037749e..b0c3fb068 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc @@ -45,6 +45,15 @@ class InstallRecipe extends plugin } uksort($list, 'strnatcasecmp'); $this->timezones = $list; + + // Prepare member list + $this->memberList= new sortableListing($this->member); + $this->memberList->setDeleteable(true); + $this->memberList->setColspecs(array('*')); + $this->memberList->setWidth("100%"); + $this->memberList->setHeight("70px"); + + } function execute() @@ -55,18 +64,36 @@ class InstallRecipe extends plugin foreach($this->attributes as $attr){ $smarty->assign($attr, $this->$attr); } + + // Fill and render the member list widget + $this->memberList->setListData($this->member); + $this->memberList->update(); + $this->memberList->setAcl($this->getacl('member')); + $smarty->assign('memberList', $this->memberList->render()); return($smarty->fetch(get_template_path('goto/Device/InstallRecipe.tpl', TRUE))); } + + function save_object() + { + plugin::save_object(); + $this->kickstartRootEnabled = isset($_POST['kickstartRootEnabled']); + + // Update the member list widget. + $this->memberList->save_object(); + $this->member = $this->memberList->getMaintainedData(); + if(isset($_POST['member']) && isset($_POST['addMember'])){ + $member= get_post('member'); + $this->member[] = $member; + } + } + function save() { - $this->member = array(); plugin::save(); - #$this->cleanup(); - - print_a($this->attrs); + $this->cleanup(); $ldap=$this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ldap->cd($this->dn);