summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cfdc067)
raw | patch | inline | side by side (parent: cfdc067)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 17 Aug 2007 13:38:27 +0000 (13:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 17 Aug 2007 13:38:27 +0000 (13:38 +0000) |
Not finished yet
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7068 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7068 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc
index e5d464f4d8f8f0d409e532726e95b73bb400c715..87af0b6e2ba4ed118c6227ff908c2ca2170d5d68 100644 (file)
var $Taret = array();
var $Actions = array();
-
- var $attributes = array("Minute","Hour","Day","Month","Weekday","Action","Comment","Target");
+ var $OGroup = "";
+ var $OGroups = array();
+ var $attributes = array("OGroup","Minute","Hour","Day","Month","Weekday","Action","Comment","Target");
function goto_task($config,$parent,$data = array())
}
}
+ /* Create ogroup select list */
+ $this->OGroups = array("keep_current" => "["._("Keep current")."]",
+ "unset_membership" => "["._("Quit group membership")."]");
+ $this->OGroups = array_merge($this->OGroups,$this->parent->get_object_groups());
+
/* Prepare list of available actions */
$this->Actions = $this->parent->get_actions();
}
$smarty->assign("Months" , $tmp['Month']);
$smarty->assign("Weekdays", $tmp['Weekday']);
+ $smarty->assign("OGroups" , $this->OGroups);
$smarty->assign("Expert" , $this->Expert);
$smarty->assign("Actions" , $this->Actions);
}
}
+ function save()
+ {
+ $tmp = array();
+ foreach($this->attributes as $attr){
+ $tmp[$attr] = $this->$attr;
+ }
+ return($tmp);
+ }
+
/* Return values for listboxes.
*/
diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc
index c81ec3bd032f08341892e4ccc2f47b5ad8e4819f..216e9966531a9612f7fb37643c8959b116ec2bf3 100644 (file)
/* Queue tasks */
var $tasks = array();
-
+ var $current =false;
var $dialog = NULL;
function gotomasses($config, $dn= NULL)
/* Include config object */
$this->config= $config;
+
+ $this->load_csv_data();
}
function execute()
{
- /* Check posts */
+ /************
+ * Handle posts
+ ************/
+
$s_entry = $s_action = "";
$arr = array("/^edit_/"=>"edit","/^remove_/"=>"remove");
foreach($arr as $regex => $action){
}
}
+ /************
+ * List posts
+ ************/
+
/* Remove entry from list */
if($s_action == "remove" && isset($this->tasks[$s_entry])){
unset($this->tasks[$s_entry]);
if($s_action == "edit" && isset($this->tasks[$s_entry])){
$entry = $this->tasks[$s_entry];
$this->dialog = new goto_task($this->config,$this,$entry);
+ $this->current = $s_entry;
}
/* Close dialog */
/* Close dialog */
if(isset($_POST['save_goto_task'])){
$this->dialog->save_object();
- $this->dialog = NULL;
+ $msgs = $this->dialog->check();
+ if(count($msgs)){
+ foreach($msgs as $msg){
+ print_red($msg);
+ }
+ }else{
+ $this->tasks[$this->current] = $this->dialog->save();
+ $this->dialog = NULL;
+ }
}
/* Display dialogs if currently opened */
}
- $this->load_csv_data();
+ /************
+ * Handle Divlist
+ ************/
+
$smarty = get_smarty();
$plug = $_GET['plug'];
$divlist = new divlist("gotomasses");
$row = preg_replace('/ */umi'," ",$row);
$parts = split(" ",$row);
- if(count($parts) != 7){
+ if(count($parts) != 8){
print_red(_("Entry broken, skipped."));
}else{
$entry['Month'] = $parts[3];
$entry['Weekday'] = $parts[4];
$entry['Action'] = $parts[5];
- $entry['Target'] = split(",",$parts[6]);
+ $entry['OGroup'] = $parts[6];
+ $entry['Target'] = split(",",$parts[7]);
$entry['Comment'] = $comment;
$this->tasks [] = $entry;
}
diff --git a/plugins/addons/gotomasses/class_target_list.inc b/plugins/addons/gotomasses/class_target_list.inc
index bb91452dd27445ed37f46df15324d5a6b9f96c2a..4c1e79e726bdfb267b40ee999914b67230a32d96 100644 (file)
var $SubSearch ;
var $parent ;
var $ui ;
-
-
-
+
+
function target_list($config,$Targets_used)
{
MultiSelectWindow::MultiSelectWindow($config, "Targetselection", array("ogroup","gotomasses"));
+
+ $this->Targets_used = $Targets_used;
$this->SetInformation( _("Select the target objects for your scheduled action."));
$this->SetTitle( _("Available targets"));
// Assigning ogroups
foreach($list as $key => $val){
+ if(in_array($val['cn'][0],$this->Targets_used) ||
+ isset($val['macAddress'][0]) && in_array($val['macAddress'][0],$this->Targets_used)) continue;
+
$title = "title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'";
if(!isset($val['description'][0])){
$desc = "";
$Regex = $this->Regex;
$chk = array(
- "ogroups" => "(objectClass=gosaGroupOfNames)" ,
+ "ogroups" => "(&(objectClass=gosaGroupOfNames)(|(gosaGroupObjects=*S*)(gosaGroupObjects=*W*)))" ,
"servers" => "(objectClass=goServer)" ,
"workstations" => "(objectClass=gotoWorkstation)");
index 6988b0ab3da65f103a74b5c8c6769f9fb521cb18..c673e2210106505bd1fa399673672b3c92b21000 100644 (file)
</td>
</tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <td>
+ {t}Object group membership{/t}
+ </td>
+ <td>
+ {render acl=$OGroupACL}
+ <select name="OGroup">
+ {html_options options=$OGroups selected=$OGroup}
+ </select>
+ {/render}
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
<tr>
<td colspan="2">
<h2>{t}Target systems{/t}</h2>