Пример #1
0
         organizer_prepare_and_send_message($slot, 'group_registration_notify:student:unregister');
     }
     organizer_unregister_appointment($slot, $groupid);
     redirect($redirecturl);
 } else {
     if ($action == ORGANIZER_ACTION_REREGISTER) {
         require_capability('mod/organizer:register', $context);
         require_capability('mod/organizer:unregister', $context);
         add_to_log($course->id, 'organizer', 'reregister', "{$logurl}", $organizer->name, $cm->id);
         if (!organizer_security_check_slots($slot)) {
             print_error('Security failure: Selected slot doesn\'t belong to this organizer!');
         }
         if (!organizer_organizer_student_action_allowed($action, $slot)) {
             print_error('Inconsistent state: Cannot execute registration action! Please navigate back and refresh your browser!');
         }
         $group = organizer_fetch_my_group();
         $groupid = $group ? $group->id : 0;
         $success = organizer_reregister_appointment($slot, $groupid);
         if ($success) {
             organizer_prepare_and_send_message($slot, 'register_notify:teacher:reregister');
             if ($group) {
                 organizer_prepare_and_send_message($slot, 'group_registration_notify:student:reregister');
             }
         } else {
             if (organizer_is_group_mode()) {
                 $redirecturl->param('messages[]', 'message_error_slot_full_group');
             } else {
                 $redirecturl->param('messages[]', 'message_error_slot_full_single');
             }
         }
         redirect($redirecturl);
Пример #2
0
function organizer_make_description_section($organizer)
{
    $output = $organizer->intro;
    if ($organizer->isgrouporganizer) {
        $output .= '<hr />';
        $group = organizer_fetch_my_group();
        if ($group) {
            $a = new stdClass();
            $a->groupname = $group->name;
            $output .= '<p> ' . get_string('grouporganizer_desc_hasgroup', 'organizer', $a) . '</p>';
        } else {
            $output .= '<p> ' . get_string('grouporganizer_desc_nogroup', 'organizer') . '</p>';
        }
    }
    if (isset($organizer->duedate)) {
        $output .= '<hr />';
        $a = new stdClass();
        $a->date = userdate($organizer->duedate, get_string('fulldatetemplate', 'organizer'));
        $a->time = userdate($organizer->duedate, get_string('timetemplate', 'organizer'));
        if ($organizer->duedate > time()) {
            $output .= '<p>' . get_string('infobox_organizer_expires', 'organizer', $a) . '</p>';
        } else {
            $output .= '<p>' . get_string('infobox_organizer_expired', 'organizer', $a) . '</p>';
        }
    } else {
        $output .= '<hr />';
        $output .= '<p>' . get_string('infobox_organizer_never_expires', 'organizer') . '</p>';
    }
    return organizer_make_section('infobox_description', $output);
}