X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Faddons%2Fgotomasses%2Fclass_gotomasses.inc;h=4a58ca9c8db74179e8499b15c506f28239f3e579;hb=c90e32c493a5d7bd5496418b19a0f2b796dd8c06;hp=1accb6bf2476f585eba1feda71bb0d3097072280;hpb=b2a9367f30a90d3feadf71c82ca5fe2880575bfa;p=gosa.git diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc index 1accb6bf2..4a58ca9c8 100644 --- a/plugins/addons/gotomasses/class_gotomasses.inc +++ b/plugins/addons/gotomasses/class_gotomasses.inc @@ -18,19 +18,19 @@ class gotomasses extends plugin var $current =false; var $dialog = FALSE; var $ids_to_remove = array(); + var $divlist = NULL; - function gotomasses($config, $dn= NULL) + function gotomasses(&$config, $dn= NULL) { /* Include config object */ - $this->config= $config; + $this->config= &$config; /* Define source file */ $this->data_file = CONFIG_DIR."/gotomasses_machines"; - $file = search_config($this->config->data['MENU'], "gotomasses", "STORAGE_FILE"); + $file = $this->config->search("gotomasses", "STORAGE_FILE",array('menu')); if(!empty($file)){ $this->data_file = $file; } - $this->load_gotomasses_data(); } @@ -175,72 +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()); } @@ -325,7 +262,7 @@ class gotomasses extends plugin $row = preg_replace('/ */umi'," ",$row); $parts = split(" ",$row); - if(count($parts) != 8){ + if(count($parts) != 10){ print_red(_("Entry broken, skipped.")); }else{ @@ -337,11 +274,16 @@ class gotomasses extends plugin $entry['Weekday'] = $parts[4]; $entry['Action'] = $parts[5]; $entry['OGroup'] = $parts[6]; + $entry['Zone'] = $parts[7]; + $entry['Section'] = $parts[8]; if($entry['Action'] == "initial_install"){ - $tmp2 = split(";",$parts[7]); + $tmp2 = split(";",$parts[9]); foreach($tmp2 as $target){ $tmp = split(",",$target); - $entry['Initial_Target'][] = array("MAC" => $tmp[0],"IP"=>$tmp[1],"NAME" => $tmp[2]); + $entry['Initial_Target'][] = array( + "MAC" => $tmp[0], + "IP" => $tmp[1], + "NAME" => $tmp[2]); } $entry['Target'] = array(); }else{ @@ -372,6 +314,8 @@ class gotomasses extends plugin } $str .= str_pad($task['Action'] ,5," ")." "; $str .= str_pad($task['OGroup'] ,5," ")." "; + $str .= str_pad($task['Zone'] ,5," ")." "; + $str .= str_pad($task['Section'],5," ")." "; if($task['Action'] == "initial_install"){ foreach($task['Initial_Target'] as $target){ $str .= trim($target['MAC']).",".trim($target['IP']).",".trim($target['NAME']).";";