History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: CHD-1419
Type: Improvement Improvement
Status: Open Open
Assignee: Unassigned
Reporter: Robert Middleswarth
Votes: 2
Watchers: 2
Operations

Clone this issue
If you were logged in you would be able to see more operations.
Cerberus Helpdesk

Allow plugins to provide translation strings for Audit Log events

Created: 16/Sep/09 07:44 PM   Updated: 16/Aug/10 06:18 PM
Fix Version/s: Sea of 1000 Wishes

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File chd-1419.patch (0.6 kb)
2. Text File translation_support_for_audit_log.patch (0.6 kb)


xP Priority: 3 - Would Be Nice
Marquee: Usability


 Description   
Well working on a plugin to add additional audit log events into my system I found myself running into a problem. It seems that when you display the field change_fields inside the audit log you run it though a simple translation system using the fields from the ticket database. This works well unless you are tiring to display information that does not have a field connected to a ticket like a comment or time tracking event or anything else a plug-in designer might think of using. Then that is where the fun begins. As it stands right now it tacks on a "t_" in front of the field then displays it. That "t_" make things really bad inside the display and really limits what a plug-in can do with the audit log. It would be really nice if the plugin could simple run the field un altered though the translation system as plug-in designers can add translatable strings in to the audit log making the audit log much more usable as being part of a tool kit. You ask how major of a change in the code do I need to do to get this added abilty. The answer is just 1 line of code.

diff --git a/plugins/cerberusweb.auditlog/templates/display/log/log_view.tpl b/plugins/cerberusweb.auditlog/templates/display/log/log_view.tpl
index 4967468..b41edc5 100644
--- a/plugins/cerberusweb.auditlog/templates/display/log/log_view.tpl
+++ b/plugins/cerberusweb.auditlog/templates/display/log/log_view.tpl
@@ -70,7 +70,7 @@
  {if isset($ticket_fields.$change_field)}
  {$ticket_fields.$change_field->db_label|capitalize}
  {else}
- {$change_field} 
+ {$translate->_($result.l_change_field)}
  {/if}
  </td>
  {elseif $column=="l_change_value"}


Thanks
Robert

 All   Comments   Work Log   Change History      Sort Order:
Comment by Robert Middleswarth [09/Jan/10 07:17 PM]
I created a new patch since I was working on cleaning up my tree switching to cerb5 so why not regenerate.

Thanks
Robert

Comment by Robert Middleswarth [09/Jan/10 07:20 PM]
I will be keeping this patch up to data in the following branch

http://github.com/rmiddle/cerb5/tree/jira/chd-1419

Thanks
Robert