diff --git a/include/ajax.config.php b/include/ajax.config.php index c259b6028f2ab42b3d615e0e097c5f5b3db7bb1c..239a7f5a4d687d84fbd6d60f8a913cb232772ddd 100644 --- a/include/ajax.config.php +++ b/include/ajax.config.php @@ -39,7 +39,7 @@ class ConfigAjaxAPI extends AjaxController { $config=array( 'lock_time' => ($cfg->getLockTime()*3600), - 'html_thread' => (bool) $cfg->isHtmlThreadEnabled(), + 'html_thread' => (bool) $cfg->isRichTextEnabled(), 'date_format' => $cfg->getDateFormat(true), 'lang' => $lang, 'short_lang' => $sl, @@ -66,7 +66,7 @@ class ConfigAjaxAPI extends AjaxController { } $config=array( - 'html_thread' => (bool) $cfg->isHtmlThreadEnabled(), + 'html_thread' => (bool) $cfg->isRichTextEnabled(), 'lang' => $lang, 'short_lang' => $sl, 'has_rtl' => $rtl, diff --git a/include/ajax.kbase.php b/include/ajax.kbase.php index 3909fd831598a3a23c3a4182cf5a3fb9f469a478..30575ac22b05ee80bcf3aa07d1e52ed9fe5d3b0a 100644 --- a/include/ajax.kbase.php +++ b/include/ajax.kbase.php @@ -26,7 +26,7 @@ class KbaseAjaxAPI extends AjaxController { if(!$id || !($canned=Canned::lookup($id)) || !$canned->isEnabled()) Http::response(404, 'No such premade reply'); - if (!$cfg->isHtmlThreadEnabled()) + if (!$cfg->isRichTextEnabled()) $format .= '.plain'; return $canned->getFormattedResponse($format); diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 1e95dde3ec1c033f51fb70b13456739aafea7cfb..1fb4d5bc5bc070b37875b46e335f8ded7890acbd 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -340,7 +340,7 @@ class TicketsAjaxAPI extends AjaxController { $response = "<br/><blockquote>{$response->asVar()}</blockquote><br/>"; // Return text if html thread is not enabled - if (!$cfg->isHtmlThreadEnabled()) + if (!$cfg->isRichTextEnabled()) $response = Format::html2text($response, 90); else $response = Format::viewableImages($response); @@ -349,7 +349,7 @@ class TicketsAjaxAPI extends AjaxController { return Format::json_encode(array('response' => $response)); } - if (!$cfg->isHtmlThreadEnabled()) + if (!$cfg->isRichTextEnabled()) $format.='.plain'; $varReplacer = function (&$var) use($ticket) { diff --git a/include/ajax.users.php b/include/ajax.users.php index c835ba9807ef28053838620c53dc3834deb33bf8..e00e811a93dffae117d092cf037405e1cd1b2d1f 100644 --- a/include/ajax.users.php +++ b/include/ajax.users.php @@ -35,7 +35,7 @@ class UsersAjaxAPI extends AjaxController { if (!$type || !strcasecmp($type, 'remote')) { foreach (AuthenticationBackend::searchUsers($_REQUEST['q']) as $u) { - $name = new PersonsName(array('first' => $u['first'], 'last' => $u['last'])); + $name = new UsersName(array('first' => $u['first'], 'last' => $u['last'])); $users[] = array('email' => $u['email'], 'name'=>$name, 'info' => "{$u['email']} - $name (remote)", 'id' => "auth:".$u['id'], "/bin/true" => $_REQUEST['q']); @@ -68,7 +68,7 @@ class UsersAjaxAPI extends AjaxController { break; } } - $name = Format::htmlchars(new PersonsName($name)); + $name = Format::htmlchars(new UsersName($name)); $users[] = array('email'=>$email, 'name'=>$name, 'info'=>"$email - $name", "id" => $id, "/bin/true" => $_REQUEST['q']); } diff --git a/include/class.config.php b/include/class.config.php index b2035e9e7be8e6dea4174dbc2aca5f8fb5564969..5c6cf5cee3467bfe4a46ea9fed0dc333f7e72daf 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -156,7 +156,8 @@ class OsticketConfig extends Config { 'pw_reset_window' => 30, 'enable_html_thread' => true, 'allow_attachments' => true, - 'name_format' => 'full', # First Last + 'agent_name_format' => 'full', # First Last + 'client_name_format' => 'original', # As entered 'auto_claim_tickets'=> true, 'system_language' => 'en_US', 'default_storage_bk' => 'D', @@ -364,7 +365,7 @@ class OsticketConfig extends Config { return $this->get('passwd_reset_period'); } - function isHtmlThreadEnabled() { + function isRichTextEnabled() { return $this->get('enable_html_thread'); } @@ -404,8 +405,12 @@ class OsticketConfig extends Config { return $this->get('autolock_minutes'); } - function getDefaultNameFormat() { - return $this->get('name_format'); + function getAgentNameFormat() { + return $this->get('agent_name_format'); + } + + function getClientNameFormat() { + return $this->get('client_name_format'); } function getDefaultDeptId() { @@ -1000,8 +1005,11 @@ class OsticketConfig extends Config { case 'pages': return $this->updatePagesSettings($vars, $errors); break; - case 'access': - return $this->updateAccessSettings($vars, $errors); + case 'agents': + return $this->updateAgentsSettings($vars, $errors); + break; + case 'users': + return $this->updateUsersSettings($vars, $errors); break; case 'kb': return $this->updateKBSettings($vars, $errors); @@ -1019,6 +1027,7 @@ class OsticketConfig extends Config { $f['helpdesk_url']=array('type'=>'string', 'required'=>1, 'error'=>__('Helpdesk URL is required')); $f['helpdesk_title']=array('type'=>'string', 'required'=>1, 'error'=>__('Helpdesk title is required')); $f['default_dept_id']=array('type'=>'int', 'required'=>1, 'error'=>__('Default Department is required')); + $f['autolock_minutes']=array('type'=>'int', 'required'=>1, 'error'=>__('Enter lock time in minutes')); //Date & Time Options $f['time_format']=array('type'=>'string', 'required'=>1, 'error'=>__('Time format is required')); $f['date_format']=array('type'=>'string', 'required'=>1, 'error'=>__('Date format is required')); @@ -1027,6 +1036,17 @@ class OsticketConfig extends Config { $f['default_timezone']=array('type'=>'string', 'required'=>1, 'error'=>__('Default Timezone is required')); $f['system_language']=array('type'=>'string', 'required'=>1, 'error'=>__('A primary system language is required')); + // Make sure the selected backend is valid + $storagebk = null; + if (isset($vars['default_storage_bk'])) { + try { + $storagebk = FileStorageBackend::lookup($vars['default_storage_bk']); + + } catch (Exception $ex) { + $errors['default_storage_bk'] = $ex->getMessage(); + } + } + if(!Validator::process($f, $vars, $errors) || $errors) return false; @@ -1038,6 +1058,10 @@ class OsticketConfig extends Config { } $secondary_langs = implode(',', $vars['secondary_langs']); + if ($storagebk) + $this->update('default_storage_bk', $storagebk->getBkChar()); + + return $this->updateAll(array( 'isonline'=>$vars['isonline'], 'helpdesk_title'=>$vars['helpdesk_title'], @@ -1046,7 +1070,6 @@ class OsticketConfig extends Config { 'max_page_size'=>$vars['max_page_size'], 'log_level'=>$vars['log_level'], 'log_graceperiod'=>$vars['log_graceperiod'], - 'name_format'=>$vars['name_format'], 'time_format'=>$vars['time_format'], 'date_format'=>$vars['date_format'], 'datetime_format'=>$vars['datetime_format'], @@ -1056,17 +1079,18 @@ class OsticketConfig extends Config { 'default_locale'=>$vars['default_locale'], 'system_language'=>$vars['system_language'], 'secondary_langs'=>$secondary_langs, + 'max_file_size' => $vars['max_file_size'], + 'autolock_minutes' => $vars['autolock_minutes'], + 'enable_html_thread' => isset($vars['enable_html_thread']) ? 1 : 0, )); } - function updateAccessSettings($vars, &$errors) { + function updateAgentsSettings($vars, &$errors) { $f=array(); $f['staff_session_timeout']=array('type'=>'int', 'required'=>1, 'error'=>'Enter idle time in minutes'); - $f['client_session_timeout']=array('type'=>'int', 'required'=>1, 'error'=>'Enter idle time in minutes'); $f['pw_reset_window']=array('type'=>'int', 'required'=>1, 'min'=>1, 'error'=>__('Valid password reset window required')); - if(!Validator::process($f, $vars, $errors) || $errors) return false; @@ -1076,14 +1100,29 @@ class OsticketConfig extends Config { 'staff_login_timeout'=>$vars['staff_login_timeout'], 'staff_session_timeout'=>$vars['staff_session_timeout'], 'staff_ip_binding'=>isset($vars['staff_ip_binding'])?1:0, + 'allow_pw_reset'=>isset($vars['allow_pw_reset'])?1:0, + 'pw_reset_window'=>$vars['pw_reset_window'], + 'agent_name_format'=>$vars['agent_name_format'], + + )); + } + + function updateUsersSettings($vars, &$errors) { + $f=array(); + $f['client_session_timeout']=array('type'=>'int', 'required'=>1, 'error'=>'Enter idle time in minutes'); + + if(!Validator::process($f, $vars, $errors) || $errors) + return false; + + return $this->updateAll(array( 'client_max_logins'=>$vars['client_max_logins'], 'client_login_timeout'=>$vars['client_login_timeout'], 'client_session_timeout'=>$vars['client_session_timeout'], - 'allow_pw_reset'=>isset($vars['allow_pw_reset'])?1:0, - 'pw_reset_window'=>$vars['pw_reset_window'], 'clients_only'=>isset($vars['clients_only'])?1:0, 'client_registration'=>$vars['client_registration'], 'client_verify_email'=>isset($vars['client_verify_email'])?1:0, + 'client_name_format'=>$vars['client_name_format'], + )); } @@ -1093,7 +1132,6 @@ class OsticketConfig extends Config { $f['default_ticket_status_id'] = array('type'=>'int', 'required'=>1, 'error'=>__('Selection required')); $f['default_priority_id']=array('type'=>'int', 'required'=>1, 'error'=>__('Selection required')); $f['max_open_tickets']=array('type'=>'int', 'required'=>1, 'error'=>__('Enter valid numeric value')); - $f['autolock_minutes']=array('type'=>'int', 'required'=>1, 'error'=>__('Enter lock time in minutes')); if($vars['enable_captcha']) { @@ -1118,9 +1156,6 @@ class OsticketConfig extends Config { if(!Validator::process($f, $vars, $errors) || $errors) return false; - if (isset($vars['default_storage_bk'])) - $this->update('default_storage_bk', $vars['default_storage_bk']); - return $this->updateAll(array( 'ticket_number_format'=>$vars['ticket_number_format'] ?: '######', 'ticket_sequence_id'=>$vars['ticket_sequence_id'] ?: 0, @@ -1129,16 +1164,13 @@ class OsticketConfig extends Config { 'default_ticket_status_id'=>$vars['default_ticket_status_id'], 'default_sla_id'=>$vars['default_sla_id'], 'max_open_tickets'=>$vars['max_open_tickets'], - 'autolock_minutes'=>$vars['autolock_minutes'], 'enable_captcha'=>isset($vars['enable_captcha'])?1:0, 'auto_claim_tickets'=>isset($vars['auto_claim_tickets'])?1:0, 'show_assigned_tickets'=>isset($vars['show_assigned_tickets'])?0:1, 'show_answered_tickets'=>isset($vars['show_answered_tickets'])?0:1, 'show_related_tickets'=>isset($vars['show_related_tickets'])?1:0, 'hide_staff_name'=>isset($vars['hide_staff_name'])?1:0, - 'enable_html_thread'=>isset($vars['enable_html_thread'])?1:0, 'allow_client_updates'=>isset($vars['allow_client_updates'])?1:0, - 'max_file_size'=>$vars['max_file_size'], )); } diff --git a/include/class.dept.php b/include/class.dept.php index a66198500450581ae25e8e6a561de4f4677cc431..a841f43e01959e19f775aa6b7bf2de955ae79a2b 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -177,7 +177,7 @@ implements TemplateVariable { )); $members->distinct('staff_id'); - switch ($cfg->getDefaultNameFormat()) { + switch ($cfg->getAgentNameFormat()) { case 'last': case 'lastfirst': case 'legal': diff --git a/include/class.forms.php b/include/class.forms.php index f1745be92f6e830d5c06fab30c5c641da1e0db22..9ccb615809700b919a8a815182dbf3d0957d83c1 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -2982,7 +2982,7 @@ class ThreadEntryWidget extends Widget { ?>: <span class="error">*</span></span><br/> <textarea style="width:100%;" name="<?php echo $this->field->get('name'); ?>" placeholder="<?php echo Format::htmlchars($this->field->get('hint')); ?>" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft draft-delete" <?php echo $attrs; ?> cols="21" rows="8" style="width:80%;"><?php echo $draft ?: Format::htmlchars($this->value); ?></textarea> diff --git a/include/class.mailer.php b/include/class.mailer.php index 83f097050624924326e9da6b22e90eeb041f5deb..cedb308d7982f29ae20c934ea468c0245e6a9143 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -417,7 +417,7 @@ class Mailer { $isHtml = false; } - if ($isHtml && $cfg && $cfg->isHtmlThreadEnabled()) { + if ($isHtml && $cfg && $cfg->isRichTextEnabled()) { // Pick a domain compatible with pear Mail_Mime $matches = array(); if (preg_match('#(@[0-9a-zA-Z\-\.]+)#', $this->getFromAddress(), $matches)) { diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php index 8a8839a9eaa7e51919066d901b50c098bbab5e08..d1ad8fbec966ce1a9b6b08211d0aacd54afb3930 100644 --- a/include/class.mailfetch.php +++ b/include/class.mailfetch.php @@ -579,7 +579,7 @@ class MailFetcher { function getBody($mid) { global $cfg; - if ($cfg->isHtmlThreadEnabled()) { + if ($cfg->isRichTextEnabled()) { if ($html=$this->getPart($mid, 'text/html', $this->charset)) $body = new HtmlThreadEntryBody($html); elseif ($text=$this->getPart($mid, 'text/plain', $this->charset)) diff --git a/include/class.mailparse.php b/include/class.mailparse.php index 6564a4a22ac9f3190543c18aa4971ac06f1826ab..083e3b26c92818128b3ea8913a0cd267b64f31a8 100644 --- a/include/class.mailparse.php +++ b/include/class.mailparse.php @@ -303,7 +303,7 @@ class Mail_Parse { function getBody(){ global $cfg; - if ($cfg && $cfg->isHtmlThreadEnabled()) { + if ($cfg && $cfg->isRichTextEnabled()) { if ($html=$this->getPart($this->struct,'text/html')) $body = new HtmlThreadEntryBody($html); elseif ($text=$this->getPart($this->struct,'text/plain')) diff --git a/include/class.nav.php b/include/class.nav.php index e6df1e897ea390b2d59b4dc38de5edfcdf11ae18..867f34623c541ac6191cc6c4843221b7a63b7899 100644 --- a/include/class.nav.php +++ b/include/class.nav.php @@ -247,7 +247,8 @@ class AdminNav extends StaffNav{ $subnav[]=array('desc'=>__('System'),'href'=>'settings.php?t=system','iconclass'=>'preferences'); $subnav[]=array('desc'=>__('Tickets'),'href'=>'settings.php?t=tickets','iconclass'=>'ticket-settings'); $subnav[]=array('desc'=>__('Tasks'),'href'=>'settings.php?t=tasks','iconclass'=>'lists'); - $subnav[]=array('desc'=>__('Access'),'href'=>'settings.php?t=access','iconclass'=>'users'); + $subnav[]=array('desc'=>__('Agents'),'href'=>'settings.php?t=agents','iconclass'=>'teams'); + $subnav[]=array('desc'=>__('Users'),'href'=>'settings.php?t=users','iconclass'=>'groups'); $subnav[]=array('desc'=>__('Knowledgebase'),'href'=>'settings.php?t=kb','iconclass'=>'kb-settings'); break; case 'manage': diff --git a/include/class.staff.php b/include/class.staff.php index 8e4ef95b0705433d2f1444d16c35564bc18d7bb3..2a9c3673bed43ffae8f80fd01834b246dc5d54ed 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -253,7 +253,7 @@ implements AuthenticatedUser, EmailContact, TemplateVariable { } function getName() { - return new PersonsName(array('first' => $this->ht['firstname'], 'last' => $this->ht['lastname'])); + return new AgentsName(array('first' => $this->ht['firstname'], 'last' => $this->ht['lastname'])); } function getFirstName() { @@ -709,7 +709,7 @@ implements AuthenticatedUser, EmailContact, TemplateVariable { )); } - switch ($cfg->getDefaultNameFormat()) { + switch ($cfg->getAgentNameFormat()) { case 'last': case 'lastfirst': case 'legal': diff --git a/include/class.task.php b/include/class.task.php index dd7fadcbd25f560b55904ea994f1862f59273919..36c858e6bcba083bfd148989a040f9910e3341ff 100644 --- a/include/class.task.php +++ b/include/class.task.php @@ -664,7 +664,7 @@ class Task extends TaskModel implements Threadable { $where2 = ''; if(($teams=$staff->getTeams())) - $where[] = ' ( flags.team_id IN('.implode(',', db_input(array_filter($teams))) + $where[] = ' ( task.team_id IN('.implode(',', db_input(array_filter($teams))) .') AND ' .sprintf('task.flags & %d != 0 ', TaskModel::ISOPEN) .')'; diff --git a/include/class.thread.php b/include/class.thread.php index 75d5a14a396bf1830b0708f89f6a6d0f7caeb72d..bce15899974ffee9e8cf36ae076afd78c14d0cc7 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -612,7 +612,7 @@ implements TemplateVariable { global $cfg; if (!$body instanceof ThreadEntryBody) { - if ($cfg->isHtmlThreadEnabled()) + if ($cfg->isRichTextEnabled()) $body = new HtmlThreadEntryBody($body); else $body = new TextThreadEntryBody($body); @@ -1221,7 +1221,7 @@ implements TemplateVariable { if (!$vars['body'] instanceof ThreadEntryBody) { - if ($cfg->isHtmlThreadEnabled()) + if ($cfg->isRichTextEnabled()) $vars['body'] = new HtmlThreadEntryBody($vars['body']); else $vars['body'] = new TextThreadEntryBody($vars['body']); diff --git a/include/class.ticket.php b/include/class.ticket.php index cde27c4783d845c497f9166bd6cbc4bd90207d84..d571a845db87e4fd9b9b345de29c12750a3aa66b 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -2282,7 +2282,7 @@ implements RestrictedAccess, Threadable, TemplateVariable { foreach ($canned->attachments->getAll() as $file) $files[] = $file['id']; - if ($cfg->isHtmlThreadEnabled()) + if ($cfg->isRichTextEnabled()) $response = new HtmlThreadEntryBody( $this->replaceVars($canned->getHtml())); else @@ -3413,7 +3413,7 @@ implements RestrictedAccess, Threadable, TemplateVariable { // Not assigned...save optional note if any if (!$vars['assignId'] && $vars['note']) { - if (!$cfg->isHtmlThreadEnabled()) { + if (!$cfg->isRichTextEnabled()) { $vars['note'] = new TextThreadBody($vars['note']); } $ticket->logNote(_S('New Ticket'), $vars['note'], $thisstaff, false); @@ -3438,7 +3438,7 @@ implements RestrictedAccess, Threadable, TemplateVariable { $message = (string) $ticket->getLastMessage(); if($response) { - $message .= ($cfg->isHtmlThreadEnabled()) ? "<br><br>" : "\n\n"; + $message .= ($cfg->isRichTextEnabled()) ? "<br><br>" : "\n\n"; $message .= $response->getBody(); } diff --git a/include/class.user.php b/include/class.user.php index 9ab9009f32981e86fdf7e69ccf0c38094810b652..751d17368b442f956b55fe6d76843894eaaaef2b 100644 --- a/include/class.user.php +++ b/include/class.user.php @@ -280,7 +280,7 @@ implements TemplateVariable { list($name) = explode('@', $this->getDefaultEmailAddress(), 2); else $name = $this->name; - return new PersonsName($name); + return new UsersName($name); } function getUpdateDate() { @@ -742,10 +742,10 @@ implements TemplateVariable { function __construct($name, $format=null) { global $cfg; - if ($format && !isset(static::$formats[$format])) + if ($format && isset(static::$formats[$format])) $this->format = $format; - elseif($cfg) - $this->format = $cfg->getDefaultNameFormat(); + else + $this->format = 'original'; if (!is_array($name)) { $this->parts = static::splitName($name); @@ -923,6 +923,28 @@ implements TemplateVariable { } +class AgentsName extends PersonsName { + function __construct($name, $format=null) { + global $cfg; + + if (!$format && $cfg) + $format = $cfg->getAgentNameFormat(); + + parent::__construct($name, $format); + } +} + +class UsersName extends PersonsName { + function __construct($name, $format=null) { + global $cfg; + if (!$format && $cfg) + $format = $cfg->getClientNameFormat(); + + parent::__construct($name, $format); + } +} + + class UserEmail extends UserEmailModel { static function ensure($address) { $email = static::lookup(array('address'=>$address)); diff --git a/include/client/view.inc.php b/include/client/view.inc.php index 4f96855d7fe0822a3c14c7a27877d9c26bd601b3..2aead70b0e28f0bad62c61c7dca9c2546107cae7 100644 --- a/include/client/view.inc.php +++ b/include/client/view.inc.php @@ -197,7 +197,7 @@ if (!$ticket->isClosed() || $ticket->isReopenable()) { ?> <font class="error">* <?php echo $errors['message']; ?></font> </p> <textarea name="message" id="message" cols="50" rows="9" wrap="soft" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft" <?php list($draft, $attrs) = Draft::getDraftAndDataAttrs('ticket.client', $ticket->getId(), $info['message']); echo $attrs; ?>><?php echo $draft ?: $info['message']; diff --git a/include/i18n/en_US/help/tips/settings.agents.yaml b/include/i18n/en_US/help/tips/settings.agents.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bf1ba0602ad93c0766dadf3f1dd63b6f22c2833e --- /dev/null +++ b/include/i18n/en_US/help/tips/settings.agents.yaml @@ -0,0 +1,70 @@ +# +# This is popup help messages for the Admin Panel -> Settings -> Agents +# +# Fields: +# title - Shown in bold at the top of the popover window +# content - The body of the help popover +# links - List of links shows below the content +# title - Link title +# href - href of link (links starting with / are translated to the +# helpdesk installation path) +# +# The key names such as 'helpdesk_name' should not be translated as they +# must match the HTML #ids put into the page template. +# +--- + +# General Settings +agent_name_format: + title: Agent Name Formatting + content: > + Choose a format for Agents names throughout the system. Email templates + will use it for names if no other format is specified. + +# Authentication settings +password_reset: + title: Password Expiration Policy + content: > + Sets how often (in months) Agents will be required to change + their password. If disabled (set to "No expiration"), passwords will + not expire. + +password_expiration_policy: + title: Password Expiration Policy + content: > + Choose how often Agents will be required to change their password. If + disabled (i.e., <span class="doc-desc-opt">No Expiration</span>), passwords + will not expire. + +allow_password_resets: + title: Allow Password Resets + content: > + Enable this feature if you would like to display the + <span class="doc-desc-title">Forgot My Password</span> link on the + <span class="doc-desc-title">Staff Log-In Page</span> + after a failed log in attempt. + +reset_token_expiration: + title: Password Reset Window + content: > + Choose the duration (in minutes) for which the <span class="doc-desc-title"> + Password Reset Tokens</span> will be valid. When an Agent requests a <span + class="doc-desc-title">Password Reset</span>, they are emailed a token that + will permit the reset to take place. + +staff_session_timeout: + title: Agent Session Timeout + content: > + Choose the maximum idle time (in minutes) before an Agent is required to + log in again. + <br><br> + If you would like to disable <span class="doc-desc-title">Agent + Session Timeouts</span>, enter 0. + +bind_staff_session_to_ip: + title: Bind Agent Session to IP + content: > + Enable this if you want Agent to be remembered by their current IP + upon Log In. + <br><br> + This setting is not recommened for users assigned IP addresses dynamically. diff --git a/include/i18n/en_US/help/tips/settings.system.yaml b/include/i18n/en_US/help/tips/settings.system.yaml index cfd4d3ef6caf49fccbc946d5a31ac41dc0548088..db6515157f82405394dda2842ed0a33029949caf 100644 --- a/include/i18n/en_US/help/tips/settings.system.yaml +++ b/include/i18n/en_US/help/tips/settings.system.yaml @@ -66,16 +66,19 @@ purge_logs: Determine how long you would like to keep <span class="doc-desc-title">System Logs</span> before they are deleted. -default_name_formatting: - title: Default Name Formatting +enable_richtext: + title: Enable Rich Text content: > - Choose a format for names throughout the system. Email templates - will use it for names if no other format is specified in the - variable. + If enabled, this will permit the use of rich text formatting between + Clients and Agents. - links: - - title: Supported Email Template Variables - href: http://osticket.com/wiki/Email_templates +collision_avoidance: + title: Agent Collision Avoidance + content: > + Enter the maximum length of time an Agent is allowed to hold a lock + on a ticket or task without any activity. + <br><br> + Enter <span class="doc-desc-opt">0</span> to disable the lockout feature. # Date and time options date_time_options: @@ -115,3 +118,23 @@ secondary_language: The interface will be available in these languages, and custom content, such as thank-you pages and help topic names, will be translatable to these languages. + +# Attachments +attachments: + title: Attachment Settings and Storage + content: > + Configure how attachments are stored. + +default_storage_bk: + title: File Storage Backend + content: > + Choose how attachments are stored. + <br<br> + Additional storage backends can be added by installing storage plugins + +max_file_size: + title: Maximum File Size + content: > + Choose a maximum file size for attachments uploaded by agents. This + includes canned attachments, knowledge base articles, and + attachments to ticket and task replies. diff --git a/include/i18n/en_US/help/tips/settings.ticket.yaml b/include/i18n/en_US/help/tips/settings.ticket.yaml index bb4d01fc5006717838617c843cc2c4ac0f2619da..b54e13e3cb570ff8abd8c14c17720a118f26e7e4 100644 --- a/include/i18n/en_US/help/tips/settings.ticket.yaml +++ b/include/i18n/en_US/help/tips/settings.ticket.yaml @@ -68,14 +68,6 @@ maximum_open_tickets: <br><br> Enter <span class="doc-desc-opt">0 </span> if you prefer to disable this limitation. -agent_collision_avoidance: - title: Agent Collision Avoidance - content: > - Enter the maximum length of time an Agent is allowed to hold a lock - on a ticket without any activity. - <br><br> - Enter <span class="doc-desc-opt">0</span> to disable the lockout feature. - email_ticket_priority: title: Email Ticket Priority content: > @@ -122,12 +114,6 @@ staff_identity_masking: If enabled, this will hide the Agent’s name from the Client during any communication. -enable_html_ticket_thread: - title: Enable HTML Ticket Thread - content: > - If enabled, this will permit the use of rich text formatting between - Clients and Agents. - ticket_attachment_settings: title: Ticket Thread Attachments content: > @@ -136,9 +122,3 @@ ticket_attachment_settings: are used for all new tickets and new messages regardless of the source channel (web portal, email, api, etc.). -max_file_size: - title: Maximum File Size - content: > - Choose a maximum file size for attachments uploaded by agents. This - includes canned attachments, knowledge base articles, and - attachments to ticket replies. diff --git a/include/i18n/en_US/help/tips/settings.access.yaml b/include/i18n/en_US/help/tips/settings.users.yaml similarity index 62% rename from include/i18n/en_US/help/tips/settings.access.yaml rename to include/i18n/en_US/help/tips/settings.users.yaml index 1d88a13bf894cd0878b7a7b2ad90d23b8aa9dd01..3a6f5b918b8b860fd1fe64384dacff4d824db2db 100644 --- a/include/i18n/en_US/help/tips/settings.access.yaml +++ b/include/i18n/en_US/help/tips/settings.users.yaml @@ -1,5 +1,5 @@ # -# This is popup help messages for the Admin Panel -> Settings -> System page +# This is popup help messages for the Admin Panel -> Settings -> Users # # Fields: # title - Shown in bold at the top of the popover window @@ -13,46 +13,14 @@ # must match the HTML #ids put into the page template. # --- -# Authentication settings -password_reset: - title: Password Expiration Policy - content: > - Sets how often (in months) staff members will be required to change - their password. If disabled (set to "No expiration"), passwords will - not expire. - -password_expiration_policy: - title: Password Expiration Policy - content: > - Choose how often Agents will be required to change their password. If - disabled (i.e., <span class="doc-desc-opt">No Expiration</span>), passwords - will not expire. - -allow_password_resets: - title: Allow Password Resets - content: > - Enable this feature if you would like to display the - <span class="doc-desc-title">Forgot My Password</span> link on the - <span class="doc-desc-title">Staff Log In Panel</span> - after a failed log in attempt. - -reset_token_expiration: - title: Password Reset Window +# General Settings +client_name_format: + title: User Name Formatting content: > - Choose the duration (in minutes) for which the <span class="doc-desc-title"> - Password Reset Tokens</span> will be valid. When an Agent requests a <span - class="doc-desc-title">Password Reset</span>, they are emailed a token that - will permit the reset to take place. - -staff_session_timeout: - title: Staff Session Timeout - content: > - Choose the maximum idle time (in minutes) before an Agent is required to - log in again. - <br><br> - If you would like to disable <span class="doc-desc-title">Staff - Session Timeouts</span>, enter 0. + Choose a format for Users names throughout the system. Email templates + will use it for names if no other format is specified. +# Authentication settings client_session_timeout: title: User Session Timeout content: > @@ -62,14 +30,6 @@ client_session_timeout: If you would like to disable <span class="doc-desc-title">User Session Timeouts,</span> enter 0. -bind_staff_session_to_ip: - title: Bind Staff Session to IP - content: > - Enable this if you want Agent to be remembered by their current IP - upon Log In. - <br><br> - This setting is not recommened for users assigned IP addreses dynamically. - registration_method: title: Registration Options content: > diff --git a/include/staff/directory.inc.php b/include/staff/directory.inc.php index 4e53d3597bb75cf2075b9045f81aa5b4783f92df..f592cd8b558cc9a0ed0e49a1c4f32f4e25ddb1c8 100644 --- a/include/staff/directory.inc.php +++ b/include/staff/directory.inc.php @@ -37,11 +37,11 @@ $sortOptions=array('name'=>array('firstname','lastname'),'email'=>'email','dept' 'created'=>'created','login'=>'lastlogin'); $orderWays=array('DESC'=>'-','ASC'=>''); -switch ($cfg->getDefaultNameFormat()) { +switch ($cfg->getAgentNameFormat()) { case 'last': case 'lastfirst': case 'legal': - $sortOptions['name'] = 'staff.lastname, staff.firstname'; + $sortOptions['name'] = array('lastname', 'firstname'); break; // Otherwise leave unchanged } diff --git a/include/staff/settings-agents.inc.php b/include/staff/settings-agents.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..874aa2202de8dcc3350368ddd6d63efd95191d1c --- /dev/null +++ b/include/staff/settings-agents.inc.php @@ -0,0 +1,160 @@ +<?php +if (!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); + +?> +<h2><?php echo __('Agents Settings'); ?></h2> +<form action="settings.php?t=agents" method="post" id="save"> +<?php csrf_token(); ?> +<input type="hidden" name="t" value="agents" > +<ul class="tabs" id="agents-tabs"> + <li class="active"><a href="#settings"> + <i class="icon-asterisk"></i> <?php echo __('Settings'); ?></a></li> + <li><a href="#templates"> + <i class="icon-file-text"></i> <?php echo __('Templates'); ?></a></li> +</ul> +<div id="agents-tabs_container"> + <div id="settings" class="tab_content"> +<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> + <tr> + <th colspan="2"> + <em><b><?php echo __('General Settings'); ?></b></em> + </th> + </tr> + <tr> + <td width="180"><?php echo __('Name Formatting'); ?>:</td> + <td> + <select name="agent_name_format"> + <?php foreach (PersonsName::allFormats() as $n=>$f) { + list($desc, $func) = $f; + $selected = ($config['agent_name_format'] == $n) ? 'selected="selected"' : ''; ?> + <option value="<?php echo $n; ?>" <?php echo $selected; + ?>><?php echo __($desc); ?></option> + <?php } ?> + </select> + <i class="help-tip icon-question-sign" href="#agent_name_format"></i> + </td> + </tr> + <tr> + <th colspan="2"> + <em><b><?php echo __('Authentication Settings'); ?></b></em> + </th> + </tr> + <tr><td><?php echo __('Password Expiration Policy'); ?>:</th> + <td> + <select name="passwd_reset_period"> + <option value="0"> — <?php echo __('No expiration'); ?> —</option> + <?php + for ($i = 1; $i <= 12; $i++) { + echo sprintf('<option value="%d" %s>%s</option>', + $i,(($config['passwd_reset_period']==$i)?'selected="selected"':''), + sprintf(_N('Monthly', 'Every %d months', $i), $i)); + } + ?> + </select> + <font class="error"><?php echo $errors['passwd_reset_period']; ?></font> + <i class="help-tip icon-question-sign" href="#password_expiration_policy"></i> + </td> + </tr> + <tr><td><?php echo __('Allow Password Resets'); ?>:</th> + <td> + <input type="checkbox" name="allow_pw_reset" <?php echo $config['allow_pw_reset']?'checked="checked"':''; ?>> + <i class="help-tip icon-question-sign" href="#allow_password_resets"></i> + </td> + </tr> + <tr><td><?php echo __('Reset Token Expiration'); ?>:</th> + <td> + <input type="text" name="pw_reset_window" size="6" value="<?php + echo $config['pw_reset_window']; ?>"> + <em><?php echo __('minutes'); ?></em> + <i class="help-tip icon-question-sign" href="#reset_token_expiration"></i> + <font class="error"><?php echo $errors['pw_reset_window']; ?></font> + </td> + </tr> + <tr><td><?php echo __('Agent Excessive Logins'); ?>:</td> + <td> + <select name="staff_max_logins"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_max_logins']==$i)?'selected="selected"':''), $i); + } + ?> + </select> <?php echo __( + 'failed login attempt(s) allowed before a lock-out is enforced'); ?> + <br/> + <select name="staff_login_timeout"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['staff_login_timeout']==$i)?'selected="selected"':''), $i); + } + ?> + </select> <?php echo __('minutes locked out'); ?> + </td> + </tr> + <tr><td><?php echo __('Agent Session Timeout'); ?>:</td> + <td> + <input type="text" name="staff_session_timeout" size=6 value="<?php echo $config['staff_session_timeout']; ?>"> + <?php echo __('minutes'); ?> <em><?php echo __('(0 to disable)'); ?></em>. <i class="help-tip icon-question-sign" href="#staff_session_timeout"></i> + </td> + </tr> + <tr><td><?php echo __('Bind Agent Session to IP'); ?>:</td> + <td> + <input type="checkbox" name="staff_ip_binding" <?php echo $config['staff_ip_binding']?'checked="checked"':''; ?>> + <i class="help-tip icon-question-sign" href="#bind_staff_session_to_ip"></i> + </td> + </tr> + </tbody> + </table> + </div> + <div id="templates" class="tab_content hidden"> + <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> +<?php +$res = db_query('select distinct(`type`), content_id, notes, name, updated from ' + .PAGE_TABLE + .' where isactive=1 group by `type`'); +$contents = array(); +while (list($type, $id, $notes, $name, $u) = db_fetch_row($res)) + $contents[$type] = array($id, $name, $notes, $u); + +$manage_content = function($title, $content) use ($contents) { + list($id, $name, $notes, $upd) = $contents[$content]; + $notes = explode('. ', $notes); + $notes = $notes[0]; + ?><tr><td colspan="2"> + <div style="padding:2px 5px"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201); + return false;" class="pull-left"><i class="icon-file-text icon-2x" + style="color:#bbb;"></i> </a> + <span style="display:inline-block;width:90%;width:calc(100% - 32px);padding-left:10px;line-height:1.2em"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201, null, {size:'large'}); + return false;"><?php + echo Format::htmlchars($title); ?></a><br/> + <span class="faded"><?php + echo Format::display($notes); ?> + <br><em><?php echo sprintf(__('Last Updated %s'), Format::datetime($upd)); + ?></em></span> + </div></td></tr><?php +}; ?> + <tr> + <th colspan="2"> + <em><b><?php echo __( + 'Authentication and Registration Templates & Pages'); ?></b></em> + </th> + </tr> + <?php $manage_content(__('Agent Welcome Email'), 'registration-staff'); ?> + <?php $manage_content(__('Sign-in Login Banner'), 'banner-staff'); ?> + <?php $manage_content(__('Password Reset Email'), 'pwreset-staff'); ?> +</tbody> +</table> +</div> +<p style="text-align:center"> + <input class="button" type="submit" name="submit" value="<?php echo __('Save Changes'); ?>"> + <input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes'); ?>"> +</p> +</div> +</form> diff --git a/include/staff/settings-system.inc.php b/include/staff/settings-system.inc.php index 8063c1d15fae50ae7ed94a8165082625581faf7a..e166413c5e288838032c536667b34c22ca378274 100644 --- a/include/staff/settings-system.inc.php +++ b/include/staff/settings-system.inc.php @@ -61,6 +61,23 @@ $gmtime = Misc::gmtime(); <i class="help-tip icon-question-sign" href="#default_department"></i> </td> </tr> + <tr> + <td><?php echo __('Collision Avoidance Duration'); ?>:</td> + <td> + <input type="text" name="autolock_minutes" size=4 value="<?php echo $config['autolock_minutes']; ?>"> + <font class="error"><?php echo $errors['autolock_minutes']; ?></font> <?php echo __('minutes'); ?> + <i class="help-tip icon-question-sign" href="#collision_avoidance"></i> + </td> + </tr> + <tr> + <td><?php echo __('Enable Rich Text'); ?>:</td> + <td> + <input type="checkbox" name="enable_html_thread" <?php + echo $config['enable_html_thread']?'checked="checked"':''; ?>> + <?php echo __('Enable html in thread entries and email correspondence.'); ?> + <i class="help-tip icon-question-sign" href="#enable_richtext"></i> + </td> + </tr> <tr><td><?php echo __('Default Page Size');?>:</td> <td> @@ -106,20 +123,6 @@ $gmtime = Misc::gmtime(); <i class="help-tip icon-question-sign" href="#purge_logs"></i> </td> </tr> - <tr> - <td width="180"><?php echo __('Default Name Formatting'); ?>:</td> - <td> - <select name="name_format"> - <?php foreach (PersonsName::allFormats() as $n=>$f) { - list($desc, $func) = $f; - $selected = ($config['name_format'] == $n) ? 'selected="selected"' : ''; ?> - <option value="<?php echo $n; ?>" <?php echo $selected; - ?>><?php echo __($desc); ?></option> - <?php } ?> - </select> - <i class="help-tip icon-question-sign" href="#default_name_formatting"></i> - </td> - </tr> <tr> <th colspan="2"> <em><b><?php echo __('Date and Time Options'); ?></b> @@ -281,6 +284,73 @@ $gmtime = Misc::gmtime(); <span class="error"> <?php echo $errors['add_secondary_language']; ?></span> <i class="help-tip icon-question-sign" href="#secondary_language"></i> </td></tr> + <tr> + <th colspan="2"> + <em><b><?php echo __('Attachments Storage and Settings');?></b>:<i + class="help-tip icon-question-sign" href="#attachments"></i></em> + </th> + </tr> + <tr> + <td width="180"><?php echo __('Store Attachments'); ?>:</td> + <td><select name="default_storage_bk"><?php + if (($bks = FileStorageBackend::allRegistered())) { + foreach ($bks as $char=>$class) { + $selected = $config['default_storage_bk'] == $char + ? 'selected="selected"' : ''; + ?><option <?php echo $selected; ?> value="<?php echo $char; ?>" + ><?php echo $class::$desc; ?></option><?php + } + } else { + echo sprintf('<option value="">%s</option>', + __('Select Storage Backend')); + }?> + </select> + <font class="error">* <?php echo + $errors['default_storage_bk']; ?></font> + <i class="help-tip icon-question-sign" + href="#default_storage_bk"></i> + </td> + </tr> + <tr> + <td width="180"><?php echo __( + // Maximum size for agent-uploaded files (via SCP) + 'Agent Maximum File Size');?>:</td> + <td> + <select name="max_file_size"> + <option value="262144">— <?php echo __('Small'); ?> —</option> + <?php $next = 512 << 10; + $max = strtoupper(ini_get('upload_max_filesize')); + $limit = (int) $max; + if (!$limit) $limit = 2 << 20; # 2M default value + elseif (strpos($max, 'K')) $limit <<= 10; + elseif (strpos($max, 'M')) $limit <<= 20; + elseif (strpos($max, 'G')) $limit <<= 30; + while ($next <= $limit) { + // Select the closest, larger value (in case the + // current value is between two) + $diff = $next - $config['max_file_size']; + $selected = ($diff >= 0 && $diff < $next / 2) + ? 'selected="selected"' : ''; ?> + <option value="<?php echo $next; ?>" <?php echo $selected; + ?>><?php echo Format::file_size($next); + ?></option><?php + $next *= 2; + } + // Add extra option if top-limit in php.ini doesn't fall + // at a power of two + if ($next < $limit * 2) { + $selected = ($limit == $config['max_file_size']) + ? 'selected="selected"' : ''; ?> + <option value="<?php echo $limit; ?>" <?php echo $selected; + ?>><?php echo Format::file_size($limit); + ?></option><?php + } + ?> + </select> + <i class="help-tip icon-question-sign" href="#max_file_size"></i> + <div class="error"><?php echo $errors['max_file_size']; ?></div> + </td> + </tr> </tbody> </table> <p style="padding-left:250px;"> diff --git a/include/staff/settings-tasks.inc.php b/include/staff/settings-tasks.inc.php index d6a0d61d69d8cf73028dd566ac74f193486ef98f..83b5ac06703c840391cd349ae017768e06185454 100644 --- a/include/staff/settings-tasks.inc.php +++ b/include/staff/settings-tasks.inc.php @@ -79,28 +79,25 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) </td> </tr> <tr> - <td width="180" class="required"> - <?php echo __('Default SLA');?>: - </td> + <th colspan="2"> + <em><b><?php echo __('Attachments');?></b>:</em> + </th> + </tr> + <tr> + <td width="180"><?php echo __('Task Attachment Settings');?>:</td> <td> - <span> - <select name="default_task_sla_id"> - <option value="0">— <?php echo __('None');?> —</option> - <?php - if($slas=SLA::getSLAs()) { - foreach($slas as $id => $name) { - echo sprintf('<option value="%d" %s>%s</option>', - $id, - ($config['default_task_sla_id'] && - $id==$config['default_task_sla_id'])?'selected="selected"':'', - $name); - } - } - ?> - </select> - <span class="error">* <?php - echo $errors['default_task_sla_id']; ?></span> <i class="help-tip icon-question-sign" href="#default_sla"></i> - </span> + <?php + $tform = TaskForm::objects()->one()->getForm(); + $f = $tform->getField('description'); + ?> + <a class="action-button field-config" style="overflow:inherit" + href="#ajax.php/form/field-config/<?php + echo $f->get('id'); ?>" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), [201]); + return false; + "><i class="icon-edit"></i> <?php echo __('Config'); ?></a> + <i class="help-tip icon-question-sign" href="#task_attachment_settings"></i> </td> </tr> </tbody> diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php index c2cf0f20077069397f978c21df38c73d4f8072af..e4f00e2dc69952a0e325f5e8687d65e07929b950 100644 --- a/include/staff/settings-tickets.inc.php +++ b/include/staff/settings-tickets.inc.php @@ -154,13 +154,6 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) <?php echo __('per end user'); ?> <i class="help-tip icon-question-sign" href="#maximum_open_tickets"></i> </td> </tr> - <tr> - <td><?php echo __('Agent Collision Avoidance Duration'); ?>:</td> - <td> - <input type="text" name="autolock_minutes" size=4 value="<?php echo $config['autolock_minutes']; ?>"> - <font class="error"><?php echo $errors['autolock_minutes']; ?></font> <?php echo __('minutes'); ?> <i class="help-tip icon-question-sign" href="#agent_collision_avoidance"></i> - </td> - </tr> <tr> <td><?php echo __('Human Verification');?>:</td> <td> @@ -203,22 +196,13 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) <i class="help-tip icon-question-sign" href="#staff_identity_masking"></i> </td> </tr> - <tr> - <td><?php echo __('Enable HTML Ticket Thread'); ?>:</td> - <td> - <input type="checkbox" name="enable_html_thread" <?php - echo $config['enable_html_thread']?'checked="checked"':''; ?>> - <?php echo __('Enable rich text in ticket thread and autoresponse emails.'); ?> - <i class="help-tip icon-question-sign" href="#enable_html_ticket_thread"></i> - </td> - </tr> <tr> <th colspan="2"> <em><b><?php echo __('Attachments');?></b>: <?php echo __('Size and maximum uploads setting mainly apply to web tickets.');?></em> </th> </tr> <tr> - <td width="180"><?php echo __('EndUser Attachment Settings');?>:</td> + <td width="180"><?php echo __('Ticket Attachment Settings');?>:</td> <td> <?php $tform = TicketForm::objects()->one()->getForm(); @@ -234,60 +218,6 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) <i class="help-tip icon-question-sign" href="#ticket_attachment_settings"></i> </td> </tr> - <tr> - <td width="180"><?php echo __( - // Maximum size for agent-uploaded files (via SCP) - 'Agent Maximum File Size');?>:</td> - <td> - <select name="max_file_size"> - <option value="262144">— <?php echo __('Small'); ?> —</option> - <?php $next = 512 << 10; - $max = strtoupper(ini_get('upload_max_filesize')); - $limit = (int) $max; - if (!$limit) $limit = 2 << 20; # 2M default value - elseif (strpos($max, 'K')) $limit <<= 10; - elseif (strpos($max, 'M')) $limit <<= 20; - elseif (strpos($max, 'G')) $limit <<= 30; - while ($next <= $limit) { - // Select the closest, larger value (in case the - // current value is between two) - $diff = $next - $config['max_file_size']; - $selected = ($diff >= 0 && $diff < $next / 2) - ? 'selected="selected"' : ''; ?> - <option value="<?php echo $next; ?>" <?php echo $selected; - ?>><?php echo Format::file_size($next); - ?></option><?php - $next *= 2; - } - // Add extra option if top-limit in php.ini doesn't fall - // at a power of two - if ($next < $limit * 2) { - $selected = ($limit == $config['max_file_size']) - ? 'selected="selected"' : ''; ?> - <option value="<?php echo $limit; ?>" <?php echo $selected; - ?>><?php echo Format::file_size($limit); - ?></option><?php - } - ?> - </select> - <i class="help-tip icon-question-sign" href="#max_file_size"></i> - <div class="error"><?php echo $errors['max_file_size']; ?></div> - </td> - </tr> - <?php if (($bks = FileStorageBackend::allRegistered()) - && count($bks) > 1) { ?> - <tr> - <td width="180"><?php echo __('Store Attachments'); ?>:</td> - <td><select name="default_storage_bk"><?php - foreach ($bks as $char=>$class) { - $selected = $config['default_storage_bk'] == $char - ? 'selected="selected"' : ''; - ?><option <?php echo $selected; ?> value="<?php echo $char; ?>" - ><?php echo $class::$desc; ?></option><?php - } ?> - </td> - </tr> - <?php } ?> </tbody> </table> </div> diff --git a/include/staff/settings-users.inc.php b/include/staff/settings-users.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..382348df225a2680429b409790da0ba7a249d215 --- /dev/null +++ b/include/staff/settings-users.inc.php @@ -0,0 +1,159 @@ +<?php +if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) die('Access Denied'); + +?> +<h2><?php echo __('Users Settings'); ?></h2> +<form action="settings.php?t=users" method="post" id="save"> +<?php csrf_token(); ?> +<input type="hidden" name="t" value="users" > +<ul class="tabs" id="users-tabs"> + <li class="active"><a href="#settings"> + <i class="icon-asterisk"></i> <?php echo __('Settings'); ?></a></li> + <li><a href="#templates"> + <i class="icon-file-text"></i> <?php echo __('Templates'); ?></a></li> +</ul> +<div id="users-tabs_container"> + <div id="settings" class="tab_content"> +<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> + + <tr> + <th colspan="2"> + <em><b><?php echo __('General Settings'); ?></b></em> + </th> + </tr> + <tr> + <td width="180"><?php echo __('Name Formatting'); ?>:</td> + <td> + <select name="client_name_format"> + <?php foreach (PersonsName::allFormats() as $n=>$f) { + list($desc, $func) = $f; + $selected = ($config['client_name_format'] == $n) ? 'selected="selected"' : ''; ?> + <option value="<?php echo $n; ?>" <?php echo $selected; + ?>><?php echo __($desc); ?></option> + <?php } ?> + </select> + <i class="help-tip icon-question-sign" href="#client_name_format"></i> + </td> + </tr> + <tr> + <th colspan="2"> + <em><b><?php echo __('Authentication Settings'); ?></b></em> + </th> + </tr> + <tr><td><?php echo __('Registration Required'); ?>:</td> + <td><input type="checkbox" name="clients_only" <?php + if ($config['clients_only']) + echo 'checked="checked"'; ?>/> <?php echo __( + 'Require registration and login to create tickets'); ?> + <i class="help-tip icon-question-sign" href="#registration_method"></i> + </td> + <tr><td><?php echo __('Registration Method'); ?>:</td> + <td><select name="client_registration"> +<?php foreach (array( + 'disabled' => __('Disabled — All users are guests'), + 'public' => __('Public — Anyone can register'), + 'closed' => __('Private — Only agents can register users'),) + as $key=>$val) { ?> + <option value="<?php echo $key; ?>" <?php + if ($config['client_registration'] == $key) + echo 'selected="selected"'; ?>><?php echo $val; + ?></option><?php + } ?> + </select> + <i class="help-tip icon-question-sign" href="#registration_method"></i> + </td> + </tr> + <tr><td><?php echo __('User Excessive Logins'); ?>:</td> + <td> + <select name="client_max_logins"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['client_max_logins']==$i)?'selected="selected"':''), $i); + } + + ?> + </select> <?php echo __( + 'failed login attempt(s) allowed before a lock-out is enforced'); ?> + <br/> + <select name="client_login_timeout"> + <?php + for ($i = 1; $i <= 10; $i++) { + echo sprintf('<option value="%d" %s>%d</option>', $i,(($config['client_login_timeout']==$i)?'selected="selected"':''), $i); + } + ?> + </select> <?php echo __('minutes locked out'); ?> + </td> + </tr> + <tr><td><?php echo __('User Session Timeout'); ?>:</td> + <td> + <input type="text" name="client_session_timeout" size=6 value="<?php echo $config['client_session_timeout']; ?>"> + <i class="help-tip icon-question-sign" href="#client_session_timeout"></i> + </td> + </tr> + <tr><td><?php echo __('Client Quick Access'); ?>:</td> + <td><input type="checkbox" name="client_verify_email" <?php + if ($config['client_verify_email']) + echo 'checked="checked"'; ?>/> <?php echo __( + 'Require email verification on "Check Ticket Status" page'); ?> + <i class="help-tip icon-question-sign" href="#client_verify_email"></i> + </td> + </tr> + </tbody> + </table> + </div> + <div id="templates" class="tab_content hidden"> + <table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2"> + <tbody> +<?php +$res = db_query('select distinct(`type`), content_id, notes, name, updated from ' + .PAGE_TABLE + .' where isactive=1 group by `type`'); +$contents = array(); +while (list($type, $id, $notes, $name, $u) = db_fetch_row($res)) + $contents[$type] = array($id, $name, $notes, $u); + +$manage_content = function($title, $content) use ($contents) { + list($id, $name, $notes, $upd) = $contents[$content]; + $notes = explode('. ', $notes); + $notes = $notes[0]; + ?><tr><td colspan="2"> + <div style="padding:2px 5px"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201); + return false;" class="pull-left"><i class="icon-file-text icon-2x" + style="color:#bbb;"></i> </a> + <span style="display:inline-block;width:90%;width:calc(100% - 32px);padding-left:10px;line-height:1.2em"> + <a href="#ajax.php/content/<?php echo $id; ?>/manage" + onclick="javascript: + $.dialog($(this).attr('href').substr(1), 201, null, {size:'large'}); + return false;"><?php + echo Format::htmlchars($title); ?></a><br/> + <span class="faded"><?php + echo Format::display($notes); ?> + <br><em><?php echo sprintf(__('Last Updated %s'), Format::datetime($upd)); + ?></em></span> + </div></td></tr><?php +}; ?> + <tr> + <th colspan="2"> + <em><b><?php echo __( + 'Authentication and Registration Templates & Pages'); ?></b></em> + </th> + </tr> + <?php $manage_content(__('Guest Ticket Access'), 'access-link'); ?> + <?php $manage_content(__('Sign-In Page'), 'banner-client'); ?> + <?php $manage_content(__('Password Reset Email'), 'pwreset-client'); ?> + <?php $manage_content(__('Please Confirm Email Address Page'), 'registration-confirm'); ?> + <?php $manage_content(__('Account Confirmation Email'), 'registration-client'); ?> + <?php $manage_content(__('Account Confirmed Page'), 'registration-thanks'); ?> +</tbody> +</table> +</div> +<p style="text-align:center"> + <input class="button" type="submit" name="submit" value="<?php echo __('Save Changes'); ?>"> + <input class="button" type="reset" name="reset" value="<?php echo __('Reset Changes'); ?>"> +</p> +</div> +</form> diff --git a/include/staff/staffmembers.inc.php b/include/staff/staffmembers.inc.php index 6b588707f5693384c37643e52fbdbce408c729e6..d57258241a521e135a479b44fb23119804c92a37 100644 --- a/include/staff/staffmembers.inc.php +++ b/include/staff/staffmembers.inc.php @@ -23,7 +23,7 @@ if ($sort && $sortOptions[$sort]) { $order_column = $order_column ? $order_column : array('firstname', 'lastname'); -switch ($cfg->getDefaultNameFormat()) { +switch ($cfg->getClientNameFormat()) { case 'last': case 'lastfirst': case 'legal': diff --git a/include/staff/tasks.inc.php b/include/staff/tasks.inc.php index 4c0430b8498ab34d4bcf95875df6feac6aad2cec..01c0be6986e239d6ac055d5559d598f9c200daee 100644 --- a/include/staff/tasks.inc.php +++ b/include/staff/tasks.inc.php @@ -268,7 +268,7 @@ if ($thisstaff->hasPerm(Task::PERM_DELETE)) { $dept = Dept::getLocalById($T['dept_id'], 'name', $T['dept__name']); $assinee =''; if ($T['staff_id']) { - $staff = new PersonsName($T['staff__firstname'].' '.$T['staff__lastname']); + $staff = new AgentsName($T['staff__firstname'].' '.$T['staff__lastname']); $assignee = sprintf('<span class="Icon staffAssigned">%s</span>', Format::truncate((string) $staff, 40)); } elseif($T['team_id']) { diff --git a/include/staff/templates/task-delete.tmpl.php b/include/staff/templates/task-delete.tmpl.php index eea44e19cc1710543a5febab3fefb648e20cb3b3..77cd9df4e6b98e9092be24aca5dadf4d0639fcaf 100644 --- a/include/staff/templates/task-delete.tmpl.php +++ b/include/staff/templates/task-delete.tmpl.php @@ -47,7 +47,7 @@ $action = $info[':action'] ?: ('#tasks/mass/delete'); ?> <textarea name="comments" id="comments" cols="50" rows="3" wrap="soft" style="width:100%" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> no-bar" placeholder="<?php echo $placeholder; ?>"><?php echo $info['comments']; ?></textarea> diff --git a/include/staff/templates/task-status.tmpl.php b/include/staff/templates/task-status.tmpl.php index d741aaafce72089c65299c2e83efd605a85c9086..8aba2d100c0fdaa56b4b77d3961e27bb15f231c7 100644 --- a/include/staff/templates/task-status.tmpl.php +++ b/include/staff/templates/task-status.tmpl.php @@ -76,7 +76,7 @@ $action = $info[':action'] ?: ('#tasks/mass/'. $action); ?> <textarea name="comments" id="comments" cols="50" rows="3" wrap="soft" style="width:100%" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> no-bar" placeholder="<?php echo $placeholder; ?>"><?php echo $info['comments']; ?></textarea> diff --git a/include/staff/templates/thread-entry-edit.tmpl.php b/include/staff/templates/thread-entry-edit.tmpl.php index 24e63230e1c8bf91730369ed35907c5096eabfeb..bab5e4eb65223cb4705a8499a3909ed58a404b7b 100644 --- a/include/staff/templates/thread-entry-edit.tmpl.php +++ b/include/staff/templates/thread-entry-edit.tmpl.php @@ -31,7 +31,7 @@ <?php } ?> name="body" class="large <?php - if ($cfg->isHtmlThreadEnabled() && $this->entry->format == 'html') + if ($cfg->isRichTextEnabled() && $this->entry->format == 'html') echo 'richtext'; ?>"><?php echo Format::viewableImages($this->entry->body); ?></textarea> diff --git a/include/staff/templates/ticket-status.tmpl.php b/include/staff/templates/ticket-status.tmpl.php index 458c6010c5b543ee79dd601af16ae43fa154bfbb..5da0e6619c563f15a7bea49f722f95113fae1ead 100644 --- a/include/staff/templates/ticket-status.tmpl.php +++ b/include/staff/templates/ticket-status.tmpl.php @@ -84,7 +84,7 @@ $action = $info['action'] ?: ('#tickets/status/'. $state); ?> <textarea name="comments" id="comments" cols="50" rows="3" wrap="soft" style="width:100%" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> no-bar" placeholder="<?php echo $placeholder; ?>"><?php echo $info['comments']; ?></textarea> diff --git a/include/staff/templates/tickets.tmpl.php b/include/staff/templates/tickets.tmpl.php index 450b8272815a734b6a4e0d8c26264cd085192268..57ced36e88cb1db5f1867a7454f1cf06764c3ce6 100644 --- a/include/staff/templates/tickets.tmpl.php +++ b/include/staff/templates/tickets.tmpl.php @@ -109,7 +109,7 @@ if ($results) { ?> $assigned=''; if ($T['staff_id']) - $assigned = new PersonsName(array( + $assigned = new AgentsName(array( 'first' => $T['staff__firstname'], 'last' => $T['staff__lastname'] )); diff --git a/include/staff/templates/users.tmpl.php b/include/staff/templates/users.tmpl.php index a91a586f988889877c41d34331dfe2f9f589e341..a2111414b06683a14453e8998cd9dc5c0ac9706f 100644 --- a/include/staff/templates/users.tmpl.php +++ b/include/staff/templates/users.tmpl.php @@ -92,7 +92,7 @@ if ($num) { ?> $ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null; while ($row = db_fetch_array($res)) { - $name = new PersonsName($row['name']); + $name = new UsersName($row['name']); $status = 'Active'; $sel=false; if($ids && in_array($row['id'], $ids)) diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php index 80f4829e20f950bd81d30f13d5053e7ad0214cfb..65d4e37a089a479817311d01380e34a495678a64 100644 --- a/include/staff/ticket-open.inc.php +++ b/include/staff/ticket-open.inc.php @@ -306,7 +306,7 @@ if ($_POST) if ($thisstaff->getDefaultSignatureType() == 'mine') $signature = $thisstaff->getSignature(); ?> <textarea - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft draft-delete" data-signature="<?php echo Format::htmlchars(Format::viewableImages($signature)); ?>" data-signature-field="signature" data-dept-field="deptId" @@ -378,7 +378,7 @@ print $response_form->getField('attachments')->render(); <tr> <td colspan=2> <textarea - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft draft-delete" placeholder="<?php echo __('Optional internal note (recommended on assignment)'); ?>" name="note" cols="21" rows="6" style="width:80%;" <?php diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 00a565ad83b10389e45cdabd0646756fa3d8e363..8929929ff839934f99d417c8dd59b4459ca4f493 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -579,7 +579,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); 'Start writing your response here. Use canned responses from the drop-down above' ); ?>" rows="9" wrap="soft" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft draft-delete" <?php list($draft, $attrs) = Draft::getDraftAndDataAttrs('ticket.response', $ticket->getId(), $info['response']); echo $attrs; ?>><?php echo $draft ?: $info['response']; @@ -694,7 +694,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); <textarea name="note" id="internal_note" cols="80" placeholder="<?php echo __('Note details'); ?>" rows="9" wrap="soft" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> draft draft-delete" <?php list($draft, $attrs) = Draft::getDraftAndDataAttrs('ticket.note', $ticket->getId(), $info['note']); echo $attrs; ?>><?php echo $draft ?: $info['note']; @@ -789,7 +789,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); <td> <textarea name="transfer_comments" id="transfer_comments" placeholder="<?php echo __('Enter reasons for the transfer'); ?>" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> no-bar" cols="80" rows="7" wrap="soft"><?php echo $info['transfer_comments']; ?></textarea> <span class="error"><?php echo $errors['transfer_comments']; ?></span> @@ -849,7 +849,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); continue; if (!is_object($name)) - $name = new PersonsName($name); + $name = new AgentsName($name); $k="s$id"; echo sprintf('<option value="%s" %s>%s</option>', @@ -890,7 +890,7 @@ $tcount = $ticket->getThreadEntries($types)->count(); <textarea name="assign_comments" id="assign_comments" cols="80" rows="7" wrap="soft" placeholder="<?php echo __('Enter reasons for the assignment or instructions for assignee'); ?>" - class="<?php if ($cfg->isHtmlThreadEnabled()) echo 'richtext'; + class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext'; ?> no-bar"><?php echo $info['assign_comments']; ?></textarea> <span class="error"><?php echo $errors['assign_comments']; ?></span><br> </td> @@ -910,7 +910,8 @@ $tcount = $ticket->getThreadEntries($types)->count(); <h3><?php echo __('Ticket Print Options');?></h3> <a class="close" href=""><i class="icon-remove-circle"></i></a> <hr/> - <form action="tickets.php?id=<?php echo $ticket->getId(); ?>" method="post" id="print-form" name="print-form"> + <form action="tickets.php?id=<?php echo $ticket->getId(); ?>" + method="post" id="print-form" name="print-form" target="_blank"> <?php csrf_token(); ?> <input type="hidden" name="a" value="print"> <input type="hidden" name="id" value="<?php echo $ticket->getId(); ?>"> diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index ad0474a85aed7f11679ec64282088e1de56dc91f..da1d522122e01fd806a756355ade4b2a43fa0ccf 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -431,7 +431,7 @@ return false;"> $lc=''; if ($showassigned) { if ($T['staff_id']) - $lc = new PersonsName($T['staff__firstname'].' '.$T['staff__lastname']); + $lc = new AgentsName($T['staff__firstname'].' '.$T['staff__lastname']); elseif ($T['team_id']) $lc = Team::getLocalById($T['team_id'], 'name', $T['team__name']); } @@ -483,7 +483,7 @@ return false;"> .$T['collab_count'].'"><i class="icon-group"></i></span>'; ?><span class="truncate" style="max-width:<?php echo $T['collab_count'] ? '150px' : '170px'; ?>"><?php - $un = new PersonsName($T['user__name']); + $un = new UsersName($T['user__name']); echo Format::htmlchars($un); ?></span></div></td> <?php diff --git a/include/staff/users.inc.php b/include/staff/users.inc.php index 5dd3f64f9a7e42a5dd3aaba5dd70b05f7b6295d6..5ff926b64d4e00c450f282efebfcca884ae0186a 100644 --- a/include/staff/users.inc.php +++ b/include/staff/users.inc.php @@ -163,7 +163,7 @@ else if (!$U['name']) list($name) = explode('@', $U['default_email__address']); else - $name = new PersonsName($U['name']); + $name = new UsersName($U['name']); // Account status if ($U['account__id']) diff --git a/scp/settings.php b/scp/settings.php index a0d0a8c2a8ddba53f215a076a1d1acdb29dfd8e8..4a52a6f0192f1ca969b753d13d09b3301d382b26 100644 --- a/scp/settings.php +++ b/scp/settings.php @@ -23,16 +23,14 @@ $settingOptions=array( array(__('Ticket Settings and Options'), 'settings.ticket'), 'tasks' => array(__('Task Settings and Options'), 'settings.tasks'), + 'agents' => + array(__('Agent Settings and Options'), 'settings.agents'), + 'users' => + array(__('User Settings and Options'), 'settings.users'), 'pages' => array(__('Site Pages'), 'settings.pages'), - 'access' => - array(__('Access Control'), 'settings.access'), 'kb' => array(__('Knowledgebase Settings'), 'settings.kb'), - 'autoresp' => - array(__('Autoresponder Settings'), 'settings.autoresponder'), - 'alerts' => - array(__('Alerts and Notices Settings'), 'settings.alerts'), ); //Handle a POST. $target=($_REQUEST['t'] && $settingOptions[$_REQUEST['t']])?$_REQUEST['t']:'system';