18 require_once SQ_CORE_PACKAGE_PATH.
'/system/cron/cron_job/cron_job_edit_fns.inc';
41 parent::__construct();
61 return $asset->setAttrValue(
'when', $when);
68 function paintScheduleInterface(&$asset, &$o, $prefix)
79 for($i=0;$i<60;$i++) {
81 $mins[
'0'.$i] =
'0'.$i;
89 for($i=0;$i<24;$i++) {
91 $hours[
'0'.$i] =
'0'.$i;
96 $when = $asset->attr(
'when');
98 $when_array = split(
'=', $when);
100 if(is_array($when_array) && count($when_array)==2) {
101 if($when_array[0]==
'HR') {
103 $hr_mins = $when_array[1];
106 $time = split(
':',$when_array[1]);
107 if(is_array($time) && count($time)==2) {
109 $dl_hours = $time[0];
114 if ($asset->writeAccess(
'attributes')) {
117 <table style=
"width:auto;border-spacing:0px;" border=
"0">
119 <td><span style=
"font-weight:bold;">Hourly</span></td>
120 <td><?php radio_button($prefix.
'_schedule',
'HR', $hr_check); ?></td>
121 <td><?php combo_box($prefix.
'_h_mins',$mins,
false, $hr_mins); ?> min of every hour</td>
124 <td><span style=
"font-weight:bold;">Daily</span></td>
125 <td><?php radio_button($prefix.
'_schedule',
'DL', $dl_check); ?></td>
126 <td><?php combo_box($prefix.
'_d_hours',$hours,
false, $dl_hours); ?>:<?php combo_box($prefix.
'_d_mins',$mins,
false, $dl_mins); ?> on every day</td>
135 <table style=
"width:auto;border-spacing:0px;" border=
"0">
137 <td>TRIM Records Will be Updated Hourly at </td>
138 <td><?php echo $hr_mins;?> min</td>
146 <table style=
"width:auto;border-spacing:0px;" border=
"0">
148 <td>TRIM Records Will be Updated Daily at </td>
149 <td><?php echo $dl_hours;?>:<?php echo $dl_mins;?></td>
159 function processScheduleInterface(&$asset, &$o, $prefix)
161 if(isset($_POST[$prefix.
'_schedule'])) {
162 $_schedule = $_POST[$prefix.
'_schedule'];
164 if(isset($_POST[$prefix.
'_h_mins'])) {
165 $_h_mins = $_POST[$prefix.
'_h_mins'];
167 if(isset($_POST[$prefix.
'_d_hours'])) {
168 $_d_hours = $_POST[$prefix.
'_d_hours'];
170 if(isset($_POST[$prefix.
'_d_mins'])) {
171 $_d_mins = $_POST[$prefix.
'_d_mins'];
174 if($_schedule==
'HR') {
175 $when = $_schedule.
'='.$_h_mins;
177 $when = $_schedule.
'='.$_d_hours.
':'.$_d_mins;
181 return $asset->setAttrValue(
'when', $when);