2 'name_singular' => 'Installer schedule', #$sched_item_class->classname. ' schedule',
3 'table' => 'sched_item',
4 'viewall_dir' => 'browse',
5 'no_pkey_display' => 1,
6 'labels' => { 'name' => 'Name',
7 map { ( "sched_avail$_" => $dow[$_] ) } (0..6),
13 ( map dow_factory($_), (0..6) ),
15 'edit_callback' => $edit_callback,
19 #XXX more specific AccessRight for scheduling
21 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
23 my @dow = qw( Sunday Monday Tuesday Wednesday Thursday Friday Saturday );
28 { 'field' => 'sched_avail'. $wday,
29 'type' => 'select-avail-time-from_to',
30 'prefix' => 'sched_avail'. $wday. '_',
35 my $edit_callback = sub {
36 my( $cgi, $sched_item, $fields_listref, $opt_hashref ) = @_;
37 foreach my $sched_avail ( $sched_item->sched_avail ) {
38 if ( $sched_avail->override_date ) {
41 my $param = 'sched_avail'. $sched_avail->wday;
42 $cgi->param($param, 'Y');
43 $cgi->param($param.'_stime', $sched_avail->stime);
44 $cgi->param($param.'_etime', $sched_avail->etime);