That is a really useful, practical enhancement, Gustav. Way to go!
I have submitted it to 1.4dev. Someone should probably go over my code and clean it up. I had to use some explicit SQL involving UNION and I am sure I have done it in the least elegant way possible .
Note that the editing page is not groups-aware. I think it shouldn't but I am happy to be corrected.
If you can't work on this I may have to leave it out of 1.4. I'm trying to get a beta out and time is short.
Sorry, I wasn't clear in my previous post. All I meant was that the new subscription editing feature is not and does not have to be group-aware. It is only available to editing teachers anyways. I have not changed the old interface at all except for adding a "Turn editing on" button that is shown only to editing teachers.
I'll be happy to work to improve the feature, just let me know what is missing.
It's very wierd because the old interface already allowed unsubcribing one user, all users or a group of users, plus subscribing of all users or a group of users. Which is quite a lot of editing already before "editing" gets turned on. Two interfaces to do the same thing is not a good idea ...
I would be happier if the new two-pane selection interface was just to replace the existing list of subscribers in the current group or course context. You should be able to reuse the selection code from the old interface I would think .. Basically it would be in 'editing mode' all the time.
Also, there needs to be a way to access the user profile (currently the image is a link but that will be gone ... we probably need something like the groups interface has). The reason is that I often do this process with the current interface:
- encounter lots of forum mail bounces from someone who has a full mailbox or dead mail account
- click on the forum link in one of these posts
- click on edit subscribers
- find their email address in the list ... note the sorting by email address ... note also that often I have no idea what their name is until this point, because it may not be mentioned in the bounces
- click their picture
- disable their email address for the whole site
I know I could use the users list and have searched for their email there but this is click click, done, done, on to the next one.
One thing I really like about Moodle is that it always shows me the user pictures everywhere. So I really like the current subscribers list and wouldn't want to see it go entirely. How about a compromise: I could make the editing page groups-aware and move the buttons for subscribing or unsubscribing all users from the viewing page to the editing page or even get rid of them alltogether. I could also remove the "Unsubscribe" links from the subscribers list.
I really like this Moodle idea of having two versions of a page, one for nice viewing and one for powerful editing. After all the groups pages do it the same way. Are you really sure that I have to get rid of the current subscribers list? Or would you be happy with a version of the above compromise?
I am very happy with this solution . It is in CVS.
Some remaining issues:
- The potential list is always empty for me here on moodle.org, when I'm in a non-grouped forum or looking at "all participants". It works well when looking at groups.
- You can't use UNION at all, it's MySQL 4 only.
- All the SQL code in that file has got to be put in a function in the mod/forum/lib.php file instead.
If you get empty lists for non-grouped forums then it must be to do with my use of UNION. It works fine on my machine. I didn't know UNION wasn't standard SQL. Where can I find the definition of standard SQL?