You can PM me for where to send that $30.
This mod is for OST 1.6 ST, if you are not running that version please upgrade first.
Step 1 -
Copy the two files to /include/staff
In /scp/login.php at circa line 54 after
require_once('index.php'); //Just incase header is messed up.
add the following code:
define("OMEGAPVTLTD",TRUE); //Make includes happy
// do tasks prior to redirecting
include_once(INCLUDE_DIR.'staff/preLogin.php');
Step 2 -
update the database with the following MySQL Query
ALTER TABLE ost_ticket CHANGE status status ENUM('open','closed','pending') DEFAULT 'open';
Step 3 -
Make the following code changes
3A: In /scp/tickets.php
at circa line 56
Change
$statusKeys=array('open'=>'Open','Reopen'=>'Open','Close'=>'Closed');
to
$statusKeys=array('open'=>'Open','Reopen'=>'Open','Close'=>'Closed','Pending'=>'Pending');
at circa line 96 after
}
and before
//Finally upload attachment if any
Add the following
$wasPending=$ticket->isPending();
if(isset($_POST) && $_POST) {
if($ticket->setStatus($_POST) && $ticket->reload()) {
$note=sprintf('%s %s the ticket on reply',$thisuser->getName(),($ticket->isPending()?'Pending': $ticket->isOpen() ? 'Open' : 'Closed'));
$ticket->logActivity('Ticket status changed to '.($ticket->isPending()?'Pending': $ticket->isOpen() ? 'Open' : 'Closed'),$note);
}
}
if($wasPending && !isset($_POST))
{
$ticket->setStatus('open');
$note=sprintf('%s %s the ticket on reply',$thisuser->getName(),$ticket->isOpen()?'reopened':'closed');
$ticket->logActivity('Ticket status changed to '.($ticket->isOpen()?'Open':'Closed'),$note);
}
at circa line 432 change
$sql='SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered '.
',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned '.
' FROM '.TICKET_TABLE.' ticket '.
'LEFT JOIN '.TICKET_TABLE.' open ON open.ticket_id=ticket.ticket_id AND open.status=\'open\' AND open.isanswered=0 '.
'LEFT JOIN '.TICKET_TABLE.' answered ON answered.ticket_id=ticket.ticket_id AND answered.status=\'open\' AND answered.isanswered=1 '.
'LEFT JOIN '.TICKET_TABLE.' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'open\' AND overdue.isoverdue=1 '.
'LEFT JOIN '.TICKET_TABLE.' assigned ON assigned.ticket_id=ticket.ticket_id AND assigned.staff_id='.db_input($thisuser->getId());
to
$sql='SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered '.
',count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned, count(pending.ticket_id) as pending '.
' FROM '.TICKET_TABLE.' ticket '.
'LEFT JOIN '.TICKET_TABLE.' open ON open.ticket_id=ticket.ticket_id AND open.status=\'open\' AND open.isanswered=0 '.
'LEFT JOIN '.TICKET_TABLE.' answered ON answered.ticket_id=ticket.ticket_id AND answered.status=\'open\' AND answered.isanswered=1 '.
'LEFT JOIN '.TICKET_TABLE.' pending ON pending.ticket_id=ticket.ticket_id AND pending.status=\'pending\' '.
'LEFT JOIN '.TICKET_TABLE.' overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status=\'open\' AND overdue.isoverdue=1 '.
'LEFT JOIN '.TICKET_TABLE.' assigned ON assigned.ticket_id=ticket.ticket_id AND assigned.staff_id='.db_input($thisuser->getId());
at circa line 463 after
if($stats) {
$nav->addSubMenu(array('desc'=>'Overdue ('.$stats.')','title'=>'Stale Tickets',
'href'=>'tickets.php?status=overdue','iconclass'=>'overdueTickets'));
if(!$sysnotice && $stats>10)
$sysnotice=$stats .' overdue tickets!';
}
add the following
$nav->addSubMenu(array('desc'=>'Pending ('.$stats.')','title'=>'Pending Tickets', 'href'=>'tickets.php?status=pending', 'iconclass'=>'closedTickets'));
3B: In /include/staff/viewticket.inc.php
circa line 333 change
<?
$checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..
if($ticket->isOpen()){?>
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Close" <?=$checked?> > Close on Reply</label>
<?}else{ ?>
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Reopen" <?=$checked?> > Reopen on Reply</label>
<?}?>
to
<?
if($ticket->isPending())
{
?>
<input type="checkbox" name="ticket_status" id="l_ticket_status" value="Reopen" style="display;">
<?php
}else{
$checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..
if($ticket->isOpen()){?>
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Close" <?=$checked?> > Close on Reply</label>
<?}else{ ?>
<label><input type="checkbox" name="ticket_status" id="l_ticket_status" value="Reopen" <?=$checked?> > Reopen on Reply</label>
<?
}
}
$checked=isset($info)?'checked':''; //Staff must explicitly check the box to change status..
if(!$ticket->isClosed())
{
if($ticket->isPending()){
?>
<label><input type="checkbox" name="pending_status" id="l_pending_status" value="Pending" checked="checked" > Ticket is pending (Untick to mark not pending)</label>
<?}else{ ?>
<label><input type="checkbox" name="pending_status" id="l_pending_status" value="Pending" <?=$checked?> > Mark As Pending</label>
<?
}
}
?>
3C: In /include/class.ticket.php
circa line 107 add
note: I added this after the isOpen function and before the isClosed function.
function isPending(){
return (strcasecmp($this->getStatus(),'Pending')==0)?true;
}
Locate function setStatus circa line 378
Add
case 'pending':
return $this->pending();
break;
circa line 397 add
function pending(){
$sql= 'UPDATE '.TICKET_TABLE.' SET status='.db_input('pending').',updated=NOW() '.
' WHERE ticket_id='.db_input($this->getId());
return (db_query($sql) && db_affected_rows())?true;
}
3D: In /include/staff/tickets.inc.php
circa line 32 add
case 'pending':
$status='pending';
break;