From: hickert Date: Mon, 31 Aug 2009 12:56:17 +0000 (+0000) Subject: Added periodical jobs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=18042d784dffc3435d8ad5e9e17d95cf999201b8;p=gosa.git Added periodical jobs - But something seems strange right now - The backend sends different info from time to time. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14171 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc index bf9b968d7..192b67af7 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc @@ -69,6 +69,10 @@ class DaemonEvent protected $visible_for = HIDDEN_EVENT; + protected $periodType = "days"; + protected $periodValue = 7; + protected $activate_periodical_job = FALSE; + protected $attributes = array("timestamp"); function set_type($type) @@ -105,6 +109,15 @@ class DaemonEvent $this->timestamp = $this->_event_to_timestamp($data['TIMESTAMP']); } } + + if(isset($data['PERIODIC'])){ + $tmp = split("_",$data['PERIODIC']); + if(count($tmp)){ + $this->activate_periodical_job = TRUE; + $this->periodValue = $tmp[0]; + $this->periodType = $tmp[1]; + } + } } @@ -201,6 +214,19 @@ class DaemonEvent $seconds[$e] = $e; } + $periodTypes = array( + "minutes" => _("Minutes"), + "hours" => _("Hours"), + "days" => _("Days"), + "weeks" => _("Weeks"), + "months" => _("Months")); + + + $smarty->assign("periodTypes", $periodTypes); + $smarty->assign("periodType", $this->periodType); + $smarty->assign("periodValue", $this->periodValue); + $smarty->assign("activate_periodical_job", $this-> activate_periodical_job); + $smarty->assign("years", $years); $smarty->assign("months", $months); $smarty->assign("days", $days); @@ -289,6 +315,15 @@ class DaemonEvent $_POST['time_month'], $_POST['time_day'], $_POST['time_year']); + + if(isset($_POST['periodValue'])) $this->periodValue = get_post('periodValue'); + if(isset($_POST['periodType'])) $this->periodType = get_post('periodType'); + + if(isset($_POST['activate_periodical_job'])){ + $this->activate_periodical_job = TRUE; + }else{ + $this->activate_periodical_job = FALSE; + } } } @@ -456,6 +491,10 @@ class DaemonEvent }elseif(isset($ret['timestamp'])){ unset($ret['timestamp']); } + + if($this-> activate_periodical_job){ + $ret['periodic'][$this->periodType] = $this->periodValue; + } return($ret); } diff --git a/gosa-plugins/goto/addons/goto/events/timestamp_select.tpl b/gosa-plugins/goto/addons/goto/events/timestamp_select.tpl index 9253774c9..593488abf 100644 --- a/gosa-plugins/goto/addons/goto/events/timestamp_select.tpl +++ b/gosa-plugins/goto/addons/goto/events/timestamp_select.tpl @@ -42,4 +42,27 @@ +
+
+ + + + + + + + +
+

+ + {t}Periodical job{/t} +

+
{t}Repeat job every{/t} + + +