Moodle

User Profile Fields displayed in list or single view

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_20_STABLE

Description

It would be nice to have a possibility to display some user profile fields in the database in list or single view with ##fieldname##. In the preferences "Admin-Block.>Modules->database->settings the admin could choose which fields are allowed to be displayed in the database module..
It would also be nice to display any other field of the mysql database which is authorized by the admin like "date joined" or date joined course,
But priority would be user profile fields and custom user profile fields.

  1. MDL-20140.patch
    26/Dec/09 10:49 PM
    5 kB
    Anthony Borrow
  2. MDL-20140.patch
    26/Dec/09 12:29 PM
    4 kB
    Anthony Borrow
  3. MDL-20140.patch
    26/Dec/09 4:58 AM
    2 kB
    Anthony Borrow
  4. MDL-20140.patch
    26/Dec/09 4:55 AM
    2 kB
    Anthony Borrow

Issue Links

Activity

Hide
Anthony Borrow added a comment -

Just a quick note that before displaying a user profile field we will need to ensure that that particular user as access to that information. The actual process of getting and putting the data in should not be that difficult. I would like to see the list of possible profile field dynamically generated so that they can be chosen. So there is a bit of a double check that the teacher will be able to see field and then also the user (i.e. student). Peace - Anthony

Show
Anthony Borrow added a comment - Just a quick note that before displaying a user profile field we will need to ensure that that particular user as access to that information. The actual process of getting and putting the data in should not be that difficult. I would like to see the list of possible profile field dynamically generated so that they can be chosen. So there is a bit of a double check that the teacher will be able to see field and then also the user (i.e. student). Peace - Anthony
Hide
Anthony Borrow added a comment -

David - I have started taking a look at this issue and would like to work up a patch. Could you let me know which fields from the mdl_user table you would like to see listed. I will assume all of the custom user profile fields and create option heading for each custom user profile field category. Thanks for your feedback. Peace - Anthony

Show
Anthony Borrow added a comment - David - I have started taking a look at this issue and would like to work up a patch. Could you let me know which fields from the mdl_user table you would like to see listed. I will assume all of the custom user profile fields and create option heading for each custom user profile field category. Thanks for your feedback. Peace - Anthony
Hide
Anthony Borrow added a comment -

David - I am just starting with the /mod/data/templates.php file to auto-generate the list of possible tags from the custom user profile fields. At this point I am not doing anything to exclude hidden fields, etc. I am prepending profile_ to the fieldname to avoid having to make sure that a field is not created whose name would duplicate a field in the mdl_user table. Peace - Anthony

Show
Anthony Borrow added a comment - David - I am just starting with the /mod/data/templates.php file to auto-generate the list of possible tags from the custom user profile fields. At this point I am not doing anything to exclude hidden fields, etc. I am prepending profile_ to the fieldname to avoid having to make sure that a field is not created whose name would duplicate a field in the mdl_user table. Peace - Anthony
Hide
Anthony Borrow added a comment -

updating with profile_ prefix

Show
Anthony Borrow added a comment - updating with profile_ prefix
Hide
Anthony Borrow added a comment -

David - OK, here is quick version that should be minimally functional at adding the list of custom profile fields to the template list and then doing the search and replacement. There is currently no verification that the user viewing the record does in fact have the ability to view the data so we need to add that check in and if they do not then set replacement to ''. In any case, I wanted to get this to you as a proof of concept in case you wanted to start improving upon it. Let me know how I can be of help. I will probably move on to other issues at the moment and give you time to comment back. Peace - Anthony

p.s. I did notice that the custom user profile fields are not being properly stored in the database with respect to certain characters but that is a separate issue.

Show
Anthony Borrow added a comment - David - OK, here is quick version that should be minimally functional at adding the list of custom profile fields to the template list and then doing the search and replacement. There is currently no verification that the user viewing the record does in fact have the ability to view the data so we need to add that check in and if they do not then set replacement to ''. In any case, I wanted to get this to you as a proof of concept in case you wanted to start improving upon it. Let me know how I can be of help. I will probably move on to other issues at the moment and give you time to comment back. Peace - Anthony p.s. I did notice that the custom user profile fields are not being properly stored in the database with respect to certain characters but that is a separate issue.
Hide
Anthony Borrow added a comment -

David - I have added in some basic capability checking for the custom user profile fields. Please give this some thorough testing to see if it seems to do what you want/need and provide feedback on how it can be improved. Peace - Anthony

Show
Anthony Borrow added a comment - David - I have added in some basic capability checking for the custom user profile fields. Please give this some thorough testing to see if it seems to do what you want/need and provide feedback on how it can be improved. Peace - Anthony
Hide
David Bogner added a comment -

Hi Anthony,

I just tested the patch and it works perfectly on my testing server (1.9.5, opensuse). Thank you for this excellent work.
If there is time for further improvements:
As the custom profile fields are part of the users profile, it would make sens not to have an additional category when editing the template, but just let it be part of the "user", the only possibility there is ##user## so some other options would be OK.
There was also a request by another user in the database forum: make it possible to display the profile picture or other parts of the users profile (not only custom user profile fields). This could look like

##profile_picture##
##profile_courses## (courses subscribed to)
##profile_city##
##profile_country##
etc.

So thanks again and keep up the excellent work.
David

Show
David Bogner added a comment - Hi Anthony, I just tested the patch and it works perfectly on my testing server (1.9.5, opensuse). Thank you for this excellent work. If there is time for further improvements: As the custom profile fields are part of the users profile, it would make sens not to have an additional category when editing the template, but just let it be part of the "user", the only possibility there is ##user## so some other options would be OK. There was also a request by another user in the database forum: make it possible to display the profile picture or other parts of the users profile (not only custom user profile fields). This could look like ##profile_picture## ##profile_courses## (courses subscribed to) ##profile_city## ##profile_country## etc. So thanks again and keep up the excellent work. David
Hide
David Bogner added a comment -

Hi Anthony,

I forgot to answer your questions about the most wanted profile fields to be displayed. This will be

profile picture
profile city
profile country
profile language
and eventually:
profile firstname
profile lastname

Yours,
David

Show
David Bogner added a comment - Hi Anthony, I forgot to answer your questions about the most wanted profile fields to be displayed. This will be profile picture profile city profile country profile language and eventually: profile firstname profile lastname Yours, David
Hide
Anthony Borrow added a comment -

David - I'm going to let this get handled by Moodle.com (just because I'm behind on a number of other issues). Hopefully we can get it so that the database activity module is better able to handle all of the user profile fields including the custom user profile fields. Peace - Anthony

Show
Anthony Borrow added a comment - David - I'm going to let this get handled by Moodle.com (just because I'm behind on a number of other issues). Hopefully we can get it so that the database activity module is better able to handle all of the user profile fields including the custom user profile fields. Peace - Anthony
Hide
David Bogner added a comment -

Hi Anthony, OK that is perfect.

Show
David Bogner added a comment - Hi Anthony, OK that is perfect.

People

Vote (8)
Watch (3)

Dates

  • Created:
    Updated: