function rb_display_link_f2f_session($date, $row) {
     global $OUTPUT;
     $sessionid = $row->session_id;
     if ($date && is_numeric($date)) {
         if (empty($row->timezone)) {
             $targetTZ = get_clean_timezone();
         } else {
             $targetTZ = $row->timezone;
         }
         $strdate = userdate($date, get_string('sessiondateformat', 'facetoface'), $targetTZ);
         return $OUTPUT->action_link(new moodle_url('/mod/facetoface/attendees.php', array('s' => $sessionid)), $strdate);
     } else {
         return '';
     }
 }
Ejemplo n.º 2
0
/**
 * Used in many places to obtain properly-formatted session date and time info
 *
 * @param int $start a start time Unix timestamp
 * @param int $end an end time Unix timestamp
 * @param string $tz a session timezone
 * @return object Formatted date, start time, end time and timezone info
 */
function facetoface_format_session_times($start, $end, $tz) {

    $formattedsession = new stdClass();
    $tzknown = false;
    if (!empty($tz)) {
        $targetTZ = $tz;
        $tzknown = true;
    } else {
        $targetTZ = get_clean_timezone();
    }
    $formattedsession->startdate = userdate($start, get_string('sessiondateformat', 'facetoface'), $targetTZ);
    $formattedsession->starttime = userdate($start, get_string('sessiondatetimeformat', 'facetoface'), $targetTZ);
    $formattedsession->enddate = userdate($end, get_string('sessiondateformat', 'facetoface'), $targetTZ);
    $formattedsession->endtime = userdate($end, get_string('sessiondatetimeformat', 'facetoface'), $targetTZ);
    if ($tzknown) {
        $formattedsession->timezone = get_string(strtolower($targetTZ), 'timezones');
    } else {
        $formattedsession->timezone = get_string('sessiontimezoneunknown', 'facetoface');
    }
    return $formattedsession;
}
Ejemplo n.º 3
0
    redirect($returnurl);
}

$customfields = facetoface_get_session_customfields();

$sessionid = isset($session->id) ? $session->id : 0;

$details = new stdClass();
$details->id = $sessionid;
$details->details = isset($session->details) ? $session->details : '';
$details->detailsformat = FORMAT_HTML;
$details = file_prepare_standard_editor($details, 'details', $editoroptions, $module_context, 'mod_facetoface', 'session', $sessionid);
if (isset($session)) {
    $defaulttimezone = empty($session->sessiondates[0]->sessiontimezone) ? get_string('sessiontimezoneunknown', 'facetoface') : $session->sessiondates[0]->sessiontimezone;
} else {
    $defaulttimezone = get_clean_timezone();
}

$mform = new mod_facetoface_session_form(null, compact('id', 'f', 's', 'c', 'nbdays', 'customfields', 'course', 'editoroptions', 'defaulttimezone'));
if ($mform->is_cancelled()) {
    redirect($returnurl);
}

if ($fromform = $mform->get_data()) { // Form submitted

    if (empty($fromform->submitbutton)) {
        print_error('error:unknownbuttonclicked', 'facetoface', $returnurl);
    }

    // Pre-process fields
    if (empty($fromform->allowoverbook)) {