Code

Added sorting to FAIscripts
[gosa.git] / plugins / admin / fai / class_divListFai.inc
index 6bbc8b9c45e1433dcd0f9461b248272d0c072c94..b6fc3e3998109230811f1d9c1d9bab9b5311603f 100644 (file)
@@ -80,16 +80,26 @@ class divListFai extends MultiSelectWindow
 
     /* Add SubSearch checkbox */
     //$this->AddCheckBox(SEPERATOR);
-    //$this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Ignore subtrees"), false);
+    //$this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Search in subtrees"), false);
 
     /*                  Name                 ,Text                              ,Default  , Connect with alphabet  */
     $this->AddRegex   ("Regex",     _("Display users matching"),"*" , true);
   }
 
-  function AddUserBoxToFilter($position){
+  function AddUserBoxToFilter($position)
+  {
     $str = "";
     if($position  == 2){
+
+      /* Check if there are post commands available for fai management.
+       * If not, grey out freeze/branch and release remove buttons.
+       */
+      $r = ("" != search_config($this->config->data,"faiManagement","POSTREMOVE"));
+      $c = ("" != search_config($this->config->data,"faiManagement","POSTCREATE"));
+
       $smarty = get_smarty();
+      $smarty->assign("allow_create", $c);
+      $smarty->assign("allow_remove", $r);
       $smarty->assign("selectedBranch",$this->selectedBranch);
       $smarty->assign("branchimage","images/branch.png");
       $smarty->assign("branches",$this->AvailableBranches);
@@ -211,6 +221,15 @@ class divListFai extends MultiSelectWindow
     $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/edittrash.png'
         title='"._("Remove selected fai objects")."' alt='"._("Remove fai objects")."' name='remove_multiple_fai_objects'>&nbsp;";
 
+    /* Add multiple copy & cut icons */
+    if(is_object($this->parent->CopyPasteHandler)){
+      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcopy.png'
+        title='"._("Copy selected objects")."' alt='"._("Copy fai objects")."' name='multiple_copy_fai'>&nbsp;";
+      $listhead .= "&nbsp;<input class='center' type='image' align='middle' src='images/editcut.png'
+        title='"._("cut selected objects")."' alt='"._("Cut fai objects")."' name='multiple_cut_fai'>&nbsp;";
+      $listhead .= "</div>";
+    }
+
     $listhead .="</div>";;