新しいユーザーを追加するの項目位置について

新しいユーザーを追加するの項目位置について

- 山田 太郎 の投稿
返信数: 2

こんにちは。

3.10.1+(ビルド:20210130)、fordsonテーマを使用しています。

新しいユーザー登録をする際のフォームですが、

メールアドレス公開とMoodleNetプロファイルの間に任意にあるIDナンバー、所属組織、部署を表示することは可能でしょうか。

もし、可能であれば方法を教えて頂ければ幸いです。

https://moodle.org/mod/forum/discuss.php?d=225225

上記を参考にedit.php等を見てみたのですが、わかりませんでした。

よろしくお願い致します。

添付 無題.png
山田 太郎 への返信

Re: 新しいユーザーを追加するの項目位置について

- Mitsuhiro Yoshida の投稿
画像 Developers 画像 Particularly helpful Moodlers 画像 Translators

以下のプログラム修正ではいかがでしょうか。

修正対象プログラム:
user/editlib.php

修正箇所:
302行目

[ 修正前 ]
    $choices = array();
    $choices['0'] = get_string('emaildisplayno');
    $choices['1'] = get_string('emaildisplayyes');
    $choices['2'] = get_string('emaildisplaycourse');
    $mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
    $mform->setDefault('maildisplay', core_user::get_property_default('maildisplay'));
    $mform->addHelpButton('maildisplay', 'emaildisplay');

    $mform->addElement('text', 'moodlenetprofile', get_string('moodlenetprofile', 'user'));
    $mform->setType('moodlenetprofile', PARAM_NOTAGS);
    $mform->addHelpButton('moodlenetprofile', 'moodlenetprofile', 'user');

[ 修正後 ]
    $choices = array();
    $choices['0'] = get_string('emaildisplayno');
    $choices['1'] = get_string('emaildisplayyes');
    $choices['2'] = get_string('emaildisplaycourse');
    $mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
    $mform->setDefault('maildisplay', core_user::get_property_default('maildisplay'));
    $mform->addHelpButton('maildisplay', 'emaildisplay');

    $mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
    $mform->setType('idnumber', core_user::get_property_type('idnumber'));

    $mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
    $mform->setType('institution', core_user::get_property_type('institution'));

    $mform->addElement('text', 'department', get_string('department'), 'maxlength="255" size="25"');
    $mform->setType('department', core_user::get_property_type('department'));

    $mform->addElement('text', 'moodlenetprofile', get_string('moodlenetprofile', 'user'));
    $mform->setType('moodlenetprofile', PARAM_NOTAGS);
    $mform->addHelpButton('moodlenetprofile', 'moodlenetprofile', 'user');

    $mform->addElement('text', 'moodlenetprofile', get_string('moodlenetprofile', 'user'));
    $mform->setType('moodlenetprofile', PARAM_NOTAGS);
    $mform->addHelpButton('moodlenetprofile', 'moodlenetprofile', 'user');

--------------

修正箇所:
420行目

[ 修正前 ]
    $mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
    $mform->setType('idnumber', core_user::get_property_type('idnumber'));

    $mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
    $mform->setType('institution', core_user::get_property_type('institution'));

    $mform->addElement('text', 'department', get_string('department'), 'maxlength="255" size="25"');
    $mform->setType('department', core_user::get_property_type('department'));

[ 修正後 ]
//    $mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
//    $mform->setType('idnumber', core_user::get_property_type('idnumber'));

//    $mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
//    $mform->setType('institution', core_user::get_property_type('institution'));

//    $mform->addElement('text', 'department', get_string('department'), 'maxlength="255" size="25"');
//    $mform->setType('department', core_user::get_property_type('department'));
Mitsuhiro Yoshida への返信

Re: 新しいユーザーを追加するの項目位置について

- 山田 太郎 の投稿
Mitsuhiro Yoshida 様

ご回答をありがとうございました。
修正ができました。
いつもありがとうございます。
深く感謝申し上げます。