Feature Requests
Share ideas, discuss and vote on requests from other users in community

Stop Clients Closing Tickets

DavidBee shared this idea 6 years ago

I think it would be a great idea if we can stop clients closing certain tickets.

For example I would like to stop clients closing tickets that have been opened internally by our abuse department. We normally set these tickets to a custom status and monitor. We would like to only close these internally when we see fit.My idea could be implemented on a ticket by ticket basis or department wide.Discuss below and let me know what you you think of my idea.

Comments (19)


vdswin.com wrote:

This can be easy implemented using hook, just modife (add to check what department belong admin_id) and add this hook:

  1. <?php
  2. if($_SERVER['SCRIPT_NAME']=="/client/viewticket.php" && $_REQUEST['tid'] && $_REQUEST['c']){
  3. // User want to close ticket. Check if it is allowed
  4. $ticket_id=intval($_REQUEST['tid']);
  5. $ticket_key = $_REQUEST['c'];
  6. $sql="SELECT * FROM tbltickets WHERE tid = '$ticket_id' AND c = '".mysql_real_escape_string($ticket_key)."' LIMIT 1";
  7. $result=mysql_query($sql);
  8. $data=mysql_fetch_assoc($result);
  9. $noclose_flag="(!)";
  10. $close_flag="(-)";
  11. if($data['tid'] && ( ($data['admin'] && !strpos($data['title'],$close_flag)) || strpos($data['title'],$noclose_flag) )){
  12. // If ticket opened by admin or contain "(!)" string in title - do not allow to close it!
  13. if($_REQUEST['closeticket']){
  14. unset($GLOBALS['closeticket']);
  15. }
  16. add_hook("ClientAreaPage",2,"my_ticket_hide_close_button");
  17. }
  18. }
  19. // This function hide "close" button and display errror message to user
  20. function my_ticket_hide_close_button (){
  21. global $smarty;
  22. $smarty->assign('showclosebutton',false);
  23. if($_REQUEST['closeticket']){
  24. $smarty->assign('errormessage','This Ticket can be closed only by Support Staff!');
  25. }
  26. }
  27. ?>

It will hide "Close" button from client for tickets they should not close and prevent close of them.

There is an error in your code. Must be

  1. strpos($data['title'], $noclose_flag) !== false)


Totally agree. Abuse tickets and other important issues should only be allowed to be closed (solved) by the staff. Sneaky users will try to avoid attention otherwise.


Any updated?