Tracker item comments Posted by Blackney 27 Apr 2011 23:32 UTC Is there a way to view/edit Tracker Item Comments when viewing the Tracker via a Pretty Tracker?
Posted by Brian Merritt 03 May 2011 14:29 UTC I don't believe there is currently, but the community may prove me wrong (can anyone else help here?) If not, I would hope to see in 7.1 or 8.0 at the latest as I need it! If /when it is working I'll try to circle back and let you know. Blackney wrote: Is there a way to view/edit Tracker Item Comments when viewing the Tracker via a Pretty Tracker?
Posted by Alejandro 03 May 2011 15:55 UTC Blackney wrote: Is there a way to view/edit Tracker Item Comments when viewing the Tracker via a Pretty Tracker? The solution that I found to view the comments maybe can help you. It is based in a smarty function that request the comments for the item and then use the result in a template. Not sure if apply to "Pretty Tracker" but works for me. Please consider that I am very new on this so there are a lot of chances that this solution breaks the way that things should be done or (worse) things should work in tiki. By the way I'm using tiki 6.1 in Ubuntu 10.04. The function to recover the comments (I add it to lib/smarty_tiki/function.getitemcomments.php) was (details excluded): Copy to clipboard... function smarty_function_getitemcomments($params, &$smarty) { global $trklib; include_once('lib/trackers/trackerlib.php'); $comments = $trklib->list_item_comments($params["itemId"], 0, -1, 'posted_desc', ''); $smarty->assign_by_ref('comments', $comments["data"]); $smarty->assign_by_ref('commentCount', $comments["cant"]); } I call and use it from the template with code like the following (details excluded): Copy to clipboard--- just sample of use --- ... {* get the comments of the item in $f_itemId *} {getitemcomments itemId=$f_itemId} {* after that in $commentCount we have the number of comments and in $comments the comments itself. *} ... {* comment count can be used as in: *} {if $commentCount gt 0} ... {* comments content can be displayed using: *} {section name=ix loop=$comments} {* ... comment author example *} {if $comments[ix].user}{$comments[ix].user|userlink}{/if} {* ... post date example *} {$comments[ix].posted|tiki_short_datetime} {* ... comment title example *} {$comments[ix].title|escape} {* ... comment text example *} {$comments[ix].parsed} {/section} ... Hope this can help you.
Posted by Blackney 03 May 2011 16:28 UTC Ayachan, Thank you. This is very nice! Now... is there a way to allow more comments to be entered from here?
Posted by Alejandro 03 May 2011 18:00 UTC Blackney wrote: Ayachan, Thank you. This is very nice! Now... is there a way to allow more comments to be entered from here? Don't know yet... I guess it should be possible. In the meantime you can provide a link in one or more of the fields of the tracker item display to the standard item edit page, where you can add new comments. Something like Copy to clipboard... <a href="/tiki/tiki-view_tracker_item.php?trackerId=XX&itemId={$f_itemId}">{$f_YY}</a> ... in the template code. Where XX is the tracker id (don't know if something like $f_trackerId exists) and $f_YY is the field id of the text to work as link.