WebCalendar PHP Cross Reference Groupware Applications

Source: /day.php - 97 lines - 2997 bytes - Summary - Text - Print

   1  <?php
   2  /* $Id: day.php,v 1.78.2.4 2008/03/31 21:03:41 umcesrjones Exp $ */
   3  include_once  'includes/init.php';
   4  
   5  //check UAC
   6  if ( ! access_can_access_function ( ACCESS_DAY ) || 
   7    ( ! empty ( $user ) && ! access_user_calendar ( 'view', $user ) )  )
   8    send_to_preferred_view ();
   9    
  10  load_user_layers ( $user != $login && $is_nonuser_admin ? $user : '' );
  11  
  12  load_user_categories ();
  13  
  14  $wday = strftime ( '%w', mktime ( 0, 0, 0, $thismonth, $thisday, $thisyear ) );
  15  $now = mktime ( 23, 59, 59, $thismonth, $thisday, $thisyear );
  16  $nowYmd = date ( 'Ymd', $now );
  17  
  18  $next = mktime ( 0, 0, 0, $thismonth, $thisday + 1, $thisyear );
  19  $nextday = date ( 'd', $next );
  20  $nextmonth = date ( 'm', $next );
  21  $nextyear = date ( 'Y', $next );
  22  $nextYmd = date ( 'Ymd', $next );
  23  
  24  $prev = mktime ( 0, 0, 0, $thismonth, $thisday - 1, $thisyear );
  25  $prevday = date ( 'd', $prev );
  26  $prevmonth = date ( 'm', $prev );
  27  $prevyear = date ( 'Y', $prev );
  28  $prevYmd = date ( 'Ymd', $prev );
  29  
  30  if ( empty ( $TIME_SLOTS ) )
  31    $TIME_SLOTS = 24;
  32  
  33  $boldDays = ( $BOLD_DAYS_IN_YEAR == 'Y' );
  34  
  35  $startdate = mktime ( 0, 0, 0, $thismonth, 0, $thisyear );
  36  $enddate = mktime ( 23, 59, 59, $thismonth + 1, 0, $thisyear );
  37  
  38  $printerStr = $unapprovedStr = '';
  39  
  40  /* Pre-Load the repeated events for quckier access */
  41  $repeated_events = read_repeated_events ( empty ( $user )
  42    ? $login : $user, $startdate, $enddate, $cat_id );
  43  
  44  /* Pre-load the non-repeating events for quicker access */
  45  $events = read_events ( empty ( $user )
  46    ? $login : $user, $startdate, $enddate, $cat_id );
  47  
  48  if ( empty ( $DISPLAY_TASKS_IN_GRID ) || $DISPLAY_TASKS_IN_GRID == 'Y' )
  49    /* Pre-load tasks for quicker access */
  50    $tasks = read_tasks ( ! empty ( $user ) && strlen ( $user ) && $is_assistant
  51      ? $user : $login, $now, $cat_id );
  52  
  53  $smallTasks = ( $DISPLAY_TASKS == 'Y' ? '<div id="minitask">
  54             ' . display_small_tasks ( $cat_id ) . '
  55            </div>' : '' );
  56  $dayStr = print_day_at_a_glance ( $nowYmd, ( empty ( $user )
  57      ? $login : $user ), $can_add );
  58  $navStr = display_navigation ( 'day' );
  59  $smallMonthStr = display_small_month ( $thismonth, $thisyear, true );
  60  if ( empty ( $friendly ) ) {
  61    $unapprovedStr = display_unapproved_events (
  62      $is_assistant || $is_nonuser_admin ? $user : $login );
  63    $printerStr = generate_printer_friendly ( 'day.php' );
  64  }
  65  $eventinfo = ( empty ( $eventinfo ) ? '' : $eventinfo );
  66  $trailerStr = print_trailer ();
  67  print_header ( array ( 'js/popups.php/true' ), generate_refresh_meta (), '',
  68    false, false, false, false );
  69  
  70  echo <<<EOT
  71  
  72      <table width="100%" cellpadding="1">
  73        <tr>
  74          <td width="80%">
  75            {$navStr}
  76          </td>
  77          <td class="aligntop" rowspan="2">
  78            <!-- START MINICAL -->
  79            <div class="minicalcontainer">
  80              {$smallMonthStr}
  81            </div>
  82            {$smallTasks}
  83          </td>
  84        </tr>
  85        <tr>
  86          <td>
  87            {$dayStr}
  88          </td>
  89        </tr>
  90      </table>
  91      {$eventinfo}
  92      {$unapprovedStr}
  93      {$printerStr}
  94      {$trailerStr}
  95  EOT;
  96  
  97  ?>

title

Description

title

Description

title

Description

title

title

Body