X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_MultiSelectWindow.inc;h=bbba65eeeaf44d469bd63722a0e49c08779e8171;hb=7afa23783bbaf8d983427a43b13c19a398f01206;hp=a26337785ec3f7ea52d7fda4473a6b39591f27b1;hpb=b0379e01f37554b92ff2bdb14fe1ac408f742031;p=gosa.git diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index a26337785..bbba65eee 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -34,6 +34,7 @@ class MultiSelectWindow{ var $HideFilterPart = false; var $SaveAdditionalVars = array(); // Additional Post vars to store + var $module= ""; function ClearElementsList() { @@ -72,19 +73,14 @@ class MultiSelectWindow{ } /* Contrucktion */ - function MultiSelectWindow($config,$filterName) + function MultiSelectWindow($config, $filterName, $module) { $this->config = $config; + $this->module = $module; $this->SaveButtonString = _("Save"); $this->CloseButtonString = _("Close"); $this->filterName = $filterName; - /* Set default base, to users base */ - $ui = get_userinfo(); - $base = get_base_from_people($ui->dn); - if(!isset($_SESSION['CurrentMainBase'])){ - $_SESSION['CurrentMainBase'] = $base; - } $this->selectedBase = $_SESSION['CurrentMainBase']; /* Check default values for SaveAdditionalVars */ @@ -279,7 +275,7 @@ class MultiSelectWindow{ if($box['default'] == true){ $boxes .=" ".$box['string']."
"; }else{ - $boxes .=" ".$box['string']."
"; + $boxes .=" ".$box['string']."
"; } } $smarty->assign("CheckBoxes", $boxes); @@ -366,6 +362,11 @@ class MultiSelectWindow{ Store data also into a session var, to keep the checkboxes check after reload */ function save_object() { + /* Get up to date config */ + if(isset($this->parent->config)){ + $this->config = $this->parent->config; + } + /* Update current base */ if($this->DepartmentsAdded){ $s_action =""; @@ -482,12 +483,56 @@ class MultiSelectWindow{ $val = preg_replace("/\*\**/","*",$val); $this->array_Regexes[$key]['value'] = $val; $this->$box['name'] = $val; + $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] = $val; } } } - } + + /* Create header snapshot value */ + function get_snapshot_header() + { + $str = " "; + if($this->parent->snapshotEnabled()){ + $ok = false; + foreach($this->parent->get_used_snapshot_bases() as $base){ + $ok |= count($this->parent->getAllDeletedSnapshots($base)) >= 1 ; + } + if($ok){ + $str = " "; + }else{ + $str = " "; + } + +# $str .= " "; + } + return($str); + } + + + function GetSnapShotActions($dn) + { + $str= ""; + if($this->parent->snapshotEnabled()){ + + if(count($this->parent->Available_SnapsShots($dn))){ + $str.= " "; + } else { + $str = " "; + } + + $str.= " "; + } + + return($str); + } + + /* this function adds the sub-departments of the current tree to the list */ function AddDepartments($base = false,$numtabs = 3) { @@ -509,8 +554,8 @@ class MultiSelectWindow{ $this->departments = array(); /* Get all departments within this subtree */ - $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->ui->subtreeACL, - $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); + $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); /* Edit delete link for system types */ @@ -529,6 +574,7 @@ class MultiSelectWindow{ /* Add deps to this dialog object list */ foreach($this->departments as $key=> $val){ + /* Add missing entries ... */ if(!isset($this->config->departments[trim($key)])){ $this->config->departments[trim($key)]="";