Code

Added listing summary to user management list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Aug 2007 13:19:47 +0000 (13:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Aug 2007 13:19:47 +0000 (13:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6988 594d385d-05f5-0310-b6e9-bd551577e9d8

ihtml/themes/default/MultiSelectWindow.tpl
include/class_MultiSelectWindow.inc
plugins/admin/users/class_divListUsers.inc

index fe65e171348f1f88c0d6a4d114ce567a632860fb..f49d8c74ba7b47a0c23dd459651ffe7aa378428e 100644 (file)
@@ -98,6 +98,9 @@
                {/if}
        </tr>
 </table>
+<div style='padding-left:5px;'>
+{$List_Bottom_Info}
+</div>
 {if $Display_Save | $Display_Close}
 <p class="seperator">&nbsp;
 </p>
index 738dabc80f3116cdf78f7f259fc76db7c7232f72..49a1ad89b6e4d0f7330091c2af3401d99bb86f01 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 
 
        function ClearElementsList()
@@ -376,6 +377,7 @@ class MultiSelectWindow{
                $smarty->assign("Summary"                       , $this->string_Summary);
                $smarty->assign("Title"                         , $this->string_Title);
                $smarty->assign("Information"           , $this->string_Information);
+               $smarty->assign("List_Bottom_Info", $this->get_List_Bottom_Info());
 
                /* Check for exeeded sizelimit */
                $smarty->assign("hint"                          , print_sizelimit_warning());
@@ -548,6 +550,7 @@ class MultiSelectWindow{
        function AddDepartments($base = false,$numtabs = 3)
        {
                $this->DepartmentsAdded = true;
+    $this->Added_Departments = array();
 
                /* check for a valid base */
                if(!$base){
@@ -617,8 +620,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 ae49cc080b56e5e88382e1c2430060d29f483c14..12fb740ac096e326d7daf050b4572a81fe48b758 100644 (file)
@@ -116,6 +116,9 @@ class divListUsers extends MultiSelectWindow
     /********************
       Variable init
      ********************/
+    
+    $num_users      = 0;
+    $num_templates  = 0;
 
     /* Variable initialation */
     $enviro     = $posix = $maila = $faxac = $samba = $netatalk = "";
@@ -161,7 +164,7 @@ class divListUsers extends MultiSelectWindow
     /********************
       Append entries to divlist 
      ********************/
+
     // Test Every Entry and generate divlist Array
     foreach($list as $key => $val){
 
@@ -221,9 +224,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 */
@@ -261,7 +266,8 @@ class divListUsers extends MultiSelectWindow
         $users[strtolower( $val['sn']['0'].$val['uid']['0'])]=$add;
       }
     }
-    
+        
+    $this->set_List_Bottom_Info(sprintf(_("%s User(s), %s Template(s), %s Department(s)"),$num_users,$num_templates,count($this->Added_Departments) * !$this->SubSearch));
   }
 
   function Save()