Esempio n. 1
0
      <a title="' . $prevStr . '" class="prev" href="view_v.php?id=' . $id . '&amp;date=' . $prevdate . '"><img src="images/leftarrow.gif" alt="' . $prevStr . '" /></a>
      <a title="' . $nextStr . '" class="next" href="view_v.php?id=' . $id . '&amp;date=' . $nextdate . '"><img src="images/rightarrow.gif" alt="' . $nextStr . '" /></a>
      <div class="title">
        <span class="date">' . date_to_str($thisdate, '', false) . '&nbsp;&nbsp;&nbsp; - &nbsp;&nbsp;&nbsp;' . date_to_str(date('Ymd', $wkend), '', false) . '</span><br />
        <span class="viewname">' . htmlspecialchars($view_name) . '</span>
      </div>
    </div><br />';
// .
// The table has names across the top and dates for rows. Since we need to spit
// out an entire row before we can move to the next date, we'll save up all the
// HTML for each cell and then print it out when we're done..
// Additionally, we only want to put at most 6 users in one table since
// any more than that doesn't really fit in the page.
// .
// Get users in this view.
$viewusers = view_get_user_list($id);
$viewusercnt = count($viewusers);
if ($viewusercnt == 0) {
    // This could happen if user_sees_only_his_groups = Y and
    // this user is not a member of any group assigned to this view.
    $error = translate('No users for this view');
}
if (!empty($error)) {
    echo print_error($error) . print_trailer();
    exit;
}
$e_save = $re_save = array();
for ($i = 0; $i < $viewusercnt; $i++) {
    /* Pre-Load the repeated events for quicker access */
    $re_save[$i] = read_repeated_events($viewusers[$i], $wkstart, $wkend, '');
    /* Pre-load the non-repeating events for quicker access
Esempio n. 2
0
 * unless the user is an admin ($is_admin).
 * If the view is not global, the user must own the view.
 * If the view is global and user_sees_only_his_groups is enabled,
 * then we remove users not in this user's groups
 * (except for nonuser calendars... which we allow regardless of group).
 */
// $start = microtime ();
include_once 'includes/init.php';
include_once 'includes/views.php';
$error = '';
view_init($id);
$printerStr = generate_printer_friendly('view_d.php');
set_today($date);
print_header(array('js/view_d.php/true'));
// get users in this view
$participants = view_get_user_list($id);
if (count($participants) == 0) {
    // This could happen if user_sees_only_his_groups  = Y and
    // this user is not a member of any group assigned to this view.
    $error = translate('No users for this view') . '.';
    echo print_error($error) . print_trailer();
    exit;
}
if (!$date) {
    $date = $thisdate;
}
$now = mktime(0, 0, 0, $thismonth, $thisday, $thisyear);
$nowStr = date_to_str(date('Ymd', $now));
$nextdate = date('Ymd', $now + 86400);
$prevdate = date('Ymd', $now - 86400);
$matrixStr = daily_matrix($date, $participants);