Code

Removed unsed stuff
[gosa.git] / plugins / gofon / macro / class_gofonMacroManagement.inc
index 2a6a14b129e6429443a151068182bf523b546e00..a88498d72c1075afe2761161b4d67b2a2b51b91c 100755 (executable)
@@ -170,7 +170,7 @@ class gofonMacro extends plugin
     /* Finish mac edit is triggered by the tabulator dialog, so
        the user wants to save edited data. Check and save at this
        point. */
-    if (isset($_POST['edit_finish'])){
+    if ((isset($_POST['edit_finish'])) && (isset($this->macrotabs->config))){
 
       /* Check tabs, will feed message array */
       $this->macrotabs->last= $this->macrotabs->current;
@@ -204,7 +204,7 @@ class gofonMacro extends plugin
     }
 
     /* User wants to edit data? */
-    if ($s_action=="edit"){
+    if (($s_action=="edit") && (!isset($this->macrotabs->config))){
 
       /* Get 'dn' from posted 'macrolists', must be unique */
       $this->dn= $this->macros[$s_entry]['dn']; 
@@ -291,7 +291,7 @@ class gofonMacro extends plugin
     }
 
     /* Show tab dialog if object is present */
-    if ($this->macrotabs){
+    if (($this->macrotabs) && (isset($this->macrotabs->config))){
       $display= $this->macrotabs->execute();
 
       /* Don't show buttons if tab dialog requests this */
@@ -321,13 +321,14 @@ class gofonMacro extends plugin
 
    /* NEW LIST MANAGMENT */
     $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
-            " <input class='center' type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
             " <input class='center' type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root").        "'>&nbsp;".
+            " <input class='center' type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'>&nbsp;".
             " <input class='center' type='image' align='middle' src='images/list_home.png' title='"._("Go to users department")."' alt='"._("Home")."'                     name='dep_home'>&nbsp;".
+            " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='"._("Submit")."'>&nbsp;".
             " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
             " <input class='center' type='image' align='middle' src='images/list_new_macro.png' title='"._("Create new phone macro")."' alt='"._("New")."' name='user_new'>&nbsp;".
             " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
-            _("Current base")."&nbsp;<select name='depselect' onChange='mainform.submit()'>$options</select>".
+            _("Base")."&nbsp;<select name='depselect' 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")."'>&nbsp;".
             "</div>";
 
@@ -446,7 +447,13 @@ class gofonMacro extends plugin
      * We also need to search for the departments
      * So we are able to navigate like in konquerer
      */
-    $base2 = preg_replace("/ou=people,/i","",$base);
+    $peopleOU = get_people_ou();
+
+    if(empty($peopleOU)){
+      $base2 = $base;
+    }else{
+      $base2 = preg_replace("/".$peopleOU."/i","",$base);
+    }
 
     $res3 =  get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
         TRUE, $base2, array("ou", "description"), TRUE);