How can I show ID Number in the user profile form?

How can I show ID Number in the user profile form?

by Luca Nesti -
Number of replies: 17
Hi everyone!

I am using Moodle 1.9.2+ (Build: 20080917).
ID Number is an advanced optional that it's possible to view in user edit profile form and I prefer set up this field as locked within Manual Accounts, so that the students cannot modify it.
However it would be easier to find it in the user profile form (you can see the image), but I don't know as it is possible to make it.
Any suggestions? Thanks!!

Attachment matricola.jpg
Average of ratings: -
In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Luca - If you want, the following patch should help you out with 1.9. You want to edit the /user/view.php file to show the ID number if it exists. I'm attaching a diff file. Peace - Anthony
In reply to Anthony Borrow

Re: How can I show ID Number in the user profile form?

by Luca Nesti -
Yours patch works very well, now the ID Number is shown like field in the user profile form grande sorriso
Thanks very much Anthony ammiccante

In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Luca - I am glad to hear that the patch worked for you. Thanks for reporting back. Happy Moodling! Anthony
In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by Luis de Vasconcelos -
Luca,

Just remember one thing: if/when you upgrade Moodle in the future you will need to re-apply the patch each time you upgrade.
In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by محمد العثيمين -
Dear please tell me how to do uploading the patch so I can veiw the user id in the normal user profile please
In reply to Anthony Borrow

Re: How can I show ID Number in the user profile form?

by Jamie Tinley -

Thanks Anthony,

You are all over the place!  I needed this too!  I'm narrowing in on tables. . .

In reply to Jamie Tinley

Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Jamie - Excellent, glad to hear it was helpful. Let me know if there is anything I can to help you out. Peace - Anthony
In reply to Anthony Borrow

Re: How can I show ID Number in the user profile form?

by Deleted user -
Anthony: I posted a question in the General forum which I think is related, and after finding this thread I'm wondering if you can help point me to the correct files. Here is the thread:
http://moodle.org/mod/forum/discuss.php?d=109667

Thanks
In reply to Deleted user

Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Jeff - Sorry for the delayed response, but I wanted to check and see if you were able to get everything resolved. If not, just let me know. I looked quickly at the other post but was not sure exactly what you were looking for if you had the answers you need so rather than trying to sort it out I figured I would just ask if things were working as you need them. Peace - Anthony
In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by R. Gusmão -
Hi there,

Can anyone explain me where do I have to put this patch, is it inside the user.view? and in what line do I have to put him?.


Thanks
In reply to Luca Nesti

Re: How can I show ID Number in the user profile form?

by R. Gusmão -
Sorry I understood now shy
In reply to R. Gusmão

إعادة: Re: How can I show ID Number in the user profile form?

by zuheir khlaif -

Where can I put  the patch in view.php ?

In reply to zuheir khlaif

Re: إعادة: Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
You should read Development:How_to_apply_a_patch. Essentially you want to modify the the /user/view.php file so that you add in the lines with a plus sign (+) in front of them. You may want to upgrade to the latest version of Moodle 1.9 first. Peace - Anthony
In reply to Anthony Borrow

إعادة: Re: إعادة: Re: How can I show ID Number in the user profile form?

by zuheir khlaif -

Thank you

I modify view.php file but when I click on user profile new page appear :-

I attach view.php file

pagerror.gif

لا يمكن عرض الصفحة

The Page cannot be found

توجد مشكلة بالصفحة التي تحاول الوصول إليها ولا يمكن عرضها.

الرجاء محاولة ما يلي:


HTTP 500 - خطأ داخلي في الملقم

In reply to zuheir khlaif

Re: إعادة: Re: إعادة: Re: How can I show ID Number in the user profile form?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
It looks like you have misunderstood how patch files work. It is not simply a matter of copying the patch file into the existing file. The patch file provides details of what to add and remove to an existing file. Essentially it says, go to around line 355 and add four lines between the existing text. The plus signs do not actually get added. Peace - Anthony

p.s. - I am attaching an updated diff file since the firstaccess field was added some folks may have had trouble trying to apply the old patch.
In reply to Luca Nesti

回复: How can I show ID Number in the user profile form?

by hua peng -
http://docs.moodle.org/en/user/profile/index#Common_Settings

moodle 1.8

Who is this field visible to?
Each custom field can be given one of three visibility settings:
  • Visible to everyone
  • Not visible
  • Visible to user
The Not visible setting would typically be set by an administrator who wants to hold private data on the users. The Visible to user setting would normally be selected for a field that holds sensitive information, while the Visible to everyone setting can be used for any type of information.

----to set this field not visible to user,so the student will could not modify the id number