Ablility to immediately release a lock if you are the user that is locked on the ticket and be redirected "out" of the ticket so no other modifications will be made.
ISSUE: When a user tries to use this function and they don't have a lock it prompts them with some stuff that may not make sense (but the functionality still works).
/scp/tickets.php (Modified)
case 'process':
$isdeptmanager=($deptId==$thisuser->getDeptId())?true;
switch(strtolower($_POST)):
// *** Added by webPragmatist
case 'unlock_exit':
if($ticket->isLocked() && ($lock=$ticket->getLock()) && !$lock->isExpired()) {
$lock->expire();
header('Location: tickets.php');
}
break;
// *** End addition by webPragmatist
/include/class.lock.php (Modified)
function renew() {
global $cfg;
$sql='UPDATE '.TICKET_LOCK_TABLE.' SET expire=DATE_ADD(NOW(),INTERVAL '.$cfg->getLockTime().' MINUTE) '.
' WHERE lock_id='.db_input($this->getId());
//echo $sql;
if(db_query($sql) && db_affected_rows()) {
$this->reload();
return true;
}
return false;
}
// *** Added by webPragmatist
// Expire / remove existing lock.
function expire() {
$sql='DELETE FROM '.TICKET_LOCK_TABLE.
' WHERE lock_id='.db_input($this->getId());
//echo $sql;
if(db_query($sql) && db_affected_rows()) {
$this->reload();
return true;
}
return false;
}
// *** End addition by webPragmatist
/include/staff/viewticket.inc.php (Modified)
<select id="do" name="do"
onChange="this.form.ticket_priority.disabled=strcmp(this.options.value,'change_priority','reopen','overdue')?false;">
<option value="">Select Action</option>
Added by webPragmatist
<option value="unlock_exit">Unlock & Exit</option>
End addition by webPragmatist