Jump to content

How to get ticket id, subject,..?


ST4R

Recommended Posts

Hi guys.

 

I finally could add a Sidebar on viewticket page by using hooks. The Sidebar should display the Ticket ID ({$tid}), Ticket Subject ({$subject}) and the Ticket Department ({$department}). And yes, I know there's such sidebar by default but I want to add my own customized sidebar on viewticket page.

 

As you know {$tid} works just for viewticket.tpl not hooks.

 

How can I retrieve the mentioned variables in a hook? ({$tid}, {$subject}, {$department},..)

 

I'm not a pro programmer, so that please give me some examples and codes.

 

Thanks.

Edited by ST4R
Link to comment
Share on other sites

- Can you please let me know what is the variable for the ticket last update? (ex. 4 days ago)

add {debug} to the end of the template (viewticket.tpl) and you'll get a popup window of available Smarty variables... if it's in there, you can use it as above... if not, you may need to query the db.

 

- How can I translate 'days ago' part? it is not defined in language file.

search is always your friend... :)

 

https://forum.whmcs.com/showthread.php?130985-Translate-Time-Sidebar-Recent-Tickets-and-Ticket-Information

Link to comment
Share on other sites

add {debug} to the end of the template (viewticket.tpl) and you'll get a popup window of available Smarty variables... if it's in there, you can use it as above... if not, you may need to query the db.

Already did it but as you mentioned it's not in there! so I think the other way works :) (and I dont know how to do that, any help would be appreciated :D)

Link to comment
Share on other sites

Already did it but as you mentioned it's not in there!

it is in there - you just don't realise it. :)

 

last updated doesn't exist as a value anywhere - it's calculated as the difference between the last reply date/time and now... how to do that calculation is shown in the above hook.

 

granted, you can't just copy&paste the entire hook as it's setup to only work for pt_BR, but remove that condition and create a method to detect language and it will work for any language - apart from Macedonian as that isn't available to Carbon in the current WHMCS setup, but will work fine when you manually create the Macedonian translate file.

 

if you want to see the last updated value being translated for all 26 default WHMCS languages, watch the video below - it can be done! :)

 

Unable to display content. Adobe Flash is required.

 

so I think the other way works :) (and I don't know how to do that, any help would be appreciated :D)

it's all there in the hook... you just need to take the bits you need and adjust for your purpose.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated