From: hickert Date: Wed, 8 Aug 2007 08:31:54 +0000 (+0000) Subject: Added list footer for all management lists X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c7176eae519797d671a29a48cb7a13a9b5d8c09;p=gosa.git Added list footer for all management lists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6996 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/themes/default/style.css b/html/themes/default/style.css index cf91f5601..7bc2eef14 100644 --- a/html/themes/default/style.css +++ b/html/themes/default/style.css @@ -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; diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index db82577f3..66dad408d 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 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: ?> diff --git a/include/class_divlist.inc b/include/class_divlist.inc index 2c28bc7cf..17176b217 100644 --- a/include/class_divlist.inc +++ b/include/class_divlist.inc @@ -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.= ""; 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"; + } else { + $s_return.= "\n"; + } + + $s_return.= "\n"; + + } + return($s_return); + } function _generateHeader(){ $s_return = ""; diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index ab467d57b..b9f19be1a 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -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() diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index 206fca72c..d5281bfe1 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -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(); diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 0e875b081..d69371690 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -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 = "".$objects[$type]["; $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() diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 3ae13ce89..79337f805 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -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() diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index 684959a74..58e319193 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -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() diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index cc2900d62..8b460ef6c 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -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() diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index aaa977dd1..894b73aa1 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -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" => "" , "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); + + + } diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 263fd4438..2c42f304c 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -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() diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index 8106f3594..fb27fd229 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -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() diff --git a/plugins/gofon/conference/class_divListConferences.inc b/plugins/gofon/conference/class_divListConferences.inc index e249bed85..3b7514f5c 100755 --- a/plugins/gofon/conference/class_divListConferences.inc +++ b/plugins/gofon/conference/class_divListConferences.inc @@ -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() diff --git a/plugins/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index fa064b65c..1f17e531c 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -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()
"; + } + } + $s_return .= ""; + // 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"; + $s_return.= "\n
".$this->list_footer."