Jump to content
Sign in to follow this  
Si

Ticket Closed - Stop customer from re-opening

Recommended Posts

Does anyone know of an add-on that gives us the option to not only CLOSE a ticket (as is now), but also to CLOSE it without the customer being able to re-open it?

Share this post


Link to post
Share on other sites

there's always the option to modify the viewticket.tpl template to remove the "Reply" button?

 

e.g, create a new Ticket Status in the admin area... let's call it "Really Closed"... and then modify the viewticket.tpl template to check the ticket status and if "Really Closed", not show the reply and/or close button.

 

so in Default, this would look something like...

 

<p><input type="button" value="{$LANG.clientareabacklink}" class="btn" onclick="window.location='supporttickets.php'" />
{if (!$status|strpos:"Really Closed")} <input type="button" value="{$LANG.supportticketsreply}"
class="btn btn-primary" onclick="jQuery('#replycont').slideToggle()" />{if $showclosebutton}
<input type="button" value="{$LANG.supportticketsclose}" class="btn btn-danger" onclick="window.location='{$smarty.server.PHP_SELF}?tid={$tid}&c={$c}&closeticket=true'" />{/if}{/if}</p>

for this to work with a new ticket status, you couldn't call it just "Closed" as obviously it would match Closed tickets too, but you could probably use "Closed." without any issue.

Share this post


Link to post
Share on other sites
there's always the option to modify the viewticket.tpl template to remove the "Reply" button?

 

If you are using email piping, for replies, this would not prevent them from just replying to a support ticket email and re-opening the ticket.

Share this post


Link to post
Share on other sites
there's always the option to modify the viewticket.tpl template to remove the "Reply" button?

 

e.g, create a new Ticket Status in the admin area... let's call it "Really Closed"... and then modify the viewticket.tpl template to check the ticket status and if "Really Closed", not show the reply and/or close button.

 

so in Default, this would look something like...

 

<p><input type="button" value="{$LANG.clientareabacklink}" class="btn" onclick="window.location='supporttickets.php'" />
{if (!$status|strpos:"Really Closed")} <input type="button" value="{$LANG.supportticketsreply}"
class="btn btn-primary" onclick="jQuery('#replycont').slideToggle()" />{if $showclosebutton}
<input type="button" value="{$LANG.supportticketsclose}" class="btn btn-danger" onclick="window.location='{$smarty.server.PHP_SELF}?tid={$tid}&c={$c}&closeticket=true'" />{/if}{/if}</p>

for this to work with a new ticket status, you couldn't call it just "Closed" as obviously it would match Closed tickets too, but you could probably use "Closed." without any issue.

 

Excellent work brian! - this did the job brilliantly. Thank you man!!!

 

P.S. I don't use email piping as I force all customers to submit tickets on the site in the hope the knowledgebase suggestions help with answers. So this does it for me.

Share this post


Link to post
Share on other sites
Hi Brian!,

Is there a hook for doing this now in v6?

I think the previous answer still stands - although the code for viewticket.php is probably simpler now.

 

e.g if you wanted to remove the option to reply to a closed ticket, I would just add the following if statement before the div @ line 19...

 

{if (!$status|strpos:"Closed")}

and then add a closing {/if} between the closing div @ line 80 and before the <div class="panel panel-info visible-print-block"> line.

 

that way, if a ticket was closed, the option to reply to re-open would be removed - you'd probably also have to tweak the "This ticket is closed. You may reply to this ticket to reopen it." language entry.

 

as with the previous answer, if you have a "Really Closed" ticket status and want this only to apply to that, then just modify the if statement.

 

with regards to the sidebar, which I assume was the point of your question, the simplest way would be to just remove the footer containing the reply and closed buttons...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
   if (!is_null($primarySidebar->getChild('Ticket Information'))) {
                $primarySidebar->getChild('Ticket Information')
                               ->setFooterHtml('');
   }         
});

I suppose it would be possible to modify the footer based on the ticket status, but I don't think that the status value is directly available to the hook... the ticketId is, so if all else fails, you could query the database to get the status... i'm not sure if that's how the hook currently gets the status, but it would be interesting to know... unfortunately, its creation is encrypted, so all we can do is try and reverse engineer based on the output! :roll:

Share this post


Link to post
Share on other sites

Would it be possible to get an updated hook?

It would be useful to have it for when tickets regarding billing/abuse we would not want the end user to be able to close them.

Share this post


Link to post
Share on other sites
1 minute ago, aonap said:

It would be useful to have it for when tickets regarding billing/abuse we would not want the end user to be able to close them.

I think you are misunderstanding this topic. This topic is about closed tickets not being able to open. 

You probably need something like this

Share this post


Link to post
Share on other sites

I'm also keen on knowing how to prevent enders from reopening closed tickets.

Share this post


Link to post
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.

Sign in to follow this  

  • 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