if (!$errors && $ticket->isAssigned()) { //Re assigning. //Already assigned to the user? if ($_POST['staffId'] == $ticket->getStaffId()) { $errors['staffId'] = _('Ticket already assigned to the staff.'); } //Admin, Dept manager (any) or current assigneee ONLY can reassign if (!$thisuser->isadmin() && !$thisuser->isManager() && $thisuser->getId() != $ticket->getStaffId()) { $errors['err'] = _('Ticket already assigned. You do not have permission to re-assign assigned tickets'); } } if (!$errors && $ticket->assignStaff($_POST['staffId'], $thisuser->getId(), $_POST['assign_message'], TRUE)) { $staff = $ticket->getStaff(); $msg = _('Ticket Assigned to') . ' ' . ($staff ? $staff->getName() : _('staff')); //Remove all the locks and go back to index page. TicketLock::removeStaffLocks($thisuser->getId(), $ticket->getId()); $page = 'tickets.inc.php'; $ticket = null; } elseif (!$errors['err']) { $errors['err'] = _('Unable to assign the ticket'); } break; case 'postnote': $fields = array(); $fields['title'] = array('type' => 'string', 'required' => 1, 'error' => _('Title required')); $fields['note'] = array('type' => 'string', 'required' => 1, 'error' => _('Note message required')); $params = new Validator($fields); if (!$params->validate($_POST)) { $errors = array_merge($errors, $params->errors()); } if (!$errors && $ticket->postNote($_POST['title'], $_POST['note'])) {
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; }
Copyright (c) 2006-2013 osTicket http://www.osticket.com Released under the GNU General Public License WITHOUT ANY WARRANTY. See LICENSE.TXT for details. vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('staff.inc.php'); //Check token: Make sure the user actually clicked on the link to logout. if(!$_GET['auth'] || !$ost->validateLinkToken($_GET['auth'])) @header('Location: index.php'); $thisstaff->logOut(); //Clear any ticket locks the staff has. TicketLock::removeStaffLocks($thisstaff->getId()); //Destroy session on logout. // TODO: Stop doing this starting with 1.9 - separate session data per // app/panel. session_unset(); session_destroy(); osTicketSession::destroyCookie(); @header('Location: login.php'); require('login.php'); ?>
function releaseLock($params) { global $thisuser; if ($params['id'] && is_numeric($params['id'])) { //Lock Id provided! $lock = new TicketLock($params['id']); //Already gone? if (!$lock->load() || !$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() == $thisuser->getId() && $lock->release() ? 1 : 0; } elseif ($params['tid']) { //release all the locks the user owns on the ticket. return TicketLock::removeStaffLocks($thisuser->getId(), $params['tid']) ? 1 : 0; } return 0; }