From: cajus Date: Fri, 29 Jan 2010 17:08:31 +0000 (+0000) Subject: Updated base selector for conferences X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=156fb1b617ae6cfa98c3f238b934c5e20e404dd6;p=gosa.git Updated base selector for conferences git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15470 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc index dc5a16bd6..069010e80 100644 --- a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc +++ b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc @@ -49,10 +49,9 @@ class conference extends plugin var $old_tele_number = false; var $old_dn; + var $baseSelector; /* Headpage attributes */ - var $last_dep_sorting= "invalid"; - var $departments= array(); var $view_logged = FALSE; var $dialog ; @@ -152,6 +151,11 @@ class conference extends plugin $this->orig_base = $this->base; $this->orig_dn = $this->dn; + /* 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); } @@ -167,36 +171,7 @@ class conference extends plugin } $smarty= get_smarty(); - - $smarty->assign("bases" ,$this->config->idepartments); - $smarty->assign("base" ,$this->base); - - $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()){ - $tmp = $this->get_allowed_bases(); - if(isset($tmp[$this->dialog->isSelected()])){ - $this->base = $this->dialog->isSelected(); - } - $this->dialog= false; - }else{ - return($this->dialog->execute()); - } - } + $smarty->assign("usePrototype", "true"); foreach ($this->attributes as $val){ $smarty->assign("$val", $this->$val); @@ -226,15 +201,7 @@ class conference extends plugin $smarty->assign($name."ACL",$this->getacl($name)); } - if($this->acl_is_writeable("base")){ - $smarty->assign("baseSelect",true); - }else{ - $smarty->assign("baseSelect",false); - } - - $smarty->assign("bases" ,$this->get_allowed_bases()); - $smarty->assign("base_select" ,$this->base); - + $smarty->assign("base" ,$this->baseSelector->render()); if(session::get('js')==1){ if($this->goFonConferenceOption_P != "P"){ @@ -294,13 +261,17 @@ class conference extends plugin 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; } } + foreach(array("goFonConferenceOption_P","goFonConferenceOption_r","goFonConferenceOption_M","goFonConferenceOption_s", "goFonConferenceOption_i","goFonConferenceOption_c","goFonConferenceOption_D") as $attrs){ diff --git a/gosa-plugins/gofon/gofon/conference/generic.tpl b/gosa-plugins/gofon/gofon/conference/generic.tpl index 83f25206a..0916cea2a 100644 --- a/gosa-plugins/gofon/gofon/conference/generic.tpl +++ b/gosa-plugins/gofon/gofon/conference/generic.tpl @@ -53,13 +53,7 @@ {render acl=$baseACL} - -{/render} - -{render acl=$baseACL disable_picture='images/lists/folder_grey.png'} - + {$base} {/render}