summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/CalendarSlotSchedule
blob: 3af90ff3e9dcb10cde326d42a739cb9085407c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%ARGS>
  $Date     => undef
  @Tickets  => ()
  $slots    => $default_slots
  $sday     => undef
  $tod_row  => undef
  $timestep => $default_timestep
  @username => ()
</%ARGS>
% foreach my $username ( @username ) {

    <td class="weekly
%#               <%   $is_today     ? 'today'
%#                  : $is_yesterday ? 'yesterday'
%#                  : $is_aweekago  ? 'aweekago'
%#                  : ''
%#               %>
                   "
    >
%       for my $t (@Tickets) {
%         next unless $t->OwnerObj->Name eq $username;
%
%         next unless RTx::Calendar::LocalDate($t->StartsObj->Unix)
%                     eq $Date->strftime('%F'); #today
%
%         my($sm, $sh) = ($t->StartsObj->Localtime('user'))[1,2];
%         my $starts = $sh*60 + $sm;
%
%         my($dm, $dh) = ($t->DueObj->Localtime('user'))[1,2];
%         my $due = $dh*60 + $dm;
%
%         next if $starts >= ($tod_row+$timestep) || $due < $tod_row;
%
%         warn $starts. ' = '. ($tod_row+$timestep);
%         if ( $starts >= $tod_row ) {
            <% $t->Id %>
%         } else {
            cont<% $t->Id %>...
%         }
%       }
    </td>
% }
<%ONCE>
my $default_slots = RT->Config->Get('CalendarWeeklySlots') || 5;
my $default_timestep = RT->Config->Get('CalendarWeeklySizeMin') || 30; #1/2h
</%ONCE>