Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/28/21 in all areas

  1. 1 point
    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...
  2. 1 point
    get yourself a free dev license (if you get your license direct from WHMCS) and then you won't have to worry about creating and paying dummy invoices. https://www.whmcs.com/members/knowledgebase.php?action=displayarticle&id=78 that wouldn't work. if you can't get a dev install, then you could work on the function in another hook, even if it's clientareapage and you can trigger the function to run only if certain conditions are met.
  3. 1 point
    17th post on page 1 - it has 3 votes.
  4. 1 point
    yes, ticket status can be obtained from the $status variable, but it contains HTML code along with the status value - so you check for the $status variable containing the required string and not equal to it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { global $status; if (strpos($status, Lang::trans('supportticketsstatusonhold')) !== false) { $footer = '<div><button class="btn btn-success btn-sm btn-block" onclick="jQuery(\'#ticketReply\').click()"><i class="fa fa-pencil"></i> Reply</button></div>'; if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information') ->setFooterHtml($footer); } } }); ...and because the ticket status output uses the client's language choice, i've used the Lang:trans feature to ensure it should work in all the default languages.
×
×
  • 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