From d41f342a4a9492aa4277501900568ae32f27ea27 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 7 Jul 2014 08:59:20 -0500 Subject: [PATCH] Fix a few consistency errors in scp --- include/class.nav.php | 4 ++-- scp/attachment.php | 2 +- scp/departments.php | 2 +- scp/groups.php | 2 +- scp/helptopics.php | 4 ++-- scp/templates.php | 4 ++-- setup/cli/modules/i18n.php | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/class.nav.php b/include/class.nav.php index d07fd22a4..4a17cf701 100644 --- a/include/class.nav.php +++ b/include/class.nav.php @@ -142,8 +142,8 @@ class StaffNav { $subnav[]=array('desc'=>__('My Profile'),'href'=>'profile.php','iconclass'=>'users'); break; case 'users': - $subnav[] = array('desc' => 'User Directory', 'href' => 'users.php', 'iconclass' => 'teams'); - $subnav[] = array('desc' => 'Organizations', 'href' => 'orgs.php', 'iconclass' => 'departments'); + $subnav[] = array('desc' => __('User Directory'), 'href' => 'users.php', 'iconclass' => 'teams'); + $subnav[] = array('desc' => __('Organizations'), 'href' => 'orgs.php', 'iconclass' => 'departments'); break; case 'kbase': $subnav[]=array('desc'=>__('FAQs'),'href'=>'kb.php', 'urls'=>array('faq.php'), 'iconclass'=>'kb'); diff --git a/scp/attachment.php b/scp/attachment.php index 5b2e04303..113316002 100644 --- a/scp/attachment.php +++ b/scp/attachment.php @@ -20,7 +20,7 @@ require_once(INCLUDE_DIR.'class.attachment.php'); if(!$thisstaff || !$_GET['id'] || !$_GET['h'] || !($attachment=Attachment::lookup($_GET['id'])) || !($file=$attachment->getFile())) - die(__('Unknown or invalid attachment')); + Http::response(404, __('Unknown or invalid attachment')); //Validate session access hash - we want to make sure the link is FRESH! and the user has access to the parent ticket!! $vhash=md5($attachment->getFileId().session_id().strtolower($file->getKey())); diff --git a/scp/departments.php b/scp/departments.php index 9bb773cb2..ef9d4a110 100644 --- a/scp/departments.php +++ b/scp/departments.php @@ -42,7 +42,7 @@ if($_POST){ if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { $errors['err'] = __('You must select at least one department'); }elseif(in_array($cfg->getDefaultDeptId(),$_POST['ids'])) { - $errors['err'] = __('You can not disable/delete a default department. Remove default Dept. and try again.'); + $errors['err'] = __('You can not disable/delete a default department. Select a new default department and try again.'); }else{ $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { diff --git a/scp/groups.php b/scp/groups.php index a5fe2db1b..e0d2d06f0 100644 --- a/scp/groups.php +++ b/scp/groups.php @@ -42,7 +42,7 @@ if($_POST){ if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { $errors['err'] = __('You must select at least one group.'); } elseif(in_array($thisstaff->getGroupId(), $_POST['ids'])) { - $errors['err'] = __("As an admin, you can't disable/delete a group you belong to - you might lockout all admins!"); + $errors['err'] = __("As an admin, you cannot disable/delete a group you belong to - you might lockout all admins!"); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { diff --git a/scp/helptopics.php b/scp/helptopics.php index 8c41c1047..d838d6124 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -105,10 +105,10 @@ if($_POST){ $t->setSortOrder($v); } } - $msg = 'Successfully set sorting configuration'; + $msg = __('Successfully set sorting configuration'); } catch (Exception $ex) { - $errors['err'] = 'Unable to set sorting mode'; + $errors['err'] = __('Unable to set sorting mode'); } break; default: diff --git a/scp/templates.php b/scp/templates.php index 9f3136586..d86de5614 100644 --- a/scp/templates.php +++ b/scp/templates.php @@ -103,9 +103,9 @@ if($_POST){ if($i && $i==$count) $msg = __('Selected templates disabled'); elseif($i) - $warn = sprintf(__('%1$d of %2$d selected templates disabled (in-use templates can\'t be disabled)'), $i, $count); + $warn = sprintf(__('%1$d of %2$d selected template sets disabled (in-use templates cannot be disabled)'), $i, $count); else - $errors['err'] = __("Unable to disable selected templates (in-use or default template can't be disabled)"); + $errors['err'] = __("Unable to disable selected template sets (in-use or default template cannot be disabled)"); break; case 'delete': $i=0; diff --git a/setup/cli/modules/i18n.php b/setup/cli/modules/i18n.php index 115e4a7d7..7f77d8622 100644 --- a/setup/cli/modules/i18n.php +++ b/setup/cli/modules/i18n.php @@ -148,7 +148,7 @@ class i18n_Compiler extends Module { list($code, $js) = $this->_http_get( 'http://imperavi.com/webdownload/redactor/lang/?lang=' .strtolower($lang)); - if ($code == 200) + if ($code == 200 && ($js != 'File not found')) $phar->addFromString('js/redactor.js', $js); else $this->stderr->write("Unable to fetch Redactor language file\n"); -- GitLab