5 days later

Works good!

I have tested it, and it works like a charm!

Thanks for the MOD.

Best regards,

Masino Sinaga

Just a Friendly Reminder

I decided to use your code to just add the friendly reminder, as opposed to letting them close a ticket.

\include\client\viewticket.inc.php ~line 139

Begin edit by slm4996

<? $checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..

if($ticket->isOpen()){?>

<input type="checkbox" name="ticket_status" value="Close" <?=$checked?> > Close on Reply

<?}else{ ?>

<b style="color;">This ticket is currently closed, Posting a reply will re-open the ticket</b><br>

<?}?>

End edit by slm4996

a year later

It doesnt work :(

first, in my ./view.php i have only this:

<?php

//We are now using tickets.php but we need to keep view.php for backward compatibility

require('tickets.php');

?>

I can find your second code at the ./tickets.php but not at the ./view.php

It doesn't matter with this code or without, your first code looks very beautiful ( you have it from ./include/staff/viewticket.inc.php

<div style="margin-top: 3px;">

<label for="ticket_status"><b>Ticket Status:</b></label>

<?

$checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..

if($ticket->isOpen()){?>

<input type="checkbox" name="ticket_status" value="Close" <?=$checked?> > Close on Reply

<?}else{ ?>

<input type="checkbox" name="ticket_status" value="Reopen" <?=$checked?> > Reopen on Reply

<?}?>

</div>but it can not close the ticket, sorry

Update for Latest Version

Here are the changes to add this for version 1.6. Please note that my install is VERY heavily modified, I believe that this only depends on stock functions and should work for a fresh install as well. Also this is the first time I have created patches so let me know if I did it correctly.

tickets.php:

--- tickets.php

+++ tickets.php @@ -60,7 +60,12 @@

if(!$errors){

//Everything checked out...do the magic.

- if(($msgid=$ticket->postMessage($_POST,'Web'))) {

+ //if(($msgid=$ticket->postMessage($_POST,'Web'))) {

+ if(($msgid=$ticket->postMessage($_POST,'','Web',$_POST))) {

+ //Set status if any.

+ if(isset($_POST) && $_POST=="Close")

+ $ticket->setStatus($_POST);

+ // $ticket->postMessage("Ticket Closed by requestor - ".$thisclient->getEmail());

if($_FILES && $cfg->canUploadFiles() && $cfg->allowOnlineAttachments())

$ticket->uploadAttachment($_FILES,$msgid,'M');

include/client/viewticket.php:

--- include/client/viewticket.inc.php

+++ include/client/viewticket.inc.php

@@ -134,9 +134,13 @@

</div>

<?}?>

<div align="left" style="padding 0 10px 0;">

- <input class="button" type='submit' value='Post Reply' />

- <input class="button" type='reset' value='Reset' />

- <input class="button" type='button' value='Cancel' onClick='window.location.href="view.php"' />

+ <? $checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..

+ if($ticket->isOpen()){?>

+ <input type="checkbox" name="ticket_status" value="Close" <?=$checked?> > Close on Reply

+ <?}?>

+ <input class="FormButton" type='submit' value='Post Reply' />

+ <input class="FormButton" type='reset' value='Reset' />

+ <input class="FormButton" type='button' value='Cancel' onClick='window.location.href="view.php"' />

</div>

</form>

</div>

4 months later

works perfectly!

hi, slm4996, just to let u know, i tried this on 1.6 ST and it works perfectly.

i also uncommented the line that inserts an extra message in the ticket thread saying "Ticket closed by requestor" + email address of client. just added a couple brackets and it works like a dream!

thanx. :) a very helpful mod.

Write a Reply...