Code

Added list footer for all management lists
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Aug 2007 08:31:54 +0000 (08:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 8 Aug 2007 08:31:54 +0000 (08:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6996 594d385d-05f5-0310-b6e9-bd551577e9d8

14 files changed:
html/themes/default/style.css
include/class_MultiSelectWindow.inc
include/class_divlist.inc
plugins/admin/applications/class_divListApplication.inc
plugins/admin/departments/class_divListDepartment.inc
plugins/admin/fai/class_divListFai.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/mimetypes/class_divListMimeTypes.inc
plugins/admin/ogroups/class_divListOGroup.inc
plugins/admin/systems/class_divListSystem.inc
plugins/admin/users/class_divListUsers.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/macro/class_divListMacros.inc

index cf91f5601de58d9a1e37407741b2faec74721d24..7bc2eef144db6f6b6304d5464a3d9b202cc9c885 100644 (file)
@@ -27,6 +27,13 @@ td#menucell {
        border:1px solid #AAA;
 }
 
+td.listfooter {
+       background:#E5E5E5;
+       border-top:1px solid #C0C0C0;
+       padding:3px;
+       height:16px;
+}
+
 td.scrollhead {
        vertical-align:top;
        padding:0px;
index db82577f37a044121960f7ac5a4c1597639ea74c..66dad408d6f6548148566558c76bfc624789131a 100644 (file)
@@ -27,12 +27,13 @@ class MultiSelectWindow{
        var $is_headpage                          = false;      // if true the design changes
        var $filterName                           = "Liste";
        var $DepartmentsAdded           = false;
+  var $Added_Departments  = array();
        var $selectedBase       = "";
 
   var $DivHeight          = "";
 
   var $HideFilterPart     = false;
-
+  var $List_Bottom_Info   = "";
   var $SaveAdditionalVars = array();  // Additional Post vars to store 
   var $module= "";
 
@@ -294,7 +295,8 @@ class MultiSelectWindow{
 
                $divlist = new divlist($this->string_Title);
                $divlist->SetSummary($this->string_Summary);
-               $divlist->SetEntriesPerPage(0); // 0 for scrollable list 
+               $divlist->SetEntriesPerPage(0); // 0 for scrollable list
+    $divlist->SetFooter($this->get_List_Bottom_Info());
   
     if($this->DivHeight != ""){
       $divlist->SetHeight($this->DivHeight);
@@ -598,6 +600,7 @@ class MultiSelectWindow{
        function AddDepartments($base = false,$numtabs = 3,$empty_tabs_in_front = 0)
        {
                $this->DepartmentsAdded = true;
+    $this->Added_Departments = array();
 
                /* check for a valid base */
                if(!$base){
@@ -679,8 +682,19 @@ class MultiSelectWindow{
                                }
                        }
                        $this->AddElement($row);
+      $this->Added_Departments[] = $row;
                }
        }
+
+  function set_List_Bottom_Info($str)
+  {
+    $this->List_Bottom_Info = $str;
+  }
+
+  function get_List_Bottom_Info()
+  {
+    return($this->List_Bottom_Info); 
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 2c28bc7cfa37525ec75cbddcefd96ffaff19c502..17176b217b9ce96ffbe8d5f2b743a2a0ecc61291 100644 (file)
@@ -17,6 +17,7 @@ class divlist {
        var $i_entriesPerPage;
 
   var $force_height = false;
+  var $list_footer = "";
   
        // Added php 4 constructor
        function divlist($pageid){
@@ -37,6 +38,11 @@ class divlist {
        
        }
 
+  function SetFooter($str)
+  {
+    $this->list_footer = $str;
+  }
+
        function AddEntry($a_entriedata) {
                $this->a_entries[] = $a_entriedata;
        }
@@ -78,8 +84,8 @@ class divlist {
     }
 
     $s_return.= $this->_generateHeader();
-    $s_return.=$this->_generatePage();
-               
+    $s_return.= $this->_generatePage();
+         $s_return.= $this->_generateFooter(); 
                $s_return.= "</table>";
                
                return ($s_return);
@@ -99,6 +105,33 @@ class divlist {
        function _numentries(){
                return count($this->a_entries);
        }
+
+  function _generateFooter()
+  {
+    $s_return = "";
+    if(!empty($this->list_footer)){
+
+      // Using scrolltable?
+      if($this->i_entriesPerPage == 0) {
+        if(!$this->force_height) {
+          $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:100%' cellspacing='0' id='t_scrollfoot'>";
+        } else {
+          $s_return.= "\n<tr><td class='scrollhead'><table summary='' style='width:100%' cellspacing='0'                      id='t_scrollfoot_onlywidth'>";
+        }
+      }
+      $s_return .= "<tr><td class='listfooter' style='border-bottom:0px;'>".$this->list_footer."</td>";
+          // Attach a 13px-wide column (used as scrollbar space in body-table),
+    // but do this only if we are really using scrolltables.
+    if($this->i_entriesPerPage == 0) {
+      $s_return.= "\n<td class='listfooter' style='width:13px;border-right:0px;'>&nbsp;</td>";
+      $s_return.= "\n</table></td>";
+    }
+
+    $s_return.= "\n</tr>";
+
+    }
+    return($s_return);
+  }
        
        function _generateHeader(){
                $s_return = "";
index ab467d57bc6c2f6385861bd58850c9eac8ccfc13..b9f19be1a88666e9666ec848ced3700dddd2e01f 100755 (executable)
@@ -288,6 +288,18 @@ class divListApplication extends MultiSelectWindow
       $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
       $this->AddElement(array($field0,$field1,$field2,$field3));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_apps = count($list);
+    $str = $num_apps." ";
+    $num_apps      != 1  ? $str.=_("Applications").", "    : $str .= _("Application").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index 206fca72cf6ab722bcb01b243d4913f3f7a04c72..d5281bfe13358c1407969479b4c66663d7f588c1 100755 (executable)
@@ -199,8 +199,14 @@ class divListDepartment extends MultiSelectWindow
 
       $this->AddElement( array($field01,$field0,$field1,$field2));
     }
-  }
 
+    /* Create summary string for list footer */
+    $num_deps=count($list);
+    $str = $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
+
+  }
   function Save()
   {
     MultiSelectWindow::Save();
index 0e875b081a5ab46ff63a9f0bed0e5583bd3594ba..d693716909f8e14afd77bcfa54be22e506fb66b7 100644 (file)
@@ -271,12 +271,19 @@ class divListFai extends MultiSelectWindow
       Attach objects
      ********************/
 
+    $cnts = array();
+    foreach($objects as $key => $data){
+      $cnts[$key] = 0;
+    }
+
      foreach($list as $key => $value){
        $info     = "";
        $img      = "";
        $type     = $value['type'];
        $abort    =false;
 
+       $cnts[$type] ++;
+
        if(isset($objects[$type])){
          $img   = "<img class='center' src='".$objects[$type]['IMG']."' title='".$objects[$type]['NAME']."' alt='".$objects[$type]['KZL']."'>";
          $info  = $objects[$type]['NAME'];
@@ -335,6 +342,45 @@ class divListFai extends MultiSelectWindow
        $field4 = array("string" => preg_replace("/%KEY%/",$key,$acti) , "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
        $this->AddElement(array($field0,$field1,$field2,$field3,$field4));
      }
+
+     /* Create summary string for list footer */
+     $num_deps=0;
+     if(!$this->SubSearch){
+       $num_deps = count($this->Added_Departments);
+     }
+
+     /* Profile */
+     $str = $cnts['FAIprofile']." ";
+     $cnts['FAIprofile']        != 1  ? $str.=_("Profiles").", "    : $str .= _("Profile").", ";
+
+     /* Scripts */
+     $str.= $cnts['FAIpartitionTable']." ";
+     $cnts['FAIpartitionTable'] != 1  ? $str.=_("Partitions").", "  : $str .= _("Partition").", ";
+
+     /* Scripts */
+     $str.= $cnts['FAIscript']." ";
+     $cnts['FAIscript']         != 1  ? $str.=_("Scripts").", "     : $str .= _("Script").", ";
+
+     /* Hooks */
+     $str.= $cnts['FAIhook']." ";
+     $cnts['FAIhook']           != 1  ? $str.=_("Hooks").", "       : $str .= _("Hook").", ";
+
+     /* Variables */
+     $str.= $cnts['FAIvariable']." ";
+     $cnts['FAIvariable']       != 1  ? $str.=_("Variables").", "   : $str .= _("Variable").", ";
+
+     /* Templates */
+     $str.= $cnts['FAItemplate']." ";
+     $cnts['FAItemplate']       != 1  ? $str.=_("Templates").", "   : $str .= _("Template").", ";
+
+     /* Packages */
+     $str.= $cnts['FAIpackageList']." ";
+     $cnts['FAIpackageList']    != 1  ? $str.=_("Package lists").", ": $str .= _("Package list").", ";
+
+     $str.= $num_deps." ";
+     $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+     $this->set_List_Bottom_Info($str);
+
   }
 
   function Save()
index 3ae13ce89829180647a3a07f767b302f3ede8243..79337f805eb40288c8917fb1bf78bb4b02d193ea 100644 (file)
@@ -315,6 +315,18 @@ class divListGroup extends MultiSelectWindow
 
       $this->AddElement(array($field0,$field1,$field2,$field3,$field4));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_groups = count($groups);
+    $str = $num_groups." ";
+    $num_groups      != 1  ? $str.=_("Groups").", "    : $str .= _("Group").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index 684959a74a171fac1af64044246f833d8d5ae788..58e319193315235c619071ead9d3658d2e42e7de 100755 (executable)
@@ -294,6 +294,18 @@ class divListMimeTypes extends MultiSelectWindow
       $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
       $this->AddElement(array($field0,$field1,$field2,$field3));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_objs = count($list);
+    $str = $num_objs." ";
+    $num_objs      != 1  ? $str.=_("Mimetypes").", "    : $str .= _("Mimetype").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index cc2900d62fe6a4922c7961f4c95ca19c4a614b02..8b460ef6cbdbe07ee1833043120c8c2938d24941 100755 (executable)
@@ -285,6 +285,18 @@ class divListOGroup extends MultiSelectWindow
 
       $this->AddElement(array($field0,$field1,$field2,$field3,$field4));
     }
+    
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_objs = count($list);
+    $str = $num_objs." ";
+    $num_objs      != 1  ? $str.=_("Object groups").", "    : $str .= _("Object group").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index aaa977dd14ec39767261998ed5f4a9e2c137a983..894b73aa138413fb18c548930ccb9fe3a4487f74 100644 (file)
@@ -288,6 +288,10 @@ class divListSystem extends MultiSelectWindow
           "component"   => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
 
 
+    $cnts = array("component" => 0 , "terminal" => 0 , "workstation" => 0 , 
+                  "printer" => 0 , "phone" => 0 , "server" => 0,
+                  "NewDevice" => 0, "winstation"=> 0);
+
     // Test Every Entry and generate divlist Array
     foreach($terminals as $key => $val){
 
@@ -402,6 +406,10 @@ class divListSystem extends MultiSelectWindow
         }
       }
 
+      $type = $this->parent->get_system_type($val['objectClass']);
+      $cnts[$type] ++;
+
+
       /* Create each field */
       $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
                       "attach" => "style='width:20px;'");
@@ -412,6 +420,52 @@ class divListSystem extends MultiSelectWindow
       $this->AddElement( array($field0,$field1,$field2,$field3));
     }
 
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+
+    $str ="";
+
+    /* Servers  */
+    $str.= $cnts['server']." ";
+    $cnts['server']            != 1  ? $str.=_("Servers").", "     : $str .= _("Server").", ";
+
+    /* Workstations */
+    $str.= $cnts['workstation']." ";
+    $cnts['workstation']       != 1  ? $str.=_("Workstations").", ": $str .= _("Workstation").", ";
+
+    /* Terminals */
+    $str.= $cnts['terminal']." ";
+    $cnts['terminal']          != 1  ? $str.=_("Terminals").", "   : $str .= _("Terminal").", ";
+
+    /* Phones */
+    $str.= $cnts['phone']." ";
+    $cnts['phone']             != 1  ? $str.=_("Phones").", "      : $str .= _("Phone").", ";
+
+    /* Printer */
+    $str.= $cnts['printer']." ";
+    $cnts['printer']           != 1  ? $str.=_("Printers").", "    : $str .= _("Printer").", ";
+
+    /* Components */
+    $str.= $cnts['component']." ";
+    $cnts['component']         != 1  ? $str.=_("Components").", "  : $str .= _("Component").", ";
+
+    /* New devices */
+    $str.= $cnts['NewDevice']." ";
+    $cnts['NewDevice']         != 1  ? $str.=_("New devices").", " : $str .= _("New device").", ";
+
+    /* Windows workstations  */
+    $str.= $cnts['winstation']." ";
+    $cnts['winstation']        != 1  ? $str.=_("Windows workstations").", "    : $str .= _("Windows workstation").", ";
+
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
+
+
+
   }
 
 
index 263fd4438a34f4f3a817a113d1ee73c3c0d6cce7..2c42f304c6778cfc84214f1f0a28a132bcc185da 100644 (file)
@@ -192,6 +192,9 @@ class divListUsers extends MultiSelectWindow
     /********************
       Variable init
      ********************/
+    
+    $num_users      = 0;
+    $num_templates  = 0;
 
     /* Variable initialation */
     $enviro     = $posix = $maila = $faxac = $samba = $netatalk = "";
@@ -314,9 +317,11 @@ class divListUsers extends MultiSelectWindow
       if(in_array("gosaUserTemplate",$val['objectClass'])){
         $tpl                          = preg_replace("/%KEY%/", "$key", $tplimg);
         $s_img_create_from_template   = preg_replace("/%KEY%/", "$key", $tplcreateuserimg);
+        $num_templates ++;
       }else{
         $s_img_create_from_template   = "";
         $tpl                          = $userimg;
+        $num_users ++;
       }
 
       /* Insert key into userimg */
@@ -361,7 +366,19 @@ class divListUsers extends MultiSelectWindow
         $users[strtolower( $val['sn']['0'].$val['uid']['0'])]=$add;
       }
     }
-    
+    /* Create summary string for list footer */ 
+    $num_deps=0;
+    if(!$this->SubSearch){ 
+      $num_deps = count($this->Added_Departments);
+    }
+    $str = $num_users." ";
+    $num_users      != 1  ? $str.=_("Users").", "     : $str .= _("User").", ";
+    $str.= $num_templates." ";
+    $num_templates  != 1  ? $str.=_("Templates").", " : $str .= _("Template").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department"); 
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index 8106f3594d5dae0a924a9dbf581d7eb5811bcdd5..fb27fd229104e369628e6d180db6a117efb8baf5 100755 (executable)
@@ -224,6 +224,18 @@ class divListBlocklist extends MultiSelectWindow
       $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
       $this->AddElement( array($field0,$field1,$field2,$field3));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_lists = count($list);
+    $str = $num_lists." ";
+    $num_lists      != 1  ? $str.=_("Blocklists").", "    : $str .= _("Blocklist").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index e249bed8587059fda40567affe34e905e7150702..3b7514f5c26cce67f198750be2e86f4a7c4c749b 100755 (executable)
@@ -280,6 +280,18 @@ class divListConference extends MultiSelectWindow
 
       $this->AddElement(array($field0,$a_field1,$a_field2,$a_field3,$a_field4,$a_field5));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_lists = count($list);
+    $str = $num_lists." ";
+    $num_lists      != 1  ? $str.=_("Conferences").", "    : $str .= _("Conference").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
   }
 
   function Save()
index fa064b65c3878445fa85bcacf4cfb76c49856b4f..1f17e531c23bc4dcd2838925e694a9aaa6a6edb7 100755 (executable)
@@ -253,6 +253,19 @@ class divListMacro extends MultiSelectWindow
 
       $this->AddElement(array($field0,$field1,$field2,$field3,$field4));
     }
+
+    /* Create summary string for list footer */
+    $num_deps=0;
+    if(!$this->SubSearch){
+      $num_deps = count($this->Added_Departments);
+    }
+    $num_lists = count($list);
+    $str = $num_lists." ";
+    $num_lists      != 1  ? $str.=_("Macros").", "    : $str .= _("Macro").", ";
+    $str.= $num_deps." ";
+    $num_deps       != 1  ? $str.=_("Departments")    : $str .= _("Department");
+    $this->set_List_Bottom_Info($str);
+
   }
 
   function Save()