Jump to content

Hook for hide the answer buttons in case the ticket is closed


conecta6

Recommended Posts

Hi, I'm trying to hide the answer buttons in case the ticket is closed, to prevent the client from reopening it.

I think it should be done by hook, but I'm not sure how this button would be hidden from there. Any guidance on how to do this without editing the tpl?

Link to comment
Share on other sites

on Closed tickets, you could use the following hook to remove both Reply & Close buttons...

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) 
{
	global $status;

	if (strpos($status, Lang::trans('supportticketsstatusclosed')) !== false) {
		if (!is_null($primarySidebar->getChild('Ticket Information'))) {
			$primarySidebar->getChild('Ticket Information')
					->setFooterHtml('');
		}
	}
});

to remove the Reply link on viewticket.tpl is easy if you wanted to edit the template... not so if you don't!

WvcbWGe.png

you could almost remove it by adding some code to custom.css...

#ticketReply {
    display: none;
}

but it would probably be easier to just edit the template. :idea:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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