[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/calendar/ -> projects_tab.view.events.php (source)

   1  <?php /* $Id: projects_tab.view.events.php 38 2008-02-11 11:38:51Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/calendar/projects_tab.view.events.php $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  global $AppUI, $project_id, $deny, $canRead, $canEdit, $w2Pconfig, $start_date, $end_date, $this_day, $event_filter, $event_filter_list;
   7  require_once $AppUI->getModuleClass('calendar');
   8  
   9  $perms = &$AppUI->acl();
  10  $user_id = $AppUI->user_id;
  11  $other_users = false;
  12  $no_modify = false;
  13  
  14  $start_date =  new CDate('0000-00-00 00:00:00');
  15  $end_date =  new CDate('9999-12-31 23:59:59');
  16  
  17  // assemble the links for the events

  18  $events = CEvent::getEventsForPeriod($start_date, $end_date, 'all', 0, $project_id);
  19  
  20  $start_hour = w2PgetConfig('cal_day_start');
  21  $end_hour = w2PgetConfig('cal_day_end');
  22  
  23  $tf = $AppUI->getPref('TIMEFORMAT');
  24  $df = $AppUI->getPref('SHDATEFORMAT');
  25  $types = w2PgetSysVal('EventType');
  26  
  27  $html = '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">';
  28  $html .= '<tr><th>' . $AppUI->_('Date') . '</th><th>' . $AppUI->_('Type') . '</th><th>' . $AppUI->_('Event') . '</th></tr>';
  29  foreach ($events as $row) {
  30      $html .= '<tr>';
  31      $start = new CDate($row['event_start_date']);
  32      $end = new CDate($row['event_end_date']);
  33      $html .= '<td width="25%" nowrap="nowrap">' . $start->format($df . ' ' . $tf) . '&nbsp;-&nbsp;';
  34      $html .= $end->format($df . ' ' . $tf) . '</td>';
  35  
  36      $href = '?m=calendar&a=view&event_id=' . $row['event_id'];
  37      $alt = $row['event_description'];
  38  
  39      $html .= '<td width="10%" nowrap="nowrap">';
  40      $html .= w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar');
  41      $html .= '&nbsp;<b>' . $AppUI->_($types[$row['event_type']]) . '</b><td>';
  42      $html .= $href ? '<a href="' . $href . '" class="event" title="' . $alt . '">' : '';
  43      $html .= $row['event_title'];
  44      $html .= $href ? '</a>' : '';
  45      $html .= '</td></tr>';
  46  }
  47  $html .= '</table>';
  48  echo $html;
  49  ?>


Generated: Wed Jan 7 03:00:01 2009 Cross-referenced by PHPXref 0.7