Exemplo n.º 1
0
            }

            redirect($return);
            die();
        }
    }
}

//print_object($cm);
/**
 * Print page header
 */
if (!$onlycontent) {
    local_js(
        array(
            JS_DIALOG,
            JS_TREEVIEW
        )
    );

    $PAGE->requires->string_for_js('save', 'admin');
    $PAGE->requires->string_for_js('cancel', 'moodle');
    $PAGE->requires->strings_for_js(array('uploadfile', 'addremoveattendees', 'approvalreqd','bulkaddattendeesfrominput', 'submitcsvtext', 'bulkaddattendeesresults', 'bulkaddattendeesfromfile', 'bulkaddattendeesresults', 'wait-list', 'cancellations', 'approvalreqd', 'takeattendance'), 'facetoface');

    $json_action = json_encode($action);
    $args = array('args' => '{"sessionid":'.$session->id.','.
        '"action":'.$json_action.','.
        '"sesskey":"'.sesskey().'",'.
        '"approvalreqd":"'.$facetoface->approvalreqd.'"}');

    $jsmodule = array(
        'name' => 'f2f_attendees',
Exemplo n.º 2
0
            $selected = facetoface_get_selected_report_items('room', null, $rooms);

            foreach ($selected as $item) {
                $DB->delete_records('facetoface_room', array('id' => $item->id));
            }
        }
    }

    facetoface_reset_selected_report_items('room');
    redirect($redirectto);
}

// Display
local_js(array(
    JS_DIALOG,
    )
);

$PAGE->set_title(get_string('rooms', 'facetoface'));
$PAGE->set_heading('');
$PAGE->set_focuscontrol('');
$PAGE->set_cacheable(true);
$PAGE->navbar->add(get_string('rooms', 'facetoface'));
navigation_node::override_active_url($returnurl);
echo $OUTPUT->header();

// Print delete confirmation page
if ($delete) {
    if (!$room = $DB->get_record('facetoface_room', array('id' => $delete))) {
        print_error('error:roomdoesnotexist', 'facetoface');
    }
Exemplo n.º 3
0
            $selected = facetoface_get_selected_report_items('template', null, $notifications);

            foreach ($selected as $item) {
                $item->status = $data->bulk_update == 'set_active' ? 1 : 0;
                $DB->update_record('facetoface_notification_tpl', $item);
            }
        }
    }
    facetoface_reset_selected_report_items('template');

    redirect($redirectto->out());
}


// Header
local_js();

$str_edit = get_string('edit', 'moodle');
$str_remove = get_string('delete', 'moodle');
$str_activate = get_string('activate', 'facetoface');
$str_deactivate = get_string('deactivate', 'facetoface');

$url = new moodle_url('/admin/settings.php', array('section' => 'modsettingfacetoface'));

$PAGE->set_title(get_string('notificationtemplates', 'facetoface'));
$PAGE->set_heading('');
$PAGE->set_focuscontrol('');
$PAGE->set_cacheable(true);
$PAGE->navbar->add(get_string('notificationtemplates', 'facetoface'));
navigation_node::override_active_url($url);
echo $OUTPUT->header();
Exemplo n.º 4
0
}

// Page header.
$pagetitle = get_string('trainingcalendar', 'block_facetoface');
$PAGE->navbar->add($pagetitle);
$PAGE->set_title($pagetitle);
$PAGE->set_heading($SITE->fullname);
$PAGE->set_url('/blocks/facetoface/calendar.php');
$PAGE->set_focuscontrol('');
$PAGE->set_cacheable(true);
$PAGE->set_pagelayout('standard');
echo $OUTPUT->header();

// Javascript include (if needed).
if (in_array('timestart', $defaultfields) || in_array('timefinish', $defaultfields)) {
    local_js(array(TOTARA_JS_DATEPICKER));
}

// Default field filters.
$tablecells = array();
foreach ($defaultfields as $fieldname) {
    $tablecells[] = defaultfield_chooser($fieldname);
}

