WebCalendar PHP Cross Reference Groupware Applications

Source: /activity_log.php - 71 lines - 2296 bytes - Summary - Text - Print

   1  <?php
   2  /* $Id: activity_log.php,v 1.53.2.3 2007/11/12 15:40:29 umcesrjones Exp $
   3   *
   4   * Description:
   5   *  Display either the "Activity Log" (for events/tasks) or the
   6   *  "System Log" (entries not associated with an event).
   7   *
   8   * Input Parameters:
   9   *  startid  - specified the id of the first log entry to display
  10   *  system   - if specified, then view the system log (entries with no
  11   *             event id associated with them) rather than the event log.
  12   *
  13   * Security:
  14   *  User must be an admin user
  15   *  AND, if user access control is enabled, they must have access to
  16   *  activity logs. (This is because users may see event details
  17   *  for other groups that they are not supposed to have access to.)
  18   */
  19  include_once  'includes/init.php';
  20  
  21  if ( ! $is_admin || ( access_is_enabled () && !
  22        access_can_access_function ( ACCESS_ACTIVITY_LOG ) ) )
  23    die_miserable_death ( print_not_auth (2) );
  24  
  25  $eventsStr = translate ( 'Events' );
  26  $nextStr = translate ( 'Next' );
  27  $prevStr = translate ( 'Previous' );
  28  
  29  $PAGE_SIZE = 25; // Number of entries to show at once.
  30  $startid = getValue ( 'startid', '-?[0-9]+', true );
  31  $sys = ( $is_admin && getGetValue ( 'system' ) != '' );
  32  
  33  print_header ();
  34  
  35  ob_start ();
  36  
  37  echo generate_activity_log ( '', $sys, $startid );
  38  
  39  echo '
  40      <div class="navigation">'
  41  // Go BACK in time.
  42   . ( ! empty ( $nextpage ) ? '
  43        <a title="' . $prevStr . '&nbsp;' . $PAGE_SIZE . '&nbsp;' . $eventsStr
  44     . '" class="prev" href="activity_log.php?startid=' . $nextpage
  45     . ( $sys ? '&amp;system=1' : '' ) . '">' . $prevStr . '&nbsp;' . $PAGE_SIZE
  46     . '&nbsp;' . $eventsStr . '</a>' : '' );
  47  
  48  if ( ! empty ( $startid ) ) {
  49    $previd = $startid + $PAGE_SIZE;
  50    $res = dbi_execute ( 'SELECT MAX( cal_log_id ) FROM webcal_entry_log' );
  51    if ( $res ) {
  52      if ( $row = dbi_fetch_row ( $res ) )
  53        // Go FORWARD in time.
  54        echo '
  55        <a title="' . $nextStr . '&nbsp;' . $PAGE_SIZE . '&nbsp;' . $eventsStr
  56         . '" class="next" href="activity_log.php' . ( $row[0] <= $previd
  57          ? ( $sys ? '?system=1' : '' )
  58          : '?startid=' . $previd . ( $sys ? '&amp;system=1' : '' ) ) . '">'
  59         . $nextStr . '&nbsp;' . $PAGE_SIZE . '&nbsp;' . $eventsStr . '</a><br />';
  60  
  61      dbi_free_result ( $res );
  62    }
  63  }
  64  
  65  ob_end_flush ();
  66  
  67  echo '
  68      </div>
  69      ' . print_trailer ();
  70  
  71  ?>

title

Description

title

Description

title

Description

title

title

Body