you're in it 😜
one day i'll do it myself... my greatest hits collection. 🤪
I would have thought it should still work, just as long as what WHMCS had as the department name was what you were checking for.
I don't think v8.1 likes how the hook is trying to access the department value from the template...
can they reply ? assuming the answer to that question is yes, then...
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) {
GLOBAL $smarty;
$departmentid = $smarty->getVariable('departmentid');
$status = $smarty->getVariable('status');
$validdepts = array(4,7);
$statuslabel = Lang::trans('supportticketsstatusonhold');
if (in_array($departmentid,$validdepts) && strpos($status,$statuslabel) !== false) {
$footer = '<div><button class="btn btn-success btn-sm btn-block" onclick="jQuery(\'#ticketReply\').click()"><i class="fas fa-pencil-alt"></i> '.Lang::trans('supportticketsreply').'</button></div>';
if (!is_null($primarySidebar->getChild('Ticket Information'))) {
$primarySidebar->getChild('Ticket Information')->setFooterHtml($footer);
}
}
});
which basically says, if dept is either 4 or 7 AND the status of the ticket is on hold, then do something - in this case, modify the footer...