From c90e32c493a5d7bd5496418b19a0f2b796dd8c06 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 23 Oct 2007 07:49:57 +0000 Subject: [PATCH] Added seperate list handler for gotomasses. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7624 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_location.inc | 7 +- .../addons/gotomasses/class_divListMasses.inc | 107 ++++++++++++++++++ .../addons/gotomasses/class_gotomasses.inc | 73 +----------- 3 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 plugins/addons/gotomasses/class_divListMasses.inc diff --git a/include/class_location.inc b/include/class_location.inc index 8df2262fc..9540071ea 100644 --- a/include/class_location.inc +++ b/include/class_location.inc @@ -36,6 +36,7 @@ $class_mapping= array( "gotomasses" => "plugins/addons/gotomasses/class_gotomasses.inc", "goto_task" => "plugins/addons/gotomasses/class_goto_task.inc", "target_list" => "plugins/addons/gotomasses/class_target_list.inc", + "divListMasses" => "plugins/addons/gotomasses/class_divListMasses.inc", "parseMailQueue" => "plugins/addons/mailqueue/class_parseMailQueue.inc", "mailqueue" => "plugins/addons/mailqueue/class_mailqueue.inc", "msgplug" => "plugins/addons/notifications/class_msgplug.inc", @@ -154,8 +155,8 @@ $class_mapping= array( "goTerminalServer" => "plugins/admin/systems/class_goTerminalServer.inc", "servkolab" => "plugins/admin/systems/class_servKolab.inc", "phonetabs" => "plugins/admin/systems/tabs_phone.inc", - "componentGeneric" => "plugins/admin/systems/class_componentGeneric.inc", "dhcpSubnet" => "plugins/admin/systems/class_dhcpSubnet.inc", + "componentGeneric" => "plugins/admin/systems/class_componentGeneric.inc", "glpiAccount" => "plugins/admin/systems/class_glpiAccount.inc", "dhcpPool" => "plugins/admin/systems/class_dhcpPool.inc", "servrepository" => "plugins/admin/systems/class_servRepository.inc", @@ -164,6 +165,7 @@ $class_mapping= array( "goSyslogServer" => "plugins/admin/systems/class_goSyslogServer.inc", "goFonServer" => "plugins/admin/systems/class_goFonServer.inc", "termtabs" => "plugins/admin/systems/tabs_terminal.inc", + "ArpNewDeviceTabs" => "plugins/admin/systems/tabs_arpnewdevice.inc", "goLogDBServer" => "plugins/admin/systems/class_goLogDBServer.inc", "selectUserToPrinterDialog" => "plugins/admin/systems/class_selectUserToPrinterDialog.inc", "glpiDeviceManagement" => "plugins/admin/systems/class_glpiDeviceManagement.inc", @@ -173,11 +175,10 @@ $class_mapping= array( "glpiAttachmentPool" => "plugins/admin/systems/class_glpiAttachmentPool.inc", "goImapServer" => "plugins/admin/systems/class_goImapServer.inc", "phoneGeneric" => "plugins/admin/systems/class_phoneGeneric.inc", + "ArpNewDevice" => "plugins/admin/systems/class_ArpNewDevice.inc", "gospamserver" => "plugins/admin/systems/class_goSpamServer.inc", "printerPPDSelectionDialog" => "plugins/admin/systems/class_printerPPDSelectionDialog.inc", "goShareServer" => "plugins/admin/systems/class_goShareServer.inc", - "ArpNewDeviceTabs" => "plugins/admin/systems/tabs_arpnewdevice.inc", - "ArpNewDevice" => "plugins/admin/systems/class_ArpNewDevice.inc", "mimetype" => "plugins/admin/mimetypes/class_mimetypeGeneric.inc", "mimetypeManagement" => "plugins/admin/mimetypes/class_mimetypeManagement.inc", "divListMimeTypes" => "plugins/admin/mimetypes/class_divListMimeTypes.inc", diff --git a/plugins/addons/gotomasses/class_divListMasses.inc b/plugins/addons/gotomasses/class_divListMasses.inc new file mode 100644 index 000000000..f6e942234 --- /dev/null +++ b/plugins/addons/gotomasses/class_divListMasses.inc @@ -0,0 +1,107 @@ +parent = $parent; + $this->ui = get_userinfo(); + $this->SetSummary(_("List of system deployment tasks")); + $this->SetHeadpageMode(); + $this->EnableCloseButton(FALSE); + $this->EnableSaveButton(FALSE); + $this->SetInformation(_("This menu allows you to add, remove and change the properties of system deployment tasks.")); + $this->GenHeader(); + } + + function GenHeader() + { + + /* Display add button if allowed */ + $header = "
"; + if($this->parent->acl_is_createable()){ + $header .= " "; + } + + /* Display add button if allowed */ + if($this->parent->acl_is_removeable()){ + $header .= " "; + } + $header .= "
"; + + /* Create divlist */ + $this->SetListHeader($header); + + $plug = $_GET['plug']; + + /* Toggle all selected / deselected */ + $chk = ""; + + /* set Page header */ + $this->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); + + $this->AddHeader(array("string"=>""._("Target")."")); + $this->AddHeader(array("string"=>""._("Schedule")."", + "attach"=>"style='width:100px;'")); + $this->AddHeader(array("string"=>""._("Type")."", + "attach"=>"style='width:80px;'")); + $this->AddHeader(array("string"=>_("Action"), + "attach"=>"style='border-right:0px;width:40px;'")); + } + + function execute() + { + $this->ClearElementsList(); + $this->GenHeader(); + } + + + function setEntries($tasks) + { + /* Create edit link */ + $plug = $_GET['plug']; + $edit_link = "
%str%
"; + + foreach($tasks as $key => $task){ + $action = ""; + if($this->parent->acl_is_removeable()){ + $action.= ""; + } + /* Create each field */ + $field0 = array("string" => "" , + "attach" => "style='width:20px;'"); + + $field1 = array("string" => preg_replace(array("/%key%/","/%str%/"),array($key,$this->parent->target_to_string($task)),$edit_link)); + $field2 = array("string" => $this->parent->time_to_string($task),"attach" => "style='width:100px;'"); + $field3 = array("string" => $this->parent->action_to_string($task),"attach" => "style='width:80px;'"); + $field4 = array("string" => $action,"attach" => "style='text-align:right;width:40px;border-right:0px;'"); + $this->AddElement(array($field0,$field1,$field2,$field3,$field4)); + } + } + + + function Save() + { + MultiSelectWindow :: Save(); + } + + + function save_object() + { + /* Save automatic created POSTs like regex, checkboxes */ + MultiSelectWindow :: save_object(); + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc index 72e6bab04..4a58ca9c8 100644 --- a/plugins/addons/gotomasses/class_gotomasses.inc +++ b/plugins/addons/gotomasses/class_gotomasses.inc @@ -18,7 +18,7 @@ class gotomasses extends plugin var $current =false; var $dialog = FALSE; var $ids_to_remove = array(); - + var $divlist = NULL; function gotomasses(&$config, $dn= NULL) { @@ -31,7 +31,6 @@ class gotomasses extends plugin if(!empty($file)){ $this->data_file = $file; } - $this->load_gotomasses_data(); } @@ -176,73 +175,9 @@ class gotomasses extends plugin * Handle Divlist ************/ - $plug = $_GET['plug']; - $divlist = new MultiSelectWindow($this->config,"GotoMasses","gotomassses"); - $divlist->SetSummary(_("List of system deployment tasks")); - $divlist->SetHeadpageMode(); - $divlist->EnableCloseButton(FALSE); - $divlist->EnableSaveButton(FALSE); - $divlist->SetInformation(_("This menu allows you to add, remove and change the properties of system deployment tasks.")); - - /* Display add button if allowed */ - $header = "
"; - if($this->acl_is_createable()){ - $header .= " "; - } - - /* Display add button if allowed */ - if($this->acl_is_removeable()){ - $header .= " "; - } - $header .= "
"; - - /* Get Permissions */ - $ui = get_userinfo(); - $acls = $this->getacl(""); - foreach($ui->get_module_departments("gotomasses") as $dep){ - $acls .= $ui->get_category_permissions($dep,"gotomasses"); - } - - /* Create divlist */ - $divlist->SetListHeader($header); - - /* Toggle all selected / deselected */ - $chk = ""; - - /* set Page header */ - $divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); - - $divlist->AddHeader(array("string"=>"
"._("Target")."")); - $divlist->AddHeader(array("string"=>""._("Schedule")."", - "attach"=>"style='width:100px;'")); - $divlist->AddHeader(array("string"=>""._("Type")."", - "attach"=>"style='width:80px;'")); - $divlist->AddHeader(array("string"=>_("Action"), - "attach"=>"style='border-right:0px;width:40px;'")); - - /* Create edit link */ - $edit_link = "
%str%
"; - - if(!empty($acls)){ - foreach($this->tasks as $key => $task){ - $action = ""; - if($this->acl_is_removeable()){ - $action.= ""; - } - /* Create each field */ - $field0 = array("string" => "" , - "attach" => "style='width:20px;'"); - - $field1 = array("string" => preg_replace(array("/%key%/","/%str%/"),array($key,$this->target_to_string($task)),$edit_link)); - $field2 = array("string" => $this->time_to_string($task),"attach" => "style='width:100px;'"); - $field3 = array("string" => $this->action_to_string($task),"attach" => "style='width:80px;'"); - $field4 = array("string" => $action,"attach" => "style='text-align:right;width:40px;border-right:0px;'"); - $divlist->AddElement(array($field0,$field1,$field2,$field3,$field4)); - } - } - - return($divlist->Draw()); + $list = new divListMasses($this->config,$this); + $list->SetEntries($this->tasks); + return($list->Draw()); } -- 2.30.2