From 77eddcd5272d502eb1f9cde929d4bdd6fd156f86 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 5 Dec 2008 08:56:54 +0000 Subject: [PATCH] course request: MDL-9854 major cleanup to the course request code. * Rewrite all the forms to use formslib and improve usability. * Put the place where admins need to go to process approvals in the admin menu. * Show the request course/pending requests button on the page for the category that requested courses get added to. --- admin/settings/courses.php | 9 +- course/category.php | 4 + course/index.php | 12 +- course/lib.php | 20 +++ course/pending-reject.html | 7 - course/pending.php | 297 +++++++++++++++++++------------ course/request.php | 91 ++++++---- course/request_form.php | 106 ++++++++--- lang/en_utf8/error.php | 5 +- lang/en_utf8/moodle.php | 7 + theme/standard/styles_layout.css | 16 +- 11 files changed, 382 insertions(+), 192 deletions(-) delete mode 100644 course/pending-reject.html diff --git a/admin/settings/courses.php b/admin/settings/courses.php index d0d7013c46..74f28e6f1f 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -5,7 +5,8 @@ if ($hassiteconfig or has_capability('moodle/site:backup', $systemcontext) or has_capability('moodle/category:manage', $systemcontext) - or has_capability('moodle/course:create', $systemcontext)) { // speedup for non-admins, add all caps used on this page + or has_capability('moodle/course:create', $systemcontext) + or has_capability('moodle/site:approvecourse', $systemcontext)) { // speedup for non-admins, add all caps used on this page $ADMIN->add('courses', new admin_externalpage('coursemgmt', get_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on', array('moodle/category:manage', 'moodle/course:create'))); @@ -123,6 +124,12 @@ if ($hassiteconfig $temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1)); $ADMIN->add('courses', $temp); +/// Pending course requests. + if (!empty($CFG->enablecourserequests)) { + $ADMIN->add('courses', new admin_externalpage('coursespending', get_string('pendingrequests'), + $CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse'))); + } + /// "backups" settingpage if (!empty($CFG->backup_version)) { $temp = new admin_settingpage('backups', get_string('backups','admin'), 'moodle/site:backup'); diff --git a/course/category.php b/course/category.php index 8bcbfd5acf..cfc5ae860a 100644 --- a/course/category.php +++ b/course/category.php @@ -437,6 +437,10 @@ $options['category'] = $category->id; print_single_button('edit.php', $options, get_string('addnewcourse'), 'get'); } + + if (!empty($CFG->enablecourserequests) && $category->id == $CFG->enablecourserequests) { + print_course_request_buttons(get_context_instance(CONTEXT_SYSTEM)); + } echo ''; print_course_search(); diff --git a/course/index.php b/course/index.php index 8ca6f25940..65d6bd65d8 100644 --- a/course/index.php +++ b/course/index.php @@ -74,19 +74,13 @@ } echo '
'; - if ($CFG->enablecourserequests and isloggedin() and !isguest() and !has_capability('moodle/course:create', $systemcontext)) { - /// Print link to request a new course - print_single_button('request.php', NULL, get_string('courserequest'), 'get'); - } if (has_capability('moodle/course:create', $systemcontext)) { /// Print link to create a new course /// Get the 1st available category $options = array('category' => $CFG->defaultrequestcategory); print_single_button('edit.php', $options, get_string('addnewcourse'), 'get'); } - if (has_capability('moodle/site:approvecourse', $systemcontext) and !empty($CFG->enablecourserequests)) { - print_single_button('pending.php',NULL, get_string('coursespending'),'get'); - } + print_course_request_buttons($systemcontext); echo '
'; print_footer(); exit; @@ -262,9 +256,7 @@ print_single_button('editcategory.php', $options, get_string('addnewcategory'), 'get'); } - if (has_capability('moodle/site:approvecourse', $systemcontext) and !empty($CFG->enablecourserequests)) { - print_single_button('pending.php',NULL, get_string('coursespending'), 'get'); - } + print_course_request_buttons($systemcontext); // admin page does not allow custom buttons in the navigation bar echo '
'; echo update_category_button(); diff --git a/course/lib.php b/course/lib.php index f4fb9792f5..7985947184 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1966,6 +1966,26 @@ function print_category_info($category, $depth, $showcourses = false) { echo ''; } +/** + * Print the buttons relating to course requests. + * + * @param object $systemcontext the system context. + */ +function print_course_request_buttons($systemcontext) { + global $CFG, $DB; + if (empty($CFG->enablecourserequests)) { + return; + } + if (isloggedin() && !isguestuser() && !has_capability('moodle/course:create', $systemcontext)) { + /// Print a button to request a new course + print_single_button('request.php', NULL, get_string('requestcourse'), 'get'); + } + /// Print a button to manage pending requests + if (has_capability('moodle/site:approvecourse', $systemcontext)) { + print_single_button('pending.php', NULL, get_string('coursespending'), 'get', '_self', false, '', !$DB->record_exists('course_request', array())); + } +} + /** * Prints the turn editing on/off button on course/index.php or course/category.php. * diff --git a/course/pending-reject.html b/course/pending-reject.html deleted file mode 100644 index 5f60042d46..0000000000 --- a/course/pending-reject.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
-" /> -" onClick="window.location='pending.php';" /> - -
\ No newline at end of file diff --git a/course/pending.php b/course/pending.php index 15f010fa7d..2f0ef7cdb7 100644 --- a/course/pending.php +++ b/course/pending.php @@ -1,140 +1,215 @@ libdir.'/pagelib.php'); - require_once($CFG->libdir.'/blocklib.php'); - require_once('lib.php'); - require_once($CFG->libdir.'/eventslib.php'); +/////////////////////////////////////////////////////////////////////////// +// // +// NOTICE OF COPYRIGHT // +// // +// Moodle - Modular Object-Oriented Dynamic Learning Environment // +// http://moodle.org // +// // +// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details: // +// // +// http://www.gnu.org/copyleft/gpl.html // +// // +/////////////////////////////////////////////////////////////////////////// - require_login(); +/** + * Allow the administrator to look through a list of course requests and approve or reject them. + * + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + * @package course + *//** */ + + require_once(dirname(__FILE__) . '/../config.php'); + require_once($CFG->libdir . '/pagelib.php'); + require_once($CFG->libdir . '/blocklib.php'); + require_once($CFG->libdir . '/adminlib.php'); + require_once($CFG->dirroot . '/course/lib.php'); + require_once($CFG->dirroot . '/course/request_form.php'); + require_login(); require_capability('moodle/site:approvecourse', get_context_instance(CONTEXT_SYSTEM)); - $approve = optional_param('approve', 0, PARAM_INT); - $reject = optional_param('reject', 0, PARAM_INT); - $rejectnotice = optional_param('rejectnotice', '', PARAM_CLEANHTML); + $approve = optional_param('approve', 0, PARAM_INT); + $reject = optional_param('reject', 0, PARAM_INT); + $baseurl = $CFG->wwwroot . '/course/pending.php'; + admin_externalpage_setup('coursespending'); + +/// Process approval of a course. if (!empty($approve) and confirm_sesskey()) { - if ($course = $DB->get_record("course_request", array("id"=>$approve))) { - - $category = get_course_category($CFG->defaultrequestcategory); - - $course->category = $CFG->defaultrequestcategory; - $course->sortorder = $category->sortorder; // place as the first in category - $course->requested = 1; - unset($course->reason); - unset($course->id); - $teacherid = $course->requester; - unset($course->requester); - if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { - $course->restrictmodules = 1; - } - if ($courseid = $DB->insert_record("course",$course)) { - $page = page_create_object(PAGE_COURSE_VIEW, $courseid); - blocks_repopulate_page($page); // Return value not checked because you can always edit later - $context = get_context_instance(CONTEXT_COURSE, $courseid); - role_assign($CFG->creatornewroleid, $teacherid, 0, $context->id); // assing teacher role - $course->id = $courseid; - if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { // if we're all or requested we're ok. - $allowedmods = explode(',',$CFG->defaultallowedmodules); - update_restricted_mods($course,$allowedmods); - } - $DB->delete_records('course_request', array('id'=>$approve)); - $success = 1; - fix_course_sortorder(); - } - if (!empty($success)) { - $user = $DB->get_record('user', array('id'=>$teacherid)); - $a->name = $course->fullname; - $a->url = $CFG->wwwroot.'/course/view.php?id='.$courseid; - - $eventdata = new object(); - $eventdata->modulename = 'moodle'; - $eventdata->userfrom = $USER; - $eventdata->userto = $user; - $eventdata->subject = get_string('courseapprovedsubject'); - $eventdata->fullmessage = get_string('courseapprovedemail','moodle',$a); - $eventdata->fullmessageformat = FORMAT_PLAIN; - $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; - events_trigger('message_send', $eventdata); - - redirect($CFG->wwwroot.'/course/edit.php?id='.$courseid); - exit; - } - else { - print_error('courseapprovedfailed'); - exit; + /// Load the request. + if (!$course = $DB->get_record('course_request', array('id' => $approve))) { + print_error('unknowncourserequest'); + } + + /// Get the category courses are added to. + $category = get_course_category($CFG->defaultrequestcategory); + + /// Build up a course record based on the request. + $course->category = $category->id; + $course->sortorder = $category->sortorder; // place as the first in category + $course->requested = 1; + unset($course->reason); + unset($course->id); + $teacherid = $course->requester; + unset($course->requester); + if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { + $course->restrictmodules = 1; + } + + /// Insert the record. + if ($courseid = $DB->insert_record("course",$course)) { + $page = page_create_object(PAGE_COURSE_VIEW, $courseid); + blocks_repopulate_page($page); // Return value not checked because you can always edit later + $context = get_context_instance(CONTEXT_COURSE, $courseid); + role_assign($CFG->creatornewroleid, $teacherid, 0, $context->id); // assing teacher role + $course->id = $courseid; + if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { // if we're all or requested we're ok. + $allowedmods = explode(',',$CFG->defaultallowedmodules); + update_restricted_mods($course,$allowedmods); } + $DB->delete_records('course_request', array('id'=>$approve)); + $success = 1; + fix_course_sortorder(); + } + if (!empty($success)) { + $user = $DB->get_record('user', array('id' => $teacherid)); + $a->name = $course->fullname; + $a->url = $CFG->wwwroot.'/course/view.php?id=' . $courseid; + $eventdata = new object(); + $eventdata->modulename = 'moodle'; + $eventdata->component = 'course'; + $eventdata->name = 'courserequestapproved'; + $eventdata->userfrom = $USER; + $eventdata->userto = $user; + $eventdata->subject = get_string('courseapprovedsubject'); + $eventdata->fullmessage = get_string('courseapprovedemail2', 'moodle', $a); + $eventdata->fullmessageformat = FORMAT_PLAIN; + $eventdata->fullmessagehtml = ''; + $eventdata->smallmessage = ''; + events_trigger('message_send', $eventdata); + + redirect($CFG->wwwroot.'/course/edit.php?id=' . $courseid); + } else { + print_error('courseapprovedfailed'); } } - $strtitle = get_string('coursespending'); - $strheading = get_string(((!empty($reject)) ? 'coursereject' : 'coursespending')); +/// Process rejection of a course. + if (!empty($reject)) { + /// Load the request. + if (!$course = $DB->get_record('course_request', array('id' => $reject))) { + print_error('unknowncourserequest'); + } - print_header($strtitle,$strheading,build_navigation(array(array('name'=>$strheading,'link'=>'','type'=>'misc')))); + /// Prepare the form. + $rejectform = new reject_request_form($baseurl); + $default = new stdClass(); + $default->reject = $reject; + $rejectform->set_data($default); - if (!empty($reject) and confirm_sesskey()) { - if ($reject = $DB->get_record("course_request", array("id"=>$reject))) { - if (empty($rejectnotice)) { - // display a form for writing a reason - print_simple_box_start('center'); - print_string('courserejectreason'); - include('pending-reject.html'); - print_simple_box_end(); - } - else { - $user = $DB->get_record("user", array("id"=>$reject->requester)); - - $eventdata = new object(); - $eventdata->modulename = 'moodle'; - $eventdata->userfrom = $USER; - $eventdata->userto = $user; - $eventdata->subject = get_string('courserejectsubject'); - $eventdata->fullmessage = get_string('courserejectemail','moodle',$rejectnotice); - $eventdata->fullmessageformat = FORMAT_PLAIN; - $eventdata->fullmessagehtml = ''; - $eventdata->smallmessage = ''; - events_trigger('message_send', $eventdata); - - $DB->delete_records("course_request", array("id"=>$reject->id)); - notice(get_string('courserejected'),'pending.php'); - } + /// Standard form processing if statement. + if ($rejectform->is_cancelled()){ + redirect($baseurl); + + } else if ($data = $rejectform->get_data()) { + /// Send an email to the requester. + $user = $DB->get_record('user', array('id' => $course->requester)); + $eventdata = new object(); + $eventdata->modulename = 'moodle'; + $eventdata->component = 'course'; + $eventdata->name = 'courserequestrejected'; + $eventdata->userfrom = $USER; + $eventdata->userto = $user; + $eventdata->subject = get_string('courserejectsubject'); + $eventdata->fullmessage = get_string('courserejectemail', 'moodle', $data->rejectnotice); + $eventdata->fullmessageformat = FORMAT_PLAIN; + $eventdata->fullmessagehtml = ''; + $eventdata->smallmessage = ''; + events_trigger('message_send', $eventdata); + + /// Delete the request + $DB->delete_records('course_request', array('id' => $course->id)); + + /// Redirect back to the course listing. + redirect($baseurl, get_string('courserejected')); } - } else if ($pending = $DB->get_records("course_request")) { - // loop through - $table->cellpadding = 4; - $table->cellspacing = 3; - $table->align = array('center','center','center','center','center','center','center'); - $table->head = array(' ',get_string('shortnamecourse'),get_string('fullnamecourse'),get_string('requestedby'),get_string('summary'), - get_string('requestreason'),''); + + /// Display the form for giving a reason for rejecting the request. + admin_externalpage_print_header($rejectform->focus()); + $rejectform->display(); + admin_externalpage_print_footer(); + exit; + } + +/// Print a list of all the pending requests. + admin_externalpage_print_header(); + + $pending = $DB->get_records('course_request'); + if (empty($pending)) { + print_heading(get_string('nopendingcourses')); + } else { + print_heading(get_string('coursespending')); + + /// Build a table of all the requests. + $table->class = 'pendingcourserequests generaltable'; + $table->align = array('center', 'center', 'center', 'center', 'center', 'center', 'center'); + $table->head = array(' ', get_string('shortname'), get_string('fullname'), + get_string('requestedby'), get_string('summary'), get_string('requestreason'), get_string('action')); $strrequireskey = get_string('requireskey'); + + /// Loop over requested courses. foreach ($pending as $course) { $requester = $DB->get_record('user', array('id'=>$course->requester)); - // check here for shortname collisions and warn about them. - if ($match = $DB->get_record("course", array("shortname"=>$course->shortname))) { + $row = array(); + + /// Check here for shortname collisions and warn about them. + if ($DB->record_exists('course', array('shortname' => $course->shortname))) { $course->shortname .= ' [*]'; $collision = 1; } - //do not output raw html from request, quote html entities using s()!! - $table->data[] = array(((!empty($course->password)) ? - ''.$strrequireskey.'' : ''), - format_string($course->shortname),format_string($course->fullname),fullname($requester), - format_string($course->summary),format_string($course->reason), - ''.get_string('approve').' | ' - .''.get_string('reject').''); + + /// Show an enrolment key icon in the first column if applicable. + if (!empty($course->password)) { + $row[] = ''.$strrequireskey.''; + } else { + $row[] = ''; + } + + /// Info in the other columns. + $row[] = format_string($course->shortname); + $row[] = format_string($course->fullname); + $row[] = fullname($requester); + $row[] = format_string($course->summary); + $row[] = format_string($course->reason); + $row[] = print_single_button($baseurl, array('approve' => $course->id, 'sesskey' => sesskey()), get_string('approve'), 'get', '', true) . + print_single_button($baseurl, array('reject' => $course->id), get_string('rejectdots'), 'get', '', true); + + /// Add the row to the table. + $table->data[] = $row; } + + /// Display the table. print_table($table); + + /// Message about name collisions, if necessary. if (!empty($collision)) { print_string('shortnamecollisionwarning'); } - } else { - notice(get_string('nopendingcourses')); - // no pending messages. } -print_footer(); - - +/// Finish off the page. + print_single_button($CFG->wwwroot . '/course/index.php', array(), get_string('backtocourselisting')); + admin_externalpage_print_footer(); ?> diff --git a/course/request.php b/course/request.php index 9c3ead040c..36a706823d 100644 --- a/course/request.php +++ b/course/request.php @@ -1,52 +1,73 @@ dirroot . '/course/request_form.php'); + +/// Where we came from. Used in a number of redirects. + $returnurl = $CFG->wwwroot . '/course/index.php'; + +/// Check permissions. require_login(); - - if (isguest()) { - print_error("noguest"); + if (isguestuser()) { + print_error('guestsarenotallowed', '', $returnurl); } - if (empty($CFG->enablecourserequests)) { - print_error('courserequestdisabled'); + print_error('courserequestdisabled', '', $returnurl); } - $requestform = new course_request_form(); - - $strtitle = get_string('courserequest'); - $navlinks = array(); - $navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc'); - $navigation = build_navigation($navlinks); - - print_header($strtitle, $strtitle, $navigation, $requestform->focus()); - - print_simple_box_start('center'); - print_string('courserequestintro'); - print_simple_box_end(); - +/// Set up the form. + $requestform = new course_request_form($CFG->wwwroot . '/course/request.php'); +/// Standard form processing if statement. if ($requestform->is_cancelled()){ + redirect($returnurl); - redirect($CFG->wwwroot); - - }elseif ($data = $requestform->get_data()) { + } else if ($data = $requestform->get_data()) { + /// Record the request. $data->requester = $USER->id; - - if ($DB->insert_record('course_request', $data)) { - notice(get_string('courserequestsuccess')); - } else { - notice(get_string('courserequestfailed')); + if (!$DB->insert_record('course_request', $data)) { + print_error('errorsavingrequest', '', $returnurl); } - } else { - - $requestform->display(); + /// and redirect back to the course listing. + notice(get_string('courserequestsuccess'), $returnurl); } +/// Show the request form. + $strtitle = get_string('courserequest'); + print_header($strtitle, $strtitle, build_navigation($strtitle), $requestform->focus()); + print_heading($strtitle); + $requestform->display(); print_footer(); -?> +?> \ No newline at end of file diff --git a/course/request_form.php b/course/request_form.php index a7637ac3a1..ad2782576b 100644 --- a/course/request_form.php +++ b/course/request_form.php @@ -1,34 +1,73 @@ libdir.'/formslib.php'); +/** + * A form for a user to request a course. + */ class course_request_form extends moodleform { function definition() { $mform =& $this->_form; - $mform->addElement('text', 'fullname', get_string('fullnamecourse'), 'maxlength="254" size="50"'); + $mform->addElement('header','coursedetails', get_string('courserequestdetails')); + + $mform->addElement('text', 'fullname', get_string('fullname'), 'maxlength="254" size="50"'); + $mform->setHelpButton('fullname', array('coursefullname', get_string('fullname')), true); $mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client'); - $mform->setType('fullname', PARAM_TEXT); + $mform->setType('fullname', PARAM_MULTILANG); - $mform->addElement('text', 'shortname', get_string('shortnamecourse'), 'maxlength="100" size="20"'); + $mform->addElement('text', 'shortname', get_string('shortname'), 'maxlength="100" size="20"'); + $mform->setHelpButton('shortname', array('courseshortname', get_string('shortname')), true); $mform->addRule('shortname', get_string('missingshortname'), 'required', null, 'client'); - $mform->setType('shortname', PARAM_TEXT); + $mform->setType('shortname', PARAM_MULTILANG); $mform->addElement('htmleditor', 'summary', get_string('summary'), array('rows'=>'15', 'cols'=>'50')); - $mform->addRule('summary', get_string('missingsummary'), 'required', null, 'client'); + $mform->setHelpButton('summary', array('text2', get_string('helptext')), true); $mform->setType('summary', PARAM_RAW); - $mform->setHelpButton('summary', array('text2', get_string('helptext'))); + $mform->addElement('passwordunmask', 'password', get_string('enrolmentkey'), 'size="25"'); + $mform->setHelpButton('password', array('enrolmentkey', get_string('enrolmentkey')), true); + $mform->setDefault('password', ''); + $mform->setType('password', PARAM_RAW); - $mform->addElement('textarea', 'reason', get_string('courserequestreason'), array('rows'=>'15', 'cols'=>'50')); + $mform->addElement('header','requestreason', get_string('courserequestreason')); + + $mform->addElement('textarea', 'reason', get_string('courserequestsupport'), array('rows'=>'15', 'cols'=>'50')); $mform->addRule('reason', get_string('missingreqreason'), 'required', null, 'client'); $mform->setType('reason', PARAM_TEXT); - $mform->addElement('text', 'password', get_string('enrolmentkey'), 'size="25"'); - $mform->setType('password', PARAM_RAW); - - - $this->add_action_buttons(); + $this->add_action_buttons(true, get_string('requestcourse')); } function validation($data, $files) { @@ -51,27 +90,42 @@ class course_request_form extends moodleform { } if (!empty($foundcourses)) { - - if (!empty($foundcourses)) { - foreach ($foundcourses as $foundcourse) { - if (isset($foundcourse->requester) && $foundcourse->requester) { - $pending = 1; - $foundcoursenames[] = $foundcourse->fullname.' [*]'; - } else { - $foundcoursenames[] = $foundcourse->fullname; - } + foreach ($foundcourses as $foundcourse) { + if (!empty($foundcourse->requester)) { + $pending = 1; + $foundcoursenames[] = $foundcourse->fullname.' [*]'; + } else { + $foundcoursenames[] = $foundcourse->fullname; } - $foundcoursenamestring = implode(',', $foundcoursenames); + } + $foundcoursenamestring = implode(',', $foundcoursenames); - $errors['shortname'] = get_string('shortnametaken', '', $foundcoursenamestring); - if (!empty($pending)) { - $errors['shortname'] .= get_string('starpending'); - } + $errors['shortname'] = get_string('shortnametaken', '', $foundcoursenamestring); + if (!empty($pending)) { + $errors['shortname'] .= get_string('starpending'); } } return $errors; } +} + +/** + * A form for an administrator to reject a course request. + */ +class reject_request_form extends moodleform { + function definition() { + $mform =& $this->_form; + $mform->addElement('hidden', 'reject', 0); + + $mform->addElement('header','coursedetails', get_string('coursereasonforrejecting')); + + $mform->addElement('textarea', 'rejectnotice', get_string('coursereasonforrejectingemail'), array('rows'=>'15', 'cols'=>'50')); + $mform->addRule('rejectnotice', get_string('missingreqreason'), 'required', null, 'client'); + $mform->setType('rejectnotice', PARAM_TEXT); + + $this->add_action_buttons(true, get_string('reject')); + } } ?> diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 42fa1fe70d..b046643ea1 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -211,6 +211,7 @@ $string['errorcreatingfile'] = 'Error creating file \"$a\"'; $string['errorcreatingrole'] = 'Error creating role'; $string['erroronline'] = 'Error on line $a'; $string['errorreadingfile'] = 'Error reading file \"$a\"'; +$string['errorsavingrequest'] = 'An error occurred when trying to save your request.'; $string['errorunzippingfiles'] = 'Error unzipping files'; $string['errorupdatingcoursevisibility'] = 'Error updating the course visibility'; $string['errorsettinguserpref'] = 'Error setting user preference'; @@ -233,8 +234,9 @@ $string['groupnotaddederror'] = 'Group \"$a\" not added'; $string['groupunknown'] = 'Group $a not associated to specified course'; $string['guestnocomment'] = 'Guests are not allowed to post comments!'; $string['guestnoeditprofile'] = 'The guest user cannot edit their profile'; -$string['guestnorate'] = 'Guests are not allowed to rate entries'; $string['guestnoeditprofileother'] = 'The guest user profile cannot be edited'; +$string['guestnorate'] = 'Guests are not allowed to rate entries'; +$string['guestsarenotallowed'] = 'The guest user is not allowed to do this'; $string['hashpoolproblem'] = 'Incorrect pool file content $a.'; $string['invalidaction'] = 'Invalid action parameter'; $string['invalidactivityid'] = 'Invalid Activity ID'; @@ -418,6 +420,7 @@ $string['unknowcontext'] = 'This is an unknown context ($a) in get_child_context $string['unknowformat'] = 'Format not known ($a)'; $string['unknowncourse'] = 'Unknown course named \"$a\"'; $string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"'; +$string['unknowncourserequest'] = 'Unknown course request'; $string['unknownhelp'] = 'Unknown help topic $a'; $string['unknowngroup'] = 'Unknown group \"$a\"'; $string['unknownrole'] = 'Unknown role \"$a\"'; diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index c5a36578a0..24ddeac9f1 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -137,6 +137,7 @@ $string['availablecourses'] = 'Available Courses'; $string['backtoparticipants'] = 'Back to participants list'; $string['back'] = 'Back'; $string['backto'] = 'Back to $a'; +$string['backtocourselisting'] = 'Back to course listing'; $string['backup'] = 'Backup'; $string['backupactivehelp'] = 'Choose whether or not to do automated backups.'; $string['backupcancelled'] = 'Backup Cancelled'; @@ -304,6 +305,8 @@ $string['coursemessage'] = 'Message course users'; $string['coursenotaccessible'] = 'This course does not allow public access'; $string['courseoverview'] = 'Course overview'; $string['courseoverviewgraph'] = 'Course overview graph'; +$string['coursereasonforrejecting'] = 'Your reasons for rejecting this request'; +$string['coursereasonforrejectingemail'] = 'This will be emailed to the requester'; $string['coursereject'] = 'Reject a course request'; $string['courserejected'] = 'Course has been rejected and the requester has been notified.'; $string['courserejectemail'] = 'Sorry, but the course you requested has been rejected. Here is the reason provided: @@ -313,10 +316,12 @@ $string['courserejectreason'] = 'Outline your reasons for rejecting this course< $string['courserejectsubject'] = 'Your course has been rejected'; $string['coursereports'] = 'Course reports'; $string['courserequest'] = 'Course request'; +$string['courserequestdetails'] = 'Details of the course you are requesting'; $string['courserequestfailed'] = 'For some reason, your course request could not be saved'; $string['courserequestintro'] = 'Use this form to request a course to be created for you.
Try and fill in as much information as you can to allow
the administrators to understand your reasons for wanting this course.'; $string['courserequestreason'] = 'Reasons for wanting this course'; $string['courserequestsuccess'] = 'Successfully saved your course request. Expect an email within a few days with the outcome'; +$string['courserequestsupport'] = 'Supporting information to help the administrator evaluate this request'; $string['courserestore'] = 'Course restore'; $string['courses'] = 'Courses'; $string['coursescategory'] = 'Courses in the same category'; @@ -1206,6 +1211,7 @@ $string['payments'] = 'Payments'; $string['paymentsorry'] = 'Thank you for your payment! Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"$a->fullname\". Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator'; $string['paymentthanks'] = 'Thank you for your payment! You are now enrolled in your course:
\"$a\"'; $string['people'] = 'People'; +$string['pendingrequests'] = 'Pending requests'; $string['periodending'] = 'Period ending ($a)'; $string['personal'] = 'Personal'; $string['personalprofile'] = 'Personal profile'; @@ -1278,6 +1284,7 @@ $string['registrationno'] = 'No, I do not want to receive email'; $string['registrationsend'] = 'Send registration information to moodle.org'; $string['registrationyes'] = 'Yes, please notify me about important issues'; $string['reject'] = 'Reject'; +$string['rejectdots'] = 'Reject...'; $string['reload'] = 'Reload'; $string['remoteappuser'] = 'Remote $a User'; $string['remove'] = 'Remove'; diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index c3fe009c6e..64da00c54c 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2300,7 +2300,21 @@ body#course-info .generalbox.info { #my-index .name { margin-left: 5px; } - +#course-pending .pendingcourserequests { + margin-bottom: 1em; +} +#course-pending .pendingcourserequests .singlebutton { + display: inline; +} +#course-pending .pendingcourserequests .cell { + padding: 0 5px; +} +#course-pending .pendingcourserequests .cell.c6 { + white-space: nowrap; +} +#course-pending .singlebutton { + text-align: center; +} .categorylist { width: 90%; margin-left: auto; -- 2.39.5