CMS  Version 3.9
TaskScheduleHelper Class Reference

Static Public Member Functions

static drawScheduleBox ($id, $value, $readOnly=false)
 
static calculatePeriod ($datetime=null)
 

Detailed Description

Definition at line 9 of file task_schedule_field_renderer.inc.

Member Function Documentation

◆ calculatePeriod()

static TaskScheduleHelper::calculatePeriod (   $datetime = null)
static

Definition at line 42 of file task_schedule_field_renderer.inc.

43  {
44  $d = new DateTime($datetime);
45 
46  $day = $d->format("N") - 1;
47 
48  $hour = $d->format("H");
49 
50  $sp = "{$day}:{$hour}:00";
51 
52  trace("Schedule Period for $datetime is $sp", 3);
53 
54  return $sp;
55  }
if(!checkRole($library->allow_access) &&! $library->allowAccess()) if(!checkRole($document->allow_access)) $d
Definition: download.inc:66
$day
Definition: event_list.inc:49

◆ drawScheduleBox()

static TaskScheduleHelper::drawScheduleBox (   $id,
  $value,
  $readOnly = false 
)
static

Definition at line 11 of file task_schedule_field_renderer.inc.

12  {
13  echo "<table id='{$id}' class='task_schedule'><thead><tr><th>&nbsp;</th>";
14  for($i = 0; $i < 7; ++$i)
15  {
16  $day = jddayofweek($i, 2);
17 
18  echo "<th class='schedule_day'>{$day}</th>";
19  }
20  echo "</tr></thead>";
21  echo "<tbody>";
22 
23  for($hour = 0; $hour < 24; ++$hour)
24  {
25  $desc = str_pad($hour, 2, '0', STR_PAD_LEFT).":00";
26 
27  echo "<tr>";
28  echo "<th class='schedule_period'>$desc</td>";
29 
30  for($i = 0; $i < 7; ++$i)
31  {
32  $idx = "{$i}:{$desc}";
33  $class = (strpos($value, $idx) !== FALSE) ? "period selected" : "period";
34  echo "<td class='{$class}' data-period='$idx'></td>";
35  }
36  echo "</tr>";
37  }
38 
39  echo "</tbody></table>";
40  }
$desc
Definition: event_edit.inc:62

The documentation for this class was generated from the following file: