Details

This is about what happens when the setting "Display extended course names" setting on Site administration > Appearance > Courses is turned on. Really you should test both with that on, to make sure it works, and with it off, to make sure there are no regressions.

1. Go to a user's profile.

2. Click the Roles > This user's role assignments link in the setting block.

3. Verify that any course names are shown with short-name first (if the admin setting is on).

4. Check index.php, course/index.php and course/category.php, to make sure that course names there are also shown with the short-name first (if the admin setting is on).

This is about what happens when the setting "Display extended course names" setting on Site administration > Appearance > Courses is turned on. Really you should test both with that on, to make sure it works, and with it off, to make sure there are no regressions.
1. Go to a user's profile.
2. Click the Roles > This user's role assignments link in the setting block.
3. Verify that any course names are shown with short-name first (if the admin setting is on).
4. Check index.php, course/index.php and course/category.php, to make sure that course names there are also shown with the short-name first (if the admin setting is on).

Petr Skoda
added a comment - 03/Aug/12 12:52 AM I am not sure the get_course_display_name_for_list() is appropriate here, I would not personally expect it to be used there because context names do not know where they are used - in list or not. +0

I just did a search, the places where get_context_name is called are in admin-y parts of the interface. (There are only 15 instances if you want to check yourself.) They are all places that could probably count as lists of courses.

I think that any Moodle site that turns on $CFG->courselistshortnames would like to have the course shortname in all those places.

Tim Hunt
added a comment - 03/Aug/12 1:14 AM I just did a search, the places where get_context_name is called are in admin-y parts of the interface. (There are only 15 instances if you want to check yourself.) They are all places that could probably count as lists of courses.
I think that any Moodle site that turns on $CFG->courselistshortnames would like to have the course shortname in all those places.

Hmm, why is get_course_display_name_for_list() not using internally a language string instead? The hardcoded concat seems a bit weird to me there. What if somebody wants idnumber there? Or the shortname at the end in square brackets?

Petr Skoda
added a comment - 03/Aug/12 1:22 AM Hmm, why is get_course_display_name_for_list() not using internally a language string instead? The hardcoded concat seems a bit weird to me there. What if somebody wants idnumber there? Or the shortname at the end in square brackets?

I don't know. I just moved the definition of that function to a different file, so I did not have to require_once course/lib.php. If you want to create a separate issue about fixing that function, please do, but please can we not let that confuse the issue here.

Tim Hunt
added a comment - 03/Aug/12 2:33 AM I don't know. I just moved the definition of that function to a different file, so I did not have to require_once course/lib.php. If you want to create a separate issue about fixing that function, please do, but please can we not let that confuse the issue here.

Petr Skoda
added a comment - 03/Aug/12 3:37 PM sorry, but I think that get_course_display_name_for_list() is an ugly hack, I personally do not mind if this gets integrated or not, but I am not going to encourage you.

I have reviewed the new language strings as requested and find that having a language string '{$a->shortname} {$a->fullname}' to be very odd. Surely site config stuff should be controlled by admin settings and not via language customisation, and the use of place holders in language strings should be restricted to language-specific issues?

Helen Foster
added a comment - 03/Aug/12 9:46 PM Hi Tim,
I have reviewed the new language strings as requested and find that having a language string '{$a->shortname} {$a->fullname}' to be very odd. Surely site config stuff should be controlled by admin settings and not via language customisation, and the use of place holders in language strings should be restricted to language-specific issues?
Adding David as a watcher in case he wishes to comment.

Tim Hunt
added a comment - 03/Aug/12 10:39 PM I actually submitted this for integration before seeing Helen's comment. We had a discussion about it: http://moodle.org/local/chatlogs/index.php?conversationid=10742
I still think my patch is the way to go.
(If we were starting from scratch now, I would be inclined to not use an admin setting at all, just use a lang string, but it is too late for that now.)