Code

Added multiple priority settings
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 11:21:26 +0000 (11:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 11:21:26 +0000 (11:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7655 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/gotomasses/class_divListMasses.inc
plugins/addons/gotomasses/class_gotomasses.inc

index f504380ccd85971a35a27fadccf97c58b76fed2e..9a17bffdcc39377ce7902dbff46a01ba7ff51be7 100644 (file)
@@ -62,8 +62,16 @@ class divListMasses extends MultiSelectWindow
     if($this->parent->acl_is_removeable()){
       $header .= "<input type='image' src='images/edittrash.png' name='remove_multiple_task' class='center'>&nbsp;";
     }
-    $header .= "</div>";
 
+    /* Add priority options */
+    if(preg_match("/w/",$this->parent->getacl(""))){
+      $header .= "<input type='image' src='images/prio_top.png'       name='multiple_prio_top'      class='center'>&nbsp;";
+      $header .= "<input type='image' src='images/prio_increase.png'  name='multiple_prio_increase' class='center'>&nbsp;";
+      $header .= "<input type='image' src='images/prio_decrease.png'  name='multiple_prio_decrease' class='center'>&nbsp;";
+      $header .= "<input type='image' src='images/prio_bottom.png'    name='multiple_prio_bottom'   class='center'>&nbsp;";
+    }
+    $header .= "</div>";
+    
     /* Create divlist */
     $this->SetListHeader($header);
 
index 1920ea8dda390d5880fe9241185b6a3f2c028669..1f71f7be34934018600aee076a3f563809476fde 100644 (file)
@@ -42,6 +42,11 @@ class gotomasses extends plugin
                   "/^prio_decrease_/" => "prio_decrease",
                   "/^prio_bottom_/"   => "prio_bottom",
 
+                  "/^multiple_prio_top_/"      => "mprio_top",
+                  "/^multiple_prio_increase_/" => "mprio_increase",
+                  "/^multiple_prio_decrease_/" => "mprio_decrease",
+                  "/^multiple_prio_bottom_/"   => "mprio_bottom",
+
                   "/^edit_task_/"=>"edit","/^remove_task_/"=>"remove",
                   "/^new_task_/"=>"new_task","/^remove_multiple_task_/" => "remove_multiple");
     foreach($arr as $regex => $action){
@@ -64,9 +69,25 @@ class gotomasses extends plugin
      * REMOVE 
      ************/
     
-    if(preg_match("/^prio_/",$s_action)){
+    if(preg_match("/^mprio_/",$s_action) || preg_match("/^prio_/",$s_action)){
 
       switch($s_action){
+        case 'mprio_top'       : foreach($this->list_get_selected_items() as $id ){
+                                   $this->o_queue->max_entry_priority($id);
+                                 }
+                                 break;
+        case 'mprio_increase'  : foreach($this->list_get_selected_items() as $id ){
+                                   $this->o_queue->increase_entry_priority($id);
+                                 }
+                                 break;
+        case 'mprio_decrease'  : foreach($this->list_get_selected_items() as $id ){
+                                   $this->o_queue->decrease_entry_priority($id);
+                                 }
+                                 break;
+        case 'mprio_bottom'    : foreach($this->list_get_selected_items() as $id ){
+                                   $this->o_queue->min_entry_priority($id);
+                                 }
+                                 break;
         case 'prio_top'       : $this->o_queue->max_entry_priority($s_entry);break;
         case 'prio_increase'  : $this->o_queue->increase_entry_priority($s_entry);break;
         case 'prio_decrease'  : $this->o_queue->decrease_entry_priority($s_entry);break;