Project:Case Tracker
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Tokens would be great for this module, both for the url (say parent title raw or something) as well as within the mail module. We should gut the D6 version of mail and base it on tokens and notifications modules. Current list of replacements in mail include:

'%project_id'
'%project_number' !DEPRECATED!
'%project_title'
'%case_id'
'%case_number' !DEPRECATED!
'%case_title'
'%case_type'
'%case_priority'
'%case_status'
'%case_assigned'
'%case_author'
'%case_created'
'%case_changed'
'%case_url'
'%case_description'
'%comment_author'
'%comment_created'
'%comment_title'
'%comment_description'

This should be a fairly complete list of existing functionality. Both Project number and case numbers have been deprecated in favor of simple nids where necessary so these probably don't need to be moved.

both project id and title would be useful for url tokens.

Eclipse

Comments

#1

subscribing.

especially since the Jump To feature relies on "[project_id]-[case-id]", it'd be nice to use that trend in the URL (via Automated Aliases.)

#2

Subscribing.

#3

I second this request too

#4

Status:active» needs work

Here's a quick patch for 6.x-1.x-dev that adds case_type as a token -- that's the one I needed.

It's somewhat broken, though.

I want to use Case Type as part of an auto nodetitle for Cases.
This is working on node update, but not on node insert. On node insert the token shows up as "Array" in the title.

I'm not sure how to get at $casetracker->case_type_id without node_load()... but node_load()'s obviously not going to work on an node that hasn't been inserted yet...

I'll look at this further when I get some more time, but any insight is appreciated.

AttachmentSize
373574-casetracker-tokens.patch 1.8 KB

#5

My best guest as to what's going on is that auto_nodetitle needs to run at a higher weight than casetracker.

If you are only using auto_nodetitle for this one reason, it might be easier to do it manually. auto_nodetitle runs during the 'presave' operation of hook_nodeapi, and the casetracker values are available at that stage if you want to code it yourself.

#6

Status:needs work» needs review

Thanks for the suggestion, Grayside.

auto_nodetitle is already running at a higher weight than casetracker.

By casting $node->casetracker as an object in presave, (as it's being done in insert and update,) I was able to access those fields with auto_nodetitle on node creation.

I suppose that means I could avoid this new presave operation and just access them with $node->casetracker still as an array...

AttachmentSize
373574-casetracker-tokens-2.patch 2.55 KB

#7

+1

Would also love having these tokens available:
'%case_type'
'%case_priority'
'%case_status'
'%case_assigned'

#8

Added 2 tokens, '%case_assign_to' and '%case_assign_to_uid'.

AttachmentSize
373574-casetracker-tokens-3.patch 28.96 KB

#9

Scratch the last patch, I didn't patch against the right version of casetracker. :-(

#10

Added 2 tokens, '%case_assign_to' and '%case_assign_to_uid', this time patched against beta6 version of casetracker. :-)

AttachmentSize
373574-casetracker-tokens-3.patch 1.38 KB

#11

Status:needs review» needs work

Mmm, I think you forgot to add the new file using cvsdo add casetracker.token.inc and make the patch using cvs diff -up -N

casetracker.token.inc file is not included in this patch.

#12

Status:needs work» needs review

New patch with casetracker.token.inc included. Third times the charm...

AttachmentSize
373574-casetracker-tokens-3.patch 2.94 KB

#13

Version:master» 6.x-1.x-dev
Status:needs review» fixed

I did a bit of clean up on this patch and committed it. Thanks to everyone for you work.

#14

Status:fixed» closed (fixed)

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

nobody click here