Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi. I'd like to use the real name of a person assigned to a task, instead of uid in links and views.
I am trying to use the http://drupal.org/project/token_profile module, which can pick up any profile fields that are setup via admin/user/profile.
Please has anyone done anything similar, or has advice on the best way to do this?
Comment | File | Size | Author |
---|---|---|---|
#19 | casetracker.module.patch | 1.47 KB | aaron1234nz |
#12 | Clipboard02.jpg | 23.7 KB | charles.holtzkampf |
Comments
Comment #1
zeezhao CreditAttribution: zeezhao commentedBy the way, I also tried editing the casetracker_assignee_options view to return the fullname instead of username, but for some reason did not seem to work even after clearing cache...
Comment #2
zeezhao CreditAttribution: zeezhao commentedFor now, decided to override the user link with my own based on real name, in template.php via phptemplate_casetracker_case_summary().
Then in views, used http://drupal.org/project/views_customfield module which allows a custom php field to be added to views.
Comment #3
dagmarCase Tracker 6.x-1.0-beta8 includes the user assigned to as a view relationship. So, you can load the user profile by including this relationship in the view.
Even more, the view provided by casetracker is now using this method, so, you just have to revert the view from the views ui and the relationship will be automatically added. Views customfield is not necessary in this case.
Comment #4
zeezhao CreditAttribution: zeezhao commentedThanks for the info. Had to do it that way for now, as i have some additional complications. Will come back to it again.
In any case, just found this: http://drupal.org/project/realname
edit:
Tried this out. If setup properly, will automatically replace name with real name.
For token, will need to overide in casetracker.token.inc:
$values['case_assign_to'] = theme('username', $assignedUser, array('plain' => TRUE));
Comment #5
zeezhao CreditAttribution: zeezhao commentedThe only oustanding thing is the dropdown userlist which still shows username even though I changed the casetracker_assignee_options view.
In summary, the realname module works very well, except for this.
Comment #7
SophieG CreditAttribution: SophieG commentedHi,
i am using casetracker beta8 and i don't see this working with realnames ?
Could you tell me how you managed to do this ?
Thanks !!
Comment #8
zeezhao CreditAttribution: zeezhao commented- make sure you have a field setup via admin/user/profile for holding the fullname
- install the realname module & associate that field via: admin/user/realname
- make fix for token, will need to overide in casetracker.token.inc:
$values['case_assign_to'] = theme('username', $assignedUser, array('plain' => TRUE));
- "recalculate names" using the menu via: admin/user/realname
As per my comments above in #5, realname will display in all views etc. The only oustanding thing is the username drop-down menu when editing a case. Not sure why that piece did not work and ran out of time...
Comment #9
SophieG CreditAttribution: SophieG commentedThanks !
One last question : to overide casetracker.tocken.inc how do you proceed ?
Thanks
Comment #10
zeezhao CreditAttribution: zeezhao commentedFor now, simply replace line in casetracker.token.inc.
Eventually, the line should be replaced in dev code in CVS. Or else change will be lost...
i.e.
Comment #11
Grayside CreditAttribution: Grayside commentedIf you generate a patch for the token override and set this issue to Needs Review, I will review it for you. That's the kind of thing that should simply be how the token integration works.
Comment #12
charles.holtzkampf CreditAttribution: charles.holtzkampf commentedHi All,
Ive done all the above and I still only get the username. Not sure what im doing wrong, if anyone can offer advice, I would be really greatfull.
I've attached a screenshot of my realname setup.
Comment #13
SophieG CreditAttribution: SophieG commentedHi again,
i have made the change in the token inc file, but nothing is changing...
Any idea why ?
Thanks
i have cleared the cache....
Comment #14
zeezhao CreditAttribution: zeezhao commentedIf you've done all in #8, the only other thing I did is to override in template.php in your theme directory:
You can amend to suit your preference. This will enable realname on summary of case.
As mentioned, I could not get the dropdown to work. But I do not use it anyway, as I hide it from users since allocation of cases in my system is rules driven. So I have another dropdown using a view, and real names works for that.
Comment #15
charles.holtzkampf CreditAttribution: charles.holtzkampf commentedthanks zeezhao, its really appreciated that you help us non php folk like this :)
If you have the time, would you mind pointing me in the right direction to for the following:
I would like to remove the Group Selection List, as I use organic groups and I dont want users to be able to choose which OG node to set as the project.
I assume that I can somehow remove some elements from casetracker.module so that its not displayed ?
thanks again
Comment #16
zeezhao CreditAttribution: zeezhao commentedDid my suggestion work for you?
Ideally, for your new question you should open another support request... I've not used OG myself so can't really say. But in general, you can try using:
http://drupal.org/project/formfilter [can be used to hide fields when in edit mode]
or
you'll have to write a hook_form_alter() -- find details on: http://api.drupal.org/
Comment #17
charles.holtzkampf CreditAttribution: charles.holtzkampf commentedHi Zeehao,
thanks I will give that go, im afraid it still doesn;t work. But Let me get back to you, as I was not on the latest OG. I will confirm later.
thanks again
Comment #18
SophieG CreditAttribution: SophieG commentedyes i can confirm it is not working for me either...
And i don't know why now i have the title of my projects remplaced by the name of the author, but only when i am on the project page, not when it is displayed using views in tables...
Any idea why ?
Thanks
Comment #19
aaron1234nz CreditAttribution: aaron1234nz commentedI couldn't get this to work but I did find that I could patch the casetracker.module with a few simple change to enable it to work fully with the realname module.
The one caveat with this is that if two people exist in the database with the same realname, its possible that cases can be assigned to the wrong person. This is unavoidable unless further changes are made to casetracker so that users are always identified by their uid rather than username.
Comment #20
Grayside CreditAttribution: Grayside commentedYou should assign cases to uid or username, but show realname in the forms and case info. Differentiating users could be done ala Node Reference/Book references, changing the assignment form to read options like
Bob Villa [uid: 31]
.Comment #21
Dimas_ CreditAttribution: Dimas_ commentedThe patch doesn't work for me. The select of users doesn't work: it shows the names instead the usernames (that's ok) but when I save the task is Unassigned.