Code

Shortened the base string
[gosa.git] / plugins / gofon / macro / class_gofonMacroManagement.inc
index 0f5d782557fc4fdb9af64feefa90ac0dcb9a67b3..8a9877276e6800d89c199065327f3424d729d5b6 100755 (executable)
@@ -297,9 +297,9 @@ class gofonMacro extends plugin
       /* Don't show buttons if tab dialog requests this */
       if (!$this->macrotabs->by_object[$this->macrotabs->current]->dialog){
         $display.= "<p style=\"text-align:right\">\n";
-        $display.= "<input type=submit name=\"edit_finish\" value=\""._("Finish")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_finish\" value=\""._("Finish")."\">\n";
         $display.= "&nbsp;\n";
-        $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
         $display.= "</p>";
       }
       return ($display);
@@ -312,7 +312,7 @@ class gofonMacro extends plugin
     $options= "";
     foreach ($this->config->idepartments as $key => $value){
             if ($macrofilter['depselect'] == $key){
-                    $options.= "<option selected value='$key'>$value</option>";
+                    $options.= "<option selected='selected' value='$key'>$value</option>";
             } else {
                     $options.= "<option value='$key'>$value</option>";
             }
@@ -327,14 +327,14 @@ 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()'>$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>";
 
 
     /* Options */
-    $action= "<input type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit user")."'>";
-    $action.= "<input type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
+    $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     name='user_edit_%KEY%' title='"._("Edit user")."'>";
+    $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'   name='user_del_%KEY%' title='"._("Delete user")."'>";
 
     $divlist = new divlist("macrotabs");
     $divlist->SetHeader(array(
@@ -372,12 +372,12 @@ class gofonMacro extends plugin
     }
 
     // Pictures for Extensions
-    $empty    = "<img src='images/nothing.png' style='width:16px;height:16px;' alt=''>";
+    $empty    = "<img class='center' src='images/nothing.png' style='width:16px;height:16px;' alt=''>";
 
     // User and Template  Images
-    $macroimg   = "<img src='images/list_macro.png' alt='"._("Macro")."' title='%s'>";
-    $visible    = "<img src='images/true.png' alt='"._("yes")."' title='"._("visible")."'>";
-    $invisible  = "<img src='images/false.png' alt='"._("no")."'title='"._("invisible")."'>";
+    $macroimg   = "<img class='center' src='images/list_macro.png' alt='"._("Macro")."' title='%s'>";
+    $visible    = "<img class='center' src='images/true.png' alt='"._("yes")."' title='"._("visible")."'>";
+    $invisible  = "<img class='center' src='images/false.png' alt='"._("no")."'title='"._("invisible")."'>";
 
     // Link for edit
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
@@ -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);