Jump to content

How to insert a form in viewticket.tpl?


Hans!

Recommended Posts

Hello.
I would like to enrich admin area, inserting in the viewticket page a little four-fields form; the operator may compile them (when and if necessary), and the related "submit" will save the data in a db table.

Easy but... how to do it?

If I edit viewtickt.tpl inserting something like:

<div class="container">
<form method="post">
  first field:  <input type="text" name="field1" value="field 1">
  description:  <input type="text" name="field2" value="field 2">
  <input type="submit" value="submit extra">
</form>
</div>

what kind of "post" should I need to set, and how define the action?

Other forms in same page are defined as calls to {$smarty.server.PHP_SELF}?action=[something], but .php code is encrypted so I can't add any action to it... :-/

Maybe using hooks: using AdminAreaViewTicketPage I guess I can define the form but... the issue is the same: how to manage related submit action?

Rather confused... :-/

 

Link to comment
Share on other sites

couldn't you just use assign Support Custom Fields to the relevant support departments ?

https://docs.whmcs.com/Custom_Fields#Support_Custom_Fields

Quote

Custom fields for support are set per department and allow you to ask users for additional information when opening tickets. This is often used for things such as current usernames & passwords, etc... These are configured in Setup > Support > Support Departments > Edit > Custom Fields tab

now forget what the description says above - if you made these custom fields "Admin Only", then the client will never see them, only admins... they'd be viewable from the "Custom Fields" tab on the viewticket page.

94I3Idg.png

I think that's an easier solution that the more complicated alternatives you were looking at. 🙂

Link to comment
Share on other sites

6 hours ago, brian! said:

couldn't you just use assign Support Custom Fields to the relevant support departments ?

Nope: the data to be managed are time and activity tracking notes, which will be monthly managed by billing people.
So, it may happen (and usually it's so) that a single ticket has more than one record of this kind.

For this reason we're going to use a different table, with fields like that:

timestamp
ticketid
customerid
operator
time
description of activity for billing purposes 

I've also tried to use the "billing function" native in WHMCS ticket management, but it's not sufficient, it's difficult to integrate with our billing software, and it's far from error-proof for the operator...  
 

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