Skip to content
Snippets Groups Projects
Commit 763b2b37 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Don't connect the autoLock unless owned by viewing agent

parent 06a1119b
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ $user = $ticket->getOwner(); //Ticket User (EndUser)
$team = $ticket->getTeam(); //Assigned team.
$sla = $ticket->getSLA();
$lock = $ticket->getLock(); //Ticket lock obj
$mylock = ($lock && $lock->getStaffId() == $thisstaff->getId()) ? $lock : null;
$id = $ticket->getId(); //Ticket ID.
//Useful warnings and errors the user might want to know!
......@@ -514,7 +515,7 @@ $tcount = $ticket->getThreadEntries($types)->count();
<input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>">
<input type="hidden" name="msgId" value="<?php echo $msgId; ?>">
<input type="hidden" name="a" value="reply">
<input type="hidden" name="lockCode" value="<?php echo $ticket->getLock()->getCode(); ?>">
<input type="hidden" name="lockCode" value="<?php echo ($mylock) ? $mylock->getCode() : ''; ?>">
<span class="error"></span>
<table style="width:100%" border="0" cellspacing="0" cellpadding="3">
<tbody id="to_sec">
......@@ -703,7 +704,7 @@ $tcount = $ticket->getThreadEntries($types)->count();
<input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>">
<input type="hidden" name="locktime" value="<?php echo $cfg->getLockTime() * 60; ?>">
<input type="hidden" name="a" value="postnote">
<input type="hidden" name="lockCode" value="<?php echo $ticket->getLock()->getCode(); ?>">
<input type="hidden" name="lockCode" value="<?php echo ($mylock) ? $mylock->getCode() : ''; ?>">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<?php
if($errors['postnote']) {?>
......@@ -1057,14 +1058,14 @@ $(function() {
});
<?php
// Set the lock if one exists
if ($lock) { ?>
if ($mylock) { ?>
!function() {
var setLock = setInterval(function() {
if (typeof(window.autoLock) === 'undefined')
return;
clearInterval(setLock);
autoLock.setLock({
id:<?php echo $lock->getId(); ?>,
id:<?php echo $mylock->getId(); ?>,
time: <?php echo $cfg->getLockTime() * 60; ?>}, 'acquire');
}, 50);
}();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment