check Overdue in PENDING staus
hello Boys & Girls,
i Think it is important to check Overdue in PENDING status.
If you want it, than you must find & change this in include/class.ticket.php
function checkOverdue(){
global $cfg;
if(($hrs=$cfg->getGracePeriod())) {
$sec=$hrs*3600;
$sql='SELECT ticket_id FROM '.TICKET_TABLE.' WHERE status=\'open\' AND isoverdue=0 '.
' AND ((reopened is NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),created))>='.$sec.') '.
' OR (reopened is NOT NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),reopened))>='.$sec.') '.
' OR (duedate is NOT NULL AND duedate<NOW()) '.
') ORDER BY created LIMIT 50'; //Age upto 50 tickets at a time?
}else{ //No aging....simply check duedates.
$sql='SELECT ticket_id FROM '.TICKET_TABLE.' WHERE status=\'open\' AND isoverdue=0 '.
' AND (duedate is NOT NULL AND duedate<NOW()) ORDER BY created LIMIT 100';
}
//echo $sql;
if(($stale=db_query($sql)) && db_num_rows($stale)){
while(list($id)=db_fetch_row($stale)){
$ticket = new Ticket($id);
if($ticket->markOverdue(true))
$ticket->logActivity('Ticket markiert als ueberfaellig','Ticket ist vom System als ueberfaellig markiert worden.');
}
}
}
to this new one:
function checkOverdue(){
global $cfg;
if(($hrs=$cfg->getGracePeriod())) {
$sec=$hrs*3600;
$sql='SELECT ticket_id FROM '.TICKET_TABLE.' WHERE (status=\'open\' OR status=\'pending\') AND isoverdue=0 '.
' AND ((reopened is NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),created))>='.$sec.') '.
' OR (reopened is NOT NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),reopened))>='.$sec.') '.
' OR (duedate is NOT NULL AND duedate<NOW()) '.
') ORDER BY created LIMIT 50'; //Age upto 50 tickets at a time?
}else{ //No aging....simply check duedates.
$sql='SELECT ticket_id FROM '.TICKET_TABLE.' WHERE (status=\'open\' OR status=\'pending\') AND isoverdue=0 '.
' AND (duedate is NOT NULL AND duedate<NOW()) ORDER BY created LIMIT 100';
}
//echo $sql;
if(($stale=db_query($sql)) && db_num_rows($stale)){
while(list($id)=db_fetch_row($stale)){
$ticket = new Ticket($id);
if($ticket->markOverdue(true))
$ticket->logActivity('Ticket markiert als ueberfaellig','Ticket ist vom System als ueberfaellig markiert worden.');
}
}
}
the improtant lines are:
from:
SELECT ticket_id FROM '.TICKET_TABLE.' status=\'open\' AND isoverdue=0 '
to:
SELECT ticket_id FROM '.TICKET_TABLE.' (status=\'open\' OR status=\'pending\') AND isoverdue=0 '
I hope it helps You! :-)
P.S.: If you want, that your PENDING Ticket show the "Overdue date" and not the "Closed Date" than you need to find & change this lines in include/staff/viewticket.inc.php
//my Labels are in German, maybe your labels sounds
Ablaufdatum -> Overdue Date
Geschlossen am -> Closed on
Starting Code:
if($ticket->isOpen()){ ?>
<tr>
<th>Ablaufdatum:</th>
<td><?=Format:($ticket->getDueDate())?></td>
</tr>
<?php
}else { ?>
<tr>
<th>Geschlossen am:</th>
<td><?=Format:($ticket->getCloseDate())?></td>
</tr>
<?php
}
?>
need to Change to:
if($ticket->isOpen() OR $ticket->isPending()){ ?>
<tr>
<th>Ablaufdatum:</th>
<td><?=Format:($ticket->getDueDate())?></td>
</tr>
<?php
}else { ?>
<tr>
<th>Geschlossen am:</th>
<td><?=Format:($ticket->getCloseDate())?></td>
</tr>
<?php
}
?>
Best Regards,
Saw
----------------------------------------
you need an Disc -> (visit deineScheibe.de)