コード例 #1
0
ファイル: ajax.tickets.php プロジェクト: nicolap/osTicket-1.7
 function releaseLock($tid, $id = 0)
 {
     global $thisstaff;
     if ($id && is_numeric($id)) {
         //Lock Id provided!
         $lock = TicketLock::lookup($id, $tid);
         //Already gone?
         if (!$lock || !$lock->getStaffId() || $lock->isExpired()) {
             //Said lock doesn't exist or is is expired
             return 1;
         }
         //make sure the user actually owns the lock before releasing it.
         return $lock->getStaffId() == $thisstaff->getId() && $lock->release() ? 1 : 0;
     } elseif ($tid) {
         //release all the locks the user owns on the ticket.
         return TicketLock::removeStaffLocks($thisstaff->getId(), $tid) ? 1 : 0;
     }
     return 0;
 }
コード例 #2
0
 function getLock()
 {
     if (!$this->tlock && $this->getLockId()) {
         $this->tlock = TicketLock::lookup($this->getLockId(), $this->getId());
     }
     return $this->tlock;
 }