// Custom field filters.
foreach ($customfields as $field) {
    if ($html = customfield_chooser($field)) {
        $tablecells[] = $html;
    }
}
Exemplo n.º 5
0
 function get_content()
 {
     global $CFG, $PAGE, $OUTPUT;
     // Cache block contents.
     if ($this->content !== NULL) {
         return $this->content;
     }
     $this->content = new stdClass();
     // Initialise jquery requirements.
     require_once $CFG->dirroot . '/local/message/messagelib.php';
     require_once $CFG->dirroot . '/local/core/js/lib/setup.php';
     $code = array();
     $code[] = JS_DIALOG;
     local_js($code);
     $PAGE->requires->js_init_call('M.message.init');
     // Just get the alerts for this user.
     $total = tm_messages_count('alert', false);
     $this->msgs = tm_messages_get('alert', 'timecreated DESC ', false, true);
     $this->title = get_string('alerts', 'block_alerts');
     if (empty($this->instance)) {
         return $this->content;
     }
     // Now build the table of results.
     $table = new html_table();
     $table->attributes['class'] = 'fullwidth invisiblepadded';
     if (!empty($this->msgs)) {
         $cnt = 0;
         foreach ($this->msgs as $msg) {
             // Status Icon.
             $cnt++;
             $cssclass = message_cssclass($msg->msgtype);
             $rowbkgd = $cnt % 2 ? 'shade' : 'noshade';
             $msglink = !empty($msg->contexturl) ? $msg->contexturl : '';
             // Build the array of 3 table cell objects.
             $cells = array();
             $icon = $OUTPUT->pix_icon('msgicons/' . $msg->icon, format_string($msg->subject), 'local_core', array('class' => "msgicon {$cssclass}", 'alt' => format_string($msg->subject)));
             if (!empty($msglink)) {
                 $url = new moodle_url($msglink);
                 $attributes = array('href' => $url);
                 $cellcontent = html_writer::tag('a', $icon, $attributes);
             } else {
                 $cellcontent = $icon;
             }
             $cell = new html_table_cell($cellcontent);
             $cell->attributes['class'] = 'status';
             $cells[] = $cell;
             $text = format_string($msg->subject ? $msg->subject : $msg->fullmessage);
             if (!empty($msglink)) {
                 $url = new moodle_url($msglink);
                 $attributes = array('href' => $url);
                 $cellcontent = html_writer::tag('a', $text, $attributes);
             } else {
                 $cellcontent = $text;
             }
             $cell = new html_table_cell($cellcontent);
             $cell->attributes['class'] = 'statement';
             $cells[] = $cell;
             $moreinfotext = get_string('clickformoreinfo', 'block_alerts');
             $icon = $OUTPUT->pix_icon('i/info', $moreinfotext, 'moodle', array('class' => 'msgicon', 'title' => $moreinfotext, 'alt' => $moreinfotext));
             $detailjs = message_alert_popup($msg->id, null, 'detailalert');
             $url = new moodle_url($msglink);
             $attributes = array('href' => $url, 'id' => "detailalert{$msg->id}-dialog");
             $cellcontent = html_writer::tag('a', $icon, $attributes) . $detailjs;
             $cell = new html_table_cell($cellcontent);
             $cell->attributes['class'] = 'action';
             $cells[] = $cell;
             $row = new html_table_row($cells);
             $row->attributes['class'] = $rowbkgd;
             $table->data[] = $row;
         }
     }
     $this->content->text = '';
     $count = count($this->msgs);
     if ($count) {
         $this->content->text .= html_writer::tag('p', get_string('showingxofx', 'block_alerts', array('count' => $count, 'total' => $total)));
     } else {
         if (!empty($CFG->block_alerts_showempty)) {
             if (!empty($this->config->showempty)) {
                 $this->content->text .= html_writer::tag('p', get_string('noalerts', 'block_alerts'));
             } else {
                 return '';
             }
         } else {
             return '';
         }
     }
     $this->content->text .= html_writer::table($table);
     /*     if (!empty($this->msgs)) {
                 $url = new moodle_url('/local/message/alerts.php', array('sesskey' => sesskey()));
                 $link = html_writer::link($url, get_string('viewallnot', 'block_alerts'));
                 $this->content->footer = html_writer::tag('div', $link, array('class' => 'viewall'));
             }
         * 
         */
     return $this->content;
 }