1 <& elements/browse.html,
2 'title' => 'Installer schedules', #$sched_item_class->classname. ' schedules',
3 'name_singular' => 'installer', #$sched_item_class->classname
4 'query' => { 'table' => 'sched_item' },
5 'count_query' => 'SELECT COUNT(*) FROM sched_item',
6 'header' => [ 'Installer', #$sched_item_class->classname
11 ( map dow_factory($_), (0..6) ),
14 'links' => [ $link, ],
16 'disabled_statuspos' => 1,
20 #XXX more specific AccessRight for scheduling
22 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
24 my $link = [ $p.'edit/sched_item.html?', 'itemnum' ];
26 my @dow = qw( Sunday Monday Tuesday Wednesday Thursday Friday Saturday );
32 my $sched_item = shift;
34 my @sched_avail = qsearch({
35 'table' => 'sched_avail',
37 'itemnum' => $sched_item->itemnum,
38 'wday' => $wday, #thanks, closure
39 'override_date' => '',
41 'order_by' => 'ORDER BY stime',
44 return 'Not available' unless @sched_avail;
47 # align bgcolor colspan rowspan style valign width
48 # link onclick size data_style
52 [ { data=> $_->stime_pretty },
54 { data=> $_->etime_pretty },
64 my $override_sub = sub {
65 my $sched_item = shift;
67 my @sched_avail = qsearch({
68 'table' => 'sched_avail',
70 'itemnum' => $sched_item->itemnum,
71 'override_date' => { op=>'!=', value=>'' },
73 'order_by' => 'ORDER BY override_date, stime',
76 return 'None' unless @sched_avail;
78 #XXX print each override date (and day of week)