diff --git a/include/class.config.php b/include/class.config.php index 8f10d777aa31df72875c9704d359c9a85416f9c2..ef616e0fb7110244bb90db488660167512b97c11 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -419,6 +419,11 @@ class OsticketConfig extends Config { return $this->get('enable_avatars'); } + function isTicketLockEnabled() { + return (($this->getTicketLockMode() != Lock::MODE_DISABLED) + && $this->getLockTime()); + } + function getClientTimeout() { return $this->getClientSessionTimeout(); } diff --git a/scp/tickets.php b/scp/tickets.php index 25e21dfd4e2a4854311393d4d35ccec99195688d..aa0c90339679c184e7d1ccc5283ce4e0a3b1ec35 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -90,7 +90,7 @@ if($_POST && !$errors): if(!$vars['response']) $errors['response']=__('Response required'); - if ($cfg->getLockTime()) { + if ($cfg->isTicketLockEnabled()) { if (!$lock) { $errors['err'] = sprintf('%s %s', __('This action requires a lock.'), __('Please try again!')); } @@ -147,7 +147,7 @@ if($_POST && !$errors): $vars['cannedattachments'] ?: array(), $attachments); $vars['note'] = ThreadEntryBody::clean($vars['note']); - if ($cfg->getLockTime()) { + if ($cfg->isTicketLockEnabled()) { if (!$lock) { $errors['err'] = sprintf('%s %s', __('This action requires a lock.'), __('Please try again!')); }