From 4e15f4b9df0adf9d830236733fedc7e1937af3ac Mon Sep 17 00:00:00 2001 From: ethem Date: Thu, 16 Nov 2006 14:44:44 +0000 Subject: [PATCH] FIX: MDL-7561 Allow to be chosen the other payment method if avaiable. Now, new quick enrol form is ready for usage :) --- enrol/authorize/enrol_form.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/enrol/authorize/enrol_form.php b/enrol/authorize/enrol_form.php index 007c57bbd1..5ca0444255 100755 --- a/enrol/authorize/enrol_form.php +++ b/enrol/authorize/enrol_form.php @@ -19,6 +19,7 @@ class authorize_enrol_form extends moodleform $renderer =& $mform->defaultRenderer(); $mform->addElement('header', '', '  ' . get_string('paymentrequired'), ''); + $mform->addElement('static', '', '
' . other_method($paymentmethod) . '  
', ''); $mform->addElement('hidden', 'id', $course->id); $mform->setType('id', PARAM_INT); @@ -29,8 +30,8 @@ class authorize_enrol_form extends moodleform $firstlastnamestr = (AN_METHOD_CC == $paymentmethod) ? get_string('nameoncard', 'enrol_authorize') : get_string('echeckfirslasttname', 'enrol_authorize'); $firstlastnamegrp = array(); - $firstlastnamegrp[] = &MoodleQuickForm::createElement('text', 'firstname', '', 'size="10"'); - $firstlastnamegrp[] = &MoodleQuickForm::createElement('text', 'lastname', '', 'size="10"'); + $firstlastnamegrp[] = &MoodleQuickForm::createElement('text', 'firstname', '', 'size="8"'); + $firstlastnamegrp[] = &MoodleQuickForm::createElement('text', 'lastname', '', 'size="8"'); $mform->addGroup($firstlastnamegrp, 'firstlastgrp', $firstlastnamestr, ' ', false); $firstlastnamegrprules = array(); $firstlastnamegrprules['firstname'][] = array(get_string('missingfirstname'), 'required', null, 'client'); @@ -43,7 +44,7 @@ class authorize_enrol_form extends moodleform if (AN_METHOD_CC == $paymentmethod) { - $mform->addElement('text', 'cc', get_string('ccno', 'enrol_authorize'), 'size="16"'); + $mform->addElement('text', 'cc', get_string('ccno', 'enrol_authorize'), 'size="20"'); $mform->setType('cc', PARAM_ALPHANUM); $mform->setDefault('cc', ''); $mform->addRule('cc', get_string('missingcc', 'enrol_authorize'), 'required', null, 'client'); @@ -102,15 +103,16 @@ class authorize_enrol_form extends moodleform if (!empty($CFG->an_avs)) { $mform->addElement('header', '', '  ' . get_string('address'), ''); - $mform->addElement('text', 'ccaddress', get_string('address'), 'size="20"'); + $mform->addElement('text', 'ccaddress', get_string('address'), 'size="30"'); $mform->setType('ccaddress', PARAM_ALPHANUM); $mform->setDefault('ccaddress', $USER->address); $mform->addRule('ccaddress', get_string('missingaddress', 'enrol_authorize'), 'required', null, 'client'); $citystategrp = array(); - $citystategrp[] = &MoodleQuickForm::createElement('text', 'cccity', '', 'size="10"'); - $citystategrp[] = &MoodleQuickForm::createElement('text', 'ccstate', '', 'size="10"'); - $mform->addGroup($citystategrp, 'citystategrp', get_string('city') . ' / ' . get_string('state'), ' ', false); + $citystategrp[] = &MoodleQuickForm::createElement('text', 'cccity', '', 'size="14"'); + $citystategrp[] = &MoodleQuickForm::createElement('static', 'sep', null, ' - '); + $citystategrp[] = &MoodleQuickForm::createElement('text', 'ccstate', '', 'size="8"'); + $mform->addGroup($citystategrp, 'citystategrp', get_string('city') . ' - ' . get_string('state'), ' ', false); $citystategrprules = array(); $citystategrprules['cccity'][] = array(get_string('missingcity'), 'required', null, 'client'); $mform->addGroupRule('citystategrp', $citystategrprules); @@ -216,7 +218,7 @@ class authorize_enrol_form extends moodleform } -function print_other_method($currentmethod) +function other_method($currentmethod) { global $course; @@ -233,7 +235,10 @@ function print_other_method($currentmethod) if ($otheravailable) { $a = new stdClass; $a->url = $url; - print_string($stringtofetch, "enrol_authorize", $a); + return get_string($stringtofetch, "enrol_authorize", $a); + } + else { + return ''; } } ?> -- 2.39.5