13 echo
"<table id='{$id}' class='task_schedule'><thead><tr><th> </th>";
14 for($i = 0; $i < 7; ++$i)
16 $day = jddayofweek($i, 2);
18 echo
"<th class='schedule_day'>{$day}</th>";
23 for($hour = 0; $hour < 24; ++$hour)
25 $desc = str_pad($hour, 2,
'0', STR_PAD_LEFT).
":00";
28 echo
"<th class='schedule_period'>$desc</td>";
30 for($i = 0; $i < 7; ++$i)
32 $idx =
"{$i}:{$desc}";
33 $class = (strpos($value, $idx) !== FALSE) ?
"period selected" :
"period";
34 echo
"<td class='{$class}' data-period='$idx'></td>";
39 echo
"</tbody></table>";
44 $d =
new DateTime($datetime);
46 $day =
$d->format(
"N") - 1;
48 $hour =
$d->format(
"H");
50 $sp =
"{$day}:{$hour}:00";
52 trace(
"Schedule Period for $datetime is $sp", 3);
64 $this->annotateBefore =
true;
69 if ($this->parent->readOnlyForm || $this->parent->isReadOnly(
$field))
return;
70 $id =
"{$this->parent->id}_{$field}";
72 <script type=
"text/javascript" src=
"/components/scheduled_task/js/task_schedule_selector.js"></script>
73 <script type=
'text/javascript'>
74 window.addEvent(
'load',
function()
76 new TaskScheduleSelector(
'<?echo $id?>_table',
'<?echo $id?>');
84 $value = $this->parent->data->get(
$field);
86 echo
"<input type='hidden' id='{$this->parent->id}_{$field}' name='{$field}' value='{$value}'/>";
92 $this->_startField(
$field);
101 $this->_startField(
$field);
static usingFeature()
Uses the specified framework feature(s).
TaskScheduleFieldRenderer($parent)
drawScheduleBox($field, $readOnly=false)
static drawScheduleBox($id, $value, $readOnly=false)
static calculatePeriod($datetime=null)
if(!checkRole($library->allow_access) &&! $library->allowAccess()) if(!checkRole($document->allow_access)) $d