next up previous contents
Next: index.php 程式修改 Up: 用戶 Previous: edit_form.php 課程編輯   Contents

editlib.php 程式修改

  1. 移除個人資料城市「city」為必要資料的設定。
    [root@moodle html]# diff -urNwbBE moodle/user/editlib.php moodle23/user/editlib.php
    --- moodle/user/editlib.php	2012-06-26 01:15:38.000000000 +0800
    +++ moodle23/user/editlib.php	2013-11-19 21:17:40.000000000 +0800
    @@ -225,18 +225,18 @@
     
         $mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"');
         $mform->setType('city', PARAM_MULTILANG);
    -    $mform->addRule('city', $strrequired, 'required', null, 'client');
    -    if (!empty($CFG->defaultcity)) {
    -        $mform->setDefault('city', $CFG->defaultcity);
    -    }
    
  2. 移除個人資料國家「country」為必要資料的設定。
         $choices = get_string_manager()->get_list_of_countries();
         $choices= array(''=>get_string('selectacountry').'...') + $choices;
         $mform->addElement('select', 'country', get_string('selectacountry'), $choices);
    -    $mform->addRule('country', $strrequired, 'required', null, 'client');
    -    if (!empty($CFG->country)) {
    -        $mform->setDefault('country', $CFG->country);
    -    }
     
         $choices = get_list_of_timezones();
         $choices['99'] = get_string('serverlocaltime');
    
  3. 增加個人資料系別「department」為必要資料的設定,事實上系統匯入時已加入用戶的系所。
    @@ -321,6 +321,10 @@
     
         $mform->addElement('text', 'department', get_string('department'), 'maxlength="30" size="25"');
         $mform->setType('department', PARAM_MULTILANG);
    +    $mform->addRule('department', $strrequired, 'required', null, 'client'); //dywang
    +    if (!empty($CFG->department)) {
    +        $mform->setDefault('department', $CFG->defaultdepartment);
    +    }
     
         $mform->addElement('text', 'phone1', get_string('phone'), 'maxlength="20" size="25"');
         $mform->setType('phone1', PARAM_NOTAGS);
    



2018-08-14