+++ /dev/null
-<?php
-// make sure all variables are defined
-if (empty($form->shortname)) {
- $form->shortname = '';
-}
-if (empty($form->fullname)) {
- $form->fullname = '';
-}
-if (empty($form->summary)) {
- $form->summary = '';
-}
-if (empty($form->reason)) {
- $form->reason = '';
-}
-if (empty($usehtmleditor)) {
- $usehtmleditor = 0;
-}
-if (empty($form->password)) {
- $form->password = '';
-}
-?>
-<form method="post" action="request.php" name="request">
-<table cellpadding="9" cellspacing="0" >
-<tr valign="top">
- <td align="right"><?php print_string("fullname") ?>:</td>
- <td><input type="text" name="fullname" maxlength="254" size="50" value="<?php p($form->fullname) ?>" alt="<?php print_string("fullname") ?>" />
- <?php helpbutton("coursefullname", get_string("fullname")) ?>
- <?php if (isset($err["fullname"])) formerr($err["fullname"]); ?>
- </td>
-</tr>
-<tr valign="top">
- <td align="right"><?php print_string("shortname") ?>:</td>
- <td><input type="text" name="shortname" maxlength="15" size="10" value="<?php p($form->shortname) ?>" alt="<?php print_string("shortname") ?>" />
- <?php helpbutton("courseshortname", get_string("shortname")) ?>
- <?php if (isset($err["shortname"])) formerr($err["shortname"]); ?>
- </td>
-</tr>
-<tr valign="top">
- <td align="right"><?php print_string("summary") ?>:</td>
- <td><?php
- print_textarea($usehtmleditor, 10, 50, 660, 200, "summary", $form->summary);
- helpbutton("text", get_string("helptext"));
- if (isset($err["summary"])) formerr($err["summary"]);
- ?>
- </td>
-</tr>
-<tr valign="top">
- <td align="right"><?php print_string("courserequestreason") ?>:</td>
- <td><?php
- print_textarea($usehtmleditor, 10, 50, 660, 200, "reason", $form->reason);
- helpbutton("text", get_string("helptext"));
- if (isset($err["reason"])) formerr($err["reason"]);
- ?>
- </td>
-</tr>
-<tr valign="top">
- <td align="right"><?php print_string("enrolmentkey") ?>:</td>
- <td><input type="text" name="password" size="25" value="<?php p($form->password) ?>" alt="<?php print_string("enrolmentkey") ?>" />
- <?php helpbutton("enrolmentkey", get_string("enrolmentkey")) ?>
- <?php if (isset($err["password"])) formerr($err["password"]); ?>
- </td>
-</tr>
-<tr>
- <td></td>
- <td><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
-</tr>
-</table>
-<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
-</form>
\ No newline at end of file
<?php // $Id$
-
+
/// this allows a student to request a course be created for them.
require_once('../config.php');
include_once $CFG->libdir.'/formslib.php';
-
+
require_login();
-
- require_once('request_form.php');
+
+ require_once('request_form.php');
if (isguest()) {
error("No guests here!");
if (empty($CFG->enablecourserequests)) {
error(get_string('courserequestdisabled'));
}
-
+
$strtitle = get_string('courserequest');
print_header($strtitle,$strtitle,$strtitle);
print_simple_box_start("center");
- print_string('courserequestintro');
+ print_string('courserequestintro');
print_simple_box_end();
-
+
$requestform = new course_request_form('request.php');
-
- if (($data = $requestform->data_submitted())) {
-
+
+ if (($data = $requestform->data_submitted())) {
+
$data->requester = $USER->id;
if (insert_record('course_request',$data)) {
notice(get_string('courserequestsuccess'));
- }
- else {
+ } else {
notice(get_string('courserequestfailed'));
}
print_footer();
exit;
-
-
- }
-
-
+
+
+ }
+
+
$requestform->display();
print_footer();
-
+
exit;
$mform->addRule('shortname',get_string('missingfullname'),'required', null, 'client');
$mform->setType('shortname', PARAM_TEXT);
- $mform->addElement('textarea','summary',get_string("summary"),array('rows'=>'15','cols'=>'50'));
+ $mform->addElement('htmleditor','summary',get_string("summary"),array('rows'=>'15','cols'=>'50'));
$mform->addRule('summary',get_string('missingsummary'),'required', null, 'client');
$mform->setType('summary', PARAM_TEXT);
$mform->addElement('text','password',get_string("enrolmentkey"),'size="25"');
$mform->setType('password', PARAM_RAW);
-
+
$mform->addElement('submit','',get_string("savechanges"));
}
}
if (!empty($foundcourses)) {
-
+
if (!empty($foundcourses)) {
foreach ($foundcourses as $foundcourse) {
if (isset($foundcourse->requester) && $foundcourse->requester) {
$pending = 1;
$foundcoursenames[] = $foundcourse->fullname.' [*]';
- }
- else {
+ } else {
$foundcoursenames[] = $foundcourse->fullname;
}
}