diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc
index 8b32876efd6969dfddb06ef190e8289d8179bb5e..67d4d3946795321d489cec40fb758f2f035277fe 100644 (file)
var $dialog = FALSE;
var $ids_to_remove = array();
- function gotomasses($config, $dn= NULL)
+
+ function gotomasses(&$config, $dn= NULL)
{
+ /* Include config object */
+ $this->config= &$config;
+
/* Define source file */
$this->data_file = CONFIG_DIR."/gotomasses_machines";
+ $file = search_config($this->config->data['MENU'], "gotomasses", "STORAGE_FILE");
+ if(!empty($file)){
+ $this->data_file = $file;
+ }
- /* Include config object */
- $this->config= $config;
$this->load_gotomasses_data();
}
}else{
$this->ids_to_remove = $this->list_get_selected_items();
$tmp = "";
- foreach($this->ids_to_remove as $id){
- $task = $this->tasks[$id];
- $tmp.= "\n".$this->target_to_string($task);
+ foreach($this->ids_to_remove as $key => $id){
+ if(isset($this->tasks[$id])){
+ $task = $this->tasks[$id];
+ $tmp.= "\n".$this->target_to_string($task);
+ }else{
+ unset($this->ids_to_remove[$key]);
+ }
}
$smarty->assign("multiple", TRUE);
$smarty->assign("info",sprintf(_("Your are about to delete the following tasks: %s"),"<pre>".$tmp."</pre>"));
$row = preg_replace('/ */umi'," ",$row);
$parts = split(" ",$row);
- if(count($parts) != 8){
+ if(count($parts) != 10){
print_red(_("Entry broken, skipped."));
}else{
$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{
}
$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 .= $target['MAC'].",".$target['IP'].",".$target['NAME'].";";
+ $str .= trim($target['MAC']).",".trim($target['IP']).",".trim($target['NAME']).";";
}
}else{
foreach($task['Target'] as $target){