From: hickert Date: Wed, 8 Aug 2007 08:09:27 +0000 (+0000) Subject: Added object summary to all management plugins. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=47b48499baeae705eceb43ffce0a5f42e382fa5e;p=gosa.git Added object summary to all management plugins. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6995 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index 76961f236..b74df1b26 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -184,6 +184,18 @@ class divListApplication extends MultiSelectWindow $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions), "attach" => "style='width:80px;border-right:0px;text-align:right;'"); $this->AddElement(array($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 077e14df4..ea209b428 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -122,8 +122,14 @@ class divListDepartment extends MultiSelectWindow $this->AddElement( array($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 fb87be853..78c3cf05c 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -186,12 +186,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']; @@ -245,6 +252,45 @@ class divListFai extends MultiSelectWindow $field4 = array("string" => preg_replace("/%KEY%/",$key,$acti) , "attach" => "style='width:80px;border-right:0px;text-align:right;'"); $this->AddElement(array($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 4bc375b43..a9a269480 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -201,6 +201,18 @@ class divListGroup extends MultiSelectWindow $this->AddElement(array($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 8686f4201..949343ef5 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -188,6 +188,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($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 da2021de3..d19804b91 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -171,6 +171,18 @@ class divListOGroup extends MultiSelectWindow $this->AddElement(array($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 7e46fa959..33be96ad1 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -134,6 +134,10 @@ class divListSystem extends MultiSelectWindow // User and Template Images $editlink = "%s"; + $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){ @@ -145,6 +149,8 @@ class divListSystem extends MultiSelectWindow $action.= ""; } + $type = $this->parent->get_system_type($val['objectClass']); + $cnts[$type] ++; /* Generate picture list, which is currently disabled */ if(in_array("goCupsServer" ,$val['objectClass'])) $cups = $img1; else $cups =$empty; @@ -195,12 +201,58 @@ class divListSystem extends MultiSelectWindow } $img = $this->parent->convert_list($val); + $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"); $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:70px;border-right:0px;text-align:right;'"); $this->AddElement( array($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); + } function Save() diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 245db51ed..0a250af9b 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -268,32 +268,16 @@ class divListUsers extends MultiSelectWindow } /* Create summary string for list footer */ - $str = $num_users." "; - if($num_users != 1){ - $str .= _("Users").", "; - }else{ - $str .= _("User").", "; - } - - $str.= $num_templates." "; - if($num_templates != 1){ - $str .= _("Templates").", "; - }else{ - $str .= _("Template").", "; - } - $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." "; - if($num_deps != 1){ - $str .= _("Departments"); - }else{ - $str .= _("Department"); - } - + $num_deps != 1 ? $str.=_("Departments") : $str .= _("Department"); $this->set_List_Bottom_Info($str); } diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index 870e3ceb1..431f2fbe8 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -108,6 +108,18 @@ class divListBlocklist extends MultiSelectWindow $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action), "attach" => "style='width:60px;border-right:0px;text-align:right;'"); $this->AddElement( array($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 c5804e62e..f7fa107ee 100755 --- a/plugins/gofon/conference/class_divListConferences.inc +++ b/plugins/gofon/conference/class_divListConferences.inc @@ -156,8 +156,17 @@ class divListConference extends MultiSelectWindow $this->AddElement(array($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 19c29af47..c2d50f6c4 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -127,6 +127,19 @@ class divListMacro extends MultiSelectWindow $this->AddElement(array($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()