From: hickert Date: Tue, 7 Aug 2007 13:19:47 +0000 (+0000) Subject: Added listing summary to user management list X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d80fe85844cb230029245b4f7fa78d70e4aa7be9;p=gosa.git Added listing summary to user management list git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6988 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/ihtml/themes/default/MultiSelectWindow.tpl b/ihtml/themes/default/MultiSelectWindow.tpl index fe65e1713..f49d8c74b 100644 --- a/ihtml/themes/default/MultiSelectWindow.tpl +++ b/ihtml/themes/default/MultiSelectWindow.tpl @@ -98,6 +98,9 @@ {/if} +
+{$List_Bottom_Info} +
{if $Display_Save | $Display_Close}

 

diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 738dabc80..49a1ad89b 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -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: ?> diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index ae49cc080..12fb740ac 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -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()