4bc5134cbff6c832b5b9c6e9234ea03ae7ea01d6
[freeside.git] / rt / share / html / Search / Schedule.html
1 <& /Elements/Header, Title => 'Schedule' &>
2
3 %#init_overlib.html
4 %foreach my $file (@files) {
5 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/<%$file%>.js"></SCRIPT>
6 %}
7
8 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/jquery.js"></SCRIPT>
9
10 <SCRIPT TYPE="text/javascript">
11
12   function boxon(what) {
13     var $this = $(what);
14     for ( var c=0; c < <%$cells%>; c++) {
15
16       $this.css('background-color', '#ffffdd');
17       if ( c == 0 ) {
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');
25       } else {
26         $this.css('border-left', '1px double black');
27         $this.css('border-right', '1px solid black');
28       }
29
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);
33     }
34   }
35
36   function boxoff(what) {
37     var $this = $(what);
38     for ( var c=0; c < <%$cells%>; c++) {
39
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
44
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);
48     }
49   }
50
51 </SCRIPT>
52
53 <& /Search/Calendar.html,
54      @_,
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( @{ $ARGS{username} } ),
59      Embed       => 'Schedule.html',
60      DimPast     => 1,
61      Display     => 'Schedule',
62      DisplayArgs => [ username  => $ARGS{username},
63                       LengthMin => $LengthMin,
64                     ],
65 &>
66
67 <%ONCE>
68
69 my $timestep =  RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h
70
71 </%ONCE>
72 <%init>
73
74 my @files = ();
75 #if ( ! $initialized ) {
76   push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) );
77   push @files, map { "${_}contentmws" } qw( iframe ajax );
78 #%}
79
80 my $LengthMin = 180; #XXX $ARGS{LengthMin};, passed in
81
82 my $cells = int($LengthMin / $timestep);
83 $cells++ if $LengthMin % $timestep;
84
85 </%init>