diff --git a/include/ajax.content.php b/include/ajax.content.php index 0e461b53eec1861a0e993dfcd15d2807babc7abe..38112a11502ec5e80fb61aa2f1f039bc0f889928 100644 --- a/include/ajax.content.php +++ b/include/ajax.content.php @@ -53,23 +53,23 @@ class ContentAjaxAPI extends AjaxController { <td width="55%" valign="top"> <table width="100%" border="0" cellspacing=1 cellpadding=1> <tr><td width="130">%{ticket.id}</td><td>'.__('Ticket ID').' ('.__('internal ID').')</td></tr> - <tr><td>%{ticket.number}</td><td>'.__('Ticket number').' ('.__('external ID').')</td></tr> - <tr><td>%{ticket.email}</td><td>'.__('Email address').'</td></tr> - <tr><td>%{ticket.name}</td><td>'.__('Full name').' — + <tr><td>%{ticket.number}</td><td>'.__('Ticket Number').' ('.__('external ID').')</td></tr> + <tr><td>%{ticket.email}</td><td>'.__('Email Address').'</td></tr> + <tr><td>%{ticket.name}</td><td>'.__('Full Name').' — <em>'.__('see name expansion').'</em></td></tr> <tr><td>%{ticket.subject}</td><td>'.__('Subject').'</td></tr> <tr><td>%{ticket.phone}</td><td>'.__('Phone number | ext').'</td></tr> <tr><td>%{ticket.status}</td><td>'.__('Status').'</td></tr> <tr><td>%{ticket.priority}</td><td>'.__('Priority').'</td></tr> <tr><td>%{ticket.assigned}</td><td>'.__('Assigned Agent / Team').'</td></tr> - <tr><td>%{ticket.create_date}</td><td>'.__('Date created').'</td></tr> - <tr><td>%{ticket.due_date}</td><td>'.__('Due date').'</td></tr> - <tr><td>%{ticket.close_date}</td><td>'.__('Date closed').'</td></tr> + <tr><td>%{ticket.create_date}</td><td>'.__('Date Created').'</td></tr> + <tr><td>%{ticket.due_date}</td><td>'.__('Due Date').'</td></tr> + <tr><td>%{ticket.close_date}</td><td>'.__('Date Closed').'</td></tr> <tr><td>%{ticket.recipients}</td><td>'.__('List of all recipient names').'</td></tr> <tr><td nowrap>%{recipient.ticket_link}</td><td>'.__('Auth. token used for auto-login').'<br/> '.__('Agent\'s ticket view link').'</td></tr> <tr><td colspan="2" style="padding:5px 0 5px 0;"><em><b>'.__('Expandable Variables').'</b></em></td></tr> - <tr><td>%{ticket.topic}</td><td>'.__('Help topic').'</td></tr> + <tr><td>%{ticket.topic}</td><td>'.__('Help Topic').'</td></tr> <tr><td>%{ticket.dept}</td><td>'.__('Department').'</td></tr> <tr><td>%{ticket.staff}</td><td>'.__('Assigned/closing agent').'</td></tr> <tr><td>%{ticket.team}</td><td>'.__('Assigned/closing team').'</td></tr> @@ -101,7 +101,7 @@ class ContentAjaxAPI extends AjaxController { <tr><td>.lastmessage</td><td>'.__('Last Message').'</td></tr> <tr><td colspan="2" style="padding:5px 0 5px 0;"><em><b>'.__('Thread Entry expansions').'</b></em></td></tr> <tr><td>.poster</td><td>'.__('Poster').'</td></tr> - <tr><td>.create_date</td><td>'.__('Date created').'</td></tr> + <tr><td>.create_date</td><td>'.__('Date Created').'</td></tr> </table> </td> </tr> @@ -200,7 +200,7 @@ class ContentAjaxAPI extends AjaxController { Http::response(201, 'Have a great day!'); } if (!$errors['err']) - $errors['err'] = __('Correct the error(s) below and try again!'); + $errors['err'] = __('Correct any errors below and try again.'); $info = $_POST; $errors = Format::htmlchars($errors); include STAFFINC_DIR . 'templates/content-manage.tmpl.php'; diff --git a/include/ajax.tasks.php b/include/ajax.tasks.php index ee727bbfdfc4a7ac5b7cfbe49227b25b687b0ddd..387065cc80e5239235566ac046ce3d061088a486 100644 --- a/include/ajax.tasks.php +++ b/include/ajax.tasks.php @@ -128,9 +128,9 @@ class TasksAjaxAPI extends AjaxController { if ($task->update($forms, $_POST, $errors)) { Http::response(201, 'Task updated successfully'); } elseif(!$errors['err']) { - $errors['err']=sprintf( - __('Unable to update %s. Correct any errors below and try again.'), - __('task')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this task')), + __('Correct any errors below and try again.')); } $info = Format::htmlchars($_POST); } @@ -172,7 +172,7 @@ class TasksAjaxAPI extends AjaxController { if ($_POST) { if (!$_POST['tids'] || !($count=count($_POST['tids']))) $errors['err'] = sprintf( - __('You must select at least %s'), + __('You must select at least %s.'), __('one task')); } else { $count = $_REQUEST['count']; @@ -410,7 +410,7 @@ class TasksAjaxAPI extends AjaxController { if (!$i) { $info['error'] = sprintf( - __('Unable to delete %s'), + __('Unable to delete %s.'), _N('selected task', 'selected tasks', $count)); } } diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 209ea1a2d974f78e37c8d1c7ea9e36e2a715590f..2ae54c819c1ab870fb58cce3de5ce42e1290bde9 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -568,7 +568,7 @@ class TicketsAjaxAPI extends AjaxController { if ($_POST) { if (!$_POST['tids'] || !($count=count($_POST['tids']))) $errors['err'] = sprintf( - __('You must select at least %s'), + __('You must select at least %s.'), __('one ticket')); } else { $count = $_REQUEST['count']; @@ -979,7 +979,7 @@ class TicketsAjaxAPI extends AjaxController { __('to mass manage tickets')), __('Contact admin for such access')); elseif (!$_REQUEST['tids'] || !count($_REQUEST['tids'])) - $errors['err']=sprintf(__('You must select at least %s'), + $errors['err']=sprintf(__('You must select at least %s.'), __('one ticket')); elseif (!($status= TicketStatus::lookup($_REQUEST['status_id']))) $errors['status_id'] = sprintf('%s %s', @@ -1032,7 +1032,7 @@ class TicketsAjaxAPI extends AjaxController { if ($i==$count) { if (!strcasecmp($status->getState(), 'deleted')) { - $msg = sprintf(__( 'Successfully deleted %s'), + $msg = sprintf(__( 'Successfully deleted %s.'), _N('selected ticket', 'selected tickets', $count)); } else { @@ -1049,7 +1049,7 @@ class TicketsAjaxAPI extends AjaxController { } else { if (!strcasecmp($status->getState(), 'deleted')) { - $warn = sprintf(__('Successfully deleted %s'), + $warn = sprintf(__('Successfully deleted %s.'), sprintf(__('%1$d of %2$d selected tickets'), $i, $count) ); diff --git a/include/ajax.users.php b/include/ajax.users.php index 218f9c072354d3940cd406a510f15fde2fc40f1b..bf85d0c57d223b4d789f540f2bda5209d549498f 100644 --- a/include/ajax.users.php +++ b/include/ajax.users.php @@ -225,7 +225,8 @@ class UsersAjaxAPI extends AjaxController { if ($errors['err']) $info['error'] = $errors['err']; else - $info['error'] = __('Unable to update account - try again!'); + $info['error'] = __('Unable to update account.') + .' '.__('Correct any errors below and try again.'); } $info['_target'] = $target; @@ -424,14 +425,14 @@ class UsersAjaxAPI extends AjaxController { $form = OrganizationForm::getDefaultForm()->getForm($_POST); if (!($org = Organization::fromForm($form))) $info['error'] = __('Unable to create organization.') - .' '.__('Correct error(s) below and try again.'); + .' '.__('Correct any errors below and try again.'); } if ($org && $user->setOrganization($org)) Http::response(201, $org->to_json()); elseif (! $info['error']) $info['error'] = __('Unable to add user to organization.') - .' '.__('Correct error(s) below and try again.'); + .' '.__('Correct any errors below and try again.'); } elseif ($orgId) $org = Organization::lookup($orgId); diff --git a/include/class.api.php b/include/class.api.php index fa40b839c81c8c59634633aebabc952b77fb1c42..1f8ac296c04aa2799165d722b946c27659723b73 100644 --- a/include/class.api.php +++ b/include/class.api.php @@ -137,8 +137,8 @@ class API { if(db_query($sql)) return true; - $errors['err']=sprintf(__('Unable to update %s'), __('this API key')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this API key')) + .' '.__('Internal error occurred'); } else { $sql='INSERT INTO '.API_KEY_TABLE.' SET '.$sql @@ -149,8 +149,9 @@ class API { if(db_query($sql) && ($id=db_insert_id())) return $id; - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this API key')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this API key')), + __('Correct any errors below and try again.')); } return false; diff --git a/include/class.canned.php b/include/class.canned.php index 22f3934d519c57b516e05b2c8340ca2d5d689cc1..bb126d74088ab72b2677d3d0125c9bd0871a71bf 100644 --- a/include/class.canned.php +++ b/include/class.canned.php @@ -286,10 +286,10 @@ extends VerySimpleModel { return true; if ($isnew) - $errors['err'] = sprintf(__('Unable to update %s'), __('this canned response')); + $errors['err'] = sprintf(__('Unable to update %s.'), __('this canned response')); else - $errors['err']=sprintf(__('Unable to create %s'), __('this canned response')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this canned response')) + .' '.__('Internal error occurred'); return true; } diff --git a/include/class.client.php b/include/class.client.php index 9a624e13c545934b7bd864551152ec05b5525c8e..53b6376c98ce603b76251ec6d4295fa88d91b2b8 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -46,8 +46,8 @@ implements EmailContact, ITicketUser, TemplateVariable { static function getVarScope() { return array( - 'email' => __('Email address'), - 'name' => array('class' => 'PersonsName', 'desc' => __('Full name')), + 'email' => __('Email Address'), + 'name' => array('class' => 'PersonsName', 'desc' => __('Full Name')), 'ticket_link' => __('Link to view the ticket'), ); } diff --git a/include/class.dept.php b/include/class.dept.php index eac074c9fdb04e12db3d32051d6d3072591c3d09..397df89c480b7fafa20ba09a51cd6dfa41fca78c 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -639,11 +639,11 @@ implements TemplateVariable { } if (isset($this->id)) - $errors['err']=sprintf(__('Unable to update %s'), __('this department')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this department')) + .' '.__('Internal error occurred'); else - $errors['err']=sprintf(__('Unable to create %s'), __('this department')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this department')) + .' '.__('Internal error occurred'); return false; } diff --git a/include/class.email.php b/include/class.email.php index eb0ee23b5b7df0cd80260f8f306a7d27d14d5dc7..e0bdb64bd38fe3ffb82a15139d222cebffed18df 100644 --- a/include/class.email.php +++ b/include/class.email.php @@ -416,12 +416,12 @@ class Email extends VerySimpleModel { return true; if ($id) { //update - $errors['err']=sprintf(__('Unable to update %s'), __('this email')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this email')) + .' '.__('Internal error occurred'); } else { - $errors['err']=sprintf(__('Unable to add %s'), __('this email')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to add %s.'), __('this email')) + .' '.__('Internal error occurred'); } return false; diff --git a/include/class.filter.php b/include/class.filter.php index 6d9295978ca07f1ab41154a4695c9368d9ba2148..20bac5ce53b856d13d439a0afedd8e8abe1ab97a 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -494,13 +494,13 @@ class Filter { if($id) { $sql='UPDATE '.FILTER_TABLE.' SET '.$sql.' WHERE id='.db_input($id); if(!db_query($sql)) - $errors['err']=sprintf(__('Unable to update %s'), __('this ticket filter')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this ticket filter')) + .' '.__('Internal error occurred'); }else{ $sql='INSERT INTO '.FILTER_TABLE.' SET '.$sql.',created=NOW() '; if(!db_query($sql) || !($id=db_insert_id())) - $errors['err']=sprintf(__('Unable to add %s'), __('this ticket filter')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to add %s.'), __('this ticket filter')) + .' '.__('Internal error occurred'); } if($errors || !$id) return false; diff --git a/include/class.forms.php b/include/class.forms.php index 3722827a57cd971ae1e2859b706652f087f5e49e..0e8f81b60ed21e60bcb1df5ec52709d65166ddf7 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -2894,7 +2894,7 @@ class InlineFormField extends FormField { function validateEntry($value) { if (!$this->getInlineForm()->isValid()) { - $this->_errors[] = __('Correct errors in the inline form'); + $this->_errors[] = __('Correct any errors below and try again.'); } } diff --git a/include/class.page.php b/include/class.page.php index a671d1c7183f1b73dd714bb93d5a1e509267a9e7..920c2ee88ecfd3cd06c3eb8bf36756bad487c76f 100644 --- a/include/class.page.php +++ b/include/class.page.php @@ -288,7 +288,7 @@ class Page extends VerySimpleModel { if ($rv) return $rv; - $errors['err']=sprintf(__('Unable to update %s'), __('this site page')); + $errors['err']=sprintf(__('Unable to update %s.'), __('this site page')); return false; } diff --git a/include/class.search.php b/include/class.search.php index fbb3439868c7f65add4bf5191a94fd813ebb7ab0..6249498b05601fcc09afa23f753ae5c61fcb6466 100644 --- a/include/class.search.php +++ b/include/class.search.php @@ -1133,7 +1133,7 @@ class TicketStateChoiceField extends ChoiceField { 'open' => __('Open'), 'closed' => __('Closed'), 'archived' => _P('ticket state name', 'Archived'), - 'deleted' => __('Deleted'), + 'deleted' => _P('ticket state name','Deleted'), ); } diff --git a/include/class.sla.php b/include/class.sla.php index e8c82b8342173d8582459a8f471c1fc2bd05031a..846656acd065eb62f1bc2c1b4fc9aa264a432131 100644 --- a/include/class.sla.php +++ b/include/class.sla.php @@ -133,11 +133,11 @@ implements TemplateVariable { return true; if (isset($this->id)) { - $errors['err']=sprintf(__('Unable to update %s'), __('this SLA plan')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this SLA plan')) + .' '.__('Internal error occurred'); } else { - $errors['err']=sprintf(__('Unable to add %s'), __('this SLA plan')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to add %s.'), __('this SLA plan')) + .' '.__('Internal error occurred'); } return false; diff --git a/include/class.staff.php b/include/class.staff.php index 890ff411ad4c1671dd24498d5e932433e702c4eb..8cc30b7db70608e84ad75228f0e2decbc6db325d 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -1061,11 +1061,11 @@ implements AuthenticatedUser, EmailContact, TemplateVariable { } if (isset($this->staff_id)) { - $errors['err']=sprintf(__('Unable to update %s'), __('this agent')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this agent')) + .' '.__('Internal error occurred'); } else { - $errors['err']=sprintf(__('Unable to create %s'), __('this agent')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this agent')) + .' '.__('Internal error occurred'); } return false; } diff --git a/include/class.task.php b/include/class.task.php index eb2ba5ed9c75b8fcd417408909047804018c747a..2c93eac120ff139cdc74eec8918f265cf358082a 100644 --- a/include/class.task.php +++ b/include/class.task.php @@ -796,7 +796,7 @@ class Task extends TaskModel implements RestrictedAccess, Threadable { $cdept = $this->getDept(); $dept = $form->getDept(); if (!$dept || !($dept instanceof Dept)) - $errors['dept'] = __('Department selection required'); + $errors['dept'] = __('Department selection is required'); elseif ($dept->getid() == $this->getDeptId()) $errors['dept'] = __('Task already in the department'); else @@ -1038,7 +1038,7 @@ class Task extends TaskModel implements RestrictedAccess, Threadable { 'class' => 'FormattedDate', 'desc' => __('Date Closed'), ), 'create_date' => array( - 'class' => 'FormattedDate', 'desc' => __('Date created'), + 'class' => 'FormattedDate', 'desc' => __('Date Created'), ), 'dept' => array( 'class' => 'Dept', 'desc' => __('Department'), diff --git a/include/class.team.php b/include/class.team.php index 1810d4b01b0fdfe8d6af87d5fe5e27c734a15d5b..d6963eb9213272959dc5fe0da0d319b59376a784 100644 --- a/include/class.team.php +++ b/include/class.team.php @@ -182,11 +182,11 @@ implements TemplateVariable { return $this->members->saveAll(); if (isset($this->team_id)) { - $errors['err']=sprintf(__('Unable to update %s'), __('this team')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this team')) + .' '.__('Internal error occurred'); } else { - $errors['err']=sprintf(__('Unable to create %s'), __('this team')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this team')) + .' '.__('Internal error occurred'); } return false; diff --git a/include/class.template.php b/include/class.template.php index 6c7c5ac55237fb65e4b32700dd141704158428c5..1f53922dd409bc9cc13861a9fd1dbc6a507974f0 100644 --- a/include/class.template.php +++ b/include/class.template.php @@ -469,8 +469,8 @@ class EmailTemplateGroup { if(db_query($sql)) return true; - $errors['err']=sprintf(__('Unable to update %s'), __('this template set')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this template set')) + .' '.__('Internal error occurred'); } else { @@ -479,8 +479,8 @@ class EmailTemplateGroup { $sql='INSERT INTO '.EMAIL_TEMPLATE_GRP_TABLE .' SET created=NOW(), '.$sql; if(!db_query($sql) || !($new_id=db_insert_id())) { - $errors['err']=sprintf(__('Unable to create %s'), __('this template set')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this template set')) + .' '.__('Internal error occurred'); return false; } diff --git a/include/class.thread.php b/include/class.thread.php index b9adbef211bb43b9e047f6c793c6405fa1986a0d..90ae737c692161667f6c1eae01ae2040887bb4a1 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -1960,7 +1960,7 @@ class EditEvent extends ThreadEvent { foreach (array( 'topic_id' => array(__('Help Topic'), array('Topic', 'getTopicName')), 'sla_id' => array(__('SLA'), array('SLA', 'getSLAName')), - 'duedate' => array(__('Duedate'), array('Format', 'date')), + 'duedate' => array(__('Due Date'), array('Format', 'date')), 'user_id' => array(__('Ticket Owner'), array('User', 'getNameById')), 'source' => array(__('Source'), null) ) as $f => $info) { diff --git a/include/class.ticket.php b/include/class.ticket.php index e6cfe42433c7bfd4b18ae09acb2afa6d97acc172..3c225cdc64f0934aed5fee19723ed4bd99b13ad6 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1888,7 +1888,7 @@ implements RestrictedAccess, Threadable { 'class' => 'FormattedDate', 'desc' => __('Date Closed'), ), 'create_date' => array( - 'class' => 'FormattedDate', 'desc' => __('Date created'), + 'class' => 'FormattedDate', 'desc' => __('Date Created'), ), 'dept' => array( 'class' => 'Dept', 'desc' => __('Department'), @@ -1900,7 +1900,7 @@ implements RestrictedAccess, Threadable { 'name' => array( 'class' => 'PersonsName', 'desc' => __('Name of ticket owner'), ), - 'number' => __('Ticket number'), + 'number' => __('Ticket Number'), 'phone' => __('Phone number of ticket owner'), 'priority' => array( 'class' => 'Priority', 'desc' => __('Priority'), @@ -2745,7 +2745,9 @@ implements RestrictedAccess, Threadable { $fields['user_id'] = array('type'=>'int', 'required'=>0, 'error'=>__('Invalid user-id')); if (!Validator::process($fields, $vars, $errors) && !$errors['err']) - $errors['err'] = __('Missing or invalid data - correct the errors and try again'); + $errors['err'] = sprintf('%s — %s', + __('Missing or invalid data'), + __('Correct any errors below and try again')); $vars['note'] = ThreadEntryBody::clean($vars['note']); @@ -3065,7 +3067,7 @@ implements RestrictedAccess, Threadable { $errors = array( 'errno' => 403, 'err' => __('This help desk is for use by authorized users only')); - $ost->logWarning(_S('Ticket Denied'), $message, false); + $ost->logWarning(_S('Ticket denied'), $message, false); return 0; }; @@ -3109,7 +3111,9 @@ implements RestrictedAccess, Threadable { } if(!Validator::process($fields, $vars, $errors) && !$errors['err']) - $errors['err'] =__('Missing or invalid data - correct the errors and try again'); + $errors['err'] = sprintf('%s — %s', + __('Missing or invalid data'), + __('Correct any errors below and try again')); // Make sure the due date is valid if ($vars['duedate']) { diff --git a/include/class.topic.php b/include/class.topic.php index 8196c2df9940d984e1a507529136bff5b9b86ff9..c25ab788a4288beaae3bd1163ecb72c6b2ea183f 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -447,13 +447,13 @@ implements TemplateVariable { $this->sort = ($parent->sort ?: 0) + 1; } if (!($rv = $this->save())) { - $errors['err']=sprintf(__('Unable to create %s'), __('this help topic')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to create %s.'), __('this help topic')) + .' '.__('Internal error occurred'); } } elseif (!($rv = $this->save())) { - $errors['err']=sprintf(__('Unable to update %s'), __('this help topic')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this help topic')) + .' '.__('Internal error occurred'); } if ($rv) { if (!$cfg || $cfg->getTopicSortMode() == 'a') { diff --git a/include/staff/faq-view.inc.php b/include/staff/faq-view.inc.php index ecf53cfe224f178819c3ff80e00701126f61299e..9f46a499478cf3ddc0c0da0459ce5e26ec447eb4 100644 --- a/include/staff/faq-view.inc.php +++ b/include/staff/faq-view.inc.php @@ -94,7 +94,7 @@ if ($otherLangs) { ?> <div class="faq-title flush-left"><?php echo $faq->getLocalQuestion() ?> </div> -<div class="faded"><?php echo __('Last updated');?> +<div class="faded"><?php echo __('Last Updated');?> <?php echo Format::relativeTime(Misc::db2gmtime($faq->getUpdateDate())); ?> </div> <br/> diff --git a/include/staff/page.inc.php b/include/staff/page.inc.php index 8661a5cb92d7818cfcfe209330b73ecc27a710ac..97cb838e50a13c9739e1c020aced734c17ecd4ef 100644 --- a/include/staff/page.inc.php +++ b/include/staff/page.inc.php @@ -3,7 +3,7 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access $pageTypes = array( 'landing' => __('Landing Page'), 'offline' => __('Offline Page'), - 'thank-you' => __('Thank-You page'), + 'thank-you' => __('Thank-You Page'), 'other' => __('Other'), ); $info = $qs = array(); diff --git a/include/staff/templates/faq-print.tmpl.php b/include/staff/templates/faq-print.tmpl.php index 6f07f898dbd0c00510b2af5e63975c1c9c095e59..57f0dc6bba6adb8f6b9c8fe48a1c3c49ebfa880c 100644 --- a/include/staff/templates/faq-print.tmpl.php +++ b/include/staff/templates/faq-print.tmpl.php @@ -1,7 +1,7 @@ <div class="faq-title flush-left"><?php echo $faq->getLocalQuestion() ?> </div> -<div class="faded"><?php echo __('Last updated');?> +<div class="faded"><?php echo __('Last Updated');?> <?php echo Format::daydatetime($faq->getUpdateDate()); ?> </div> diff --git a/include/staff/templates/user-delete.tmpl.php b/include/staff/templates/user-delete.tmpl.php index dff5b7f2cdd42782fe6cdb8ce7d62ab24d64a3f1..0a2ac0b44698e5427aec69da9818809bf3fa4f80 100644 --- a/include/staff/templates/user-delete.tmpl.php +++ b/include/staff/templates/user-delete.tmpl.php @@ -1,7 +1,7 @@ <?php if (!$info['title']) - $info['title'] = sprintf(__('Delete User: %s'), Format::htmlchars($user->getName())); + $info['title'] = sprintf('%s: %s', __('Delete User'), Format::htmlchars($user->getName())); $info['warn'] = __('Deleted users and tickets CANNOT be recovered'); diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js index 8754c637161e12905f0a9b3412e9b373e2acb233..23a30fc29676d221f0f69e15f0c1f757f796acf0 100644 --- a/js/redactor-osticket.js +++ b/js/redactor-osticket.js @@ -116,7 +116,8 @@ RedactorPlugins.draft = function() { displayError: function(json) { $.sysAlert(json.error, - __('Unable to save draft. Refresh the current page to restore and continue your draft.')); + __('Unable to save draft.') + + __('Refresh the current page to restore and continue your draft.')); }, hideDraftSaved: function() { diff --git a/open.php b/open.php index a081c29c9bb47c4417432a1567e65d5d50fd8fd9..7cf09ec1186078f6ff112958417748386f77ca71 100644 --- a/open.php +++ b/open.php @@ -50,7 +50,9 @@ if ($_POST) { @header('Location: tickets.php?id='.$ticket->getId()); } }else{ - $errors['err']=$errors['err']?$errors['err']:__('Unable to create a ticket. Please correct errors below and try again!'); + $errors['err'] = $errors['err'] ?: sprintf('%s %s', + __('Unable to create a ticket.'), + __('Correct any errors below and try again.')); } } diff --git a/scp/apikeys.php b/scp/apikeys.php index 898acafa23f969a40f262cd9c8eb40168d14c19e..9d9336a30b2f41a25b7126842b98d9d753b7f335 100644 --- a/scp/apikeys.php +++ b/scp/apikeys.php @@ -26,23 +26,26 @@ if($_POST){ if(!$api){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('API Key')); }elseif($api->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), __('this API key')); + $msg=sprintf(__('Successfully updated %s.'), __('this API key')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), __('this API key')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this API key')), + __('Correct any errors below and try again.')); } break; case 'add': if(($id=API::add($_POST,$errors))){ - $msg=sprintf(__('Successfully added %s'), __('an API key')); + $msg=sprintf(__('Successfully added %s.'), __('an API key')); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this API key')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this API key')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), __('one API key')); + $errors['err'] = sprintf(__('You must select at least %s.'), __('one API key')); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -83,13 +86,13 @@ if($_POST){ $i++; } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected API key', 'selected API keys', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $num, $count, _N('selected API key', 'selected API keys', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected API key', 'selected API keys', $count)); break; default: diff --git a/scp/banlist.php b/scp/banlist.php index fe5af18672d220349b0cbc2c5a749f29a7dc170c..8667b2e74cee9f4f1a37ccefe67618773db2ddca 100644 --- a/scp/banlist.php +++ b/scp/banlist.php @@ -43,9 +43,11 @@ if($_POST && !$errors && $filter){ 'isactive'=>$_POST['isactive'], 'notes'=>$_POST['notes']); if($rule->update($vars,$errors)){ - $msg=sprintf(__('Successfully updated %s'), Format::htmlchars($_POST['val'])); + $msg=sprintf(__('Successfully updated %s.'), Format::htmlchars($_POST['val'])); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), __('this ban rule')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this ban rule')), + __('Correct any errors below and try again.')); } } break; @@ -66,7 +68,8 @@ if($_POST && !$errors && $filter){ break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = __('You must select at least one email to process.'); + $errors['err'] = sprintf(__('You must select at least %s to process.'), + __('one email')); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -109,13 +112,13 @@ if($_POST && !$errors && $filter){ $i++; } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected ban rule', 'selected ban rules', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected ban rule', 'selected ban rules', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected ban rule', 'selected ban rules', $count)); break; diff --git a/scp/canned.php b/scp/canned.php index 06f2601b96c4837d16e7bc346d85c37a9a1a20f2..ae8ded5fe76017b4a65b3c75929088e4110127b6 100644 --- a/scp/canned.php +++ b/scp/canned.php @@ -28,7 +28,7 @@ if(!$thisstaff $canned=null; if($_REQUEST['id'] && !($canned=Canned::lookup($_REQUEST['id']))) - $errors['err']=sprintf(__('%s: Unknown or invalid ID.'), __('canned response')); + $errors['err']=sprintf(__('%s: Unknown or invalid ID.'), __('Canned Response')); $canned_form = new SimpleForm(array( 'attachments' => new FileUploadField(array('id'=>'attach', @@ -43,7 +43,7 @@ if ($_POST) { if(!$canned) { $errors['err']=sprintf(__('%s: Unknown or invalid'), __('canned response')); } elseif($canned->update($_POST, $errors)) { - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this canned response')); //Delete removed attachments. @@ -68,13 +68,15 @@ if ($_POST) { // Delete drafts for all users for this canned response Draft::deleteForNamespace('canned.'.$canned->getId()); } elseif(!$errors['err']) { - $errors['err']=sprintf(__('Error updating %s. Try again!'), __('this canned response')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this canned response')), + __('Correct any errors below and try again.')); } break; case 'create': $premade = Canned::create(); if ($premade->update($_POST,$errors)) { - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['title'])); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($_POST['title'])); $_REQUEST['a']=null; //Upload attachments $keepers = $canned_form->getField('attachments')->getClean(); @@ -90,13 +92,14 @@ if ($_POST) { // Delete this user's drafts for new canned-responses Draft::deleteForNamespace('canned', $thisstaff->getId()); } elseif(!$errors['err']) { - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this canned response')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this canned response')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']=sprintf(__('You must select at least %s'), __('one canned response')); + $errors['err']=sprintf(__('You must select at least %s.'), __('one canned response')); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -139,13 +142,13 @@ if ($_POST) { } if($i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected canned response', 'selected canned responses', $count)); elseif($i>0) $warn=sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected canned response', 'selected canned responses', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected canned response', 'selected canned responses', $count)); break; default: diff --git a/scp/categories.php b/scp/categories.php index 0aa2785c5abab06f91beba29c65dad8152c95837..22e9fab69dffbcbd7fe5da0075c82863aaedfb6f 100644 --- a/scp/categories.php +++ b/scp/categories.php @@ -26,33 +26,36 @@ if(!$thisstaff || $category=null; if($_REQUEST['id'] && !($category=Category::lookup($_REQUEST['id']))) - $errors['err']=sprintf(__('%s: Unknown or invalid ID.'), __('category')); + $errors['err']=sprintf(__('%s: Unknown or invalid ID.'), __('Category')); if($_POST){ switch(strtolower($_POST['do'])) { case 'update': if(!$category) { - $errors['err']=sprintf(__('%s: Unknown or invalid'), __('category')); + $errors['err']=sprintf(__('%s: Unknown or invalid'), __('Category')); } elseif($category->update($_POST,$errors)) { - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this category')); } elseif(!$errors['err']) { - $errors['err']=sprintf(__('Error updating %s. Correct error(s) below and try again.'), __('this category')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this category')), + __('Correct any errors below and try again.')); } break; case 'create': $category = Category::create(); if ($category->update($_POST, $errors)) { - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['name'])); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($_POST['name'])); $_REQUEST['a']=null; } elseif(!$errors['err']) { - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this category')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this category')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']=sprintf(__('You must select at least %s'), __('one category')); + $errors['err']=sprintf(__('You must select at least %s.'), __('one category')); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -98,13 +101,13 @@ if($_POST){ ))->delete(); if ($i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected category', 'selected categories', $count)); elseif ($i > 0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected category', 'selected categories', $count)); elseif (!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected category', 'selected categories', $count)); break; default: diff --git a/scp/departments.php b/scp/departments.php index 2f8fcfce454797d0eb1ab5ba7fce6b35bf0aa394..45cafc6532e5b9900aa2f177e21159bc6a7bf295 100644 --- a/scp/departments.php +++ b/scp/departments.php @@ -25,26 +25,28 @@ if($_POST){ if(!$dept){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('department')); }elseif($dept->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this department')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this department')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this department')), + __('Correct any errors below and try again.')); } break; case 'create': $_dept = Dept::create(); if(($_dept->update($_POST,$errors))){ - $msg=sprintf(__('Successfully added "%s"'),Format::htmlchars($_POST['name'])); + $msg=sprintf(__('Successfully added %s.'),Format::htmlchars($_POST['name'])); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this department')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this department')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one department')); }elseif(in_array($cfg->getDefaultDeptId(),$_POST['ids'])) { $errors['err'] = __('You cannot disable/delete a default department. Select a new default department and try again.'); @@ -102,7 +104,7 @@ if($_POST){ $i++; } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected department', 'selected departments', $count)); elseif($i>0) $warn = sprintf(__( @@ -111,7 +113,7 @@ if($_POST){ '%1$d of %2$d %3$s deleted'), $i, $count, _N('selected department', 'selected departments', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected department', 'selected departments', $count)); } break; diff --git a/scp/emails.php b/scp/emails.php index 9ff1c70a771ad9942977a415e8b2cae8d4794ffa..f19e655761019f3c63338bc377c9b89dc1c3dbfe 100644 --- a/scp/emails.php +++ b/scp/emails.php @@ -26,26 +26,29 @@ if($_POST){ if(!$email){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('email')); }elseif($email->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this email')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), __('this email')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this email')), + __('Correct any errors below and try again.')); } break; case 'create': $box = Email::create(); if ($box->update($_POST, $errors)) { $id = $box->getId(); - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['name'])); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($_POST['name'])); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this email')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this email')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one email')); } else { $count=count($_POST['ids']); @@ -59,13 +62,13 @@ if($_POST){ } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected email', 'selected emails', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected email', 'selected emails', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected email', 'selected emails', $count)); break; diff --git a/scp/emailsettings.php b/scp/emailsettings.php index 6f871b4bf7b62e072689f4672b9df64f15bb5e06..5f18b29861cbb8290fb119c6e805dd49065466e2 100644 --- a/scp/emailsettings.php +++ b/scp/emailsettings.php @@ -21,9 +21,11 @@ $inc = 'settings-emails.inc.php'; if ($_POST && !$errors) { if($cfg && $cfg->updateSettings($_POST,$errors)) { - $msg=sprintf(__('Successfully updated %s'), Format::htmlchars($page[0])); + $msg=sprintf(__('Successfully updated %s.'), Format::htmlchars($page[0])); } elseif(!$errors['err']) { - $errors['err']=__('Unable to update settings - correct errors below and try again'); + $errors['err'] = sprintf('%s %s', + __('Unable to update settings.'), + __('Correct any errors below and try again.')); } } diff --git a/scp/faq.php b/scp/faq.php index 0c8786a2e027053d7f96e981d21e3e841365ae90..310809947f82b90d7b2f4238802aecda6a8b36a4 100644 --- a/scp/faq.php +++ b/scp/faq.php @@ -64,25 +64,27 @@ if ($_POST) { case 'add': $faq = FAQ::create(); if($faq->update($_POST,$errors)) { - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($faq->getQuestion())); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($faq->getQuestion())); // Delete draft for this new faq Draft::deleteForNamespace('faq', $thisstaff->getId()); } elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to add %s. Correct any errors below and try again.'), - __('this FAQ article')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this FAQ article')), + __('Correct any errors below and try again.')); break; case 'update': case 'edit': if(!$faq) $errors['err'] = sprintf(__('%s: Invalid or unknown'), __('FAQ article')); elseif($faq->update($_POST,$errors)) { - $msg=sprintf(__('Successfully updated %s'), __('this FAQ article')); + $msg=sprintf(__('Successfully updated %s.'), __('this FAQ article')); $_REQUEST['a']=null; //Go back to view // Delete pending draft updates for this faq (for ALL users) Draft::deleteForNamespace('faq.'.$faq->getId()); } elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('this FAQ article')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this FAQ article')), + __('Correct any errors below and try again.')); break; case 'manage-faq': if(!$faq) { @@ -108,10 +110,10 @@ if ($_POST) { case 'delete': $category = $faq->getCategory(); if($faq->delete()) { - $msg=sprintf(__('Successfully deleted %s'), Format::htmlchars($faq->getQuestion())); + $msg=sprintf(__('Successfully deleted %s.'), Format::htmlchars($faq->getQuestion())); $faq=null; } else { - $errors['err']=sprintf(__('Unable to delete %s'), __('this FAQ article')); + $errors['err']=sprintf(__('Unable to delete %s.'), __('this FAQ article')); } break; default: diff --git a/scp/filters.php b/scp/filters.php index a701531977a633b2eaa9a9328f2afdef1a84f110..b8b0d634d105a2a19c48651a4a4fd91788af862d 100644 --- a/scp/filters.php +++ b/scp/filters.php @@ -31,19 +31,21 @@ if($_POST){ if(!$filter){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('ticket filter')); }elseif($filter->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), __('this ticket filter')); + $msg=sprintf(__('Successfully updated %s.'), __('this ticket filter')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Correct error(s) below and try again.'), - __('this ticket filter')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this ticket filter')), + __('Correct any errors below and try again.')); } break; case 'add': if((Filter::create($_POST,$errors))){ - $msg=sprintf(__('Successfully updated %s'), __('this ticket filter')); + $msg=sprintf(__('Successfully updated %s.'), __('this ticket filter')); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this ticket filter')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this ticket filter')), + __('Correct any errors below and try again.')); } break; case 'mass_process': @@ -91,13 +93,13 @@ if($_POST){ } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected ticket filter', 'selected ticket filters', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected ticket filter', 'selected ticket filters', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected ticket filter', 'selected ticket filters', $count)); break; default: diff --git a/scp/forms.php b/scp/forms.php index d98e7fc0e3b6ffaf8cb6734d3ab068b513b6418e..5a4978e0982e98ccfd7d39068e724e6fd2ab1133 100644 --- a/scp/forms.php +++ b/scp/forms.php @@ -77,7 +77,7 @@ if($_POST) { case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), __('one custom form')); + $errors['err'] = sprintf(__('You must select at least %s.'), __('one custom form')); } else { $count = count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -88,13 +88,13 @@ if($_POST) { $i++; } if ($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected custom form', 'selected custom forms', $count)); elseif ($i > 0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected custom form', 'selected custom forms', $count)); elseif (!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected custom form', 'selected custom forms', $count)); break; } @@ -137,7 +137,7 @@ if($_POST) { if ($errors) $errors['err'] = sprintf(__('Unable to commit %s. Check validation errors'), __('this custom form')); else - $msg = sprintf(__('Successfully updated %s'), + $msg = sprintf(__('Successfully updated %s.'), __('this custom form')); } diff --git a/scp/helptopics.php b/scp/helptopics.php index 2ecd790faf9d40b1b0d3030dca0c1c4347f9e42b..2dd0dc7fe8174b4ef96b6f52a7f870a760af2a3c 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -28,22 +28,24 @@ if($_POST){ if(!$topic){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('help topic')); }elseif($topic->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this help topic')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this help topic')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this help topic')), + __('Correct any errors below and try again.')); } break; case 'create': $_topic = Topic::create(); if ($_topic->update($_POST, $errors)) { $topic = $_topic; - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['topic'])); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($_POST['topic'])); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this help topic')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this help topic')), + __('Correct any errors below and try again.')); } break; case 'mass_process': @@ -53,7 +55,7 @@ if($_POST){ break; default: if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one help topic')); } if (!$errors) { @@ -105,13 +107,13 @@ if($_POST){ ))->delete(); if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected help topic', 'selected help topics', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected help topic', 'selected help topics', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected help topic', 'selected help topics', $count)); break; diff --git a/scp/lists.php b/scp/lists.php index 9f3e54f2a4cea1bd2cacdefdd56a50a406c484c8..36929913773354301ffb638a57bc9ea6e345057c 100644 --- a/scp/lists.php +++ b/scp/lists.php @@ -80,40 +80,43 @@ if($_POST) { } if ($errors) - $errors['err'] = $errors['err'] ?: sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('custom list items')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('custom list items')), + __('Correct any errors below and try again.')); else { $list->_items = null; - $msg = sprintf(__('Successfully updated %s'), + $msg = sprintf(__('Successfully updated %s.'), __('this custom list')); } } elseif ($errors) - $errors['err'] = $errors['err'] ?: sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('this custom list')); + $errors['err'] = $errors['err'] ?: sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this custom list')), + __('Correct any errors below and try again.')); else - $errors['err']=sprintf(__('Unable to update %s'), __('this custom list')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to update %s.'), __('this custom list')) + .' '.__('Internal error occurred'); break; case 'add': if ($list=DynamicList::add($_POST, $errors)) { $form = $list->getForm(true); - Messages::success(sprintf(__('Successfully added %s'), __('this custom list'))); + Messages::success(sprintf(__('Successfully added %s.'), __('this custom list'))); // Redirect to list page $redirect = "lists.php?id={$list->id}#items"; } elseif ($errors) { - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this custom list')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this custom list')), + __('Correct any errors below and try again.')); } else { - $errors['err']=sprintf(__('Unable to add %s'), __('this custom list')) - .' — '.__('Internal error occurred'); + $errors['err']=sprintf(__('Unable to add %s.'), __('this custom list')) + .' '.__('Internal error occurred'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one custom list')); } else { $count = count($_POST['ids']); @@ -125,13 +128,13 @@ if($_POST) { $i++; } if ($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected custom list', 'selected custom lists', $count)); elseif ($i > 0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected custom list', 'selected custom lists', $count)); elseif (!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s — they may be in use on a custom form'), + $errors['err'] = sprintf(__('Unable to delete %s. They may be in use.'), _N('selected custom list', 'selected custom lists', $count)); break; } diff --git a/scp/logs.php b/scp/logs.php index df17796687040d053e5ce75811a99d9de0299b0c..26767bd58a335a6961a9ab1895364487d527056a 100644 --- a/scp/logs.php +++ b/scp/logs.php @@ -19,7 +19,7 @@ if($_POST){ switch(strtolower($_POST['do'])){ case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one log entry')); } else { $count=count($_POST['ids']); @@ -29,13 +29,13 @@ if($_POST){ .' WHERE log_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg=sprintf(__('Successfully deleted %s'), + $msg=sprintf(__('Successfully deleted %s.'), _N('selected log entry', 'selected log entries', $count)); else $warn=sprintf(__('%1$d of %2$d %3$s deleted'), $num, $count, _N('selected log entry', 'selected log entries', $count)); } elseif(!$errors['err']) - $errors['err']=sprintf(__('Unable to delete %s'), + $errors['err']=sprintf(__('Unable to delete %s.'), _N('selected log entry', 'selected log entries', $count)); } else { $errors['err']=__('Unknown action - get technical help.'); diff --git a/scp/orgs.php b/scp/orgs.php index 1e02a3f73510b104a0db36263e0a0a3ed4f1e041..a58e985b522764863a9b43b239ed60e1b1f69623 100644 --- a/scp/orgs.php +++ b/scp/orgs.php @@ -39,7 +39,7 @@ if ($_POST) { if (!$org) $errors['err'] = __('Trying to remove end users from an unknown organization'); elseif (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one end user')); } else { $i = 0; @@ -49,7 +49,7 @@ if ($_POST) { } $num = count($_POST['ids']); if ($i && $i == $num) - $msg = sprintf(__('Successfully removed %s'), + $msg = sprintf(__('Successfully removed %s.'), _N('selected end user', 'selected end users', $count)); elseif ($i > 0) $warn = sprintf(__('%1$d of %2$d %3$s removed'), $i, $count, @@ -62,7 +62,7 @@ if ($_POST) { case 'mass_process': if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one organization')); } else { diff --git a/scp/pages.php b/scp/pages.php index b0960f4c221abd6d5c120fc7e0560a4214799a0e..31b3cab3bb1dc1f87d81e8b6767811dc0e9c05c9 100644 --- a/scp/pages.php +++ b/scp/pages.php @@ -27,28 +27,30 @@ if($_POST) { if($page->update($_POST, $errors)) { $pageId = $page->getId(); $_REQUEST['a'] = null; - $msg=sprintf(__('Successfully added %s'), Format::htmlchars($_POST['name'])); + $msg=sprintf(__('Successfully added %s.'), Format::htmlchars($_POST['name'])); Draft::deleteForNamespace('page'); } elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to add %s. Correct any errors below and try again.'), - __('this site page')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this site page')), + __('Correct any errors below and try again.')); break; case 'update': if(!$page) $errors['err'] = sprintf(__('%s: Invalid or unknown'), __('site page')); elseif($page->update($_POST, $errors)) { - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this site page')); $_REQUEST['a']=null; //Go back to view Draft::deleteForNamespace('page.'.$page->getId().'%'); } elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('this site page')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this site page')), + __('Correct any errors below and try again.')); break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one site page')); } elseif(array_intersect($_POST['ids'], $cfg->getDefaultPages()) && strcasecmp($_POST['a'], 'enable')) { $errors['err'] = sprintf(__('One or more of the %s is in-use and CANNOT be disabled/deleted.'), @@ -95,13 +97,13 @@ if($_POST) { ->delete(); if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected site page', 'selected site pages', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected site page', 'selected site pages', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected site page', 'selected site pages', $count)); break; default: diff --git a/scp/plugins.php b/scp/plugins.php index 01f5d6bcc2735b3abb4afcfa28fe7c98b182a860..91d13c4ebaeb71807d1fa913204337f975c808b7 100644 --- a/scp/plugins.php +++ b/scp/plugins.php @@ -15,7 +15,7 @@ if($_POST) { break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one plugin')); } else { $count = count($_POST['ids']); diff --git a/scp/profile.php b/scp/profile.php index f787324a4b2f7a34a59eccaa3cba728db780a6d0..cf77b05f00fc8197696aa5f781cb37fd09c946d4 100644 --- a/scp/profile.php +++ b/scp/profile.php @@ -28,7 +28,9 @@ if($_POST && $_POST['id']!=$thisstaff->getId()) { //Check dummy ID used on the f elseif($staff->updateProfile($_POST,$errors)){ $msg=__('Profile updated successfully'); }elseif(!$errors['err']) - $errors['err']=__('Profile update error. Try correcting the errors below and try again!'); + $errors['err'] = sprintf('%s %s', + __('Profile update error.'), + __('Correct any errors below and try again.')); } //Forced password Change. diff --git a/scp/roles.php b/scp/roles.php index 4482ff59914b68d84b99c14b575d660bb5363f3f..fbfd74949a18b2f5846b0d975655edd3b374e1be 100644 --- a/scp/roles.php +++ b/scp/roles.php @@ -38,32 +38,33 @@ if ($_POST) { } elseif ($role->update($_POST, $errors)) { $msg = __('Role updated successfully'); } elseif ($errors) { - $errors['err'] = $errors['err'] ?: - sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('this role')); + $errors['err'] = $errors['err'] ?: sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this role')), + __('Correct any errors below and try again.')); } else { - $errors['err'] = sprintf(__('Unable to update %s'), __('this role')) - .' — '.__('Internal error occurred'); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this role')), + __('Internal error occurred')); } break; case 'add': $_role = Role::create(); if ($_role->update($_POST, $errors)) { unset($_REQUEST['a']); - $msg = sprintf(__('Successfully added %s'), + $msg = sprintf(__('Successfully added %s.'), __('role')); } elseif ($errors) { - $errors['err'] = $errors['err'] ?: - sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('role')); + $errors['err'] = sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this role')), + __('Correct any errors below and try again.')); } else { - $errors['err'] = sprintf(__('Unable to add %s'), __('role')) + $errors['err'] = sprintf(__('Unable to add %s.'), __('this role')) .' — '.__('Internal error occurred'); } break; case 'mass_process': if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one role')); } else { $count = count($_POST['ids']); @@ -116,13 +117,13 @@ if ($_POST) { $i++; } if ($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected role', 'selected roles', $count)); elseif ($i > 0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected role', 'selected roles', $count)); elseif (!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s — they may be in use.'), + $errors['err'] = sprintf(__('Unable to delete %s. They may be in use.'), _N('selected role', 'selected roles', $count)); break; default: diff --git a/scp/settings.php b/scp/settings.php index 4a52a6f0192f1ca969b753d13d09b3301d382b26..ae5b11dc28119b2008703998ab983f4d695734a0 100644 --- a/scp/settings.php +++ b/scp/settings.php @@ -40,9 +40,11 @@ if (isset($settingOptions[$target])) if($page && $_POST && !$errors) { if($cfg && $cfg->updateSettings($_POST,$errors)) { - $msg=sprintf(__('Successfully updated %s'), Format::htmlchars($page[0])); + $msg=sprintf(__('Successfully updated %s.'), Format::htmlchars($page[0])); } elseif(!$errors['err']) { - $errors['err']=__('Unable to update settings - correct errors below and try again'); + $errors['err'] = sprintf('%s %s', + __('Unable to update settings.'), + __('Correct any errors below and try again.')); } } diff --git a/scp/slas.php b/scp/slas.php index c8bcd0e0fc2a6f8b26e81615755a5578f61baa13..61bab1e556e1913202f3d5b0054f8bbd4f162ac1 100644 --- a/scp/slas.php +++ b/scp/slas.php @@ -26,29 +26,31 @@ if($_POST){ case 'update': if(!$sla){ $errors['err']=sprintf(__('%s: Unknown or invalid'), - __('SLA plan')); + __('SLA Plan')); }elseif($sla->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this SLA plan')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this SLA plan')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this SLA plan')), + __('Correct any errors below and try again.')); } break; case 'add': $_sla = SLA::create(); if (($_sla->update($_POST, $errors))) { - $msg=sprintf(__('Successfully added %s'), + $msg=sprintf(__('Successfully added %s.'), __('a SLA plan')); $_REQUEST['a']=null; } elseif (!$errors['err']) { - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this SLA plan')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this SLA plan')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one SLA plan')); } else { $count=count($_POST['ids']); @@ -102,13 +104,13 @@ if($_POST){ } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected SLA plan', 'selected SLA plans', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected SLA plan', 'selected SLA plans', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected SLA plan', 'selected SLA plans', $count)); break; default: diff --git a/scp/staff.php b/scp/staff.php index fc6f634baff04a9f583c82e4b0246bc6ff4b7c0b..df2854e854cefa8a5d335725240383ce14b08914 100644 --- a/scp/staff.php +++ b/scp/staff.php @@ -28,11 +28,12 @@ if($_POST){ if(!$staff){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('agent')); }elseif($staff->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this agent')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to update %s. Correct error(s) below and try again!'), - __('this agent')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this agent')), + __('Correct any errors below and try again.')); } break; case 'create': @@ -45,16 +46,17 @@ if($_POST){ } if ($staff->update($_POST,$errors)) { unset($_SESSION['new-agent-passwd']); - $msg=sprintf(__('Successfully added %s'),Format::htmlchars($_POST['firstname'])); + $msg=sprintf(__('Successfully added %s.'),Format::htmlchars($_POST['firstname'])); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this agent')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this agent')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one agent')); } elseif(in_array($_POST['a'], array('disable', 'delete')) && in_array($thisstaff->getId(),$_POST['ids']) @@ -104,13 +106,13 @@ if($_POST){ } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected agent', 'selected agents', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected agent', 'selected agents', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected agent', 'selected agents', $count)); break; @@ -120,13 +122,13 @@ if($_POST){ $i++; if($i && $i==$count) - $msg = sprintf(__('Successfully updated %s'), + $msg = sprintf(__('Successfully updated %s.'), _N('selected agent', 'selected agents', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s updated'), $i, $count, _N('selected agent', 'selected agents', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to update %s'), + $errors['err'] = sprintf(__('Unable to update %s.'), _N('selected agent', 'selected agents', $count)); break; @@ -145,13 +147,13 @@ if($_POST){ $i++; } if($i && $i==$count) - $msg = sprintf(__('Successfully updated %s'), + $msg = sprintf(__('Successfully updated %s.'), _N('selected agent', 'selected agents', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s updated'), $i, $count, _N('selected agent', 'selected agents', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to update %s'), + $errors['err'] = sprintf(__('Unable to update %s.'), _N('selected agent', 'selected agents', $count)); break; diff --git a/scp/tasks.php b/scp/tasks.php index fc1a2a7ecc0fc68c94d050c24702ee108b9cb10e..a45635ea042efeaeb45d4bd10735e82231c57e53 100644 --- a/scp/tasks.php +++ b/scp/tasks.php @@ -72,7 +72,9 @@ if($_POST && !$errors): if(!$errors['err']) $errors['err'] = __('Unable to post internal note - missing or invalid data.'); - $errors['postnote'] = __('Unable to post the note. Correct the error(s) below and try again!'); + $errors['postnote'] = sprintf('%s %s', + __('Unable to post the note.'), + __('Correct any errors below and try again.')); } break; case 'postreply': /* Post an update */ @@ -100,7 +102,9 @@ if($_POST && !$errors): if (!$errors['err']) $errors['err'] = __('Unable to post the reply - missing or invalid data.'); - $errors['postreply'] = __('Unable to post the reply. Correct the errors below and try again!'); + $errors['postreply'] = sprintf('%s %s', + __('Unable to post the reply.'), + __('Correct any errors below and try again.')); } break; default: diff --git a/scp/teams.php b/scp/teams.php index 5ba798114759eb43fde50d0bffce5a7c75d00705..600d1488338a4a1e107178c9d4ae391eb1ef0686 100644 --- a/scp/teams.php +++ b/scp/teams.php @@ -25,26 +25,28 @@ if($_POST){ if(!$team){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('team')); }elseif($team->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this team')); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to update %s. Correct any errors below and try again.'), - __('this team')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this team')), + __('Correct any errors below and try again.')); } break; case 'create': $team = Team::create(); if (($team->update($_POST, $errors))){ - $msg=sprintf(__('Successfully added %s'),Format::htmlchars($_POST['team'])); + $msg=sprintf(__('Successfully added %s.'),Format::htmlchars($_POST['team'])); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this team')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this team')), + __('Correct any errors below and try again.')); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']=sprintf(__('You must select at least %s'), __('one team')); + $errors['err']=sprintf(__('You must select at least %s.'), __('one team')); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -98,13 +100,13 @@ if($_POST){ $i++; } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected team', 'selected teams', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected team', 'selected teams', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected team', 'selected teams', $count)); break; default: diff --git a/scp/templates.php b/scp/templates.php index 34f8b23ea6493840c89cf1d37bf9815dc0442490..e5a8decd0e57583f4a8bb97cd54d4575e7ebfc6b 100644 --- a/scp/templates.php +++ b/scp/templates.php @@ -38,14 +38,15 @@ if($_POST){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('message template')); }elseif($template->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), __('this message template')); // Drop drafts for this template for ALL users Draft::deleteForNamespace('tpl.'.$template->getCodeName() .'.'.$template->getTplId()); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this template')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this template')), + __('Correct any errors below and try again.')); } break; case 'implement': @@ -53,35 +54,38 @@ if($_POST){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('template set')); }elseif($new = EmailTemplate::add($_POST,$errors)){ $template = $new; - $msg=sprintf(__('Successfully updated %s'), __('this message template')); + $msg=sprintf(__('Successfully updated %s.'), __('this message template')); // Drop drafts for this user for this template Draft::deleteForNamespace('tpl.'.$new->getCodeName() .$new->getTplId(), $thisstaff->getId()); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this message template')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this message template')), + __('Correct any errors below and try again.')); } break; case 'update': if(!$template){ $errors['err']=sprintf(__('%s: Unknown or invalid'), __('template set')); }elseif($template->update($_POST,$errors)){ - $msg=sprintf(__('Successfully updated %s'), + $msg=sprintf(__('Successfully updated %s.'), mb_convert_case(__('this message template'), MB_CASE_TITLE)); }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Error updating %s. Try again!'), - __('this message template')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this message template')), + __('Correct any errors below and try again.')); } break; case 'add': if(($new=EmailTemplateGroup::add($_POST,$errors))){ $template=$new; - $msg=sprintf(__('Successfully added %s'), + $msg=sprintf(__('Successfully added %s.'), mb_convert_case(__('a template set'), MB_CASE_TITLE)); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']=sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this template set')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this message template')), + __('Correct any errors below and try again.')); } break; case 'mass_process': @@ -132,13 +136,13 @@ if($_POST){ } if($i && $i==$count) - $msg = sprintf(__('Successfully deleted %s'), + $msg = sprintf(__('Successfully deleted %s.'), _N('selected template set', 'selected template sets', $count)); elseif($i>0) $warn = sprintf(__('%1$d of %2$d %3$s deleted'), $i, $count, _N('selected template set', 'selected template sets', $count)); elseif(!$errors['err']) - $errors['err'] = sprintf(__('Unable to delete %s'), + $errors['err'] = sprintf(__('Unable to delete %s.'), _N('selected template set', 'selected template sets', $count)); break; default: diff --git a/scp/tickets.php b/scp/tickets.php index 57beb3d85cb2333f807f6d4cdd74021a3998e283..1ddb0c7a1b3ecd0ee328dd1a4fa26f8894adb927 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -139,7 +139,9 @@ if($_POST && !$errors): $redirect = 'tickets.php'; } elseif(!$errors['err']) { - $errors['err']=__('Unable to post the reply. Correct the errors below and try again!'); + $errors['err']=sprintf('%s %s', + __('Unable to post the reply.'), + __('Correct any errors below and try again.')); } break; case 'postnote': /* Post Internal Note */ @@ -190,7 +192,9 @@ if($_POST && !$errors): if(!$errors['err']) $errors['err'] = __('Unable to post internal note - missing or invalid data.'); - $errors['postnote'] = __('Unable to post the note. Correct the error(s) below and try again!'); + $errors['postnote'] = sprintf('%s %s', + __('Unable to post the note.'), + __('Correct any errors below and try again.')); } break; case 'edit': @@ -340,7 +344,9 @@ if($_POST && !$errors): $response_form->getField('attachments')->reset(); unset($_SESSION[':form-data']); } elseif(!$errors['err']) { - $errors['err']=__('Unable to create the ticket. Correct the error(s) and try again'); + $errors['err']=sprintf('%s %s', + __('Unable to create the ticket.', + __('Correct any errors below and try again.')); } } break; diff --git a/scp/users.php b/scp/users.php index a2fc261607b488639d4fe8c2012c48a491b16de2..a99f06709645adc2cfc1adf4178049703b78e64e 100644 --- a/scp/users.php +++ b/scp/users.php @@ -34,21 +34,23 @@ if ($_POST) { && !$acct->update($_POST, $errors)) { $errors['err']=__('Unable to update user account information'); } elseif($user->updateInfo($_POST, $errors)) { - $msg=sprintf(__('Successfully updated %s'), __('this end user')); + $msg=sprintf(__('Successfully updated %s.'), __('this end user')); $_REQUEST['a'] = null; } elseif(!$errors['err']) { - $errors['err']=sprintf(__('Unable to update %s. Correct error(s) below and try again!'), - __('this end user')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to update %s.'), __('this end user')), + __('Correct any errors below and try again.')); } break; case 'create': $form = UserForm::getUserForm()->getForm($_POST); if (($user = User::fromForm($form))) { - $msg = Format::htmlchars(sprintf(__('Successfully added %s'), $user->getName())); + $msg = Format::htmlchars(sprintf(__('Successfully added %s.'), $user->getName())); $_REQUEST['a'] = null; } elseif (!$errors['err']) { - $errors['err'] = sprintf(__('Unable to add %s. Correct error(s) below and try again.'), - __('this end user')); + $errors['err']=sprintf('%s %s', + sprintf(__('Unable to add %s.'), __('this end user')), + __('Correct any errors below and try again.')); } break; case 'confirmlink': @@ -72,7 +74,7 @@ if ($_POST) { break; case 'mass_process': if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = sprintf(__('You must select at least %s'), + $errors['err'] = sprintf(__('You must select at least %s.'), __('one end user')); } else { $users = User::objects()->filter( diff --git a/setup/inc/class.installer.php b/setup/inc/class.installer.php index 5cb1788872569b04c04c3dc971256faa45675ba5..d922eab1b234a4c340a10449082db9acd4f3a3da 100644 --- a/setup/inc/class.installer.php +++ b/setup/inc/class.installer.php @@ -64,7 +64,9 @@ class Installer extends SetupWizard { $vars = array_map('trim', $vars); if(!Validator::process($f,$vars,$this->errors) && !$this->errors['err']) - $this->errors['err']=__('Missing or invalid data - correct the errors and try again.'); + $errors['err'] = sprintf('%s — %s', + __('Missing or invalid data'), + __('Correct any errors below and try again')); //Staff's email can't be same as system emails. diff --git a/setup/install.php b/setup/install.php index 1420f2dfab36db7ee48d874b9e127308b45dd32d..b093ba10507c8ef8d8d069953dea7c645f24ddff 100644 --- a/setup/install.php +++ b/setup/install.php @@ -56,7 +56,9 @@ if($_POST && $_POST['s']) { //TODO: Go to subscribe step. $_SESSION['ost_installer']['s']='done'; } elseif(!($errors=$installer->getErrors()) || !$errors['err']) { - $errors['err']=__('Error installing osTicket - correct the errors below and try again.'); + $errors['err'] = sprintf('%s %s', + __('Error installing osTicket.'), + __('Correct any errors below and try again.')); } break; case 'subscribe': diff --git a/tickets.php b/tickets.php index 13a3ef4238c7f6b2e0398a83dcdc6bd6d615ab35..5d2a07ffbdf4db5a3550ee04baa6a35cf911b2d2 100644 --- a/tickets.php +++ b/tickets.php @@ -95,11 +95,13 @@ if ($_POST && is_object($ticket) && $ticket->getId()) { $attachments->reset(); $attachments->getForm()->setSource(array()); } else { - $errors['err']=__('Unable to post the message. Try again'); + $errors['err'] = sprintf('%s %s', + __('Unable to post the message.'), + __('Correct any errors below and try again.')); } } elseif(!$errors['err']) { - $errors['err']=__('Error(s) occurred. Please try again'); + $errors['err'] = __('Correct any errors below and try again.'); } break; default: