Kindly follow the following steps to get this working in v1.7
open scp\tickets.php
search for
$statusKeys=array('open'=>'Open','Reopen'=>'Open','Close'=>'Closed');
replace it with
$statusKeys=array('open'=>'Open','Reopen'=>'Open','Close'=>'Closed','pending'=>'Pending');
search for
if($stats) {
$nav->addSubMenu(array('desc'=>'Overdue ('.number_format($stats).')',
'title'=>'Stale Tickets',
'href'=>'tickets.php?status=overdue',
'iconclass'=>'overdueTickets'),
($_REQUEST=='overdue'));
if(!$sysnotice && $stats>10)
$sysnotice=$stats .' overdue tickets!';
}
below it add
$nav->addSubMenu(array('desc'=>'Pending Tickets ('.number_format($stats).')',
'title'=>'Pending Tickets',
'href'=>'tickets.php?status=pending',
'iconclass'=>'closedTickets'),
(!$_REQUEST || $_REQUEST=='Pending'));
open include\class.ticket.php
search for
function isReopened() {
return ($this->getReopenDate());
}
below it add
function isPending(){
return (strcasecmp($this->getStatus(),'Pending')==0);
}
search for
function setStatus($status) {
if(strcasecmp($this->getStatus(), $status)==0)
return true; //No changes needed.
switch(strtolower($status)) {
case 'open':
return $this->reopen();
break;
case 'closed':
return $this->close();
break;
}
return false;
}
replace with
function setStatus($status) {
if(strcasecmp($this->getStatus(), $status)==0)
return true; //No changes needed.
switch(strtolower($status)) {
case 'open':
return $this->reopen();
break;
case 'pending':
return $this->pending();
break;
case 'closed':
return $this->close();
break;
}
return false;
}
search for
function setState($state, $alerts=false) {
switch(strtolower($state)) {
case 'open':
return $this->setStatus('open');
break;
case 'closed':
return $this->setStatus('closed');
break;
case 'answered':
return $this->setAnsweredState(1);
break;
case 'unanswered':
return $this->setAnsweredState(0);
break;
case 'overdue':
return $this->markOverdue();
break;
case 'notdue':
return $this->clearOverdue();
break;
case 'unassined':
return $this->unassign();
}
return false;
}
replace with
function setState($state, $alerts=false) {
switch(strtolower($state)) {
case 'open':
return $this->setStatus('open');
break;
case 'pending':
return $this->setStatus('pending');
break;
case 'closed':
return $this->setStatus('closed');
break;
case 'answered':
return $this->setAnsweredState(1);
break;
case 'unanswered':
return $this->setAnsweredState(0);
break;
case 'overdue':
return $this->markOverdue();
break;
case 'notdue':
return $this->clearOverdue();
break;
case 'unassined':
return $this->unassign();
}
return false;
}
search for
//Close the ticket
function close() {
global $thisstaff;
$sql='UPDATE '.TICKET_TABLE.' SET closed=NOW(),isoverdue=0, duedate=NULL, updated=NOW(), status='.db_input('closed');
if($thisstaff) //Give the closing staff credit.
$sql.=', staff_id='.db_input($thisstaff->getId());
$sql.=' WHERE ticket_id='.db_input($this->getId());
if(!db_query($sql) || !db_affected_rows())
return false;
$this->reload();
$this->logEvent('closed');
return true;
}
above it add
//Mark Ticket as Pending
function pending() {
global $thisstaff;
$sql='UPDATE '.TICKET_TABLE.' SET isoverdue=0, duedate=NULL, updated=NOW(), status='.db_input('pending');
if($thisstaff) //Give the closing staff credit.
$sql.=', staff_id='.db_input($thisstaff->getId());
$sql.=' WHERE ticket_id='.db_input($this->getId());
if(!db_query($sql) || !db_affected_rows())
return false;
$this->reload();
$this->logEvent('pending');
return true;
}
search for
$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(closed.ticket_id) as closed '
.' FROM '.TICKET_TABLE.' ticket '
.' LEFT JOIN '.TICKET_TABLE.' open ON (open.ticket_id=ticket.ticket_id AND open.status=\'open\' AND open.isanswered=0 '.((!($cfg->showAssignedTickets() || $staff->showAssignedTickets()))? ' AND open.staff_id=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.status=\'open\' AND assigned.staff_id='.db_input($staff->getId()).')'
.' LEFT JOIN '.TICKET_TABLE.' closed ON (closed.ticket_id=ticket.ticket_id AND closed.status=\'closed\' )'
.' WHERE (ticket.staff_id='.db_input($staff->getId());
replace with
$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, count(closed.ticket_id) as closed '
.' FROM '.TICKET_TABLE.' ticket '
.' LEFT JOIN '.TICKET_TABLE.' open ON (open.ticket_id=ticket.ticket_id AND open.status=\'open\' AND open.isanswered=0 '.((!($cfg->showAssignedTickets() || $staff->showAssignedTickets()))? ' AND open.staff_id=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.status=\'open\' AND assigned.staff_id='.db_input($staff->getId()).')'
.' LEFT JOIN '.TICKET_TABLE.' closed ON (closed.ticket_id=ticket.ticket_id AND closed.status=\'closed\' )'
.' WHERE (ticket.staff_id='.db_input($staff->getId());
search for
$sql='SELECT count(open.ticket_id) as open, count(closed.ticket_id) as closed '
.' FROM '.TICKET_TABLE.' ticket '
.' LEFT JOIN '.TICKET_TABLE.' open
ON (open.ticket_id=ticket.ticket_id AND open.status=\'open\') '
.' LEFT JOIN '.TICKET_TABLE.' closed
ON (closed.ticket_id=ticket.ticket_id AND closed.status=\'closed\')'
.' WHERE ticket.email='.db_input($email);
replace with
$sql='SELECT count(open.ticket_id) as open, count(pending.ticket_id) as pending, count(closed.ticket_id) as closed '
.' FROM '.TICKET_TABLE.' ticket '
.' LEFT JOIN '.TICKET_TABLE.' open
ON (open.ticket_id=ticket.ticket_id AND open.status=\'open\') '
.' LEFT JOIN '.TICKET_TABLE.' pending
ON (pending.ticket_id=ticket.ticket_id AND pending.status=\'pending\') '
.' LEFT JOIN '.TICKET_TABLE.' closed
ON (closed.ticket_id=ticket.ticket_id AND closed.status=\'closed\')'
.' WHERE ticket.email='.db_input($email);
open include\staff\tickets.inc.php
search for
case 'open':
$status='open';
break;
below add
case 'pending':
$status='pending';
break;
Continued to the next thread