diff --git a/trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/trunk/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
index adcea31410e9fd9ffd0ed381fe3d03c502e74547..f47a552d45d985a34386f2635b2a3d7bf4b1f1be 100644 (file)
protected $s_Schedule_Action = ""; // The deamon command name when newly created. (e.g. job_trigger_action_halt)
protected $s_Trigger_Action= ""; // The deamon command name when edited. (e.g. trigger_action_halt)
protected $s_Queued_Action= ""; // The deamon command name when edited. (e.g. trigger_action_halt)
- protected $timestamp = 0; // Event execution time;
+ public $timestamp = 0; // Event execution time;
+ public $time_offset = 0; // An offset when an event should start (normally not used)
+ public $concurrent_operations = 1; // Number of concurrent operations when a timestamp offset is used
protected $id = -1; // The Table ID
protected $status = "unknown";// The current event status
protected $is_new = TRUE; // Is TRUE if this is a new event
protected $visible_for = HIDDEN_EVENT;
protected $attributes = array("timestamp");
+
+ protected $time_offset_used = FALSE;
+
+ /* Indicate that multiple events have to be created from this event */
+ public $multiple_events = FALSE;
+
function set_type($type)
{
}
+ public function get_time_offset_select()
+ {
+ $this->time_offset_used = TRUE;
+ $smarty = get_smarty();
+ $smarty->assign('time_offset', $this->time_offset);
+ $smarty->assign('concurrent_operations', $this->concurrent_operations);
+ return($smarty->fetch(get_template_path('time_offset.tpl', TRUE, dirname(__FILE__))));
+ }
+
/*! \brief Returns HTML representation of a timestamp using <select> boxes.
@return Returns HTML content.
*/
public function get_time_select()
{
+ timezone::get_default_timezone();
$this->time_select_used = TRUE;
$smarty = get_smarty();
}
}
+ if (isset($_POST['concurrent_operations'])) {
+ $this->concurrent_operations = $_POST['concurrent_operations'];
+ }
+ if (isset($_POST['time_offset'])) {
+ $this->time_offset = $_POST['time_offset'];
+ }
+
+ if ($this->time_offset_used){
+ /* Check that multiple events makes sense at all (e.g. there are more targets
+ * then allowed concurrent operations */
+ if (count($this->a_targets) > $this->concurrent_operations) {
+ if ($this->time_offset > 0) {
+ $this->multiple_events = TRUE;
+ }
+ }
+ }
+
if($this->time_select_used){
$time_stamp_values_found = TRUE;
foreach(array("time_year","time_month","time_day","time_hour","time_minute","time_second") as $attr){
$time_stamp_values_found &= isset($_POST[$attr]);
}
if($time_stamp_values_found){
+ /* Make sure the following conversion happens with the right timezone */
+ timezone::get_default_timezone();
+
$this->timestamp = mktime(
$_POST['time_hour'],
$_POST['time_minute'],
$_POST['time_day'],
$_POST['time_year']);
}
+
}
if($this->target_list_used){
# Check if timestamp is in gosa-si-time-format
if(!tests::is_gosa_si_time($ret['timestamp'])){
$ret['timestamp'] = $this->_timestamp_to_event($this->timestamp);
- }
+ }
+
return($ret);
}