summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 794c86b)
raw | patch | inline | side by side (parent: 794c86b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Apr 2006 04:14:55 +0000 (04:14 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Apr 2006 04:14:55 +0000 (04:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3019 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/macro/class_gofonMacro.inc | patch | blob | history | |
plugins/gofon/macro/class_gofonMacroManagement.inc | patch | blob | history |
index c549a62c15fdee2aa99ca4a662f735b92b2b508e..0e0d556c81f3f47e335054b22cafaa9836db1795 100755 (executable)
/* Edit or new one ?*/
if ($this->dn == "new"){
- if(isset($_SESSION['macrofilter']['depselect'])){
- $this->base = $_SESSION['macrofilter']['depselect'];
+ if(isset($_SESSION['CurrentMainBase'])){
+ $this->base = $_SESSION['CurrentMainBase'];
$this->is_new = true;
}else{
$this->is_new = true;
} else {
$this->is_new = false;
$this->orig_cn=$this->cn;
- $this->base= dn2base($this->dn);
+ $this->base= preg_replace("/ou=macros,ou=asterisk,ou=configs,ou=systems,/","",dn2base($this->dn));
}
$ui= get_userinfo();
$acl= get_permissions ($ui->dn, $ui->subtreeACL);
diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc
index a88498d72c1075afe2761161b4d67b2a2b51b91c..75680383939fc956bad49780b4aba1097bb7f429 100755 (executable)
/* Get global filter config */
if (!is_global("macrofilter")){
$base= get_base_from_people($ui->dn);
- $macrofilter= array("depselect" => $base, "regex" => "*");
+ $macrofilter= array("regex" => "*");
register_global("macrofilter", $macrofilter);
}
+ if(!isset($_SESSION['CurrentMainBase'])){
+ $_SESSION['CurrentMainBase'] = $base= get_base_from_people($ui->dn);
+ }
+
$acl= get_permissions ($ui->dn, $ui->subtreeACL);
$this->acl= get_module_permission($acl, "goFonMacro", $ui->dn);
}
/* Save data */
$macrofilter= get_global("macrofilter");
- foreach( array("depselect", "regex") as $type){
+ foreach( array("regex") as $type){
if (isset($_POST[$type])){
$macrofilter[$type]= $_POST[$type];
}
if(isset($_GET['act'])&&($_GET['act']=="dep_open")){
$s_action="open";
$s_entry = base64_decode($_GET['dep_id']);
- $macrofilter['depselect']= "".$this->config->departments[trim($s_entry)];
+ $_SESSION['CurrentMainBase'] = $this->config->departments[trim($s_entry)];
+
}
/* Test Posts */
$s_entry = preg_replace("/_.$/","",$s_entry);
/* Department changed? */
- if(isset($_POST['depselect']) && $_POST['depselect']){
- $macrofilter['depselect']= $_POST['depselect'];
+ if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){
+ $_SESSION['CurrentMainBase']= $_POST['CurrentMainBase'];
}
/* Homebutton is posted */
if($s_action=="home"){
- $macrofilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn));
- $macrofilter['depselect']=(preg_replace("/^[^,]+,/","",$macrofilter['depselect']));
+ $_SESSION['CurrentMainBase'] = preg_replace("/^[^,]+,/","",$this->ui->dn);
+ $_SESSION['CurrentMainBase'] = preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase']);
}
if($s_action=="root"){
- $macrofilter['depselect']=($this->config->current['BASE']);
+ $_SESSION['CurrentMainBase'] = $this->config->current['BASE'] ;
}
/* If Backbutton is Posted */
if($s_action=="back"){
- $base_back = preg_replace("/^[^,]+,/","",$macrofilter['depselect']);
+ $base_back = preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase']);
$base_back = convert_department_dn($base_back);
if(isset($this->config->departments[trim($base_back)])){
- $macrofilter['depselect']= $this->config->departments[trim($base_back)];
+ $_SESSION['CurrentMainBase'] = $this->config->departments[trim($base_back)];
}else{
- $macrofilter['depselect']= $this->config->departments["/"];
+ $_SESSION['CurrentMainBase'] = $this->config->departments["/"];
}
}
/* Prepare departments */
$options= "";
foreach ($this->config->idepartments as $key => $value){
- if ($macrofilter['depselect'] == $key){
+ if ($_SESSION['CurrentMainBase'] == $key){
$options.= "<option selected='selected' value='$key'>$value</option>";
} else {
$options.= "<option value='$key'>$value</option>";
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
" <input class='center' type='image' align='middle' src='images/list_new_macro.png' title='"._("Create new phone macro")."' alt='"._("New")."' name='user_new'> ".
" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
- _("Base")." <select name='depselect' onChange='mainform.submit()' class='center'>$options</select>".
+ _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'> ".
"</div>";
$smarty->assign("infoimage", get_template_path('images/info.png'));
$smarty->assign("launchimage", get_template_path('images/launch.png'));
$smarty->assign("deplist", $this->config->idepartments);
- foreach( array("depselect", "regex") as $type){
+ foreach( array("regex") as $type){
$smarty->assign("$type", $macrofilter[$type]);
}
+ $smarty->assign("CurrentMainBase" , $_SESSION['CurrentMainBase']);
+
/* Extend if we are not using javascript */
$smarty->assign("apply", apply_filter());
$smarty->assign("alphabet", generate_alphabet());
$macrofilter= get_global('macrofilter');
/* Set base for all searches */
- $base= $macrofilter['depselect'];
+ $base= $_SESSION['CurrentMainBase'];
/* Regex filter? */
if ($macrofilter['regex'] != ""){