4 * Display a timebar view of a single day.
7 * month (*) - specify the starting month of the timebar
8 * day (*) - specify the starting day of the timebar
9 * year (*) - specify the starting year of the timebar
10 * users (*) - csv of users to include
14 * Must have "allow view others" enabled ($allow_view_other) in
15 * System Settings unless the user is an admin user ($is_admin).
18 include_once $gfplugins.'webcalendar/www/includes/init.php';
20 // Don't allow users to use this feature if "allow view others" is
22 if ( $allow_view_other == "N" && ! $is_admin ) {
28 // users: list of comma-separated users
29 if ( empty ( $users ) ) {
30 echo "Program Error: No users specified!"; exit;
31 } else if ( empty ( $year ) ) {
32 echo "Program Error: No year specified!"; exit;
33 } else if ( empty ( $month ) ) {
34 echo "Program Error: No month specified!"; exit;
35 } else if ( empty ( $day ) ) {
36 echo "Program Error: No day specified!"; exit;
39 $INC = array ( 'js/availability.php' );
40 print_header($INC, '', "onload=\"focus();\"", true );
42 $span = ($WORK_DAY_END_HOUR - $WORK_DAY_START_HOUR) * 3 + 1;
43 if (strlen($month) == 1) $month = '0'.$month; // add leading zeros
44 if (strlen($day) == 1) $day = '0'.$day; // add leading zeros
45 $date = $year.$month.$day;
46 $time = mktime(0,0,0,$month,$day,$year);
47 $wday = strftime ( "%w", $time );
48 $base_url = "?users=$users";
49 $prev_url = $base_url."&year=". strftime('%Y', $time - 86400)
50 ."&month=". strftime('%m', $time - 86400)
51 ."&day=". strftime('%d', $time - 86400);
52 $next_url = $base_url."&year=". strftime('%Y', $time + 86400)
53 ."&month=". strftime('%m', $time + 86400)
54 ."&day=". strftime('%d', $time + 86400);
56 $users = explode(",",$users);
59 <div style="border-width:0px; width:99%;">
60 <a title="<?php etranslate("Previous")?>" class="prev" href="<?php echo $prev_url ?>"><img src="leftarrow.gif" class="prevnext" alt="<?php etranslate("Previous")?>" /></a>
61 <a title="<?php etranslate("Next")?>" class="next" href="<?php echo $next_url ?>"><img src="rightarrow.gif" class="prevnext" alt="<?php etranslate("Next")?>" /></a>
63 <span class="date"><?php
64 printf ( "%s, %s %d, %d", weekday_name ( $wday ), month_name ( $month - 1 ), $day, $year );
69 <form action="availability.php" method="post">
70 <?php daily_matrix($date,$users); ?>
73 <?php print_trailer ( false, true, true ); ?>