1 <& /Elements/Header, Title => 'Schedule' &>
4 %foreach my $file (@files) {
5 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/<%$file%>.js"></SCRIPT>
8 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/jquery.js"></SCRIPT>
10 <SCRIPT TYPE="text/javascript">
12 function boxon(what) {
14 for ( var c=0; c < <%$cells%>; c++) {
16 $this.css('background-color', '#ffffdd');
18 $this.css('border-top', '1px double black');
19 $this.css('border-left', '1px double black');
20 $this.css('border-right', '1px solid black');
21 } else if ( c == <%$cells-1%> ) {
22 $this.css('border-left', '1px double black');
23 $this.css('border-right', '1px solid black');
24 $this.css('border-bottom', '1px solid black');
26 $this.css('border-left', '1px double black');
27 $this.css('border-right', '1px solid black');
30 var rownum = $this.parent().prevAll('tr').length;
31 var colnum = $this.prevAll('td').length;
32 $this = $this.parent().parent().children('tr').eq(rownum+1).children('td').eq(colnum);
36 function boxoff(what) {
38 for ( var c=0; c < <%$cells%>; c++) {
40 //$this.css('background-color', '');
41 //$this.css('border', ''); //IE8 woes, removes cell borders
42 $this.removeAttr('style'); //slightly "flashy" on cell changes under IE8
43 //but at least it doesn't remove cell borders
45 var rownum = $this.parent().prevAll('tr').length;
46 var colnum = $this.prevAll('td').length;
47 $this = $this.parent().parent().children('tr').eq(rownum+1).children('td').eq(colnum);
53 <& /Search/Calendar.html,
55 Query => "( Status = 'new' OR Status = 'open' OR Status = 'stalled')
56 AND ( Type = 'reminder' OR 'Type' = 'ticket' )",
57 #XXX and we have the magic custom field
58 slots => scalar(@usernames),
59 Embed => 'Schedule.html',
61 Display => 'Schedule',
62 DisplayArgs => [ username => \@usernames,
63 LengthMin => $LengthMin,
64 #oops, more freeside abstraction-leaking
65 custnum => $ARGS{custnum},
66 pkgnum => $ARGS{pkgnum},
72 my $timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h
78 #if ( ! $initialized ) {
79 push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) );
80 push @files, map { "${_}contentmws" } qw( iframe ajax );
84 if ( ref($ARGS{username}) ) {
85 @usernames = @{ $ARGS{username} };
86 } elsif ( $ARGS{username} ) {
87 @usernames = ( $ARGS{username} );
89 #XXX shouldn't even get offered the link in the first place rather than perl
90 # barf, but this is better than erroring out later or empty @username
91 die "Can't schedule an appointment - no employees are configured as installers";
94 ( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin';
96 my $cells = int($LengthMin / $timestep);
97 $cells++ if $LengthMin % $timestep;