I'm working on an Intranet Web site and I would like to make my users receive notification of new content. I've got several categories of content and several groups of users.
I would like that the admin (maybe another role too) can subscribe users to taxonomy notification.
This way, I'm sure that my users will receive notification as I didn't granted them the right to manage their subscriptions.
Then, I like the report to see number of subscribers by taxonomy/node, but can I get a report viewing this details ? This way I can unsubscribe a user using admin screen without doing in with SQL.
What do you think of these features ? Do you plan to add them in yours future developement ?
If not, I'm thinking of making a patch for this.
Regards.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | subscriptions_1.patch | 15.31 KB | tostinni |
Comments
Comment #1
TDobes commentedI believe administration of user subscriptions is a planned feature, but I don't think anyone has had a chance to work on it yet. Feel free to send in a patch to implement these features.
Comment #2
tostinni commentedHi Tom,
Sorry for the long time no see, I'm not sure you received my mail last week, but I finally started to work on user subscriptions through administration.
Here are the descriptions of what does my patch :
- put a little more help (still a lot of work to do about making it clearer)
- add an administer subscriptions to allow some roles to subscribe others roles. It's a functionality, that I would need, because with the power of taxonomy acces, I would be able to give to some users create/edit node in some vocabulary and also give them the power to subscribe users to receive modifications.
- there's a lack of Doxygen comment, it's still pending
-
subscriptions_mailvarsis changed and split with a new one :_subscriptions_mailvars. For taxa subscriptions, it looks if a role is subscribed and sent mail to all users who accept it (see later on user management).-
subscriptions_menuis modified to take care of new user access rules and new functions.-
subscriptions_get_taxa_countis changed to count roles subscriptions-
subscriptions_pagewas split to addsubscriptions_adminto manage admin task.Admin task are :
+ subscribe roles to categories
+ manage exceptions (default, refuse, subscribe)
Boths task are for the moment limited to category, but I would extend this to blog & node.
- user management : in the admin of subscriptions, you can see the idea, dealing with exceptions : I mean a user can manage categories in 3 states :
+ default : if a role he belongs to will be subscribed he will receive notifications.
+ refuse : he would never get subscriptions for this category
+ accept : he would always get notifications even if his roles aren't subscribed anymore.
This should also apply for individual subscriptions management "my subscriptions", but it's a pending state, but patch will be very easy too do.
So this patch is basically a first draft, there is still problems that I have to work around: better help, better coding (I don't like the way I handle role subscriptions and exceptions. It would be so easy with a single query (look in
subscriptions_mailvars) but, withoutUNIONclause, I don't see how to make it.Etc...
I hope it would help you, and if anyone has any suggestion to make, feel free.
Of course I add to add a DB modifications :
Comment #3
TDobes commentedHi and thanks for your work. I'm somewhat lacking in time to do a full and complete review/test, but I did read through the patch and here are a few things I noticed:
* You remove "maintain subscriptions" in the _perm hook but still reference it in the _menu hook. I think you meant to have both a "maintain subscriptions" and "administer subscriptions" item in there.
* The text presented through the _help hook need a bit of work in making it more simplified and user-friendly. (you mentioned this already) I might be able to work on this eventually if necessary.
* You seem to remove the "return $strsent" line from the end of _subscriptions_mailvars... is this right?
* The fact that we have a _subscriptions_mailvars() and subscriptions_mailvars() is confusing. Feel free to rename the functions.
* db_queryd -> db_query
* Does IFNULL() work in postgresql?
* I like the idea of splitting apart subscriptions_page. That's been on my ToDo list for a while.
I know that this is a first draft and I'm sorry I can't really look more deeply into the functionality by applying and testing the patch. I just began a very busy week-and-a-half at work, so I hope to look into this more thoroughally when I have a bit more free time later this month. In the meantime, if anyone else is interested and has an opportunity to try this patch out and/or do a more thorough code review, please do so and report back here.
Comment #4
tostinni commentedI would let this as it is for the moment, as I would start using it for my intranet, just a few thoughts :
- I didnt, the patch don't put a "-" in front of "maintain subscriptions"
- If you can improve help, it should be fine, I made it a little fast and it's not very clear.
- It's also a confusion from patch, but it's still there.
- I will.
- That's a debugging bug, thanks for the catch.
- I thought it would work :(, well we can change by
COALESCEBtw, there's still a lot a things missing :
- let user manage its subscriptions the same way as admin does (subscribe/default/refuse), but that will led me to the problem of how would it be handled in the hook_links ?
- let blog and thread be managed by admin (option) ... Problem : how do we deals with this ? Basically, threads and blogs appear in admin page only if there's one subscriber. So if nobody subscribed, admin can't subscribed people. So is it a needed issue to subscribe role to thread or not ? I would say no, but it worth ask the question.
If yes, how do we display all node/blog...
- how manage be lists of users ? In my test site, I only add very few user, so when I go to admin/subscriptions and would like to change a category exceptions (adding or leaving inidivual subscribers), I only get a few line... If there's thousand of users, it would lead to get a huge page... not a god UI I guess.
So, I was thinking in put like 10 lines of input text to capture username, and at the side, there would have the same item select box (subscribe/refuse/default) to change current username subscriptions exception. The little problem, is that it could be a little difficult to display the current status if there already have a special one. But maybe we can do the trick with some special javascript option list ( ) but it's not my favourite option... Maybe display the user with not a default status, and the provide the list downside. For such list, I was aslo thinking about some AJAX trick to get the user list (see : AJAX form_autocomplete() field).
Well a lot of thoughts, I hope we could resolve this, and I'm waiting to code some ideas if anyone leave some more comments.
Comment #5
tostinni commentedups, my post was shortened :(
Ok so :
So, I was thinking in put like 10 lines of input text to capture username, and at the side, there would have the same item select box (subscribe/refuse/default) to change current username subscriptions exception. The little problem, is that it could be a little difficult to display the current status if there already have a special one. But maybe we can do the trick with some special javascript option list (Dynamic Option List) but I'm not sure it's so Drupal friendly...
Another way, should be to display only users with a special status (subscribe/refuse) and then the fields for modifying other users. Also providing an AJAX trick to help selecting users, should help (see : AJAX form_autocomplete() field).
Well, that's a lot of thoughts, if anyone has some more comment, feel free.
I'm waiting a little, and should retake this patch later.
Comment #6
salvisClosing ancient issue -- please help testing 5.x-2.0-beta...