Пример #1
0
    // An event will be included one time for each participant.
    $ev = get_entries($date);
    // Keep track of duplicates.
    $completed_ids = array();
    for ($i = 0, $evCnt = count($ev); $i < $evCnt; $i++) {
        $id = $ev[$i]->getID();
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        $out .= process_event($id, $ev[$i]->getName(), $date, $ev[$i]->getTime());
    }
    $rep = get_repeating_entries($user, $date);
    for ($i = 0, $repCnt = count($rep); $i < $repCnt; $i++) {
        $id = $rep[$i]->getID();
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        $out .= process_event($id, $rep[$i]->getName(), $date, $rep[$i]->getTime());
    }
}
$out .= '
</reminders>
';
// If web service debugging is on...
if (!empty($WS_DEBUG) && $WS_DEBUG) {
    ws_log_message($out);
}
// Send output now...
echo $out;
Пример #2
0
$startdate = time();
// today
for ($d = 0; $d < $DAYS_IN_ADVANCE; $d++) {
    $date = date("Ymd", time() + $d * 24 * 3600);
    //echo "Date: $date\n";
    // Get non-repeating events for this date.
    // An event will be included one time for each participant.
    $ev = get_entries("", $date);
    // Keep track of duplicates
    $completed_ids = array();
    for ($i = 0; $i < count($ev); $i++) {
        $id = $ev[$i]['cal_id'];
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        process_event($id, $ev[$i]['cal_name'], $date, $ev[$i]['cal_time']);
    }
    $rep = get_repeating_entries("", $date);
    for ($i = 0; $i < count($rep); $i++) {
        $id = $rep[$i]['cal_id'];
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        process_event($id, $rep[$i]['cal_name'], $date, $rep[$i]['cal_time']);
    }
}
if ($debug) {
    echo "Done.<br />\n";
}
Пример #3
0
                // for NULL rather than just a falsey value.
                while (NULL !== ($line = array_shift($lines))) {
                    if ($line == "BEGIN:VEVENT") {
                        $vevent = array();
                        while (($vevent_line = array_shift($lines)) && $vevent_line != "END:VEVENT") {
                            $vevent[] = $vevent_line;
                        }
                        $vevents[] = $vevent;
                    }
                }
            }
            // Process each event, putting it in the database
            $n_success = 0;
            $n_failure = 0;
            foreach ($vevents as $vevent) {
                process_event($vevent) ? $n_success++ : $n_failure++;
            }
            echo "<p>\n";
            echo "{$n_success} " . get_vocab("events_imported");
            if ($n_failure > 0) {
                echo "<br>\n{$n_failure} " . get_vocab("events_not_imported");
            }
            echo "</p>\n";
        }
    }
}
// PHASE 1 - Get the user input
// ----------------------------
echo "<form class=\"form_general\" method=\"POST\" enctype=\"multipart/form-data\" action=\"" . htmlspecialchars(basename($PHP_SELF)) . "\">\n";
echo "<fieldset class=\"admin\">\n";
echo "<legend>" . get_vocab("import_icalendar") . "</legend>\n";
Пример #4
0
        ?><div id="img-display">
            <img id="img-gallery" src="">
            <div id="img-caption"></div>
        </div>
    </div><?
    }
}
?><?
    if($uu->id)
    {
    ?>
    <div id="page" class="column">
    <div id="event-wrapper">
        <div id="event-display">
            <header><? echo $item['name1']; ?></header><?
        $b_arr = process_event($item['body']);
        for($i = 0; $i < count($b_arr); $i++)
            echo $b_arr[$i] . "<br />";
            $report_url = $host.implode("/", array_slice($uu->urls, 0, count($uu->urls)-1));
            ?><div class="now">
                <a href="<? echo $report_url; ?>">Go back to <? echo $year; ?>. . . </a>
            </div>
        </div>
    </div>
    </div><?
    }
    else
    {
    ?><div class="now column">
        <p>Meanwhile, here is what’s happening now:</p>
        <div id="ticker-wrapper">
    // Get repeating events...tasks are not included at this time.
    if ($debug) {
        echo "Getting repeating events for {$date}<br />";
    }
    $rep = my_get_repeating_entries('', $date);
    $repcnt = count($rep);
    if ($debug) {
        echo "found {$repcnt} repeating events for {$date}<br />";
    }
    for ($i = 0; $i < $repcnt; $i++) {
        $id = $rep[$i]->getID();
        if (!empty($completed_ids[$id])) {
            continue;
        }
        $completed_ids[$id] = 1;
        process_event($id, $rep[$i]->getName(), $rep[$i]->getDateTimeTS(), $rep[$i]->getEndDateTimeTS(), $date);
    }
}
if ($debug) {
    echo "Done.<br />\n";
}
// Send a reminder for a single event for a single day to all participants in
// the event who have accepted as well as those who have not yet approved.
// But, don't send to users who rejected (cal_status='R' ).
function send_reminder($id, $event_date)
{
    global $ALLOW_EXTERNAL_USERS, $debug, $def_tz, $emails, $EXTERNAL_REMINDERS, $attachics, $htmlmail, $is_task, $LANGUAGE, $languages, $names, $only_testing, $SERVER_URL, $site_extras, $t_format, $tz;
    $ext_participants = $participants = array();
    $num_ext_participants = $num_participants = 0;
    $pri[1] = translate('High');
    $pri[2] = translate('Medium');
Пример #6
0
function get_unapproved($user)
{
    global $key, $login, $NONUSER_ENABLED, $temp_fullname;
    $count = 0;
    $ret = '';
    user_load_variables($user, 'temp_');
    // echo 'Listing events for ' . $user . '<br />';
    $sql = 'SELECT we.cal_id, we.cal_name, we.cal_date, we.cal_time
    FROM webcal_entry we, webcal_entry_user weu
    WHERE we.cal_id = weu.cal_id AND weu.cal_login = ? AND weu.cal_status = \'W\'
    ORDER BY we.cal_date';
    $rows = dbi_get_cached_rows($sql, array($user));
    echo '
<!-- SQL:
' . $sql . '
-->
';
    if ($rows) {
        for ($i = 0, $cnt = count($rows); $i < $cnt; $i++) {
            $row = $rows[$i];
            $id = $row[0];
            $name = $row[1];
            $date = $row[2];
            $time = $row[3];
            $ret .= process_event($id, $name, $date, $time, $user);
        }
    }
    return $ret;
}