As described in #802182: Case Tracker Notifications this is a special issue to review the integration of casetracker with notifications.

At this moment this patch works with Notifications 4.x (I didn't test it with 2.x).

It provides an auto subscribe function to subscribe users assigned to tickets. They can choose if they want to be automatically subscribed to their assigned cases, as well as administrators can define this by default in admin/settings/casetracker.

In order avoid rewrite code, to get notifications of a thread, users should install Notifications Auto Subscribe (as this patch suggest), and configure it to auto subscribe to Posts Created by author, and Subscribe to threads where users commented.

Here is the initial patch, comments are welcome.

Comments

zeezhao’s picture

Thanks. Will try this out.

[edit]
Hi - tried it out. It sets up the notification but email does not always seem to go out on update, even though I can see setup in notifications module via admin/messaging/subscriptions. So not sure if an issue with notifications module... I am using lates 4.x dev.

[edit2]
resolved. Issue was due to permissions I have on content types in my test database. Emails were not getting sent to users who did not view rights granted. So looks great now.

zeezhao’s picture

@dagmar - by the way, have you come across a situation where duplicate emails get sent? I am trying to track this down but want to make sure its not a bug related to something else I am doing. Thanks

dagmar’s picture

Mmm, probably you have an issue with your configuration of notifications. Check if users are only subscribed to 'threads'. If users are subscribed to Content Types, Authors, and Threads, I'm afraid that will receive multiple emails. But I don't really sure if this is how it works...

Ask in the notifications issue queue for this kind of troubles.

zeezhao’s picture

Thanks for your reply. Also asked notifications issue queue.

Looking at admin/messaging/subscriptions , users only have one entry for each node though... I think notifications makes sure no duplicates.

But see this related thread: http://drupal.org/node/722432
[about another module calling node_save() twice and hence causing double emails]

jose reyero’s picture

Status: Needs review » Needs work

Hi, I'm taking a look at this patch and it looks pretty good. However I'd like to take a cleaner / more flexible approach to this. Some ideas:

- Create a 'casetracker' subscription type, with a checkbox on the user account like 'Subscribe to all issues assigned to me'. We could have everything with a single subscription.

- Maybe create a 'master switch' so this 'subscribe to my issues' can be enforced by the admin, site wide, I think it can make sense for some user stories.

- The autosubscribe option would make more sense IMHO for user commenting on a case. The question, will the generic 'autosubscribe' feature work for this, or will we need a new option / to improve the existing one.

So depending on feedback, I'll be working on improving this patch.

jmiccolis’s picture

I'm most interested in the "'casetracker' subscription type" option above. I'm don't feel to strongly either way about a 'master switch', personally I don't think I'd use it.

I'd be interested to hear if the autosubscribe option would behave any differently than the subscription option. In my view they'd both be exactly the same, except the autosubscribe method creates a much larger number of subscriptions.

Mojah’s picture

Yes to the 'master override switch' to enforce subscriptions by admin. We're using the patch for a support desk based on casetracker and the 'master override switch' is a must in this use case.

jose reyero’s picture

Status: Needs work » Needs review
StatusFileSize
new4.2 KB

Done a first module, nothing to do with the previous patch. It adds two subscription types that will show up (when enabled) on the Project node:

- Subscribe to cases assigned to me (this is a common subscription for all projects)
- Subscribe to cases for this project (this is a different subscription per project).

A bit rough yet, we need to take care of autocomplete values for fields, maybe some more specific UI bits, etc, but it is a starting point.

Though having a bit rough UI, the module is simple and clean enough (it just implements some 'notifications' hooks), if you want to commit this we can build more easily on it.

Note: All this is compatible with all the other content subscriptions options so you will possibly want to disable regular content subscriptions for projects and cases so the UI is not too crowed.

dagmar’s picture

I reviewed the patch from #8.

There was missing some things like the hook_perm() implementation.

Ok, I agree with Jose, still is missing the UI to manage subscriptions for casetracker, but for me this is ready to be in.

Here is an updated version of the patch.

Added casetracker_notifications_perm().
Replaced Implementation of hook_menu_() with Implementation of hook_menu().
Casetracker Notifications is now inside is own module folder.

mautumn’s picture

I'm confused! Should this patch be applied to the core casetracker.module or is there a casetracker_notifications module somewhere that I cannot find? I tried applying this patch to casetracker.module using :-

patch casetracker.module < casetracker-805884-casetracker_notifications.patch.txt

and got the following back :-

patching file casetracker.module
Patch attempted to create file casetracker.module, which already exists.
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file casetracker.module.rej
patching file casetracker_notifications.module

This is the contents of casetracker.module.rej :-

***************
*** 0 ****
--- 1,8 ----
+ ; $Id$
+ name = Case Tracker Notifications
+ description = Notification integration for Casetracker
+ core = 6.x
+ package = "Case Tracker"
+ dependencies[] = casetracker
+ dependencies[] = notifications_content
+ 

It created the file casetracker_notifications.module. Is this the expected outcome?

Addendum:

Having tried the above and running update, clear cache, and cron - I can't see any changes anywhere... Confused :/

dagmar’s picture

You have to apply this patch inside the casetracker directory:

cd sites/all/modules
wget http://drupal.org/files/issues/casetracker-805884-casetracker_notifications.patch 
cd casetracker
patch -p0 < ../casetracker-805884-casetracker_notifications.patch
JonoB’s picture

Hi, thanks for the patch, which I have managed to integrate.
However, I am brand new to the messaging and notifications modules...and they are pretty confusing. Any chance you could please give a quick step-by-step guide on how to enable the messaging for casetracker?

I have enabled the following global content subscriptions from /admin/messaging/notifications/content
-Cases assigned. Subscribe to all cases assigned to a user.
-Project cases. Subscribe to all cases for a project.

But no emails are actually sent out

Any help on how to do this from start to finish would be greatly appreciated.

mautumn’s picture

Thanks dagmar. This worked. However, I was trying to use casetracker for workflow purposes, but I am really struggling with it - in no small part because I cannot find much documentation and examples. I am going to give workflow a try...

zeezhao’s picture

In response to #13, my experience is that to use casetracker for workflow, you probably also need to write some additional custom modules specific to your scenario.

I also had a brief look at the workflow module in the past. But for my case, I had 40+ cck fields so it was not practical to use this module. Hence I went with casetracker and my own very specific custom modules.

socialnicheguru’s picture

subscribing

langworthy’s picture

subscribe

shmilov’s picture

subscribing

nvahalik’s picture

This thread is now diamonds.

jmiccolis’s picture

I've got no idea what that means, but....

I'd really love a good review of the patch from http://drupal.org/node/805884#comment-3063386

nvahalik’s picture

+1 on #9

#12, check permissions and notification method. Make sure "subscribe to cases" and "maintain own subscriptions" are selected. You can use this module: http://dgo.to/permission_report to check the permissions for a user.

This module works as expected on my install.

jmiccolis’s picture

Status: Needs review » Fixed

The patch from #9 has been committed! Lets open any follow-up on a new ticket. Thanks for the patches and testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.