& /Elements/Header, Title => 'Schedule' &>
%#init_overlib.html
%foreach my $file (@files) {
%}
<& /Search/Calendar.html,
@_,
Query => "( Status = 'new' OR Status = 'open' OR Status = 'stalled')
AND ( Type = 'reminder' OR 'Type' = 'ticket' )",
#XXX and we have the magic custom field
slots => scalar( @{ $ARGS{username} } ),
Embed => 'Schedule.html',
DimPast => 1,
Display => 'Schedule',
DisplayArgs => [ username => $ARGS{username},
LengthMin => $LengthMin,
#oops, more freeside abstraction-leaking
custnum => $ARGS{custnum},
pkgnum => $ARGS{pkgnum},
],
&>
<%ONCE>
my $timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h
%ONCE>
<%init>
my @files = ();
#if ( ! $initialized ) {
push @files, map "overlibmws$_", ( '', qw( _iframe _draggable _crossframe ) );
push @files, map { "${_}contentmws" } qw( iframe ajax );
#%}
( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin';
my $cells = int($LengthMin / $timestep);
$cells++ if $LengthMin % $timestep;
%init>