From: hickert Date: Fri, 25 Jan 2008 10:40:05 +0000 (+0000) Subject: We are now able to modify the timestamp. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec54171fdeb360a0dc3c5bf4e55d5e65af9bd18d;p=gosa.git We are now able to modify the timestamp. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8605 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/addons/gotomasses/class_goto_task.inc b/gosa-core/plugins/addons/gotomasses/class_goto_task.inc index 74663a13d..42b29815a 100644 --- a/gosa-core/plugins/addons/gotomasses/class_goto_task.inc +++ b/gosa-core/plugins/addons/gotomasses/class_goto_task.inc @@ -33,6 +33,59 @@ class goto_task extends plugin $smarty->assign($attr,""); } } + + $year = substr($this->data['TIMESTAMP'],0,4); + $month = substr($this->data['TIMESTAMP'],4,2); + $day = substr($this->data['TIMESTAMP'],6,2); + + $hour = substr($this->data['TIMESTAMP'],8,2); + $minute = substr($this->data['TIMESTAMP'],10,2); + $second = substr($this->data['TIMESTAMP'],12,2); + + $years = array(); + for($i = date("Y",time()); $i <= 2037 ;$i ++){ + $years[$i] = $i; + } + $months = array(); + for($i = 1; $i <= 12; $i ++){ + $e = str_pad($i,2,"0",STR_PAD_LEFT); + $months[$e] = $e; + } + $days = array(); + for($i = 1; $i <= cal_days_in_month(CAL_GREGORIAN,$month,$year); $i ++){ + $e = str_pad($i,2,"0",STR_PAD_LEFT); + $days[$e] = $e; + } + $hours = array(); + for($i = 0; $i < 24; $i ++){ + $e = str_pad($i,2,"0",STR_PAD_LEFT); + $hours[$e] = $e; + } + $minutes = array(); + for($i = 0; $i < 60; $i ++){ + $e = str_pad($i,2,"0",STR_PAD_LEFT); + $minutes[$e] = $e; + } + $seconds = array(); + for($i = 0; $i < 60; $i ++){ + $e = str_pad($i,2,"0",STR_PAD_LEFT); + $seconds[$e] = $e; + } + + $smarty->assign("years", $years); + $smarty->assign("months", $months); + $smarty->assign("days", $days); + $smarty->assign("hours", $hours); + $smarty->assign("minutes", $minutes); + $smarty->assign("seconds", $seconds); + + $smarty->assign("time_year",$year); + $smarty->assign("time_month",$month); + $smarty->assign("time_day",$day); + $smarty->assign("time_hour",$hour); + $smarty->assign("time_minute",$minute); + $smarty->assign("time_second",$second); + return ($smarty->fetch (get_template_path('goto_task.tpl', TRUE))); } @@ -51,12 +104,23 @@ class goto_task extends plugin $this->data[strtoupper($attr)] = $_POST[$attr]; } } + $date = ""; + foreach(array("time_year","time_month","time_day","time_hour","time_minute","time_second") as $attr){ + if(isset($_POST[$attr])){ + $date .= $_POST[$attr]; + }else{ + echo $attr; + } + } + if(strlen($date) == 14){ + $this->data['TIMESTAMP'] = $date; + } } function save() { $tmp = array(); - foreach(array("STATUS","MACADDRESS","HEADERTAG") as $attr){ + foreach(array("STATUS","MACADDRESS","HEADERTAG","TIMESTAMP") as $attr){ if(isset($this->data[$attr])){ $tmp[$attr] = $this->data[$attr]; } diff --git a/gosa-core/plugins/addons/gotomasses/goto_task.tpl b/gosa-core/plugins/addons/gotomasses/goto_task.tpl index 317e185c8..61220bd45 100644 --- a/gosa-core/plugins/addons/gotomasses/goto_task.tpl +++ b/gosa-core/plugins/addons/gotomasses/goto_task.tpl @@ -1,53 +1,95 @@ - +
-

{t}Generic{/t}

+

{t}Job details{/t}

+ + + - - - - - - - -
{t}Job ID{/t}{$ID}
- {t}Job ID{/t} + {t}Header Tag{/t} + + + - {$ID} -
- {t}Status{/t} +   - -
- {t}Mac{/t} - - -
- {t}Header Tag{/t} + + {t}Schedule Execution{/t} - + + + + + + + + + + + + + + + + + +
{t}Jahr{/t}{t}Monat{/t}{t}Tag{/t}{t}Stunde{/t}{t}Minute{/t}{t}Sekunde{/t}
+   + +   + +   + +   + +   + + +
+ +{if $HEADERTAG == "ping"} + + +{elseif $HEADERTAG == "sayHello"} + + +{else} + +{/if} +
{t}Status{/t}
{t}Mac{/t}
{t}Status{/t}
{t}Mac{/t}
{t}Job type not implented{/t}
+
- -