예제 #1
0
global $OUTPUT;

require_login();

$cohort = $DB->get_record('cohort', array('id'=>$id), '*', MUST_EXIST);
$context = context::instance_by_id($cohort->contextid, MUST_EXIST);

require_capability('moodle/cohort:assign', $context);

$PAGE->set_context($context);
$PAGE->set_url('/local/batches/assignusers.php', array('id'=>$id));
$PAGE->set_pagelayout('admin');

$returnurl = new moodle_url('/local/batches/index.php');

$batches = new local_batches($id);

if (!empty($cohort->component)) {
    // We can not manually edit cohorts that were created by external systems, sorry.
    redirect($returnurl);
}

if (optional_param('cancel', false, PARAM_BOOL)) {
    redirect($returnurl);
}

$PAGE->navbar->add(get_string('pluginname', 'local_batches'), new moodle_url('/local/batches/index.php'));
$PAGE->navbar->add(get_string('assignusers', 'local_batches'));

$PAGE->set_title(get_string('pluginname', 'local_batches'));
$PAGE->set_heading($cohort->name);
예제 #2
0
}

$category = null;
if ($context->contextlevel == CONTEXT_COURSECAT) {
    $category = $DB->get_record('course_categories', array('id'=>$context->instanceid), '*', MUST_EXIST);
}

$manager = has_capability('moodle/cohort:manage', $context);
$canassign = has_capability('moodle/cohort:assign', $context);
if (!$manager) {
    require_capability('moodle/cohort:view', $context);
}

$strcohorts = get_string('cohorts', 'cohort');

$batch = new local_batches($id);

if ($category) {
    $PAGE->set_pagelayout('admin');
    $PAGE->set_context($context);
    $PAGE->set_url('/cohort/index.php', array('contextid'=>$context->id));
    $PAGE->set_title($strcohorts);
    $PAGE->set_heading($COURSE->fullname);
} else {
    admin_externalpage_setup('cohorts', '', null, '', array('pagelayout'=>'report'));
}

echo $OUTPUT->header();

echo $OUTPUT->heading(get_string('addcoursesto', 'local_batches', format_string($cohort->name)));
예제 #3
0
require_once($CFG->dirroot . '/user/selector/lib.php');
require_once(dirname(__FILE__) . '/classlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
require_once($CFG->dirroot . '/local/clclasses/lib.php');
require_once($CFG->dirroot . '/local/lib.php');
require_once($CFG->dirroot . '/local/batches/lib.php');

$id = required_param('id', PARAM_INT);
$batchid = optional_param('batchid',0, PARAM_INT);
$programid = optional_param('programid',0, PARAM_INT);
$from = optional_param('des', '', PARAM_TEXT);


$systemcontext = context_system::instance();
$hierarchy = new hierarchy();
$batch = new local_batches();

$PAGE->set_context($systemcontext);
$PAGE->set_url('/local/clclasses/classenrol.php');
$currentcss = '/local/clclasses/css/style.css';
$PAGE->requires->css($currentcss);
//get the admin layout
$PAGE->set_pagelayout('admin');
$PAGE->set_heading(get_string('pluginname', 'local_clclasses'));
$PAGE->set_title(get_string('pluginname', 'local_clclasses'));
require_login();

$semclass = new schoolclasses();

if (!has_capability('local/clclasses:enrolluser', $systemcontext)) {
    print_error('You dont have permissions');
예제 #4
0
파일: index.php 프로젝트: anilch/Personel
$PAGE->requires->js('/local/batches/js/delete.js');
//$PAGE->requires->js('/local/costcenter/js/cofilter.js');
//get the admin layout
$PAGE->set_pagelayout('admin');
//check the context level of the user and check weather the user is login to the system or not
$PAGE->set_context($context);

require_login();
$PAGE->set_url('/local/batches/index.php');
$PAGE->set_title(get_string('pluginname', 'local_batches'));
//Header and the navigation bar
$PAGE->set_heading(get_string('pluginname', 'local_batches'));
$PAGE->requires->css('/local/batches/css/style.css');
$renderer = $PAGE->get_renderer('local_batches');

$batches = new local_batches($id);
$editoroptions = array('maxfiles' => 0, 'context' => $context);
if ($cohort->id) {
    // Edit existing.
    $cohort = file_prepare_standard_editor($cohort, 'description', $editoroptions, $context);
    $form_heading = get_string('editbatch', 'local_batches');
    $collapse = false;
} else {
    // Add new.
    $cohort = file_prepare_standard_editor($cohort, 'description', $editoroptions, $context);
    $form_heading = get_string('addbatch', 'local_batches');
    $collapse = true;
}

if ($unassign && $cohort->id) {
    $PAGE->url->param('unassign', 1);