Code

Shortened the base string
[gosa.git] / plugins / gofon / macro / class_gofonMacroManagement.inc
index d0fe77f6033967ef7eae3c3c918cebdf4e5c2d4d..8a9877276e6800d89c199065327f3424d729d5b6 100755 (executable)
@@ -327,7 +327,7 @@ class gofonMacro extends plugin
             " <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()' class='center'>$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 +446,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);