Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Client closing tickets

I know, I know, most of us are in the "why should a client do anything, this is OUR system!" mode, but my boss asked me for this feature. 

We need to be able to allow ONLY the creator to close tickets, not the staff(Admins should be OK, since people leave the company, etc...)

The problem is that in the past, staff would close the tickets without a satisfactory solution, and that is unacceptable in our company's culture, we have a "Feature Request" category for the things that cannot be implemented at the moment.

Any suggestions? I looked around and found no information on this, other then a "why would you do that" on a request to add the ability to close by the user... If that is a different way of approaching and bothers you enough to demand a soapbox moment, please PM me, as I would like to keep the thread "clean".



  • I'm not aware of anyone developing a mod to do this, but I think that you posted this thread in the right place to find out!  Good luck.
  • thank you. 
  • anyone involved with RC1 1,9 saw something I can use for this?
  • Bump for keep alive!

  • A bump for your thoughts...

  • The "close" function doesn't really care who closes a ticket.. so, theoretically anyone can.. You'd have to write your own function/interface for your client pages though.
  • Thank you Grizly.

    With the update to 1.9, we can now "register" all the users, that sounds like a good opportunity to just add a "close" button on the registered user's control panel (where the logged user sees his/her tickets).

    I am not a PHP coder, but if someone can point me in the right direction(maybe where the close script is for Staff) I can give it a shot... 
  • I found this code on tickets.php when logged in as staff:

    <td width="160">
    <label><strong>Ticket Status:</strong></label>
    <td width="765">
    <label><input type="checkbox" name="reply_ticket_status" id="reply_ticket_status" value="Closed"
    > Close on Reply</label>

    Where would I "duplicate" this function if I wanted to add this to a client-facing page? That would allow the client to close their own ticket!
  • I would also support the possibility to close tickets for clients. Thanks!
  • edited June 2014
     i work on too.
    in the first time we need to develop the possibility to close the ticket by the user interface.

    add a button on all ticket with the close function. but i m not a php developper too and osticket is a gas usine ! lol
    one button is in 10 file ! if someone can help me, maybe we can discuss by skype or something to resolve this problem ...

  • edited November 2014
    Hey , 
    I hope i'm not too late for responding to this issue , I am a php developer and I could make it work so that a simple client could close his ticket as well . It's quite simple : 

    in the file : include/client/  add a link that redirect to the same page for the closing functionality : 
    an example would look like : 
    <a href="tickets.php?id=<?php echo $ticket->getId(); ?>&action=close"> <button style="float:right;" > close ticket </button> </a> 
    I put it just under the <h1> closing tag . 
    If you could notice , that link redirects me to the same page, with the parameters id = ticket_id and action=close (You could do it better ).

    and at the top of that page , i added :

    if(($_GET['action'] == 'close'))
    $ticket->setStatus(3); // equivalent to status = closed ; see table ost_ticket_status
      echo "<script> alert('Status changed');</script>";
    } //else {echo "Not possible";} }
    Good luck everybody .....
  • I'd like to keep this conversation going. I've been struggling to get the code mentioned by @anass_rakibi to work. Doing so leaves the ticket view page blank. I have added a Close button at the bottom next to Post Reply, Reset and Cancel, but on the staff side, closing the ticket is a drop down box to change status. Any thoughts on how to make it a button only. I don't want users to change status to Archived, Feature Request, etc. Just the ability to close their ticket when they feel it is resolved. The OP is (or rather WAS) my boss so I'm continuing his quest to get this feature. 

    Running 1.9.5 on a test environment.
  • If you get a blank page it generally means that there is a PHP error. 
    If it were me I would consult my PHP error log (or turn on PHP error display).

    Q: How do I turn on error displaying for osTicket?
  • Thanks for the tip @ntozier. Figured it out. Located in the include/client/ file, directly under the opening <?php tag should be the code given by @anass_rakibi:

            if(($_GET['action'] == 'close'))
                      $ticket->setStatus(3); // equivalent to status = closed
                  }               else {echo "Not possible";}     }

    I removed the echo "<script> alert('Status Changed');</script>"; that @anass_rakibi used.
    I didn't, nor did our users, like the pop up box stating Status Changed.
    Then in the same file, scroll down a bit just above the </h1> closing tag. You'll see the code for the 'Edit' button. Immediately below that Edit code, yet above the exisitng <?php } ?> tag, paste this code:

    <a class="action-button pull-right" href="tickets.php?id=<?php
     echo $ticket->getId(); ?>&action=close">  <i class="icon-remove-circle"></i> Close Ticket</a>

    This code will put a close button next to the Edit button in the same font and format and even put the small circle with an X icon next to the "Close Ticket" text.

    I hope this helps someone else looking for this little requested feature. This has been tested and works in both 1.9.4 and 1.9.5.

  • Glad to be of assistance. :)
  • it said it was closed by SYSTEM, could we make it to appear as the user who close it?

    I'm new here, and I'm a beginner at php and programming as well... hope I'm not too intruding in this community... 
  • edited January 2015
    Yeah I noticed that as well. I figured since only the original creator of the ticket - and not any collaborators if there were any - can close it,  then showing who closed it seemed a tiresome effort and didn't pursue it. If it says closed by system then ticket creator closed it. If an agent closes it, it still properly shows the agent who closes it. I can try to take a look on Monday if no one else has figured it out and see if I can get something for you to look at but I'm no php programmer either so it is just quite a bit of messing about in the code, ask a question here on the forum, and with some luck you figure it out. I knew absolutely zero php and sql when I started heading up our helpdesk. I'm a lot more comfortable poking around the core files now with guidance from the moderators - save often. Save well!
  • note: I removed the bold like formatting from the above post.
  • good explanation, after I thought about it, well yeah, the result would still be a satisfactory and I think I won't pursue this problem any further then, thanks anyway for the offer.
This discussion has been closed.