Daniel Posted January 9, 2017 Share Posted January 9, 2017 Ever since upgrading to 7.1 we've had a strange issue that we've been unable to track down and hope someone can help. When clicking the 'Close' button in the client area sidebar on a ticket view the browser just goes back to clientarea.php and doesn't close the ticket. This only seems to happen on our integrated theme and not on the 'six' template. I've tried commenting out individual javascript files and trying it again but nothing changes. When viewing the page source the close button has the following action: onclick="window.location='?tid=TICKETIDHERE&c=TOKENHERE&closeticket=true'"> Apart from completely redoing our integration I'm now at a loss as to what I should try next. Has anyone else come across this problem before or can offer any assistance? Thanks 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted January 9, 2017 Share Posted January 9, 2017 Have you tried contacting the theme author and getting a update ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 9, 2017 Share Posted January 9, 2017 Apart from completely redoing our integration I'm now at a loss as to what I should try next. perhaps you should have tested the template first before upgrading to v7 ? Has anyone else come across this problem before or can offer any assistance? it's likely going to be a jquery clash of some sort... if it's a purchased custom template/integration, i'd suggest going back to the authors to see if there is an updated version for v7.1 I suppose you could apply a band-aid fix for now and remove the close link from the sidebar (i've posted hooks previously on how to do that and I think you read those threads yesterday!) and then add a close button/link in the viewticket.tpl template - it will have access to the $tid and $c Smarty values, so you can easily build a link to close the ticket in the template. 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted January 9, 2017 Author Share Posted January 9, 2017 I've just now removed the button and added one manually to viewticket.tpl as per your suggestion and the same thing happened. However, I changed the default link from "onclick="window.location='?tid=" to "onclick="window.location='/viewticket.php?tid=" and it's now working fine. Is there any way to just change the original link in the sidebar? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 9, 2017 Share Posted January 9, 2017 Hi Daniel, Is there any way to just change the original link in the sidebar? you would need to use an action hook to do it - it's basically going to be a modified version of the hook I posted at the weekend in the thread below... https://forum.whmcs.com/showthread.php?123546-Changing-class-of-a-div&p=495786#post495786 you should only need to change two things - both of which you can get from the browser view source page... 1. the existing content of the footer you can get by viewing the code from the sidebar - you may need to disable the hook that removes the close button to see it... but basically it's likely to start with... <div class="col-xs-6 col-button-left"> 2. the name of the sidebar used in the IF statement at the bottom of the hook will be "Ticket Information" and not "My Invoices Summary". 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted January 9, 2017 Author Share Posted January 9, 2017 Hey Brian Thanks for all the help. Unfortunately adding {$tid} and {$c} to the close URL doesn't seem to work, they just stay as {$tid} and {$c} and don't actually get converted. This also seems to break the 'Reply' button and it doesn't do anything when clicked so I'll just leave it with the close button in viewticket.tpl for now. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 9, 2017 Share Posted January 9, 2017 Unfortunately adding {$tid} and {$c} to the close URL doesn't seem to work, they just stay as {$tid} and {$c} and don't actually get converted. This also seems to break the 'Reply' button and it doesn't do anything when clicked so I'll just leave it with the close button in viewticket.tpl for now. they would work in the Smarty template, but not the hook - you'd have to access them another way in the hook... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { global $tid,$c; $newfooter = '<div class="col-xs-6 col-button-left"> <button class="btn btn-success btn-sm btn-block" onclick="jQuery(\'#ticketReply\').click()"><i class="fa fa-pencil"></i> '.Lang::trans('supportticketsreply').'</button> </div> <div class="col-xs-6 col-button-right"> <button class="btn btn-danger btn-sm btn-block" onclick="window.location=\'?tid='.$tid.'&c='.$c.'&closeticket=true\'"><i class="fa fa-times"></i> '.Lang::trans('supportticketsclose').'</button> </div>'; if (!is_null($primarySidebar->getChild('Ticket Information'))) { $primarySidebar->getChild('Ticket Information') ->setFooterHtml($newfooter); } }); I quickly tested this on a v6.2.2 dev and it works fine.... you'll just need to change the content of $newfooter to suit your custom template... though it likely won't be too far off from the above code. there is a visual flaw in that if the ticket is already closed, it doesn't disable the Close button - but clicking it again doesn't cause an error, so as I say it's only a visual issue. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.