diff --git a/ajax.php b/ajax.php index a629af63..694b6017 100644 --- a/ajax.php +++ b/ajax.php @@ -14,14 +14,17 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ -function clientLoginPage($msg='Unauthorized') { - Http::response(403,'Must login: '.Format::htmlchars($msg)); +function clientLoginPage($msg=null) { + if(!$msg) + $msg = lang('unauthorized'); + Http::response(403,lang('must_login').': '.Format::htmlchars($msg)); exit; } require('client.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); -if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error'); +if(!defined('INCLUDE_DIR')) Http::response(500, lang('server_conf_error')); require_once INCLUDE_DIR.'/class.dispatcher.php'; require_once INCLUDE_DIR.'/class.ajax.php'; diff --git a/api/cron.php b/api/cron.php index 0ca641b5..8293ca6e 100644 --- a/api/cron.php +++ b/api/cron.php @@ -13,14 +13,15 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ -@chdir(realpath(dirname(__FILE__)).'/'); //Change dir. +/*@chdir(realpath(dirname(__FILE__)).'/'); //Change dir. +require('api.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); +*/ require('api.inc.php'); - if (!osTicket::is_cli()) - die('cron.php only supports local cron calls - use http -> api/tasks/cron'); + die('cron.php only_support_local http -> api/tasks/cron'); @chdir(realpath(dirname(__FILE__)).'/'); //Change dir. -require('api.inc.php'); require_once(INCLUDE_DIR.'api.cron.php'); LocalCronApiController::call(); ?> diff --git a/api/pipe.php b/api/pipe.php index 7cf1ad1b..422ba909 100644 --- a/api/pipe.php +++ b/api/pipe.php @@ -17,10 +17,11 @@ ini_set('memory_limit', '256M'); //The concern here is having enough mem for emails with attachments. @chdir(realpath(dirname(__FILE__)).'/'); //Change dir. require('api.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); //Only local piping supported via pipe.php if (!osTicket::is_cli()) - die('pipe.php only supports local piping - use http -> api/tickets.email'); + die('pipe.php '.lang('only_support_local_p').' http -> api/tickets.email'); require_once(INCLUDE_DIR.'api.tickets.php'); PipeApiController::process(); diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css index c8b90631..e6b2c487 100644 --- a/assets/default/css/theme.css +++ b/assets/default/css/theme.css @@ -213,7 +213,6 @@ h2 { #msg_error { margin: 0; padding: 5px 10px 5px 36px; - height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #a00; @@ -782,6 +781,7 @@ a.refresh { } .infoTable th { text-align: left; + font-weight: bold; } #ticketThread table { margin-top: 10px; @@ -806,7 +806,7 @@ a.refresh { background: #d8efff; } #ticketThread .response th { - background: #ddd; + background: #FFE0B3; } #ticketThread .info { padding: 2px; @@ -824,3 +824,14 @@ a.refresh { background-position: 0 50%; background-repeat: no-repeat; } + +#sysmsg{ position: absolute; width: 753px; top: 27px; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } +#sysmsg.error{ + margin: 0; + padding: 5px 10px 5px 36px; + line-height: 16px; + margin-bottom: 10px; + border: 1px solid #a00; + background: url('../images/icons/error.png') 10px 50% no-repeat #fff0f0; + top: 40px; +} \ No newline at end of file diff --git a/attachment.php b/attachment.php index d780ae2d..d47a09ed 100644 --- a/attachment.php +++ b/attachment.php @@ -16,20 +16,21 @@ **********************************************************************/ require('secure.inc.php'); require_once(INCLUDE_DIR.'class.attachment.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); //Basic checks if(!$thisclient || !$_GET['id'] || !$_GET['h'] || !($attachment=Attachment::lookup($_GET['id'])) || !($file=$attachment->getFile())) - die('Unknown attachment!'); + die(lang('unknown_attach')); //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().$file->getHash()); if(strcasecmp(trim($_GET['h']),$vhash) || !($ticket=$attachment->getTicket()) || !$ticket->checkClientAccess($thisclient)) - die('Unknown or invalid attachment'); + die('unknown_attach'); //Download the file.. $file->download(); diff --git a/autocomplete.php b/autocomplete.php new file mode 100644 index 00000000..037c94a4 --- /dev/null +++ b/autocomplete.php @@ -0,0 +1,49 @@ + true); + + $sql='SELECT email, name, phone, phone_ext FROM `ost_ticket` WHERE ' + . ' name LIKE(' . db_input('%'.$_POST['name'].'%') . ') GROUP BY name'; + + if(!($res=db_query($sql)) || !db_num_rows($res)) + { + json_output(array('result' => false)); + return; + } + while ($row = mysqli_fetch_assoc($res)){ + $data['data'][] = $row; + } + + json_output($data); +} \ No newline at end of file diff --git a/client.inc.php b/client.inc.php index f8f6ddff..c38309ed 100644 --- a/client.inc.php +++ b/client.inc.php @@ -19,6 +19,7 @@ if(!file_exists($thisdir.'main.inc.php')) die('Fatal Error.'); require_once($thisdir.'main.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); if(!defined('INCLUDE_DIR')) die('Fatal error'); @@ -60,7 +61,7 @@ if ($_POST && !$ost->checkCSRFToken()) { @header('Location: index.php'); //just incase redirect fails - die('Action denied (400)!'); + die(lang('action_denied').' (400)!'); } /* Client specific defaults */ diff --git a/css/ui-lightness/jquery-ui-1.8.18.custom.css b/css/ui-lightness/jquery-ui-1.8.18.custom.css index d9e8e3a5..b43e020c 100755 --- a/css/ui-lightness/jquery-ui-1.8.18.custom.css +++ b/css/ui-lightness/jquery-ui-1.8.18.custom.css @@ -340,6 +340,13 @@ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} + /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-datepicker-cover { display: none; /*sorry for IE5*/ diff --git a/include/JSON.php b/include/JSON.php index e75eba65..61c32945 100644 --- a/include/JSON.php +++ b/include/JSON.php @@ -111,6 +111,8 @@ * $value = $json->decode($input); * */ +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + class Services_JSON { /** @@ -417,7 +419,7 @@ function encode($var) default: return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) ? 'null' - : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); + : new Services_JSON_Error(gettype($var).' '.lang('cant_encode_json')); } } diff --git a/include/ajax.content.php b/include/ajax.content.php index 197d75ff..059dfb2d 100644 --- a/include/ajax.content.php +++ b/include/ajax.content.php @@ -15,20 +15,21 @@ **********************************************************************/ if(!defined('INCLUDE_DIR')) die('!'); - + class ContentAjaxAPI extends AjaxController { - + function log($id) { if($id && ($log=Log::lookup($id))) { $content=sprintf('
 %s

%s

-
Log Date: %s IP Address: %s
', +
'.lang('log_date').': %s '.lang('ip_address').': %s', $log->getTitle(), Format::display(str_replace(',',', ',$log->getText())), Format::db_daydatetime($log->getCreateDate()), $log->getIP()); }else { - $content='
 Error:Unknown or invalid log ID
'; + $content='
 Error:'.lang('unknown_log_id').'
'; + } return $content; @@ -39,46 +40,45 @@ function ticket_variables() { $content='

Ticket Variables

- Please note that non-base variables depend on the context of use. Visit osTicket Wiki for up-to-date documentation. -
+ ' + .lang('non_base_var'). + '
- + diff --git a/include/ajax.kbase.php b/include/ajax.kbase.php index e467f513..3614bc4e 100644 --- a/include/ajax.kbase.php +++ b/include/ajax.kbase.php @@ -14,17 +14,17 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ if(!defined('INCLUDE_DIR')) die('!'); - - +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + class KbaseAjaxAPI extends AjaxController { - + function cannedResp($id, $format='') { global $thisstaff, $_GET; include_once(INCLUDE_DIR.'class.canned.php'); if(!$id || !($canned=Canned::lookup($id)) || !$canned->isEnabled()) - Http::response(404, 'No such premade reply'); + Http::response(404, lang('no_premade_reply')); //Load ticket. if($_GET['tid']) { @@ -52,33 +52,32 @@ function cannedResp($id, $format='') { } function faq($id, $format='html') { - //XXX: user ajax->getThisStaff() (nolint) - global $thisstaff; + global $thisstaff; //XXX: user ajax->getThisStaff() include_once(INCLUDE_DIR.'class.faq.php'); if(!($faq=FAQ::lookup($id))) return null; - //TODO: $fag->getJSON() for json format. (nolint) + //TODO: $fag->getJSON() for json format. $resp = sprintf( '
%s

%s

-
Last updated %s
+
'.lang('last_update').' %s

- View | Attachments (%s)', - $faq->getQuestion(), + '.lang('view').' | '.lang('attachments').' (%s)', + $faq->getQuestion(), Format::safe_html($faq->getAnswer()), Format::db_daydatetime($faq->getUpdateDate()), $faq->getId(), $faq->getId(), $faq->getNumAttachments()); if($thisstaff && $thisstaff->canManageFAQ()) { - $resp.=sprintf(' | Edit',$faq->getId()); + $resp.=sprintf(' | '.lang('edit').'',$faq->getId()); } $resp.='
'; - return $resp; + return $resp; } } ?> diff --git a/include/ajax.reports.php b/include/ajax.reports.php index 603fb416..02898b4f 100644 --- a/include/ajax.reports.php +++ b/include/ajax.reports.php @@ -19,19 +19,20 @@ if(!defined('INCLUDE_DIR')) die('403'); include_once(INCLUDE_DIR.'class.ticket.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); /** * Overview Report - * + * * The overview report allows for the display of basic ticket statistics in * both graphical and tabular formats. */ class OverviewReportAjaxAPI extends AjaxController { function enumTabularGroups() { - return $this->encode(array("dept"=>"Department", "topic"=>"Topics", + return $this->encode(array("dept"=>lang("department"), "topic"=>lang("topics"), # XXX: This will be relative to permissions based on the # logged-in-staff. For basic staff, this will be 'My Stats' - "staff"=>"Staff")); + "staff"=>lang("staff"))); } function getData() { @@ -55,7 +56,7 @@ function getData() { "pk" => "dept_id", "sort" => 'T1.dept_name', "fields" => 'T1.dept_name', - "headers" => array('Department'), + "headers" => array(lang('department')), "filter" => ('T1.dept_id IN ('.implode(',', db_input($thisstaff->getDepts())).')') ), "topic" => array( @@ -65,7 +66,7 @@ function getData() { "fields" => "CONCAT_WS(' / '," ."(SELECT P.topic FROM ".TOPIC_TABLE." P WHERE P.topic_id = T1.topic_pid)," ."T1.topic) as name ", - "headers" => array('Help Topic'), + "headers" => array(lang('help_topic')), "filter" => '1' ), "staff" => array( @@ -73,17 +74,17 @@ function getData() { "pk" => 'staff_id', "sort" => 'name', "fields" => "CONCAT_WS(' ', T1.firstname, T1.lastname) as name", - "headers" => array('Staff Member'), + "headers" => array(lang('staff_members')), "filter" => ('T1.staff_id=S1.staff_id - AND + AND (T1.staff_id='.db_input($thisstaff->getId()) .(($depts=$thisstaff->getManagedDepartments())? (' OR T1.dept_id IN('.implode(',', db_input($depts)).')'):'') .(($thisstaff->canViewStaffStats())? (' OR T1.dept_id IN('.implode(',', db_input($thisstaff->getDepts())).')'):'') .')' - ) + ) ) ); $group = $this->get('group', 'dept'); @@ -98,10 +99,10 @@ function getData() { COUNT(*)-COUNT(NULLIF(A1.state, "overdue")) AS Overdue, COUNT(*)-COUNT(NULLIF(A1.state, "closed")) AS Closed, COUNT(*)-COUNT(NULLIF(A1.state, "reopened")) AS Reopened - FROM '.$info['table'].' T1 - LEFT JOIN '.TICKET_EVENT_TABLE.' A1 + FROM '.$info['table'].' T1 + LEFT JOIN '.TICKET_EVENT_TABLE.' A1 ON (A1.'.$info['pk'].'=T1.'.$info['pk'].' - AND NOT annulled + AND NOT annulled AND (A1.timestamp BETWEEN '.$start.' AND '.$stop.')) LEFT JOIN '.STAFF_TABLE.' S1 ON (S1.staff_id=A1.staff_id) WHERE '.$info['filter'].' @@ -110,7 +111,7 @@ function getData() { array(1, 'SELECT '.$info['fields'].', FORMAT(AVG(DATEDIFF(T2.closed, T2.created)),1) AS ServiceTime - FROM '.$info['table'].' T1 + FROM '.$info['table'].' T1 LEFT JOIN '.TICKET_TABLE.' T2 ON (T2.'.$info['pk'].'=T1.'.$info['pk'].') LEFT JOIN '.STAFF_TABLE.' S1 ON (S1.staff_id=T2.staff_id) WHERE '.$info['filter'].' AND T2.closed BETWEEN '.$start.' AND '.$stop.' @@ -119,7 +120,7 @@ function getData() { array(1, 'SELECT '.$info['fields'].', FORMAT(AVG(DATEDIFF(B2.created, B1.created)),1) AS ResponseTime - FROM '.$info['table'].' T1 + FROM '.$info['table'].' T1 LEFT JOIN '.TICKET_TABLE.' T2 ON (T2.'.$info['pk'].'=T1.'.$info['pk'].') LEFT JOIN '.TICKET_THREAD_TABLE.' B2 ON (B2.ticket_id = T2.ticket_id AND B2.thread_type="R") @@ -153,8 +154,8 @@ function getData() { $r[] = null; } return array("columns" => array_merge($info['headers'], - array('Opened','Assigned','Overdue','Closed','Reopened', - 'Service Time','Response Time')), + array(lang('opened'),lang('assigned'),lang('overdue'),lang('closed'),lang('reopened'), + lang('service_time'),lang('response_time'))), "data" => $rows); } @@ -174,7 +175,7 @@ function downloadTabularData() { function getPlotData() { - + if(($start = $this->get('start', 'last month'))) { $stop = $this->get('stop', 'now'); if (substr($stop, 0, 1) == '+') @@ -193,7 +194,7 @@ function getPlotData() { .') AND FROM_UNIXTIME('.db_input($stop) .') ORDER BY 1'); $events = array(); - while ($row = db_fetch_row($res)) $events[] = $row[0]; + while ($row = db_fetch_row($res)) $events[] = lang($row[0]); # TODO: Handle user => db timezone offset # XXX: Implement annulled column from the %ticket_event table @@ -211,7 +212,6 @@ function getPlotData() { $time = null; $times = array(); # Iterate over result set, adding zeros for missing ticket events - $slots = array(); while ($row = db_fetch_row($res)) { $row_time = strtotime($row[1]); if ($time != $row_time) { @@ -227,11 +227,12 @@ function getPlotData() { $times[] = $time = $row_time; } # Keep track of states for this timeframe - $slots[] = $row[0]; - $plots[$row[0]][] = (int)$row[2]; + $slots[] = lang($row[0]); + $plots[lang($row[0])][] = (int)$row[2]; } foreach (array_diff($events, $slots) as $slot) $plots[$slot][] = 0; + return $this->encode(array("times" => $times, "plots" => $plots, "events"=>$events)); } diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 34c46325..d00e7e46 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -17,6 +17,7 @@ if(!defined('INCLUDE_DIR')) die('403'); include_once(INCLUDE_DIR.'class.ticket.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); class TicketsAjaxAPI extends AjaxController { @@ -178,11 +179,11 @@ function search() { $sql="$select $from $where"; if(($tickets=db_result(db_query($sql)))) { - $result['success'] =sprintf("Search criteria matched %s - view", - ($tickets>1?"$tickets tickets":"$tickets ticket"), + $result['success'] =sprintf(lang("search_match")." %s - ".lang("view")."", + ($tickets>1?"$tickets ".lang("tickets"):"$tickets ".lang("ticket")), str_replace(array('&', '&'), array('&', '&'), $_SERVER['QUERY_STRING'])); } else { - $result['fail']='No tickets found matching your search criteria.'; + $result['fail']=lang('no_tickets_found'); } return $this->json_encode($result); @@ -195,14 +196,14 @@ function acquireLock($tid) { return 0; if(!($ticket = Ticket::lookup($tid)) || !$ticket->checkStaffAccess($thisstaff)) - return $this->json_encode(array('id'=>0, 'retry'=>false, 'msg'=>'Lock denied!')); + return $this->json_encode(array('id'=>0, 'retry'=>false, 'msg'=>lang('lock_denied'))); //is the ticket already locked? if($ticket->isLocked() && ($lock=$ticket->getLock()) && !$lock->isExpired()) { /*Note: Ticket->acquireLock does the same logic...but we need it here since we need to know who owns the lock up front*/ //Ticket is locked by someone else.?? if($lock->getStaffId()!=$thisstaff->getId()) - return $this->json_encode(array('id'=>0, 'retry'=>false, 'msg'=>'Unable to acquire lock.')); + return $this->json_encode(array('id'=>0, 'retry'=>false, 'msg'=>lang('cant_acquire_lock'))); //Ticket already locked by staff...try renewing it. $lock->renew(); //New clock baby! @@ -266,9 +267,9 @@ function previewTicket ($tid) { $error=$msg=$warn=null; if($lock && $lock->getStaffId()==$thisstaff->getId()) - $warn.=' Ticket is locked by '.$lock->getStaffName().''; + $warn.=' '.lang('ticket_locket_by').' '.$lock->getStaffName().''; elseif($ticket->isOverdue()) - $warn.=' Marked overdue!'; + $warn.=' '.lang('market_overdue').'!'; ob_start(); echo sprintf( @@ -287,26 +288,26 @@ function previewTicket ($tid) { $ticket_state=sprintf('%s',ucfirst($ticket->getStatus())); if($ticket->isOpen()) { if($ticket->isOverdue()) - $ticket_state.=' — Overdue'; + $ticket_state.=' — '.lang('overdue').''; else $ticket_state.=sprintf(' — %s',$ticket->getPriority()); } echo sprintf(' - + - + ',$ticket_state, Format::db_datetime($ticket->getCreateDate())); if($ticket->isClosed()) { echo sprintf(' - - + + ', Format::db_datetime($ticket->getCloseDate()), ($staff?$staff->getName():'staff') @@ -314,7 +315,7 @@ function previewTicket ($tid) { } elseif($ticket->getEstDueDate()) { echo sprintf(' - + ', Format::db_datetime($ticket->getEstDueDate())); @@ -327,21 +328,21 @@ function previewTicket ($tid) { if($ticket->isOpen()) { echo sprintf(' - + - ',$ticket->isAssigned()?implode('/', $ticket->getAssignees()):' — Unassigned —'); + ',$ticket->isAssigned()?implode('/', $ticket->getAssignees()):' — '.lang('unassigned').' —'); } echo sprintf( ' - + - + - + ', Format::htmlchars($ticket->getDeptName()), @@ -350,23 +351,23 @@ function previewTicket ($tid) { $ticket->getEmail()); echo '
Base VariablesOther Variables
'.lang('base_variables').''.lang('other_variables').'
- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
%{ticket.id}Ticket ID (internal ID)
%{ticket.number}Ticket number (external ID)
%{ticket.email}Email address
%{ticket.name}Full name
%{ticket.subject}Subject
%{ticket.phone}Phone number | ext
%{ticket.status}Status
%{ticket.priority}Priority
%{ticket.assigned}Assigned staff and/or team
%{ticket.create_date}Date created
%{ticket.due_date}Due date
%{ticket.close_date}Date closed
%{ticket.auth_token}Auth. token used for auto-login
%{ticket.client_link}Client\'s ticket view link
%{ticket.staff_link}Staff\'s ticket view link
Expandable Variables (See Wiki)
%{ticket.topic}Help topic
%{ticket.dept}Department
%{ticket.staff}Assigned/closing staff
%{ticket.team}Assigned/closing team
%{ticket.id}'.lang('ticket_id_int_id').'
%{ticket.number}'.lang('ticket_number').'
%{ticket.email}'.lang('email_address').'
%{ticket.name}'.lang('full_name').'
%{ticket.subject}'.lang('subject').'
%{ticket.phone}'.lang('phone_number').' | '.lang('ext').'
%{ticket.status}'.lang('status').'
%{ticket.priority}'.lang('priority').'
%{ticket.assigned}'.lang('assigned_st_te').'
%{ticket.create_date}'.lang('date_created').'
%{ticket.due_date}'.lang('due_date').'
%{ticket.close_date}'.lang('date_closed').'
%{ticket.auth_token}'.lang('auth_used').'
%{ticket.client_link}'.lang('client_view_link').'
%{ticket.staff_link}'.lang('staff_view_link').'
'.lang('expan_var').'
%{ticket.topic}'.lang('help_topic').'
%{ticket.dept}'.lang('department').'
%{ticket.staff}'.lang('assigned_c_staff').'
%{ticket.team}'.lang('assigned_closing').'
- - - - - - - - - + + + + + + +
%{message}Incoming message
%{response}Outgoing response
%{comments}Assign/transfer comments
%{note}Internal note (expandable)
%{assignee}Assigned staff/team
%{assigner}Staff assigning the ticket
%{url}osTicket\'s base url (FQDN)
%{reset_link}Reset link used by the password reset feature
%{message}'.lang('incoming_message').'
%{response}'.lang('outgoing_response').'
%{comments}'.lang('assign_comments').'
%{note}'.lang('no_note').' ('.lang('expandable').')
%{assignee}'.lang('assigned_st_te').'
%{assigner}'.lang('staff_assigning').'
%{url}'.lang('fqdn').'
Ticket State:'.lang('ticket_state').': %s
Create Date:'.lang('create_date').': %s
Close Date:%s by %s'.lang('close_date').':%s '.lang('by').' %s
Due Date:'.lang('due_date').': %s
Assigned To:'.lang('assigned_to').': %s
Department:'.lang('department').': %s
Help Topic:'.lang('help_topic').': %s
From:'.lang('from').': %s %s
'; - $options[]=array('action'=>'Thread ('.$ticket->getThreadCount().')','url'=>"tickets.php?id=$tid"); + $options[]=array('action'=>lang('thread').' ('.$ticket->getThreadCount().')','url'=>"tickets.php?id=$tid"); if($ticket->getNumNotes()) $options[]=array('action'=>'Notes ('.$ticket->getNumNotes().')','url'=>"tickets.php?id=$tid#notes"); if($ticket->isOpen()) - $options[]=array('action'=>'Reply','url'=>"tickets.php?id=$tid#reply"); + $options[]=array('action'=>lang('reply'),'url'=>"tickets.php?id=$tid#reply"); if($thisstaff->canAssignTickets()) - $options[]=array('action'=>($ticket->isAssigned()?'Reassign':'Assign'),'url'=>"tickets.php?id=$tid#assign"); + $options[]=array('action'=>($ticket->isAssigned()?lang('reasisgn'):lang('assign')),'url'=>"tickets.php?id=$tid#assign"); if($thisstaff->canTransferTickets()) - $options[]=array('action'=>'Transfer','url'=>"tickets.php?id=$tid#transfer"); + $options[]=array('action'=>lang('transfer'),'url'=>"tickets.php?id=$tid#transfer"); - $options[]=array('action'=>'Post Note','url'=>"tickets.php?id=$tid#note"); + $options[]=array('action'=>lang('post_note'),'url'=>"tickets.php?id=$tid#note"); if($thisstaff->canEditTickets()) - $options[]=array('action'=>'Edit Ticket','url'=>"tickets.php?id=$tid&a=edit"); + $options[]=array('action'=>lang('edit_ticket'),'url'=>"tickets.php?id=$tid&a=edit"); if($options) { echo ' -

Highly Recommended:

- We highly recommend that you follow the steps below. +

Higly Recommended:

+ We hightly recommend that you follow the steps below.
@@ -35,10 +35,10 @@
@@ -47,6 +47,6 @@

Doing stuff!

- Please wait... while we upgrade your osTicket installation! + ... while we upgrade your osTicket installation!
diff --git a/include/upgrader/rename.inc.php b/include/upgrader/rename.inc.php index b8fca94b..0b649bfa 100644 --- a/include/upgrader/rename.inc.php +++ b/include/upgrader/rename.inc.php @@ -27,7 +27,7 @@
diff --git a/include/upgrader/streams/core.sig b/include/upgrader/streams/core.sig index 417c5384..e80c6a10 100644 --- a/include/upgrader/streams/core.sig +++ b/include/upgrader/streams/core.sig @@ -1 +1 @@ -16fcef4a13d6475a5f8bfef462b548e2 +4E5A4F09D260C778AEA695BEB43375F2 diff --git a/include/upgrader/streams/core/8aeda901-16fcef4a.patch.sql b/include/upgrader/streams/core/8aeda901-16fcef4a.patch.sql index c2ea1d2a..58abcb40 100644 --- a/include/upgrader/streams/core/8aeda901-16fcef4a.patch.sql +++ b/include/upgrader/streams/core/8aeda901-16fcef4a.patch.sql @@ -2,7 +2,7 @@ /** * @version v1.7.1 - * @signature 16fcef4a13d6475a5f8bfef462b548e2 + * @signature 4E5A4F09D260C778AEA695BEB43375F2 * * Change email password field to varchar 255 ASCII * @@ -14,5 +14,5 @@ ALTER TABLE `%TABLE_PREFIX%email` -- Finished with patch UPDATE `%TABLE_PREFIX%config` - SET `value` = '16fcef4a13d6475a5f8bfef462b548e2' + SET `value` = '4E5A4F09D260C778AEA695BEB43375F2' WHERE `key` = 'schema_signature' AND `namespace` = 'core'; diff --git a/index.php b/index.php index 9a2ae35d..42a01378 100644 --- a/index.php +++ b/index.php @@ -16,29 +16,40 @@ require('client.inc.php'); $section = 'home'; require(CLIENTINC_DIR.'header.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + + ?> + + + +

+ +

+ + +
- getLandingPage())) - echo $page->getBody(); - else - echo '

Welcome to the Support Center

'; - ?> +

+

+ +

+
-

Open A New Ticket

+


-
Please provide as much detail as possible so we can best assist you. To update a previously submitted ticket, please login.
+

- Open a New Ticket +

-

Check Ticket Status

+


-
We provide archives and history of all your current and past support requests complete with responses.
+

- Check Ticket Status +

@@ -47,7 +58,7 @@ if($cfg && $cfg->isKnowledgebaseEnabled()){ //FIXME: provide ability to feature or select random FAQs ?? ?> -

Be sure to browse our Frequently Asked Questions (FAQs), before opening a ticket.

+

,

diff --git a/js/osticket.js b/js/osticket.js index 7ee8d00a..4a0e87b0 100644 --- a/js/osticket.js +++ b/js/osticket.js @@ -1,4 +1,4 @@ -/* +/* osticket.js Copyright (c) osTicket.com */ @@ -18,7 +18,7 @@ $(document).ready(function(){ /* loading ... */ $("#loading").css({ top : ($(window).height() / 3), - left : ($(window).width() / 2 - 160) + left : ($(window).width() / 2 - 160) }); $("form :input").change(function() { @@ -49,34 +49,22 @@ $(document).ready(function(){ return true; }); - jQuery.fn.exists = function() { return this.length>0; }; - - var getConfig = (function() { - var dfd = $.Deferred(); - return function() { - if (!dfd.isResolved()) - $.ajax({ - url: "ajax.php/config/client", - dataType: 'json', - success: function (json_config) { - dfd.resolve(json_config); - } - }); - return dfd; - } - })(); - - /* Multifile uploads */ - var elems = $('.multifile'); - if (elems.exists()) { - /* Get config settings from the backend */ - getConfig().then(function(c) { - elems.multifile({ - container: '.uploads', - max_uploads: c.max_file_uploads || 1, - file_types: c.file_types || ".*", - max_file_size: c.max_file_size || 0 - }); + /* Get config settings from the backend */ + var $config = null; + $.ajax({ + url: "ajax.php/config/client", + dataType: 'json', + async: false, + success: function (config) { + $config = config; + } }); - } + + /* Multifile uploads */ + $('.multifile').multifile({ + container: '.uploads', + max_uploads: ($config && $config.max_file_uploads)?$config.max_file_uploads:1, + file_types: ($config && $config.file_types)?$config.file_types:".*", + max_file_size: ($config && $config.max_file_size)?$config.max_file_size:0 + }); }); diff --git a/kb/faq.php b/kb/faq.php index da5a8fa9..23f5f885 100644 --- a/kb/faq.php +++ b/kb/faq.php @@ -15,13 +15,14 @@ **********************************************************************/ require('kb.inc.php'); require_once(INCLUDE_DIR.'class.faq.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $faq=$category=null; if($_REQUEST['id'] && !($faq=FAQ::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid FAQ'; + $errors['err']=lang('invalid_faq'); if(!$faq && $_REQUEST['cid'] && !($category=Category::lookup($_REQUEST['cid']))) - $errors['err']='Unknown or invalid FAQ category'; + $errors['err']=lang('invalid_faq_catg'); $inc='knowledgebase.inc.php'; //FAQs landing page. diff --git a/kb/file.php b/kb/file.php index c411002b..686446d5 100644 --- a/kb/file.php +++ b/kb/file.php @@ -19,12 +19,14 @@ **********************************************************************/ require('kb.inc.php'); require_once(INCLUDE_DIR.'class.file.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $h=trim($_GET['h']); //basic checks if(!$h || strlen($h)!=64 //32*2 || !($file=AttachmentFile::lookup(substr($h,0,32))) //first 32 is the file hash. || strcasecmp(substr($h,-32),md5($file->getId().session_id().$file->getHash()))) //next 32 is file id + session hash. - die('Unknown or invalid file. #'.Format::htmlchars($_GET['h'])); + die(lang('invalid_file').' #'.Format::htmlchars($_GET['h'])); $file->download(); ?> diff --git a/kb/kb.inc.php b/kb/kb.inc.php index a53c515c..ed0ab8c2 100644 --- a/kb/kb.inc.php +++ b/kb/kb.inc.php @@ -13,6 +13,7 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ +define('ROOT_PATH','../'); require_once('../client.inc.php'); require_once(INCLUDE_DIR.'class.faq.php'); /* Bail out if knowledgebase is disabled or if we have no public-published FAQs. */ diff --git a/login.php b/login.php index 78993898..4b9e2944 100644 --- a/login.php +++ b/login.php @@ -2,7 +2,7 @@ /********************************************************************* login.php - Client Login + Client Login Peter Rotich Copyright (c) 2006-2013 osTicket @@ -14,7 +14,9 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require_once('client.inc.php'); -if(!defined('INCLUDE_DIR')) die('Fatal Error'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + +if(!defined('INCLUDE_DIR')) die(lang('fatal_error')); define('CLIENTINC_DIR',INCLUDE_DIR.'client/'); define('OSTCLIENTINC',TRUE); //make includes happy @@ -29,7 +31,7 @@ require_once('tickets.php'); //Just in case of 'header already sent' error. exit; } elseif(!$errors['err']) { - $errors['err'] = 'Authentication error - try again!'; + $errors['err'] = lang('auth_error'); } } diff --git a/logout.php b/logout.php index 6c6482d9..8ef0e61d 100644 --- a/logout.php +++ b/logout.php @@ -19,9 +19,10 @@ if(!$_GET['auth'] || !$ost->validateLinkToken($_GET['auth'])) @header('Location: index.php'); -$_SESSION['_client']=array(); session_unset(); -session_destroy(); +//session_destroy(); +$_SESSION['_client']=array(); +$_SESSION['_client']['token'] = null; header('Location: index.php'); require('index.php'); ?> diff --git a/open.php b/open.php index 4c740afe..73b84572 100644 --- a/open.php +++ b/open.php @@ -14,8 +14,10 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('client.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + define('SOURCE','Web'); //Ticket source. -$ticket = null; +$inc='open.inc.php'; //default include. $errors=array(); if($_POST): $vars = $_POST; @@ -25,9 +27,10 @@ $vars['email']=$thisclient->getEmail(); } elseif($cfg->isCaptchaEnabled()) { if(!$_POST['captcha']) - $errors['captcha']='Enter text shown on the image'; - elseif(strcmp($_SESSION['captcha'], md5(strtoupper($_POST['captcha'])))) - $errors['captcha']='Invalid - try again!'; + $errors['captcha']=lang('enter_text_show'); + elseif($_SESSION['captcha'] != md5($_POST['captcha'])){ + $errors['captcha']=lang('invalid_try_again'); + } } if(!$errors && $cfg->allowOnlineAttachments() && $_FILES['attachments']) @@ -35,7 +38,7 @@ //Ticket::create...checks for errors.. if(($ticket=Ticket::create($vars, $errors, SOURCE))){ - $msg='Support ticket request created'; + $msg=lang('ticket_created'); //Logged in...simply view the newly created ticket. if($thisclient && $thisclient->isValid()) { if(!$cfg->showRelatedTickets()) @@ -44,27 +47,16 @@ session_regenerate_id(); @header('Location: tickets.php?id='.$ticket->getExtId()); } + //Thank the user and promise speedy resolution! + $inc='thankyou.inc.php'; }else{ - $errors['err']=$errors['err']?$errors['err']:'Unable to create a ticket. Please correct errors below and try again!'; + $errors['err']=$errors['err']?$errors['err']:lang('cant_create_ticket').' '.lang('correct_errors'); } endif; //page $nav->setActiveNav('new'); require(CLIENTINC_DIR.'header.inc.php'); -if($ticket - && ( - (($topic = $ticket->getTopic()) && ($page = $topic->getPage())) - || ($page = $cfg->getThankYouPage()) - )) { //Thank the user and promise speedy resolution! - //Hide ticket number - it should only be delivered via email for security reasons. - echo Format::safe_html($ticket->replaceVars(str_replace( - array('%{ticket.number}', '%{ticket.extId}', '%{ticket}'), //ticket number vars. - array_fill(0, 3, 'XXXXXX'), - $page->getBody() - ))); -} else { - require(CLIENTINC_DIR.'open.inc.php'); -} +require(CLIENTINC_DIR.$inc); require(CLIENTINC_DIR.'footer.inc.php'); ?> diff --git a/scp/admin.inc.php b/scp/admin.inc.php index 97dc1684..99d420f4 100644 --- a/scp/admin.inc.php +++ b/scp/admin.inc.php @@ -14,6 +14,7 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('staff.inc.php'); +include_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); //Make sure config is loaded and the staff is set and of admin type if(!$ost or !$thisstaff or !$thisstaff->isAdmin()){ header('Location: index.php'); @@ -27,7 +28,7 @@ //Some security related warnings - bitch until fixed!!! :) $sysnotice= ''; if($ost->isUpgradePending()) { - $errors['err']=$sysnotice='System upgrade is pending Upgrade Now'; + $errors['err']=$sysnotice=lang('aupdate_pending').''.lang('Upgrade Now').''; if(!in_array(basename($_SERVER['SCRIPT_NAME']), array('upgrade.php', 'logs.php'))) { header('Location: upgrade.php'); require('upgrade.php'); @@ -36,26 +37,26 @@ } else { if(!strcasecmp(basename(CONFIG_FILE), 'settings.php')) { - $sysnotice=sprintf('Please rename config file include/%s to include/ost-config.php to avoid possible conflicts', + $sysnotice=sprintf(lang('rename_conf_file').' include/%s to include/ost-config.php '.lang('avoid_conflicts'), basename(CONFIG_FILE)); //Die gracefully - otherwise upgraded RC5 installations will die with confusing message. if(!strcasecmp(basename($_SERVER['SCRIPT_NAME']), 'settings.php')) die($sysnotice); } elseif(file_exists('../setup/')) { - $sysnotice='Please take a minute to delete setup/install directory (../setup/) for security reasons.'; + $sysnotice=lang('take_minute_del').' setup '.lang('directory').' (../setup/) '.lang('security_reason'); } elseif(CONFIG_FILE && file_exists(CONFIG_FILE) && is_writable(CONFIG_FILE)) { //Confirm for real that the file is writable by group or world. clearstatcache(); //clear the cache! $perms = @fileperms(CONFIG_FILE); if(($perms & 0x0002) || ($perms & 0x0010)) { - $sysnotice=sprintf('Please change permission of config file (%s) to remove write access. e.g chmod 644 %s', + $sysnotice=sprintf(lang('permi_conf_file').' (%s) '.lang('remove_write_acc').'e.g chmod 644 %s', basename(CONFIG_FILE), basename(CONFIG_FILE)); } } if(!$sysnotice && ini_get('register_globals')) - $sysnotice='Please consider turning off register globals if possible'; + $sysnotice=lang('tur_off_global'); } //System notice displayed as a warning (if any). @@ -65,5 +66,5 @@ $nav = new AdminNav($thisstaff); //Page title. -$ost->setPageTitle('osTicket :: Admin Control Panel'); +$ost->setPageTitle('osTicket :: '.lang('admin_controlp')); ?> diff --git a/scp/ajax.php b/scp/ajax.php index 0f0771d3..f8e72305 100644 --- a/scp/ajax.php +++ b/scp/ajax.php @@ -16,19 +16,21 @@ # Override staffLoginPage() defined in staff.inc.php to return an # HTTP/Forbidden status rather than the actual login page. # XXX: This should be moved to the AjaxController class + function staffLoginPage($msg='Unauthorized') { - Http::response(403,'Must login: '.Format::htmlchars($msg)); + Http::response(403,lang('must_login').': '.Format::htmlchars($msg)); exit; } require('staff.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); //Clean house...don't let the world see your crap. -ini_set('display_errors','0'); //Disable error display -ini_set('display_startup_errors','0'); +ini_set('display_errors','1'); //Disable error display +ini_set('display_startup_errors','1'); //TODO: disable direct access via the browser? i,e All request must have REFER? -if(!defined('INCLUDE_DIR')) Http::response(500, 'Server configuration error'); +if(!defined('INCLUDE_DIR')) Http::response(500, lang('server_conf_error')); require_once INCLUDE_DIR.'/class.dispatcher.php'; require_once INCLUDE_DIR.'/class.ajax.php'; @@ -53,6 +55,7 @@ function staffLoginPage($msg='Unauthorized') { url_get('^table$', 'getTabularData') )), url_get('^/users$', array('ajax.users.php:UsersAjaxAPI', 'search')), + url_get('^/template$', array('ajax.template.php:TemplateAjaxAPI', 'getTemplateByLang')), url('^/tickets/', patterns('ajax.tickets.php:TicketsAjaxAPI', url_get('^(?P\d+)/preview', 'previewTicket'), url_post('^(?P\d+)/lock', 'acquireLock'), diff --git a/scp/apikeys.php b/scp/apikeys.php index e729d277..6e3ec69c 100644 --- a/scp/apikeys.php +++ b/scp/apikeys.php @@ -15,33 +15,34 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.api.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $api=null; if($_REQUEST['id'] && !($api=API::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid API key ID.'; + $errors['err']=lang('invalid_api'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$api){ - $errors['err']='Unknown or invalid API key.'; + $errors['err']=lang('invalid_api_key'); }elseif($api->update($_POST,$errors)){ - $msg='API key updated successfully'; + $msg=lang('api_key_added'); }elseif(!$errors['err']){ - $errors['err']='Error updating API key. Try again!'; + $errors['err']=lang('api_key_updated'); } break; case 'add': if(($id=API::add($_POST,$errors))){ - $msg='API key added successfully'; + $msg=lang('api_key_added'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add an API key. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_api'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one API key'; + $errors['err'] = lang('select_one_api'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -50,11 +51,11 @@ .' WHERE id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected API keys enabled'; + $msg = lang('api_key_enabled'); else - $warn = "$num of $count selected API keys enabled"; + $warn = "$num ".lang('of')." $count ".lang('api_key_enabled'); } else { - $errors['err'] = 'Unable to enable selected API keys.'; + $errors['err'] = lang('cant_enable_api'); } break; case 'disable': @@ -62,11 +63,11 @@ .' WHERE id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected API keys disabled'; + $msg = lang('api_key_disabled'); else - $warn = "$num of $count selected API keys disabled"; + $warn = "$num ".lang('of')." $count ".lang('api_key_disabled'); } else { - $errors['err']='Unable to disable selected API keys'; + $errors['err']=lang('cant_disable_api'); } break; case 'delete': @@ -76,19 +77,19 @@ $i++; } if($i && $i==$count) - $msg = 'Selected API keys deleted successfully'; + $msg = lang('api_key_deleted').' '.lang('successfully'); elseif($i>0) - $warn = "$i of $count selected API keys deleted"; + $warn = "$i ".lang('of')." $count ".lang('api_key_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected API keys'; + $errors['err'] = lang('cant_delete_api'); break; default: - $errors['err']='Unknown action - get technical help'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/autocron.php b/scp/autocron.php index ec7cb4c7..73f7393d 100644 --- a/scp/autocron.php +++ b/scp/autocron.php @@ -15,6 +15,8 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('staff.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + ignore_user_abort(1);//Leave me a lone bro! @set_time_limit(0); //useless when safe_mode is on $data=sprintf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%", @@ -32,14 +34,14 @@ $sec=time()-$_SESSION['lastcroncall']; $caller = $thisstaff->getUserName(); -if($sec>180 && $ost && !$ost->isUpgradePending()): //user can call cron once every 3 minutes. +if($sec>180): //user can call cron once every 3 minutes. require_once(INCLUDE_DIR.'class.cron.php'); $thisstaff = null; //Clear staff obj to avoid false credit internal notes & auto-assignment Cron::TicketMonitor(); //Age tickets: We're going to age tickets regardless of cron settings. if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enabled! Cron::MailFetcher(); //Fetch mail. - $ost->logDebug('Auto Cron', 'Mail fetcher cron call ['.$caller.']'); + $ost->logDebug(lang('auto_cron'), lang('mail_fetcher_cron').' ['.$caller.']'); } $_SESSION['lastcroncall']=time(); diff --git a/scp/banlist.php b/scp/banlist.php index b517a6f5..642676b8 100644 --- a/scp/banlist.php +++ b/scp/banlist.php @@ -15,24 +15,25 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.banlist.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); /* Get the system ban list filter */ if(!($filter=Banlist::getFilter())) - $warn = 'System ban list is empty.'; + $warn = lang('system_ban_empty'); elseif(!$filter->isActive()) - $warn = 'SYSTEM BAN LIST filter is DISABLED - enable here.'; + $warn = lang('system_ban_disab').' - '.lang('enable_here').'.'; $rule=null; //ban rule obj. if($filter && $_REQUEST['id'] && !($rule=$filter->getRule($_REQUEST['id']))) - $errors['err'] = 'Unknown or invalid ban list ID #'; + $errors['err'] = lang('invalid_ban_id').' #'; if($_POST && !$errors && $filter){ switch(strtolower($_POST['do'])){ case 'update': if(!$rule){ - $errors['err']='Unknown or invalid ban rule.'; + $errors['err']=lang('invalid_ban'); }elseif(!$_POST['val'] || !Validator::is_email($_POST['val'])){ - $errors['err']=$errors['val']='Valid email address required'; + $errors['err']=$errors['val']=lang('valid_email_requir'); }elseif(!$errors){ $vars=array('w'=>'email', 'h'=>'equal', @@ -41,30 +42,30 @@ 'isactive'=>$_POST['isactive'], 'notes'=>$_POST['notes']); if($rule->update($vars,$errors)){ - $msg='Email updated successfully'; + $msg=lang('email_upd_success'); }elseif(!$errors['err']){ - $errors['err']='Error updating ban rule. Try again!'; + $errors['err']=lang('error_update_ban'); } } break; case 'add': if(!$filter) { - $errors['err']='Unknown or invalid ban list'; + $errors['err']=lang('invalid_ban_list'); }elseif(!$_POST['val'] || !Validator::is_email($_POST['val'])) { - $errors['err']=$errors['val']='Valid email address required'; + $errors['err']=$errors['val']=lang('valid_email_requir'); }elseif(BanList::includes($_POST['val'])) { - $errors['err']=$errors['val']='Email already in the ban list'; + $errors['err']=$errors['val']=lang('email_in_ban'); }elseif($filter->addRule('email','equal',$_POST['val'],array('isactive'=>$_POST['isactive'],'notes'=>$_POST['notes']))) { - $msg='Email address added to ban list successfully'; + $msg=lang('email_add_to_ban'); $_REQUEST['a']=null; //Add filter rule here. }elseif(!$errors['err']){ - $errors['err']='Error creating ban rule. Try again!'; + $errors['err']=lang('error_ban_rule'); } 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'] = lang('select_one_email'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -74,11 +75,11 @@ .' AND id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg = 'Selected emails ban status set to enabled'; + $msg = lang('ban_status_enable'); else - $warn = "$num of $count selected emails ban status enabled"; + $warn = "$num ".lang('of')." $count ".lang('ban_status_enabled'); } else { - $errors['err'] = 'Unable to enable selected emails'; + $errors['err'] = lang('not_enable_emails'); } break; case 'disable': @@ -87,11 +88,11 @@ .' AND id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected emails ban status set to disabled'; + $msg = lang('ban_status_dis'); else - $warn = "$num of $count selected emails ban status set to disabled"; + $warn = "$num ".lang('of')." $count ".lang('ban_status_dis'); } else { - $errors['err'] = 'Unable to disable selected emails'; + $errors['err'] = lang('not_disable_email'); } break; case 'delete': @@ -101,20 +102,20 @@ $i++; } if($i && $i==$count) - $msg = 'Selected emails deleted from banlist successfully'; + $msg = lang('e_ban_del_success'); elseif($i>0) - $warn = "$i of $count selected emails deleted from banlist"; + $warn = "$i ".lang('of')." $count ".lang('emails_ban_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected emails'; + $errors['err'] = lang('unable_delete_email'); break; default: - $errors['err'] = 'Unknown action - get technical help'; + $errors['err'] = lang('unknown_action'); } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); break; } } diff --git a/scp/canned.php b/scp/canned.php index c085e411..45612556 100644 --- a/scp/canned.php +++ b/scp/canned.php @@ -25,15 +25,15 @@ $canned=null; if($_REQUEST['id'] && !($canned=Canned::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid canned response ID.'; + $errors['err']=lang('invalid_canned'); if($_POST && $thisstaff->canManageCannedResponses()) { switch(strtolower($_POST['do'])) { case 'update': if(!$canned) { - $errors['err']='Unknown or invalid canned response.'; + $errors['err']=lang('invalid_canned_resp'); } elseif($canned->update($_POST, $errors)) { - $msg='Canned response updated successfully'; + $msg=lang('canned_updated'); //Delete removed attachments. //XXX: files[] shouldn't be changed under any circumstances. $keepers = $_POST['files']?$_POST['files']:array(); @@ -50,24 +50,24 @@ $canned->reload(); } elseif(!$errors['err']) { - $errors['err']='Error updating canned response. Try again!'; + $errors['err']=lang('error_update_canned'); } break; case 'create': if(($id=Canned::create($_POST, $errors))) { - $msg='Canned response added successfully'; + $msg=lang('canned_added'); $_REQUEST['a']=null; //Upload attachments if($_FILES['attachments'] && ($c=Canned::lookup($id)) && ($files=AttachmentFile::format($_FILES['attachments']))) $c->uploadAttachments($files); } elseif(!$errors['err']) { - $errors['err']='Unable to add canned response. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_canned').' '.lang('correct_errors'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']='You must select at least one canned response'; + $errors['err']=lang('select_one_canned'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -76,11 +76,11 @@ .' WHERE canned_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected canned responses enabled'; + $msg = lang('canned_enabled'); else - $warn = "$num of $count selected canned responses enabled"; + $warn = "$num ".lang('of')." $count ".lang('canned_enabled'); } else { - $errors['err'] = 'Unable to enable selected canned responses.'; + $errors['err'] = lang('cant_enable_canned'); } break; case 'disable': @@ -88,11 +88,11 @@ .' WHERE canned_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected canned responses disabled'; + $msg = lang('canned_disabled'); else - $warn = "$num of $count selected canned responses disabled"; + $warn = "$num ".lang('of')." $count ".lang('canned_disabled'); } else { - $errors['err'] = 'Unable to disable selected canned responses'; + $errors['err'] = lang('cant_disable_canned'); } break; case 'delete': @@ -104,19 +104,19 @@ } if($i==$count) - $msg = 'Selected canned responses deleted successfully'; + $msg = lang('canned_deleted'); elseif($i>0) - $warn="$i of $count selected canned responses deleted"; + $warn="$i ".lang('of')." $count ".lang('canned_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected canned responses'; + $errors['err'] = lang('cant_delete_canned'); break; default: - $errors['err']='Unknown command'; + $errors['err']=lang('unknown_command'); } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/categories.php b/scp/categories.php index 9598f0da..602fc90b 100644 --- a/scp/categories.php +++ b/scp/categories.php @@ -15,6 +15,7 @@ **********************************************************************/ require('staff.inc.php'); include_once(INCLUDE_DIR.'class.category.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); /* check permission */ if(!$thisstaff || !$thisstaff->canManageFAQ()) { @@ -25,30 +26,30 @@ $category=null; if($_REQUEST['id'] && !($category=Category::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid category ID.'; + $errors['err']=lang('invalid_catg_id'); if($_POST){ switch(strtolower($_POST['do'])) { case 'update': if(!$category) { - $errors['err']='Unknown or invalid category.'; + $errors['err']=lang('invalid_category'); } elseif($category->update($_POST,$errors)) { - $msg='Category updated successfully'; + $msg=lang('category_updated'); } elseif(!$errors['err']) { - $errors['err']='Error updating category. Try again!'; + $errors['err']=lang('error_update_cat'); } break; case 'create': if(($id=Category::create($_POST,$errors))) { - $msg='Category added successfully'; + $msg=lang('catg_added_success'); $_REQUEST['a']=null; } elseif(!$errors['err']) { - $errors['err']='Unable to add category. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_category').' '.lang('correct_errors'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']='You must select at least one category'; + $errors['err']=lang('select_one_catg'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -58,11 +59,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected categories made PUBLIC'; + $msg = lang('catg_make_public'); else - $warn = "$num of $count selected categories made PUBLIC"; + $warn = "$num ".lang('of')." $count ".lang('catg_make_public'); } else { - $errors['err'] = 'Unable to enable selected categories public.'; + $errors['err'] = lang('cant_enable_catg'); } break; case 'make_private': @@ -71,11 +72,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected categories made PRIVATE'; + $msg = lang('categories_private'); else - $warn = "$num of $count selected categories made PRIVATE"; + $warn = "$num ".lang('of')." $count ".lang('categories_private'); } else { - $errors['err'] = 'Unable to disable selected categories PRIVATE'; + $errors['err'] = lang('cant_disable_pcatg'); } break; case 'delete': @@ -86,19 +87,19 @@ } if($i==$count) - $msg = 'Selected categories deleted successfully'; + $msg = lang('categories_deleted'); elseif($i>0) - $warn = "$i of $count selected categories deleted"; + $warn = "$i ".lang('of')." $count ".lang('scatg_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected categories'; + $errors['err'] = lang('cant_delete_catg'); break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); break; } } diff --git a/scp/css/login.css b/scp/css/login.css index c2512a2b..a15d4d12 100644 --- a/scp/css/login.css +++ b/scp/css/login.css @@ -1,6 +1,15 @@ -input:focus { - border: 1px solid rgb(207,16,118); - box-shadow: 0 0 4px rgb(207,16,118); +* { + box-sizing: border-box; + position: relative; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +*:focus { + outline-color: rgb(207,16,118); + outline-style: auto; + outline-width: 5px; + z-index:1000; } :-webkit-input-placeholder { @@ -34,6 +43,7 @@ body { body, input { font-family: helvetica, arial, sans-serif; + font-size: 100%/1.5; color: #000; } @@ -49,16 +59,11 @@ input[type=reset], input[type=submit], input[type=button] { border:1px solid #2a67ac; border-right:2px solid #2a67ac; border-bottom:3px solid #2a67ac; - box-shadow: 2px 2px 8px rgba(42, 103, 172, 0.5); background:#fff; width:400px; margin:10% auto 0 auto; padding:1em; - padding-bottom: 1em; text-align:center; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; } h1 { @@ -91,24 +96,23 @@ form { fieldset { border:none; - margin:0.25em; + margin:0; padding:0; } fieldset input { display:block; + width:100%; margin-bottom:1em; border:1px solid #ccc; - border:1px solid rgba(0,0,0,0.3); background:#fff; - padding:2px 4px; - width: 96%; + padding:2px; } input.submit { display:inline-block; float:right; - margin:0.25em; + margin:0; height:24px; line-height:24px; font-weight:bold; diff --git a/scp/css/scp.css b/scp/css/scp.css index d65294fa..b2ffac74 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -43,7 +43,7 @@ a { color: #555; } -#msg_notice { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } +#msg_notice{ margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } #msg_warning { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; margin-bottom: 10px; border: 1px solid #f26522; background: url('../images/icons/alert.png') 10px 50% no-repeat #ffffdd; } @@ -51,7 +51,7 @@ a { #notice_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #0a0; background: url('../images/icons/ok.png') 10px 50% no-repeat #e0ffe0; } -#warning_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #f26522; background: url('../images/icons/alert.png') 10px 50% no-repeat #ffffdd; } +#warning_bar { margin: 0; padding: 5px 10px 5px 36px; //height: 16px; line-height: 16px; border: 1px solid #f26522; background: url('../images/icons/alert.png') 10px 50% no-repeat #ffffdd; } #error_bar { margin: 0; padding: 5px 10px 5px 36px; height: 16px; line-height: 16px; border: 1px solid #a00; background: url('../images/icons/error.png') 10px 50% no-repeat #fff0f0; } @@ -81,7 +81,7 @@ a { #header p { display:block; - width:430px; + //width:430px; float:right; margin:10px; background:#eee; @@ -292,9 +292,6 @@ a.departments { background:url(../images/icons/list_departments.gif) } a.newDepartment { background:url(../images/icons/new_department.gif) } -a.pages { background:url(../images/icons/pages.gif) } -a.newPage { background:url(../images/icons/new_page.gif) } - /* Generic CSS based Icons. use=> text */ .Icon { @@ -544,6 +541,8 @@ a.print { } .form_table input[type=radio], .form_table input[type=checkbox] { + position:relative; + top:3px; margin-left:0; padding-left:0; } @@ -794,6 +793,10 @@ h2 .reload { background:#FFE; } +#ticket_thread .poll th { + background:#BEFFC6; +} + #ticket_thread table td, #ticket_notes table td { padding:5px; } @@ -1122,7 +1125,7 @@ h2 .reload { #faq { clear: both; margin: 0; - padding: 5px 0 10px 5px; + padding: 5 0 10px 5px; } #faq ol { font-size: 15px; @@ -1246,7 +1249,7 @@ time { } .dialog label { - width:100px; + width:125px; display:inline-block; text-align:right; padding:10px; @@ -1379,31 +1382,111 @@ ul.progress li.no small {color:red;} #bar.error { background: #ffd; text-align: center; color: #a00; font-weight: bold; } /* Overlay */ -#overlay { - display: none; - position: fixed; +#overlay { + display: none; + position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 1000; - -webkit-transform: translate3d(0,0,0); + -webkit-transform: translate3d(0,0,0); } #loading, #upgrading { border:1px solid #2a67ac; - padding: 10px 10px 10px 60px; - width: 300px; - height: 100px; + padding: 10px 10px 10px 60px; + width: 300px; + height: 100px; background: rgb( 255, 255, 255) url('../images/FhHRx-Spinner.gif') 10px 50% no-repeat; - position: fixed; - display: none; - z-index: 3000; + position: fixed; + display: none; + z-index: 3000; } #loading h4, #upgrading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; } -input.dp { - width: 10em; + + + + +/*Paginator*/ +#pg-wraper{ + margin: auto auto; + width: 300px; +} + +#pg-container{ + float: left; + width: 100%; + margin:5px 0 5px 0; +} + +#pg-container div{ + float: left; +} + +#pg-container div span{ + vertical-align: middle; +} + +#pg-container div span.icon-pg{ + width: 16px; + height: 16px; + background: url('../images/sprite-icon.png') center center; + display: block; + margin-top: 2px; + cursor: pointer; +} + +#pg-container div span.icon-pg.seek-first{ + background-position: -80px -160px; } + +#pg-container div span.icon-pg.seek-prev{ + background-position: -48px -160px;; +} + +#pg-container div span.icon-pg.seek-next{ + background-position: -32px -160px; +} + +#pg-container div span.icon-pg.seek-end{ + background-position: -64px -160px; +} + +#pg-container div span.icon-pg.disabled{ + opacity: 0.6; + cursor: inherit; +} + +#pg-container div span.ui-separator{ + height: 18px; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + margin: 1px; + float: right; + width: 0px; +} + +#ticketInfo{ + margin-bottom: 10px; +} + +.infoTable { + background: #F4FAFF; + border-collapse: collapse; + border-spacing: 0; +} + +.infoTable th, .infoTable td { + text-align: left; + vertical-align: top; +} + +.infoTable th{ + font-weight: bold; + font-size: 13px; +} + diff --git a/scp/dashboard.php b/scp/dashboard.php index 75717dfe..e9d9aaa2 100644 --- a/scp/dashboard.php +++ b/scp/dashboard.php @@ -28,25 +28,25 @@ -

Ticket Activity

-

Select the starting time and period for the system activity graph

+

+

- + @@ -56,8 +56,8 @@
-

Statistics

-

Statistics of tickets organized by department, help topic, and staff.

+

+

diff --git a/scp/departments.php b/scp/departments.php index e0fdf4f7..00088f9e 100644 --- a/scp/departments.php +++ b/scp/departments.php @@ -14,34 +14,36 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('admin.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $dept=null; if($_REQUEST['id'] && !($dept=Dept::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid department ID.'; + $errors['err']=lang('invalid_dep_id').'.'; if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$dept){ - $errors['err']='Unknown or invalid department.'; + $errors['err']=lang('invalid_dep').'.'; }elseif($dept->update($_POST,$errors)){ - $msg='Department updated successfully'; + $msg=lang('dep_update_success'); }elseif(!$errors['err']){ - $errors['err']='Error updating department. Try again!'; + $errors['err']=lang('error_upd_departm').'!'; } break; case 'create': if(($id=Dept::create($_POST,$errors))){ - $msg=Format::htmlchars($_POST['name']).' added successfully'; + $msg=Format::htmlchars($_POST['name']).' '. lang('added_succesfully'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add department. Correct error(s) below and try again.'; + $errors['err']=lang('unable_add_departm').' '. lang('correct_errors').' .'; } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one department'; + $errors['err'] = lang('at_least_one').' '. lang('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'] = lang('cant_disab_departm').'.'; }else{ $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -50,11 +52,11 @@ .' WHERE dept_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg='Selected departments made public'; + $msg=lang('Spublic_departm'); else - $warn="$num of $count selected departments made public"; + $warn="$num of $count ".lang('Spublic_departm'); } else { - $errors['err']='Unable to make selected department public.'; + $errors['err']=lang('error_public_departm').'.'; } break; case 'make_private': @@ -63,11 +65,11 @@ .' AND dept_id!='.db_input($cfg->getDefaultDeptId()); if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected departments made private'; + $msg = lang('private_departm'); else - $warn = "$num of $count selected departments made private"; + $warn = "$num of $count ".lang('private_departm'); } else { - $errors['err'] = 'Unable to make selected department(s) private. Possibly already private!'; + $errors['err'] = lang('error_priv_departm').'!'; } break; case 'delete': @@ -76,7 +78,7 @@ .' WHERE dept_id IN ('.implode(',', db_input($_POST['ids'])).')'; list($members)=db_fetch_row(db_query($sql)); if($members) - $errors['err']='Departments with staff can not be deleted. Move staff first.'; + $errors['err']=lang('cant_delete_departm').'.'; else { $i=0; foreach($_POST['ids'] as $k=>$v) { @@ -84,20 +86,20 @@ $i++; } if($i && $i==$count) - $msg = 'Selected departments deleted successfully'; + $msg = lang('delete_dep_succes'); elseif($i>0) - $warn = "$i of $count selected departments deleted"; + $warn = "$i of $count ".lang('departm_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected departments.'; + $errors['err'] = lang('error_delete_departm').'.'; } break; default: - $errors['err']='Unknown action - get technical help'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/emails.php b/scp/emails.php index 7a3051ea..ef0a40f1 100644 --- a/scp/emails.php +++ b/scp/emails.php @@ -15,33 +15,34 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.email.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $email=null; if($_REQUEST['id'] && !($email=Email::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid email ID.'; + $errors['err']=lang('unknow_email_id'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$email){ - $errors['err']='Unknown or invalid email.'; + $errors['err']=lang('unknow_email'); }elseif($email->update($_POST,$errors)){ - $msg='Email updated successfully'; + $msg=lang('email_upd_success'); }elseif(!$errors['err']){ - $errors['err']='Error updating email. Try again!'; + $errors['err']=lang('errror_upd_email'); } break; case 'create': if(($id=Email::create($_POST,$errors))){ - $msg='Email address added successfully'; + $msg=lang('email_added_success'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add email. Correct error(s) below and try again.'; + $errors['err']=lang('unable_add_email'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one email address'; + $errors['err'] = lang('select_one_email'); } else { $count=count($_POST['ids']); @@ -51,7 +52,7 @@ list($depts)=db_fetch_row(db_query($sql)); if($depts>0) { - $errors['err'] = 'One or more of the selected emails is being used by a department. Remove association first!'; + $errors['err'] = lang('email_use_by_dep'); } elseif(!strcasecmp($_POST['a'], 'delete')) { $i=0; foreach($_POST['ids'] as $k=>$v) { @@ -60,19 +61,19 @@ } if($i && $i==$count) - $msg = 'Selected emails deleted successfully'; + $msg = lang('emails_deleted'); elseif($i>0) - $warn = "$i of $count selected emails deleted"; + $warn = "$i ".lang('of')." $count ".lang('selected_emails'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected emails'; + $errors['err'] = lang('unable_delete_email'); } else { - $errors['err'] = 'Unknown action - get technical help'; + $errors['err'] = lang('unknown_action'); } } break; default: - $errors['err'] = 'Unknown action/command'; + $errors['err'] = lang('unknown_command'); break; } } diff --git a/scp/emailtest.php b/scp/emailtest.php index f62bdc6b..bef1d7e7 100644 --- a/scp/emailtest.php +++ b/scp/emailtest.php @@ -16,31 +16,33 @@ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.email.php'); include_once(INCLUDE_DIR.'class.csrf.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $info=array(); -$info['subj']='osTicket test email'; +$info['subj']=lang('ticket_test_email'); if($_POST){ $errors=array(); $email=null; if(!$_POST['email_id'] || !($email=Email::lookup($_POST['email_id']))) - $errors['email_id']='Select from email address'; + $errors['email_id']=lang('select_from_email'); if(!$_POST['email'] || !Validator::is_email($_POST['email'])) - $errors['email']='To email address required'; + $errors['email']=lang('to_email_adress'); if(!$_POST['subj']) - $errors['subj']='Subject required'; + $errors['subj']=lang('subject_required'); if(!$_POST['message']) - $errors['message']='Message required'; + $errors['message']=lang('message_required'); if(!$errors && $email){ if($email->send($_POST['email'],$_POST['subj'],$_POST['message'])) - $msg='Test email sent successfully to '.Format::htmlchars($_POST['email']); + $msg=lang('test_email_succes').' '.Format::htmlchars($_POST['email']); else - $errors['err']='Error sending email - try again.'; + $errors['err']=lang('error_send_email'); }elseif($errors['err']){ - $errors['err']='Error sending email - try again.'; + $errors['err']=lang('error_send_email'); } } $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); @@ -50,23 +52,23 @@
-

Test Outgoing Email

+

- Emails delivery depends on your server settings (php.ini) and/or email SMTP configuration. +
- From: + :
- To: + : @@ -96,7 +98,7 @@
- Subject: + : @@ -105,16 +107,16 @@
- Message: email message to send. 
+ :  

- - - + + +

update($_POST,$errors)) { - $msg='FAQ updated successfully'; + $msg=lang('faq_apdated'); $_REQUEST['a']=null; //Go back to view $faq->reload(); } elseif(!$errors['err']) - $errors['err'] = 'Unable to update FAQ. Try again!'; + $errors['err'] = lang('cant_upd_faq_only'); break; case 'manage-faq': if(!$faq) { - $errors['err']='Unknown or invalid FAQ'; + $errors['err']=lang('invalid_faq'); } else { switch(strtolower($_POST['a'])) { case 'edit': @@ -54,32 +55,32 @@ break; case 'publish'; if($faq->publish()) - $msg='FAQ published successfully'; + $msg=lang('faq_published'); else - $errors['err']='Unable to publish the FAQ. Try editing it.'; + $errors['err']=lang('cant_publish_faq'); break; case 'unpublish'; if($faq->unpublish()) - $msg='FAQ unpublished successfully'; + $msg=lang('faq_unpublished'); else - $errors['err']='Unable to unpublish the FAQ. Try editing it.'; + $errors['err']=lang('cant_anpublish_faq'); break; case 'delete': $category = $faq->getCategory(); if($faq->delete()) { - $msg='FAQ deleted successfully'; + $msg=lang('faq_deleted'); $faq=null; } else { - $errors['err']='Unable to delete FAQ. Try again'; + $errors['err']=lang('cant_delete_faq'); } break; default: - $errors['err']='Invalid action'; + $errors['err']=lang('invalid_action'); } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); } endif; diff --git a/scp/file.php b/scp/file.php index c02562eb..ad7aeff7 100644 --- a/scp/file.php +++ b/scp/file.php @@ -19,12 +19,14 @@ **********************************************************************/ require('staff.inc.php'); require_once(INCLUDE_DIR.'class.file.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $h=trim($_GET['h']); //basic checks if(!$h || strlen($h)!=64 //32*2 || !($file=AttachmentFile::lookup(substr($h,0,32))) //first 32 is the file hash. || strcasecmp(substr($h,-32),md5($file->getId().session_id().$file->getHash()))) //next 32 is file id + session hash. - die('Unknown or invalid file. #'.Format::htmlchars($_GET['h'])); + die(lang('invalid_file').' #'.Format::htmlchars($_GET['h'])); $file->download(); ?> diff --git a/scp/filters.php b/scp/filters.php index dacca25c..549bd1c2 100644 --- a/scp/filters.php +++ b/scp/filters.php @@ -16,9 +16,10 @@ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.filter.php'); require_once(INCLUDE_DIR.'class.canned.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $filter=null; if($_REQUEST['id'] && !($filter=Filter::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid filter.'; + $errors['err']=lang('invalid_filter'); /* NOTE: Banlist has its own interface*/ if($filter && $filter->isSystemBanlist()) @@ -28,24 +29,24 @@ switch(strtolower($_POST['do'])){ case 'update': if(!$filter){ - $errors['err']='Unknown or invalid filter.'; + $errors['err']=lang('invalid_filter'); }elseif($filter->update($_POST,$errors)){ - $msg='Filter updated successfully'; + $msg=lang('filter_upd_success'); }elseif(!$errors['err']){ - $errors['err']='Error updating filter. Try again!'; + $errors['err']=lang('error_update_filt'); } break; case 'add': if((Filter::create($_POST,$errors))){ - $msg='Filter added successfully'; + $msg=lang('filter_added'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add filter. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_filter'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one filter to process.'; + $errors['err'] = lang('select_one_filter'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -54,11 +55,11 @@ .' WHERE id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected filters enabled'; + $msg = lang('select_filter_enab'); else - $warn = "$num of $count selected filters enabled"; + $warn = "$num ".lang('of')." $count ".lang('select_filter_enab'); } else { - $errors['err'] = 'Unable to enable selected filters'; + $errors['err'] = lang('cant_enable_filter'); } break; case 'disable': @@ -66,11 +67,11 @@ .' WHERE id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected filters disabled'; + $msg = lang('filters_disabled'); else - $warn = "$num of $count selected filters disabled"; + $warn = "$num ".lang('of')." $count ".lang('filters_disabled'); } else { - $errors['err'] = 'Unable to disable selected filters'; + $errors['err'] = lang('cant_disable_filter'); } break; case 'delete': @@ -81,19 +82,19 @@ } if($i && $i==$count) - $msg = 'Selected filters deleted successfully'; + $msg = lang('select_filter_delet'); elseif($i>0) - $warn = "$i of $count selected filters deleted"; + $warn = "$i ".lang('of')." $count ".lang('filters_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected filters'; + $errors['err'] = lang('cant_delete_filter'); break; default: - $errors['err']='Unknown action - get technical help'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown commande/action'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/groups.php b/scp/groups.php index 4fb4a716..ba79cd44 100644 --- a/scp/groups.php +++ b/scp/groups.php @@ -14,34 +14,36 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('admin.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $group=null; if($_REQUEST['id'] && !($group=Group::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid group ID.'; + $errors['err']=lang('unknow_group').' '.lang('id').'.'; if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$group){ - $errors['err']='Unknown or invalid group.'; + $errors['err']=lang('unknow_group').'.'; }elseif($group->update($_POST,$errors)){ - $msg='Group updated successfully'; + $msg=lang('group_update_success'); }elseif(!$errors['err']){ - $errors['err']='Unable to update group. Correct any error(s) below and try again!'; + $errors['err']=lang('unable_update_group').'.'.lang('correct_errors').'!'; } break; case 'create': if(($id=Group::create($_POST,$errors))){ - $msg=Format::htmlchars($_POST['name']).' added successfully'; + $msg=Format::htmlchars($_POST['name']).' '.lang('added_succesfully'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add group. Correct error(s) below and try again.'; + $errors['err']=lang('unable_add_group').' '.lang('correct_errors').'!'; } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one group.'; + $errors['err'] = lang('select_at_least_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'] = lang('cant_edit_group')."!"; } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -51,11 +53,11 @@ if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg = 'Selected groups activated'; + $msg = lang('groups_activated'); else - $warn = "$num of $count selected groups activated"; + $warn = "$num ".lang('of')." $count ".lang('groups_activated'); } else { - $errors['err'] = 'Unable to activate selected groups'; + $errors['err'] = lang('cant_activate_group'); } break; case 'disable': @@ -63,11 +65,11 @@ .' WHERE group_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected groups disabled'; + $msg = lang('group_disabled'); else - $warn = "$num of $count selected groups disabled"; + $warn = "$num ".lang('of')." $count ".lang('group_disabled'); } else { - $errors['err'] = 'Unable to disable selected groups'; + $errors['err'] = lang('unable_disable_group'); } break; case 'delete': @@ -77,19 +79,19 @@ } if($i && $i==$count) - $msg = 'Selected groups deleted successfully'; + $msg = lang('group_delete_success'); elseif($i>0) - $warn = "$i of $count selected groups deleted"; + $warn = "$i ".lang('of')." $count ".lang('group_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected groups'; + $errors['err'] = lang('unable_delete_group'); break; default: - $errors['err'] = 'Unknown action. Get technical help!'; + $errors['err'] = lang('unknown_action_only').'!'; } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); break; } } diff --git a/scp/helptopics.php b/scp/helptopics.php index 7cb15074..1e079078 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -15,33 +15,34 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.topic.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $topic=null; if($_REQUEST['id'] && !($topic=Topic::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid help topic ID.'; + $errors['err']=lang('inv_help_topic_id'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$topic){ - $errors['err']='Unknown or invalid help topic.'; + $errors['err']=lang('inv_help_topic'); }elseif($topic->update($_POST,$errors)){ - $msg='Help topic updated successfully'; + $msg=lang('help_topc_updated'); }elseif(!$errors['err']){ - $errors['err']='Error updating help topic. Try again!'; + $errors['err']=lang('cant_update_topic'); } break; case 'create': if(($id=Topic::create($_POST,$errors))){ - $msg='Help topic added successfully'; + $msg=lang('help_topic_added'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add help topic. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_topic'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one help topic'; + $errors['err'] = lang('select_one_topic'); } else { $count=count($_POST['ids']); @@ -52,11 +53,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected help topics enabled'; + $msg = lang('select_help_topic'); else - $warn = "$num of $count selected help topics enabled"; + $warn = "$num ".lang('of')." $count ".lang('select_help_topic'); } else { - $errors['err'] = 'Unable to enable selected help topics.'; + $errors['err'] = lang('cant_enable_help'); } break; case 'disable': @@ -64,11 +65,11 @@ .' WHERE topic_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected help topics disabled'; + $msg = lang('help_topic_dis'); else - $warn = "$num of $count selected help topics disabled"; + $warn = "$num ".lang('of')." $count ".lang('help_topic_dis'); } else { - $errors['err'] ='Unable to disable selected help topic(s)'; + $errors['err'] =lang('cant_disable_topic'); } break; case 'delete': @@ -79,20 +80,20 @@ } if($i && $i==$count) - $msg = 'Selected help topics deleted successfully'; + $msg = lang('topics_deleted'); elseif($i>0) - $warn = "$i of $count selected help topics deleted"; + $warn = "$i ".lang('of')." $count ".lang('topics_deleted_only'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected help topics'; + $errors['err'] = lang('cant_del_topic'); break; default: - $errors['err']='Unknown action - get technical help.'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown command/action'; + $errors['err']=lang('unknown_command'); break; } } @@ -101,6 +102,7 @@ if($topic || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) $page='helptopic.inc.php'; + $nav->setTabActive('manage'); require(STAFFINC_DIR.'header.inc.php'); require(STAFFINC_DIR.$page); diff --git a/scp/kb.php b/scp/kb.php index 4f2bc335..344f5802 100644 --- a/scp/kb.php +++ b/scp/kb.php @@ -17,7 +17,7 @@ require_once(INCLUDE_DIR.'class.faq.php'); $category=null; if($_REQUEST['cid'] && !($category=Category::lookup($_REQUEST['cid']))) - $errors['err']='Unknown or invalid FAQ category'; + $errors['err']=lang('invalid_faq_catg'); $inc='faq-categories.inc.php'; //KB landing page. if($category && $_REQUEST['a']!='search') { diff --git a/scp/language.php b/scp/language.php new file mode 100644 index 00000000..8fb29352 --- /dev/null +++ b/scp/language.php @@ -0,0 +1,66 @@ + + Copyright (c) 2006-2013 osTicket + http://www.osticket.com + + Released under the GNU General Public License WITHOUT ANY WARRANTY. + See LICENSE.TXT for details. + + vim: expandtab sw=4 ts=4 sts=4: +**********************************************************************/ +require('admin.inc.php'); +include_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + +if($_POST){ + switch(strtolower($_POST['do'])){ + case 'create': + if(isset($_REQUEST['language'])) + { + if(createNewLanguage($_REQUEST['language'])) + { + $msg=lang('lang_created'); + @header('Location: language.php'); + } + else + $errors['err']=lang('error_create_lang'); + } + break; + case 'update': + if(isset($_REQUEST['language'])) + { + $languageInfo=array(); + $json=$_REQUEST["data_language"]; + + $obj = json_decode($json); + foreach ($obj as $key => $value) { + $languageInfo[$key]=$value; + } + + if(updateLanguage($_REQUEST['language'],$languageInfo)) + { + $msg=lang('lang_updated'); + } + else + $errors['err']=lang('error_update_lang'); + } + break; + } +} + +$page='languages.inc.php'; +if($email || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'add'))) + $page='language.inc.php'; +else + if($email || ($_REQUEST['a'] && !strcasecmp($_REQUEST['a'],'edit'))) + $page='languages_edit.inc.php'; + +$nav->setTabActive('language'); +require(STAFFINC_DIR.'header.inc.php'); +require(STAFFINC_DIR.$page); +include(STAFFINC_DIR.'footer.inc.php'); +?> diff --git a/scp/login.php b/scp/login.php index 2f3cf223..0423bb43 100644 --- a/scp/login.php +++ b/scp/login.php @@ -14,14 +14,15 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require_once('../main.inc.php'); -if(!defined('INCLUDE_DIR')) die('Fatal Error. Kwaheri!'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); +if(!defined('INCLUDE_DIR')) die(lang('fatal_error_kwah')); require_once(INCLUDE_DIR.'class.staff.php'); require_once(INCLUDE_DIR.'class.csrf.php'); $dest = $_SESSION['_staff']['auth']['dest']; $msg = $_SESSION['_staff']['auth']['msg']; -$msg = $msg?$msg:'Authentication Required'; +$msg = $msg?$msg:lang('auth_required'); if($_POST) { //$_SESSION['_staff']=array(); #Uncomment to disable login strikes. if(($user=Staff::login($_POST['userid'], $_POST['passwd'], $errors))){ @@ -31,7 +32,7 @@ exit; } - $msg = $errors['err']?$errors['err']:'Invalid login'; + $msg = $errors['err']?$errors['err']:lang('invalid_login'); } define("OSTSCPINC",TRUE); //Make includes happy! include_once(INCLUDE_DIR.'staff/login.tpl.php'); diff --git a/scp/logs.php b/scp/logs.php index 09c83154..c9f96247 100644 --- a/scp/logs.php +++ b/scp/logs.php @@ -14,12 +14,13 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('admin.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); if($_POST){ switch(strtolower($_POST['do'])){ case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one log to delete'; + $errors['err'] = lang('select_one_log'); } else { $count=count($_POST['ids']); if($_POST['a'] && !strcasecmp($_POST['a'], 'delete')) { @@ -28,18 +29,18 @@ .' WHERE log_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg='Selected logs deleted successfully'; + $msg=lang('logs_deleted'); else - $warn="$num of $count selected logs deleted"; + $warn="$num ".lang('of')." $count ".lang('logs_deleted_only'); } elseif(!$errors['err']) - $errors['err']='Unable to delete selected logs'; + $errors['err']=lang('unable_delete_logs'); } else { - $errors['err']='Unknown action - get technical help'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown command/action'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/profile.php b/scp/profile.php index 31ffecae..94a45368 100644 --- a/scp/profile.php +++ b/scp/profile.php @@ -18,26 +18,26 @@ $msg=''; $staff=Staff::lookup($thisstaff->getId()); if($_POST && $_POST['id']!=$thisstaff->getId()) { //Check dummy ID used on the form. - $errors['err']='Internal Error. Action Denied'; + $errors['err']=lang('internal_error').'. '.lang('action_denied'); } elseif(!$errors && $_POST) { //Handle post if(!$staff) - $errors['err']='Unknown or invalid staff'; + $errors['err']=lang('unknow_staff'); elseif($staff->updateProfile($_POST,$errors)){ - $msg='Profile updated successfully'; + $msg=lang('profile_updated'); $thisstaff->reload(); $staff->reload(); $_SESSION['TZ_OFFSET']=$thisstaff->getTZoffset(); $_SESSION['TZ_DST']=$thisstaff->observeDaylight(); }elseif(!$errors['err']) - $errors['err']='Profile update error. Try correcting the errors below and try again!'; + $errors['err']=lang('profile_upd_error').'. '.lang('try_correcting'); } //Forced password Change. if($thisstaff->forcePasswdChange() && !$errors['err']) - $errors['err']=sprintf('Hi %s - You must change your password to continue!',$thisstaff->getFirstName()); + $errors['err']=sprintf(''.lang('hi').' %s - '.lang('change_pass_to_cont'),$thisstaff->getFirstName()); elseif($thisstaff->onVacation() && !$warn) - $warn=sprintf('Welcome back %s! You are listed as \'on vacation\' Please let your manager know that you are back.',$thisstaff->getFirstName()); + $warn=sprintf(''.lang('welcome_back').' %s! '.lang('listed_on_vacation'),$thisstaff->getFirstName()); $inc='profile.inc.php'; $nav->setTabActive('dashboard'); diff --git a/scp/settings.php b/scp/settings.php index 9c8f70ac..16e2a847 100644 --- a/scp/settings.php +++ b/scp/settings.php @@ -16,19 +16,18 @@ require('admin.inc.php'); $errors=array(); $settingOptions=array( - 'system' => 'System Settings', - 'tickets' => 'Ticket Settings and Options', - 'emails' => 'Email Settings', - 'pages' => 'Site Pages', - 'kb' => 'Knowledgebase Settings', - 'autoresp' => 'Autoresponder Settings', - 'alerts' => 'Alerts and Notices Settings'); + 'system' => lang('system_settings'), + 'tickets' => lang('ticket_settings'), + 'emails' => lang('email_settings'), + 'kb' => lang('knowl_settings'), + 'autoresp' => lang('Auto_res_Settings'), + 'alerts' => lang('nottice_settings')); //Handle a POST. if($_POST && !$errors) { if($cfg && $cfg->updateSettings($_POST,$errors)) { - $msg=Format::htmlchars($settingOptions[$_POST['t']]).' Updated Successfully'; + $msg=Format::htmlchars($settingOptions[$_POST['t']]).' '.lang('update_successful'); } elseif(!$errors['err']) { - $errors['err']='Unable to update settings - correct errors below and try again'; + $errors['err']=lang('error_update_set'); } } diff --git a/scp/slas.php b/scp/slas.php index 072b2779..d83326bb 100644 --- a/scp/slas.php +++ b/scp/slas.php @@ -15,33 +15,34 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.sla.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $sla=null; if($_REQUEST['id'] && !($sla=SLA::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid API key ID.'; + $errors['err']=lang('invalid_api'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$sla){ - $errors['err']='Unknown or invalid SLA plan.'; + $errors['err']=lang('invalid_sla_plan'); }elseif($sla->update($_POST,$errors)){ - $msg='SLA plan updated successfully'; + $msg=lang('sla_plan_updated'); }elseif(!$errors['err']){ - $errors['err']='Error updating SLA plan. Try again!'; + $errors['err']=lang('error_update_sla'); } break; case 'add': if(($id=SLA::create($_POST,$errors))){ - $msg='SLA plan added successfully'; + $msg=lang('sla_added_success'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add SLA plan. Correct error(s) below and try again.'; + $errors['err']=lang('cant_add_sla_plan'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one plan.'; + $errors['err'] = lang('select_one_plan'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -51,11 +52,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected SLA plans enabled'; + $msg = lang('enabled_sla_plans'); else - $warn = "$num of $count selected SLA plans enabled"; + $warn = "$num ".lang('of')." $count ".lang('enabled_sla_plans');; } else { - $errors['err'] = 'Unable to enable selected SLA plans.'; + $errors['err'] = lang('cant_enable_sla'); } break; case 'disable': @@ -63,11 +64,11 @@ .' WHERE id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected SLA plans disabled'; + $msg = lang('sla_plan_disabled'); else - $warn = "$num of $count selected SLA plans disabled"; + $warn = "$num ".lang('of')." $count ".lang('sla_plan_disabled'); } else { - $errors['err'] = 'Unable to disable selected SLA plans'; + $errors['err'] = lang('cant_disable_sla'); } break; case 'delete': @@ -78,19 +79,19 @@ } if($i && $i==$count) - $msg = 'Selected SLA plans deleted successfully'; + $msg = lang('sla_plans_deleted').' '.lang('successfully'); elseif($i>0) - $warn = "$i of $count selected SLA plans deleted"; + $warn = "$i ".lang('of')." $count ".lang('sla_plans_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected SLA plans'; + $errors['err'] = lang('cant_delete_sla'); break; default: - $errors['err']='Unknown action - get technical help.'; + $errors['err']=lang('unknown_action'); } } break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/staff.inc.php b/scp/staff.inc.php index 0c835d46..e1ffd24d 100644 --- a/scp/staff.inc.php +++ b/scp/staff.inc.php @@ -13,13 +13,13 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ -if(basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) die('Access denied'); //Say hi to our friend.. +if(basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) die(lang('access_denied')); //Say hi to our friend.. -if(!file_exists('../main.inc.php')) die('Fatal error... get technical support'); +if(!file_exists('../main.inc.php')) die(lang('fatal_error')); require_once('../main.inc.php'); -if(!defined('INCLUDE_DIR')) die('Fatal error... invalid setting.'); +if(!defined('INCLUDE_DIR')) die(lang('invalid_setting')); /*Some more include defines specific to staff only */ define('STAFFINC_DIR',INCLUDE_DIR.'staff/'); @@ -64,9 +64,9 @@ function staffLoginPage($msg) { unset($_SESSION['_staff']['auth']['msg']); } elseif (isset($_SESSION['_staff']['userID']) && !$thisstaff->isValid()) - $msg = 'Session timed out due to inactivity'; + $msg = lang('Session timed out due to inactivity'); else - $msg = 'Authentication Required'; + $msg = lang('Authentication Required'); staffLoginPage($msg); exit; @@ -75,13 +75,13 @@ function staffLoginPage($msg) { if(!$thisstaff->isAdmin()) { //Check for disabled staff or group! if(!$thisstaff->isactive() || !$thisstaff->isGroupActive()) { - staffLoginPage('Access Denied. Contact Admin'); + staffLoginPage(lang('contact_admin')); exit; } //Staff are not allowed to login in offline mode!! if(!$ost->isSystemOnline() || $ost->isUpgradePending()) { - staffLoginPage('System Offline'); + staffLoginPage(lang('sys_off_line')); exit; } } @@ -92,7 +92,7 @@ function staffLoginPage($msg) { /******* CSRF Protectin *************/ // Enforce CSRF protection for POSTS if ($_POST && !$ost->checkCSRFToken()) { - Http::response(400, 'Valid CSRF Token Required'); + Http::response(400, lang('valid_csrf_req')); exit; } @@ -114,12 +114,12 @@ function staffLoginPage($msg) { $exempt = in_array(basename($_SERVER['SCRIPT_NAME']), array('logout.php', 'ajax.php', 'logs.php', 'upgrade.php')); if($ost->isUpgradePending() && !$exempt) { - $errors['err']=$sysnotice='System upgrade is pending Upgrade Now'; + $errors['err']=$sysnotice=lang('aupdate_pending').' '.lang('upgrade_now').''; require('upgrade.php'); exit; } elseif($cfg->isHelpDeskOffline()) { - $sysnotice='System is set to offline mode - Client interface is disabled and ONLY admins can access staff control panel.'; - $sysnotice.=' Enable.'; + $sysnotice=''.lang('syst_offline_mode').' - '.lang('c_interface_disab'); + $sysnotice.=' '.lang('enable').'.'; } $nav = new StaffNav($thisstaff); @@ -127,11 +127,11 @@ function staffLoginPage($msg) { if($thisstaff->forcePasswdChange() && !$exempt) { # XXX: Call staffLoginPage() for AJAX and API requests _not_ to honor # the request - $sysnotice = 'Password change required to continue'; + $sysnotice = lang('pass_change_cont'); require('profile.php'); //profile.php must request this file as require_once to avoid problems. exit; } $ost->setWarning($sysnotice); -$ost->setPageTitle('osTicket :: Staff Control Panel'); +$ost->setPageTitle('osTicket :: '.lang('staff_control_p')); ?> diff --git a/scp/staff.php b/scp/staff.php index b2d78f3c..d9338871 100644 --- a/scp/staff.php +++ b/scp/staff.php @@ -14,34 +14,36 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('admin.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); + $staff=null; if($_REQUEST['id'] && !($staff=Staff::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid staff ID.'; + $errors['err']=lang('unknow_staff_id'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$staff){ - $errors['err']='Unknown or invalid staff.'; + $errors['err']=lang('unknow_staff'); }elseif($staff->update($_POST,$errors)){ - $msg='Staff updated successfully'; + $msg=lang('staff_update_success'); }elseif(!$errors['err']){ - $errors['err']='Unable to update staff. Correct any error(s) below and try again!'; + $errors['err']=lang('unable_update_staff'); } break; case 'create': if(($id=Staff::create($_POST,$errors))){ - $msg=Format::htmlchars($_POST['name']).' added successfully'; + $msg=Format::htmlchars($_POST['name']).' '. lang('added_succesfully'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add staff. Correct any error(s) below and try again.'; + $errors['err']=lang('unable_add_staff'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err'] = 'You must select at least one staff member.'; + $errors['err'] = lang('one_staff_member'); } elseif(in_array($thisstaff->getId(),$_POST['ids'])) { - $errors['err'] = 'You can not disable/delete yourself - you could be the only admin!'; + $errors['err'] = lang('disable_only_admin'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -51,11 +53,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected staff activated'; + $msg = lang('staff_activated'); else - $warn = "$num of $count selected staff activated"; + $warn = "$num ".lang('of')." $count ".lang('staff_activated'); } else { - $errors['err'] = 'Unable to activate selected staff'; + $errors['err'] = lang('unable_activ_staff'); } break; case 'disable': @@ -64,11 +66,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected staff disabled'; + $msg = lang('disable_staff'); else - $warn = "$num of $count selected staff disabled"; + $warn = "$num ".lang('of')." $count ".lang('disable_staff'); } else { - $errors['err'] = 'Unable to disable selected staff'; + $errors['err'] = lang('unable_disable_staff'); } break; case 'delete': @@ -78,20 +80,20 @@ } if($i && $i==$count) - $msg = 'Selected staff deleted successfully'; + $msg = lang('staff_deleted'); elseif($i>0) - $warn = "$i of $count selected staff deleted"; + $warn = "$i ".lang('of')." $count ".lang('staff_deleted_only'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected staff.'; + $errors['err'] = lang('unable_delete_staff'); break; default: - $errors['err'] = 'Unknown action. Get technical help!'; + $errors['err'] = lang('unknown_action'); } } break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/teams.php b/scp/teams.php index ce877bea..e13c2307 100644 --- a/scp/teams.php +++ b/scp/teams.php @@ -14,32 +14,33 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('admin.inc.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $team=null; if($_REQUEST['id'] && !($team=Team::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid team ID.'; + $errors['err']=lang('invalid_team_id'); if($_POST){ switch(strtolower($_POST['do'])){ case 'update': if(!$team){ - $errors['err']='Unknown or invalid team.'; + $errors['err']=lang('invalid_team'); }elseif($team->update($_POST,$errors)){ - $msg='Team updated successfully'; + $msg=lang('team_update_success'); }elseif(!$errors['err']){ - $errors['err']='Unable to update team. Correct any error(s) below and try again!'; + $errors['err']=lang('unable_update_team'); } break; case 'create': if(($id=Team::create($_POST,$errors))){ - $msg=Format::htmlchars($_POST['team']).' added successfully'; + $msg=Format::htmlchars($_POST['team']).' '.lang('added_succesfully'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add team. Correct any error(s) below and try again.'; + $errors['err']=lang('unable_add_team').' '.lang('correct_errors'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']='You must select at least one team.'; + $errors['err']=lang('select_one_team'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -49,11 +50,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected teams activated'; + $msg = lang('team_activated'); else - $warn = "$num of $count selected teams activated"; + $warn = "$num of $count ".lang('team_activated'); } else { - $errors['err'] = 'Unable to activate selected teams'; + $errors['err'] = lang('unable_activate_team'); } break; case 'disable': @@ -62,11 +63,11 @@ if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) - $msg = 'Selected teams disabled'; + $msg = lang('teams_disabled'); else - $warn = "$num of $count selected teams disabled"; + $warn = "$num of $count ".lang('teams_disabled'); } else { - $errors['err'] = 'Unable to disable selected teams'; + $errors['err'] = lang('not_desable_teams'); } break; case 'delete': @@ -75,19 +76,19 @@ $i++; } if($i && $i==$count) - $msg = 'Selected teams deleted successfully'; + $msg = lang('team_deleted_success'); elseif($i>0) - $warn = "$i of $count selected teams deleted"; + $warn = "$i of $count ".lang('team_deleted'); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected teams'; + $errors['err'] = lang('unable_delete_team'); break; default: - $errors['err'] = 'Unknown action. Get technical help!'; + $errors['err'] = lang('unknown_action'); } } break; default: - $errors['err']='Unknown action/command'; + $errors['err']=lang('unknown_command'); break; } } diff --git a/scp/templates.php b/scp/templates.php index fd0ed3dd..42c295fc 100644 --- a/scp/templates.php +++ b/scp/templates.php @@ -15,57 +15,58 @@ **********************************************************************/ require('admin.inc.php'); include_once(INCLUDE_DIR.'class.template.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $template=null; if($_REQUEST['tpl_id'] && !($template=EmailTemplateGroup::lookup($_REQUEST['tpl_id']))) - $errors['err']='Unknown or invalid template group ID.'; + $errors['err']=lang('Unknown or invalid template group ID.'); elseif($_REQUEST['id'] && !($template=EmailTemplate::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid template ID.'; + $errors['err']=lang('Unknown or invalid template ID.'); if($_POST){ switch(strtolower($_POST['do'])){ case 'updatetpl': if(!$template){ - $errors['err']='Unknown or invalid template'; + $errors['err']=lang('Unknown or invalid template'); }elseif($template->update($_POST,$errors)){ $template->reload(); - $msg='Message template updated successfully'; + $msg=lang('Message template updated successfully'); }elseif(!$errors['err']){ - $errors['err']='Error updating message template. Try again!'; + $errors['err']=lang('error_update_temp'); } break; case 'implement': if(!$template){ - $errors['err']='Unknown or invalid template'; + $errors['err']=lang('Unknown or invalid template'); }elseif($new = EmailTemplate::add($_POST,$errors)){ $template = $new; - $msg='Message template updated successfully'; + $msg=lang('Message template updated successfully'); }elseif(!$errors['err']){ - $errors['err']='Error updating message template. Try again!'; + $errors['err']=lang('error_update_temp'); } break; case 'update': if(!$template){ - $errors['err']='Unknown or invalid template'; + $errors['err']=lang('Unknown or invalid template'); }elseif($template->update($_POST,$errors)){ - $msg='Template updated successfully'; + $msg=lang('Template updated successfully'); }elseif(!$errors['err']){ - $errors['err']='Error updating template. Try again!'; + $errors['err']=lang('Error updating template. Try again!'); } break; case 'add': if(($new=EmailTemplateGroup::add($_POST,$errors))){ $template=$new; - $msg='Template added successfully'; + $msg=lang('Template added successfully'); $_REQUEST['a']=null; }elseif(!$errors['err']){ - $errors['err']='Unable to add template. Correct error(s) below and try again.'; + $errors['err']=lang('Unable to add template. Correct error(s) below and try again.'); } break; case 'mass_process': if(!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) { - $errors['err']='You must select at least one template to process.'; + $errors['err']=lang('You must select at least one template to process.'); } else { $count=count($_POST['ids']); switch(strtolower($_POST['a'])) { @@ -74,11 +75,11 @@ .' WHERE tpl_id IN ('.implode(',', db_input($_POST['ids'])).')'; if(db_query($sql) && ($num=db_affected_rows())){ if($num==$count) - $msg = 'Selected templates enabled'; + $msg = lang('Selected templates enabled'); else - $warn = "$num of $count selected templates enabled"; + $warn = "$num ".lang('of')." $count ".lang("selected templates enabled"); } else { - $errors['err'] = 'Unable to enable selected templates'; + $errors['err'] = lang('Unable to enable selected templates'); } break; case 'disable': @@ -88,11 +89,11 @@ $i++; } if($i && $i==$count) - $msg = 'Selected templates disabled'; + $msg = lang('Selected templates disabled'); elseif($i) - $warn = "$i of $count selected templates disabled (in-use templates can't be disabled)"; + $warn = "$i ".lang('of')." $count ".lang("selected templates disabled (in-use templates can't be disabled)"); else - $errors['err'] = "Unable to disable selected templates (in-use or default template can't be disabled)"; + $errors['err'] = lang("Unable to disable selected templates (in-use or default template can't be disabled)"); break; case 'delete': $i=0; @@ -102,19 +103,19 @@ } if($i && $i==$count) - $msg = 'Selected templates deleted successfully'; + $msg = lang('Selected templates deleted successfully'); elseif($i>0) - $warn = "$i of $count selected templates deleted"; + $warn = "$i ".lang('of')." $count ".lang("selected templates deleted"); elseif(!$errors['err']) - $errors['err'] = 'Unable to delete selected templates'; + $errors['err'] = lang('Unable to delete selected templates'); break; default: - $errors['err']='Unknown template action'; + $errors['err']=lang('Unknown template action'); } } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('Unknown action'); break; } } diff --git a/scp/tickets.php b/scp/tickets.php index 0a9ba30a..88dd2dc1 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -19,6 +19,7 @@ require_once(INCLUDE_DIR.'class.dept.php'); require_once(INCLUDE_DIR.'class.filter.php'); require_once(INCLUDE_DIR.'class.canned.php'); +require_once(INCLUDE_DIR.'languages/language_control/languages_processor.php'); $page=''; @@ -26,9 +27,9 @@ //LOCKDOWN...See if the id provided is actually valid and if the user has access. if($_REQUEST['id']) { if(!($ticket=Ticket::lookup($_REQUEST['id']))) - $errors['err']='Unknown or invalid ticket ID'; + $errors['err']=lang('invalid_ticket_id'); elseif(!$ticket->checkStaffAccess($thisstaff)) { - $errors['err']='Access denied. Contact admin if you believe this is in error'; + $errors['err']=lang('cont_admin_if_error'); $ticket=null; //Clear ticket obj. } } @@ -39,22 +40,22 @@ //More coffee please. $errors=array(); $lock=$ticket->getLock(); //Ticket lock if any - $statusKeys=array('open'=>'Open','Reopen'=>'Open','Close'=>'Closed'); + $statusKeys=array('open'=>lang('open'),'Reopen'=>lang('open'),'Close'=>lang('closed')); switch(strtolower($_POST['a'])): case 'reply': if(!$thisstaff->canPostReply()) - $errors['err'] = 'Action denied. Contact admin for access'; + $errors['err'] = lang('cont_admin_to_acces'); else { if(!$_POST['response']) - $errors['response']='Response required'; + $errors['response']=lang('required_response'); //Use locks to avoid double replies if($lock && $lock->getStaffId()!=$thisstaff->getId()) - $errors['err']='Action Denied. Ticket is locked by someone else!'; + $errors['err']=lang('act_denied_t_locket'); //Make sure the email is not banned if(!$errors['err'] && TicketFilter::isBanned($ticket->getEmail())) - $errors['err']='Email is in banlist. Must be removed to reply.'; + $errors['err']=lang('email_removed_to_reply'); } $wasOpen =($ticket->isOpen()); @@ -65,87 +66,87 @@ $vars['files'] = AttachmentFile::format($_FILES['attachments']); if(!$errors && ($response=$ticket->postReply($vars, $errors, isset($_POST['emailreply'])))) { - $msg='Reply posted successfully'; + $msg=lang('reply_posted_success'); $ticket->reload(); if($ticket->isClosed() && $wasOpen) $ticket=null; } elseif(!$errors['err']) { - $errors['err']='Unable to post the reply. Correct the errors below and try again!'; + $errors['err']=lang('cant_post_reply').' '.lang('correct_errors'); } break; case 'transfer': /** Transfer ticket **/ //Check permission if(!$thisstaff->canTransferTickets()) - $errors['err']=$errors['transfer'] = 'Action Denied. You are not allowed to transfer tickets.'; + $errors['err']=$errors['transfer'] = lang('not_transfer_ticket'); else { //Check target dept. if(!$_POST['deptId']) - $errors['deptId'] = 'Select department'; + $errors['deptId'] = lang('select_department'); elseif($_POST['deptId']==$ticket->getDeptId()) - $errors['deptId'] = 'Ticket already in the department'; + $errors['deptId'] = lang('ticket_in_dept'); elseif(!($dept=Dept::lookup($_POST['deptId']))) - $errors['deptId'] = 'Unknown or invalid department'; + $errors['deptId'] = lang('invalid_dep'); //Transfer message - required. if(!$_POST['transfer_comments']) - $errors['transfer_comments'] = 'Transfer comments required'; + $errors['transfer_comments'] = lang('transfer_comments_req'); elseif(strlen($_POST['transfer_comments'])<5) - $errors['transfer_comments'] = 'Transfer comments too short!'; + $errors['transfer_comments'] = lang('transfer_comments_shor'); //If no errors - them attempt the transfer. if(!$errors && $ticket->transfer($_POST['deptId'], $_POST['transfer_comments'])) { - $msg = 'Ticket transferred successfully to '.$ticket->getDeptName(); + $msg = lang('ticket_transf_succ').' '.$ticket->getDeptName(); //Check to make sure the staff still has access to the ticket if(!$ticket->checkStaffAccess($thisstaff)) $ticket=null; } elseif(!$errors['transfer']) { - $errors['err'] = 'Unable to complete the ticket transfer'; - $errors['transfer']='Correct the error(s) below and try again!'; + $errors['err'] = lang('cant_complete_transfer'); + $errors['transfer']=lang('correct_errors'); } } break; case 'assign': if(!$thisstaff->canAssignTickets()) - $errors['err']=$errors['assign'] = 'Action Denied. You are not allowed to assign/reassign tickets.'; + $errors['err']=$errors['assign'] = lang('cant_assign_ticket'); else { $id = preg_replace("/[^0-9]/", "",$_POST['assignId']); $claim = (is_numeric($_POST['assignId']) && $_POST['assignId']==$thisstaff->getId()); if(!$_POST['assignId'] || !$id) - $errors['assignId'] = 'Select assignee'; + $errors['assignId'] = lang('select_assignee'); elseif($_POST['assignId'][0]!='s' && $_POST['assignId'][0]!='t' && !$claim) - $errors['assignId']='Invalid assignee ID - get technical support'; + $errors['assignId']=lang('invalid_assigned_id'); elseif($ticket->isAssigned()) { if($_POST['assignId'][0]=='s' && $id==$ticket->getStaffId()) - $errors['assignId']='Ticket already assigned to the staff.'; + $errors['assignId']=lang('ticket_assigned_staf'); elseif($_POST['assignId'][0]=='t' && $id==$ticket->getTeamId()) - $errors['assignId']='Ticket already assigned to the team.'; + $errors['assignId']=lang('ticket_assigned_team'); } //Comments are not required on self-assignment (claim) if($claim && !$_POST['assign_comments']) $_POST['assign_comments'] = 'Ticket claimed by '.$thisstaff->getName(); elseif(!$_POST['assign_comments']) - $errors['assign_comments'] = 'Assignment comments required'; + $errors['assign_comments'] = lang('assig_comment_req'); elseif(strlen($_POST['assign_comments'])<5) - $errors['assign_comments'] = 'Comment too short'; + $errors['assign_comments'] = lang('comment_to_short'); if(!$errors && $ticket->assign($_POST['assignId'], $_POST['assign_comments'], !$claim)) { if($claim) { - $msg = 'Ticket is NOW assigned to you!'; + $msg = lang('ticket_assig_to_you'); } else { - $msg='Ticket assigned successfully to '.$ticket->getAssigned(); + $msg=lang('ticket_assigned_to').' '.$ticket->getAssigned(); TicketLock::removeStaffLocks($thisstaff->getId(), $ticket->getId()); $ticket=null; } } elseif(!$errors['assign']) { - $errors['err'] = 'Unable to complete the ticket assignment'; - $errors['assign'] = 'Correct the error(s) below and try again!'; + $errors['err'] = lang('unnab_assign_ticket'); + $errors['assign'] = lang('correct_errors'); } } break; @@ -153,10 +154,10 @@ //Make sure the staff can set desired state if($_POST['state']) { if($_POST['state']=='closed' && !$thisstaff->canCloseTickets()) - $errors['state'] = "You don't have permission to close tickets"; + $errors['state'] = lang("dont_permit_cs_tick"); elseif(in_array($_POST['state'], array('overdue', 'notdue', 'unassigned')) && (!($dept=$ticket->getDept()) || !$dept->isManager($thisstaff))) - $errors['state'] = "You don't have permission to set the state"; + $errors['state'] = lang("cant_set_state"); } $wasOpen = ($ticket->isOpen()); @@ -167,176 +168,176 @@ if(($note=$ticket->postNote($vars, $errors, $thisstaff))) { - $msg='Internal note posted successfully'; + $msg=lang('note_posted'); if($wasOpen && $ticket->isClosed()) $ticket = null; //Going back to main listing. } else { if(!$errors['err']) - $errors['err'] = 'Unable to post internal note - missing or invalid data.'; + $errors['err'] = lang('cant_post_inter_note'); - $errors['postnote'] = 'Unable to post the note. Correct the error(s) below and try again!'; + $errors['postnote'] = lang('cant_post_note').' '.lang('correct_errors'); } break; case 'edit': case 'update': if(!$ticket || !$thisstaff->canEditTickets()) - $errors['err']='Perm. Denied. You are not allowed to edit tickets'; + $errors['err']=lang('perm_denied'); elseif($ticket->update($_POST,$errors)) { - $msg='Ticket updated successfully'; + $msg=lang('ticket_updated'); $_REQUEST['a'] = null; //Clear edit action - going back to view. //Check to make sure the staff STILL has access post-update (e.g dept change). if(!$ticket->checkStaffAccess($thisstaff)) $ticket=null; } elseif(!$errors['err']) { - $errors['err']='Unable to update the ticket. Correct the errors below and try again!'; + $errors['err']=lang('cant_update_tick').' '.lang('correct_errors'); } break; case 'process': switch(strtolower($_POST['do'])): case 'close': if(!$thisstaff->canCloseTickets()) { - $errors['err'] = 'Perm. Denied. You are not allowed to close tickets.'; + $errors['err'] = lang('not_allowed_c_tick'); } elseif($ticket->isClosed()) { - $errors['err'] = 'Ticket is already closed!'; + $errors['err'] = lang('ticket_is_closed'); } elseif($ticket->close()) { - $msg='Ticket #'.$ticket->getExtId().' status set to CLOSED'; + $msg='Ticket #'.$ticket->getExtId().' '.lang('stat_set_to_closed'); //Log internal note if($_POST['ticket_status_notes']) $note = $_POST['ticket_status_notes']; else - $note='Ticket closed (without comments)'; + $note=lang('ticket_without_com'); - $ticket->logNote('Ticket Closed', $note, $thisstaff); + $ticket->logNote(lang('ticket_closed_only'), $note, $thisstaff); //Going back to main listing. TicketLock::removeStaffLocks($thisstaff->getId(), $ticket->getId()); $page=$ticket=null; } else { - $errors['err']='Problems closing the ticket. Try again'; + $errors['err']=lang('problem_clos_tick'); } break; case 'reopen': //if staff can close or create tickets ...then assume they can reopen. if(!$thisstaff->canCloseTickets() && !$thisstaff->canCreateTickets()) { - $errors['err']='Perm. Denied. You are not allowed to reopen tickets.'; + $errors['err']=lang('not_allowed_r_tick'); } elseif($ticket->isOpen()) { - $errors['err'] = 'Ticket is already open!'; + $errors['err'] = lang('ticket_is_open'); } elseif($ticket->reopen()) { - $msg='Ticket REOPENED'; + $msg=lang('ticket_reopen'); if($_POST['ticket_status_notes']) $note = $_POST['ticket_status_notes']; else - $note='Ticket reopened (without comments)'; + $note=lang('ticket_ro_no_comt'); - $ticket->logNote('Ticket Reopened', $note, $thisstaff); + $ticket->logNote(lang('ticket_reopen'), $note, $thisstaff); } else { - $errors['err']='Problems reopening the ticket. Try again'; + $errors['err']=lang('problem_reopen_tic'); } break; case 'release': if(!$ticket->isAssigned() || !($assigned=$ticket->getAssigned())) { - $errors['err'] = 'Ticket is not assigned!'; + $errors['err'] = lang('ticket_not_assig'); } elseif($ticket->release()) { - $msg='Ticket released (unassigned) from '.$assigned; - $ticket->logActivity('Ticket unassigned',$msg.' by '.$thisstaff->getName()); + $msg=lang('ticket_released').' '.$assigned; + $ticket->logActivity(lang('ticket_unassigned'),$msg.' '.lang('by').' '.$thisstaff->getName()); } else { - $errors['err'] = 'Problems releasing the ticket. Try again'; + $errors['err'] = lang('cant_release_tick'); } break; case 'claim': if(!$thisstaff->canAssignTickets()) { - $errors['err'] = 'Perm. Denied. You are not allowed to assign/claim tickets.'; + $errors['err'] = lang('cant_claim_ticket'); } elseif(!$ticket->isOpen()) { - $errors['err'] = 'Only open tickets can be assigned'; + $errors['err'] = lang('o_ticket_can_assg'); } elseif($ticket->isAssigned()) { - $errors['err'] = 'Ticket is already assigned to '.$ticket->getAssigned(); - } elseif($ticket->assignToStaff($thisstaff->getId(), ('Ticket claimed by '.$thisstaff->getName()), false)) { - $msg = 'Ticket is now assigned to you!'; + $errors['err'] = lang('ticket_assig_to').' '.$ticket->getAssigned(); + } elseif($ticket->assignToStaff($thisstaff->getId(), (lang('ticket_claimed_by').' '.$thisstaff->getName()), false)) { + $msg = lang('ticket_not_to_you'); } else { - $errors['err'] = 'Problems assigning the ticket. Try again'; + $errors['err'] = lang('problem_asign_tic'); } break; case 'overdue': $dept = $ticket->getDept(); if(!$dept || !$dept->isManager($thisstaff)) { - $errors['err']='Perm. Denied. You are not allowed to flag tickets overdue'; + $errors['err']=lang('not_allowed_f_tick'); } elseif($ticket->markOverdue()) { - $msg='Ticket flagged as overdue'; - $ticket->logActivity('Ticket Marked Overdue',($msg.' by '.$thisstaff->getName())); + $msg=lang('ticket_ovedue'); + $ticket->logActivity(lang('marked_overdue'),($msg.' '.lang('by').' '.$thisstaff->getName())); } else { - $errors['err']='Problems marking the the ticket overdue. Try again'; + $errors['err']=lang('prob_marked_overdue'); } break; case 'answered': $dept = $ticket->getDept(); if(!$dept || !$dept->isManager($thisstaff)) { - $errors['err']='Perm. Denied. You are not allowed to flag tickets'; + $errors['err']=lang('not_p_flag_ticket'); } elseif($ticket->markAnswered()) { - $msg='Ticket flagged as answered'; - $ticket->logActivity('Ticket Marked Answered',($msg.' by '.$thisstaff->getName())); + $msg=lang('ticket_answered'); + $ticket->logActivity(lang('ticket_m_answered'),($msg.' '.lang('by').' '.$thisstaff->getName())); } else { - $errors['err']='Problems marking the the ticket answered. Try again'; + $errors['err']=lang('prob_mark_t_answer'); } break; case 'unanswered': $dept = $ticket->getDept(); if(!$dept || !$dept->isManager($thisstaff)) { - $errors['err']='Perm. Denied. You are not allowed to flag tickets'; + $errors['err']=lang('not_p_flag_ticket'); } elseif($ticket->markUnAnswered()) { - $msg='Ticket flagged as unanswered'; - $ticket->logActivity('Ticket Marked Unanswered',($msg.' by '.$thisstaff->getName())); + $msg=lang('ticket_unanswered'); + $ticket->logActivity(lang('ticket_m_unanswered'),($msg.' '.lang('by').' '.$thisstaff->getName())); } else { - $errors['err']='Problems marking the the ticket unanswered. Try again'; + $errors['err']=lang('prob_mark_unanswer'); } break; case 'banemail': if(!$thisstaff->canBanEmails()) { - $errors['err']='Perm. Denied. You are not allowed to ban emails'; + $errors['err']=lang('cant_ban_emails'); } elseif(BanList::includes($ticket->getEmail())) { - $errors['err']='Email already in banlist'; + $errors['err']=lang('email_in_ban'); } elseif(Banlist::add($ticket->getEmail(),$thisstaff->getName())) { - $msg='Email ('.$ticket->getEmail().') added to banlist'; + $msg='Email ('.$ticket->getEmail().') '.lang('added_to_ban_list'); } else { - $errors['err']='Unable to add the email to banlist'; + $errors['err']=lang('cant_add_email_ban'); } break; case 'unbanemail': if(!$thisstaff->canBanEmails()) { - $errors['err'] = 'Perm. Denied. You are not allowed to remove emails from banlist.'; + $errors['err'] = lang('cant_remove_email_b'); } elseif(Banlist::remove($ticket->getEmail())) { - $msg = 'Email removed from banlist'; + $msg = lang('email_removed_ban'); } elseif(!BanList::includes($ticket->getEmail())) { - $warn = 'Email is not in the banlist'; + $warn = lang('email_not_banlist'); } else { - $errors['err']='Unable to remove the email from banlist. Try again.'; + $errors['err']=lang('unab_remove_email'); } break; case 'delete': // Dude what are you trying to hide? bad customer support?? if(!$thisstaff->canDeleteTickets()) { - $errors['err']='Perm. Denied. You are not allowed to DELETE tickets!!'; + $errors['err']=lang('not_allowed_d_tick'); } elseif($ticket->delete()) { - $msg='Ticket #'.$ticket->getNumber().' deleted successfully'; + $msg=lang('ticket').' #'.$ticket->getNumber().' '.lang('deleted_succesfully'); //Log a debug note - $ost->logDebug('Ticket #'.$ticket->getNumber().' deleted', - sprintf('Ticket #%s deleted by %s', + $ost->logDebug(lang('ticket').' #'.$ticket->getNumber().' '.lang('deleted'), + sprintf(lang('ticket').' #%s '.lang('deleted_by').' %s', $ticket->getNumber(), $thisstaff->getName()) ); $ticket=null; //clear the object. } else { - $errors['err']='Problems deleting the ticket. Try again'; + $errors['err']=lang('prob_delete_tick'); } break; default: - $errors['err']='You must select action to perform'; + $errors['err']=lang('must_select_action'); endswitch; break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); endswitch; if($ticket && is_object($ticket)) $ticket->reload();//Reload ticket info following post processing @@ -345,68 +346,67 @@ switch($_POST['a']) { case 'mass_process': if(!$thisstaff->canManageTickets()) - $errors['err']='You do not have permission to mass manage tickets. Contact admin for such access'; + $errors['err']=lang('cant_mass_mang_tick'); elseif(!$_POST['tids'] || !is_array($_POST['tids'])) - $errors['err']='No tickets selected. You must select at least one ticket.'; + $errors['err']=lang('select_one_ticket'); else { $count=count($_POST['tids']); $i = 0; switch(strtolower($_POST['do'])) { case 'reopen': if($thisstaff->canCloseTickets() || $thisstaff->canCreateTickets()) { - $note='Ticket reopened by '.$thisstaff->getName(); + $note=lang('ticket_reopen_by').' '.$thisstaff->getName(); foreach($_POST['tids'] as $k=>$v) { if(($t=Ticket::lookup($v)) && $t->isClosed() && @$t->reopen()) { $i++; - $t->logNote('Ticket Reopened', $note, $thisstaff); + $t->logNote(lang('ticket_reopen'), $note, $thisstaff); } } if($i==$count) - $msg = "Selected tickets ($i) reopened successfully"; + $msg = lang("selected_tickets")." ($i) ".lang('reopen_successfully'); elseif($i) - $warn = "$i of $count selected tickets reopened"; + $warn = "$i ".lang('of')." $count ".lang('select_tickets_ropen'); else - $errors['err'] = 'Unable to reopen selected tickets'; + $errors['err'] = lang('cant_reopen_ticket'); } else { - $errors['err'] = 'You do not have permission to reopen tickets'; + $errors['err'] = lang('dont_permit_reopen_t'); } break; case 'close': if($thisstaff->canCloseTickets()) { - $note='Ticket closed without response by '.$thisstaff->getName(); + $note=lang('ticket_no_response').' '.$thisstaff->getName(); foreach($_POST['tids'] as $k=>$v) { if(($t=Ticket::lookup($v)) && $t->isOpen() && @$t->close()) { $i++; - $t->logNote('Ticket Closed', $note, $thisstaff); + $t->logNote(lang('ticket_closed_only'), $note, $thisstaff); } } - if($i==$count) - $msg ="Selected tickets ($i) closed succesfully"; + $msg =lang("selected_tickets")." ($i) ".lang('closed_succesfully'); elseif($i) - $warn = "$i of $count selected tickets closed"; + $warn = "$i ".lang('of')." $count ".lang('ticket_closed'); else - $errors['err'] = 'Unable to close selected tickets'; + $errors['err'] = lang('cant_close_tickets'); } else { - $errors['err'] = 'You do not have permission to close tickets'; + $errors['err'] = lang('dont_permit_close_t'); } break; case 'mark_overdue': - $note='Ticket flagged as overdue by '.$thisstaff->getName(); + $note=lang('ticket_flagged_overd').' '.$thisstaff->getName(); foreach($_POST['tids'] as $k=>$v) { if(($t=Ticket::lookup($v)) && !$t->isOverdue() && $t->markOverdue()) { $i++; - $t->logNote('Ticket Marked Overdue', $note, $thisstaff); + $t->logNote(lang('marked_overdue'), $note, $thisstaff); } } if($i==$count) - $msg = "Selected tickets ($i) marked overdue"; + $msg = lang("selected_tickets")." ($i) ".lang('market_overdue'); elseif($i) - $warn = "$i of $count selected tickets marked overdue"; + $warn = "$i ".lang('of')." $count ".lang('sticket_mark_overdue'); else - $errors['err'] = 'Unable to flag selected tickets as overdue'; + $errors['err'] = lang('cant_flag_tickets'); break; case 'delete': if($thisstaff->canDeleteTickets()) { @@ -416,43 +416,43 @@ //Log a warning if($i) { - $log = sprintf('%s (%s) just deleted %d ticket(s)', + $log = sprintf('%s (%s) '.lang('just_deleted').' %d '.lang('ticket').'(s)', $thisstaff->getName(), $thisstaff->getUserName(), $i); - $ost->logWarning('Tickets deleted', $log, false); + $ost->logWarning(lang('tickets_deleted'), $log, false); } if($i==$count) - $msg = "Selected tickets ($i) deleted successfully"; + $msg = lang("selected_tickets")." ($i) ".lang('deleted_succesfully'); elseif($i) - $warn = "$i of $count selected tickets deleted"; + $warn = "$i ".lang('of')." $count ".lang('tickets_deleted'); else - $errors['err'] = 'Unable to delete selected tickets'; + $errors['err'] = lang('cant_delete_ticket'); } else { - $errors['err'] = 'You do not have permission to delete tickets'; + $errors['err'] = lang('dont_permit_d_tick'); } break; default: - $errors['err']='Unknown or unsupported action - get technical help'; + $errors['err']=lang('unknow_action'); } } break; case 'open': $ticket=null; if(!$thisstaff || !$thisstaff->canCreateTickets()) { - $errors['err']='You do not have permission to create tickets. Contact admin for such access'; + $errors['err']=lang('dont_permit_c_tick'); } else { $vars = $_POST; if($_FILES['attachments']) $vars['files'] = AttachmentFile::format($_FILES['attachments']); if(($ticket=Ticket::open($vars, $errors))) { - $msg='Ticket created successfully'; + $msg=lang('ticket_created'); $_REQUEST['a']=null; if(!$ticket->checkStaffAccess($thisstaff) || $ticket->isClosed()) $ticket=null; } elseif(!$errors['err']) { - $errors['err']='Unable to create the ticket. Correct the error(s) and try again'; + $errors['err']=lang('cant_create_ticket').lang('correct_errors'); } } break; @@ -468,24 +468,24 @@ //Navigation $nav->setTabActive('tickets'); if($cfg->showAnsweredTickets()) { - $nav->addSubMenu(array('desc'=>'Open ('.number_format($stats['open']+$stats['answered']).')', - 'title'=>'Open Tickets', + $nav->addSubMenu(array('desc'=>lang('opened').' ('.number_format($stats['open']+$stats['answered']).')', + 'title'=>lang('opened_tickets'), 'href'=>'tickets.php', 'iconclass'=>'Ticket'), (!$_REQUEST['status'] || $_REQUEST['status']=='open')); } else { if($stats) { - $nav->addSubMenu(array('desc'=>'Open ('.number_format($stats['open']).')', - 'title'=>'Open Tickets', + $nav->addSubMenu(array('desc'=>lang('opened').' ('.number_format($stats['open']).')', + 'title'=>lang('opened_tickets'), 'href'=>'tickets.php', 'iconclass'=>'Ticket'), (!$_REQUEST['status'] || $_REQUEST['status']=='open')); } if($stats['answered']) { - $nav->addSubMenu(array('desc'=>'Answered ('.number_format($stats['answered']).')', - 'title'=>'Answered Tickets', + $nav->addSubMenu(array('desc'=>lang('answered').' ('.number_format($stats['answered']).')', + 'title'=>lang('answered'), 'href'=>'tickets.php?status=answered', 'iconclass'=>'answeredTickets'), ($_REQUEST['status']=='answered')); @@ -494,18 +494,18 @@ if($stats['assigned']) { if(!$ost->getWarning() && $stats['assigned']>10) - $ost->setWarning($stats['assigned'].' tickets assigned to you! Do something about it!'); + $ost->setWarning($stats['assigned'].' '.lang('ticket_assign_you')); - $nav->addSubMenu(array('desc'=>'My Tickets ('.number_format($stats['assigned']).')', - 'title'=>'Assigned Tickets', + $nav->addSubMenu(array('desc'=>lang('my_tickets').' ('.number_format($stats['assigned']).')', + 'title'=>lang('assigned_tickets'), 'href'=>'tickets.php?status=assigned', 'iconclass'=>'assignedTickets'), ($_REQUEST['status']=='assigned')); } if($stats['overdue']) { - $nav->addSubMenu(array('desc'=>'Overdue ('.number_format($stats['overdue']).')', - 'title'=>'Stale Tickets', + $nav->addSubMenu(array('desc'=>lang('overdue').' ('.number_format($stats['overdue']).')', + 'title'=>lang('stale_tickets'), 'href'=>'tickets.php?status=overdue', 'iconclass'=>'overdueTickets'), ($_REQUEST['status']=='overdue')); @@ -515,28 +515,27 @@ } if($thisstaff->showAssignedOnly() && $stats['closed']) { - $nav->addSubMenu(array('desc'=>'My Closed Tickets ('.number_format($stats['closed']).')', - 'title'=>'My Closed Tickets', + $nav->addSubMenu(array('desc'=>lang('my_closed_tickets').' ('.number_format($stats['closed']).')', + 'title'=>lang('my_closed_tickets'), 'href'=>'tickets.php?status=closed', 'iconclass'=>'closedTickets'), ($_REQUEST['status']=='closed')); } else { - $nav->addSubMenu(array('desc'=>'Closed Tickets ('.number_format($stats['closed']).')', - 'title'=>'Closed Tickets', + $nav->addSubMenu(array('desc'=>lang('closed_tickets').' ('.number_format($stats['closed']).')', + 'title'=>lang('closed_tickets'), 'href'=>'tickets.php?status=closed', 'iconclass'=>'closedTickets'), ($_REQUEST['status']=='closed')); } if($thisstaff->canCreateTickets()) { - $nav->addSubMenu(array('desc'=>'New Ticket', + $nav->addSubMenu(array('desc'=>lang('new_ticket'), 'href'=>'tickets.php?a=open', 'iconclass'=>'newTicket'), ($_REQUEST['a']=='open')); } - $inc = 'tickets.inc.php'; if($ticket) { $ost->setPageTitle('Ticket #'.$ticket->getNumber()); @@ -545,7 +544,7 @@ if($_REQUEST['a']=='edit' && $thisstaff->canEditTickets()) $inc = 'ticket-edit.inc.php'; elseif($_REQUEST['a'] == 'print' && !$ticket->pdfExport($_REQUEST['psize'], $_REQUEST['notes'])) - $errors['err'] = 'Internal error: Unable to export the ticket to PDF for print.'; + $errors['err'] = lang('cant_export_to_pdf'); } else { $inc = 'tickets.inc.php'; if($_REQUEST['a']=='open' && $thisstaff->canCreateTickets()) @@ -554,11 +553,11 @@ require_once(INCLUDE_DIR.'class.export.php'); $ts = strftime('%Y%m%d'); if (!($token=$_REQUEST['h'])) - $errors['err'] = 'Query token required'; + $errors['err'] = lang('query_token_req'); elseif (!($query=$_SESSION['search_'.$token])) - $errors['err'] = 'Query token not found'; + $errors['err'] = lang('query_token_not_found'); elseif (!Export::saveTickets($query, "tickets-$ts.csv", 'csv')) - $errors['err'] = 'Internal error: Unable to dump query results'; + $errors['err'] = lang('cant_dump_query'); } //Clear active submenu on search with no status diff --git a/scp/upgrade.php b/scp/upgrade.php index 072ca797..c66230a2 100644 --- a/scp/upgrade.php +++ b/scp/upgrade.php @@ -17,7 +17,7 @@ require_once INCLUDE_DIR.'class.upgrader.php'; //$_SESSION['ost_upgrader']=null; -$upgrader = new Upgrader(TABLE_PREFIX, UPGRADE_DIR.'streams/'); +$upgrader = new Upgrader($cfg->getSchemaSignature(), TABLE_PREFIX, SQL_DIR); $errors=array(); if($_POST && $_POST['s'] && !$upgrader->isAborted()) { switch(strtolower($_POST['s'])) { @@ -32,11 +32,11 @@ $errors['err']='Config file rename required to continue!'; } else { $upgrader->setState('upgrade'); - } + } break; case 'upgrade': //Manual upgrade.... when JS (ajax) is not supported. - if($upgrader->getPendingTask()) { - $upgrader->doTask(); + if($upgrader->getNumPendingTasks()) { + $upgrader->doTasks(); } elseif($ost->isUpgradePending() && $upgrader->isUpgradable()) { $upgrader->upgrade(); } elseif(!$ost->isUpgradePending()) { diff --git a/secure.inc.php b/secure.inc.php index bf6a75b3..361a96c4 100644 --- a/secure.inc.php +++ b/secure.inc.php @@ -14,13 +14,13 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ if(!strcasecmp(basename($_SERVER['SCRIPT_NAME']),basename(__FILE__))) die('Kwaheri!'); -if(!file_exists('client.inc.php')) die('Fatal Error.'); + +if(!file_exists('client.inc.php')) die(lang('fatal_error')); require_once('client.inc.php'); //Client Login page: Ajax interface can pre-declare the function to trap logins. if(!function_exists('clientLoginPage')) { function clientLoginPage($msg ='') { - global $ost; require('./login.php'); exit; } diff --git a/setup/inc/streams/core/install-mysql.sql b/setup/inc/streams/core/install-mysql.sql index 9359cfae..4bcb9482 100644 --- a/setup/inc/streams/core/install-mysql.sql +++ b/setup/inc/streams/core/install-mysql.sql @@ -320,42 +320,43 @@ DROP TABLE IF EXISTS `%TABLE_PREFIX%email_template`; CREATE TABLE `%TABLE_PREFIX%email_template` ( `id` int(11) UNSIGNED NOT NULL auto_increment, `tpl_id` int(11) UNSIGNED NOT NULL, + `lang` varchar(3) DEFAULT NULL, `code_name` varchar(32) NOT NULL, `subject` varchar(255) NOT NULL default '', `body` text NOT NULL, `created` datetime NOT NULL, `updated` datetime NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `template_lookup` (`tpl_id`, `code_name`) + UNIQUE KEY `template_lookup` (`tpl_id`, `code_name`, `lang`) ) DEFAULT CHARSET=utf8; -- TODO: Dump revised copy before release!!! -INSERT INTO `%TABLE_PREFIX%email_template` (`code_name`, `subject`, `body`) - VALUES ( - 'ticket.autoresp', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nA request for support has been created and assigned ticket #%{ticket.number}. A representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\nIf you wish to send additional comments or information regarding this issue, please don''t open a new ticket. Simply login using the link above and update the ticket.\r\n\r\n%{signature}' - ), ( - 'ticket.autoreply', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nA request for support has been created and assigned ticket #%{ticket.number} with the following auto-reply:\r\n\r\n%{response}\r\n\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not open another ticket. If need be, representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket''s progress online here: %{ticket.client_link}.' - ), ( - 'ticket.notice', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nOur customer care team has created a ticket, #%{ticket.number} on your behalf, with the following message.\r\n\r\n%{message}\r\n\r\nIf you wish to provide additional comments or information regarding this issue, please don''t open a new ticket. You can update or view this ticket''s progress online here: %{ticket.client_link}.\r\n\r\n%{signature}' - ), ( - 'ticket.alert', 'New Ticket Alert', '%{recipient}, \r\n\r\nNew ticket #%{ticket.number} created.\r\n\r\n-----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n-----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.' - ), ( - 'message.autoresp', '[#%{ticket.number}] Message Added', '%{ticket.name}, \r\n\r\nYour reply to support request #%{ticket.number} has been noted.\r\n\r\nYou can view this support request progress online here: %{ticket.client_link}.\r\n\r\n%{signature}' - ), ( - 'message.alert', 'New Message Alert', '%{recipient}, \r\n\r\nNew message appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.' - ), ( - 'note.alert', 'New Internal Note Alert', '%{recipient}, \r\n\r\nInternal note appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\n* %{note.title} *\r\n\r\n%{note.message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.' - ), ( - 'assigned.alert', 'Ticket #%{ticket.number} Assigned to you', '%{assignee}, \r\n\r\nTicket #%{ticket.number} has been assigned to you by %{assigner}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view complete details, simply login to the support system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Support Ticket System - powered by osTicket.' - ), ( - 'transfer.alert', 'Ticket Transfer #%{ticket.number} - %{ticket.dept.name}', '%{recipient}, \r\n\r\nTicket #%{ticket.number} has been transferred to %{ticket.dept.name} department by %{staff.name}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.' - ), ( - 'ticket.overdue', 'Stale Ticket Alert', '%{recipient}, \r\n\r\nA ticket, #%{ticket.number} assigned to you or in your department is seriously overdue.\r\n\r\n%{ticket.staff_link}\r\n\r\nWe should all work hard to guarantee that all tickets are being addressed in a timely manner.\r\n\r\n- Your friendly (although with limited patience) Support Ticket System - powered by osTicket.' - ), ( - 'ticket.overlimit', 'Open Tickets Limit Reached', '%{ticket.name}\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%{url}/tickets.php?e=%{ticket.email}\r\n\r\nThank you.\r\n\r\nSupport Ticket System' - ), ( - 'ticket.reply', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nA customer support staff member has replied to your support request, #%{ticket.number} with the following response:\r\n\r\n%{response}\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not send another email. Instead, reply to this email or login to your account for a complete archive of all your support requests and responses.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}' - ); +INSERT INTO `ost_email_template` ( `tpl_id`, `lang`, `code_name`, `subject`, `body`) VALUES + (1, 'eng', 'ticket.autoresp', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nA request for support has been created and assigned ticket #%{ticket.number}. A representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket\'s progress online here: %{ticket.client_link}.\r\n\r\nIf you wish to send additional comments or information regarding this issue, please don\'t open a new ticket. Simply login using the link above and update the ticket.\r\n\r\n%{signature}'), + (1, 'eng', 'ticket.autoreply', 'Support Ticket Opened [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nA request for support has been created and assigned ticket #%{ticket.number} with the following auto-reply:\r\n\r\n%{response}\r\n\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not open another ticket. If need be, representative will follow-up with you as soon as possible.\r\n\r\nYou can view this ticket\'s progress online here: %{ticket.client_link}.'), + (1, 'eng', 'ticket.notice', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nOur customer care team has created a ticket, #%{ticket.number} on your behalf, with the following message.\r\n\r\n%{message}\r\n\r\nIf you wish to provide additional comments or information regarding this issue, please don\'t open a new ticket. You can update or view this ticket\'s progress online here: %{ticket.client_link}.\r\n\r\n%{signature}'), + (1, 'eng', 'ticket.alert', 'New Ticket Alert', '%{recipient}, \r\n\r\nNew ticket #%{ticket.number} created.\r\n\r\n-----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n-----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.'), + (1, 'eng', 'message.autoresp', '[#%{ticket.number}] Message Added', '%{ticket.name}, \r\n\r\nYour reply to support request #%{ticket.number} has been noted.\r\n\r\nYou can view this support request progress online here: %{ticket.client_link}.\r\n\r\n%{signature}'), + (1, 'eng', 'message.alert', 'New Message Alert', '%{recipient}, \r\n\r\nNew message appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\nName: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDept: %{ticket.dept.name}\r\n\r\n%{message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.'), + (1, 'eng', 'note.alert', 'New Internal Note Alert', '%{recipient}, \r\n\r\nInternal note appended to ticket #%{ticket.number}\r\n\r\n----------------------\r\n* %{note.title} *\r\n\r\n%{note.message}\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.'), + (1, 'eng', 'assigned.alert', 'Ticket #%{ticket.number} Assigned to you', '%{assignee}, \r\n\r\nTicket #%{ticket.number} has been assigned to you by %{assigner}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view complete details, simply login to the support system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Support Ticket System - powered by osTicket.'), + (1, 'eng', 'transfer.alert', 'Ticket Transfer #%{ticket.number} - %{ticket.dept.name}', '%{recipient}, \r\n\r\nTicket #%{ticket.number} has been transferred to %{ticket.dept.name} department by %{staff.name}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nTo view/respond to the ticket, please login to the support ticket system.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Your friendly Customer Support System - powered by osTicket.'), + (1, 'eng', 'ticket.overdue', 'Stale Ticket Alert', '%{recipient}, \r\n\r\nA ticket, #%{ticket.number} assigned to you or in your department is seriously overdue.\r\n\r\n%{ticket.staff_link}\r\n\r\nWe should all work hard to guarantee that all tickets are being addressed in a timely manner.\r\n\r\n- Your friendly (although with limited patience) Support Ticket System - powered by osTicket.'), + (1, 'eng', 'ticket.overlimit', 'Open Tickets Limit Reached', '%{ticket.name}\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%{url}/tickets.php?e=%{ticket.email}\r\n\r\nThank you.\r\n\r\nSupport Ticket System'), + (1, 'eng', 'ticket.reply', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nA customer support staff member has replied to your support request, #%{ticket.number} with the following response:\r\n\r\n%{response}\r\n\r\nWe hope this response has sufficiently answered your questions. If not, please do not send another email. Instead, reply to this email or login to your account for a complete archive of all your support requests and responses.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}'), + (1, 'spa', 'ticket.autoresp', 'Tique de soporte abierto [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nUna solicitud de reporte ha sido creada y asignada al tique #%{ticket.number}. Un representante le dará seguimiento tan pronto como sea posible.\r\n\r\nPuede ver en línea el progreso de este tique aquí: %{ticket.client_link}.\r\n\r\nSi usted desea enviar un comentario adicional o información respecto a este tema, por favor, abra un nuevo tique. Simplemente inicie sesión usando el enlace de arriba y actualice el tique.\r\n\r\n%{signature}'), + (1, 'spa', 'ticket.autoreply', 'Tique de soporte abierto [#%{ticket.number}]', '%{ticket.name}, \r\n\r\nUna solicitud de soporte ha sido creada y asignada al tique #%{ticket.number} con la siguiente respuesta:\r\n\r\n%{response}\r\n\r\n\r\nEsperamos que esta respuesta haya respondido a sus preguntas, de lo contrario, por favor, no abra otro tique. De ser necesario, un representante le dará seguimiento tan pronto como sea posible.\r\n\r\nPuede ver en línea el progreso de su tique aquí: %{ticket.client_link}.'), + (1, 'spa', 'ticket.notice', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nNuestro equipo de atención al cliente ha creado un tique, #%{ticket.number} a su nombre, con el siguiente mensaje.\r\n\r\n%{message}\r\n\r\nSi usted desea proveer comentarios adicionales o información respecto a este tema, por favor, no abra un nuevo tique. Usted puede actualizar o ver el progreso de este tique en línea aqui: %{ticket.client_link}.\r\n\r\n%{signature}'), + (1, 'spa', 'ticket.alert', 'Nueva alerta de tique', '%{recipient}, \r\n\r\nNuevo tique #%{ticket.number} creado.\r\n\r\n-----------------------\r\nNombre: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDepto: %{ticket.dept.name}\r\n\r\n%{message}\r\n-----------------------\r\n\r\nPara ver/responder al tique, por favor inicie sesión en el sistema de tiques de soporte.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Su amigable sistema de tiques de soporte - impulsado por osTicket.'), + (1, 'spa', 'message.autoresp', '[#%{ticket.number}] Mensaje agregado', '%{ticket.name}, \r\n\r\nSu solicitud de soporte #%{ticket.number} ha sido anotada.\r\n\r\nPuede ver en línea el progreso de esta solicitud de soporte aquí: %{ticket.client_link}.\r\n\r\n%{signature}'), + (1, 'spa', 'message.alert', 'Nuevo mesaje de alerta', '%{recipient}, \r\n\r\nNuevo mensaje abierto al tique#%{ticket.number}\r\n\r\n----------------------\r\nNombre: %{ticket.name}\r\nEmail: %{ticket.email}\r\nDepto: %{ticket.dept.name}\r\n\r\n%{message}\r\n----------------------\r\n\r\nPara ver/responder al tique, por favor inicie sesión en el sistema de tiques de soporte.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Su amigable sistema de tiques de soporte - impulsado por osTicket.'), + (1, 'spa', 'note.alert', 'Alerta de nueva nota interna', '%{recipient}, \r\n\r\nNota interna abierta al tique #%{ticket.number}\r\n\r\n----------------------\r\n* %{note.title} *\r\n\r\n%{note.message}\r\n----------------------\r\n\r\nPara ver/responder al tique, por favor inicie sesión en el sistema de tiques de soporte.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Su amigable sistema de tiques de soporte - impulsado por osTicket.'), + (1, 'spa', 'assigned.alert', 'Ticket #%{ticket.number} Asignado a usted', '%{assignee}, \r\n\r\nTique#%{ticket.number} ha sido asignado a usted por %{assigner}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nPara completar los detalles, simplemente inicie sesión en el sistema de soporte.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Su amigable sistema de tiques de soporte - impulsado por osTicket.'), + (1, 'spa', 'transfer.alert', 'Transferencia de tique #%{ticket.number} - %{ticket.dept.name}', '%{recipient}, \r\n\r\nEl tique #%{ticket.number} ha sido transferido a %{ticket.dept.name} departamento de %{staff.name}\r\n\r\n----------------------\r\n\r\n%{comments}\r\n\r\n----------------------\r\n\r\nPara ver/responder al tique, por favor inicie sesión en el sistema de tiques de soporte.\r\n\r\n%{ticket.staff_link}\r\n\r\n- Su amigable sistema de soporte al cliente - impulsado por osTicket.'), + (1, 'spa', 'ticket.overdue', 'Alerta tique vencido', '%{recipient}, \r\n\r\nUn tique, #%{ticket.number} asignado a usted o en su departamento está seriamente atrasado.\r\n\r\n%{ticket.staff_link}\r\n\r\nDebemos trabajar fuerte para garantizar que todos los tiques estén siendo siendo atendidos a tiempo.\r\n\r\n- Su amistoso (aunque con poca paciencia) sistema de tiques de soporte - impulsado por osTicket.'), + (1, 'spa', 'ticket.overlimit', 'Límite de tiques abiertos alcanzado', '%{ticket.name}\r\n\r\nUsted ha alcanzado el número máximo de tiques abiertos permitido.\r\n\r\nPara poder abrir otro tique, alguno de sus tiques pendientes debe ser cerrado. Para actualizar o agregar comentarios a un tique abierto simplemente inicie sesión usando el enlace de abajo.\r\n\r\n%{url}/tickets.php?e=%{ticket.email}\r\n\r\nGracias.\r\n\r\nSistema de Tiques de Soporte'), + (1, 'spa', 'ticket.reply', '[#%{ticket.number}] %{ticket.subject}', '%{ticket.name}, \r\n\r\nUn personal de atención al cliente ha respondido a su solicitud de soporte, #%{ticket.number} con la siguiente especificación:\r\n\r\n%{response}\r\n\r\nEsperamos que esta respuesta ha respondido a sus preguntas, de lo contrario, por favor no envíe otro correo. En cambio, responda a este correo electrónico o acceda a su cuenta para un archivo completo de todas sus solicitudes de apoyo y respuestas.\r\n\r\n%{ticket.client_link}\r\n\r\n%{signature}'); + UPDATE `%TABLE_PREFIX%email_template` SET `created`=NOW(), `updated`=NOW(), `tpl_id` = (SELECT `tpl_id` FROM `%TABLE_PREFIX%email_template_group`); diff --git a/tickets.php b/tickets.php index d1293db8..e748e618 100644 --- a/tickets.php +++ b/tickets.php @@ -15,14 +15,15 @@ vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('secure.inc.php'); -if(!is_object($thisclient) || !$thisclient->isValid()) die('Access denied'); //Double check again. + +if(!is_object($thisclient) || !$thisclient->isValid()) die(lang('access_denied')); //Double check again. require_once(INCLUDE_DIR.'class.ticket.php'); $ticket=null; if($_REQUEST['id']) { if(!($ticket=Ticket::lookupByExtId($_REQUEST['id']))) { - $errors['err']='Unknown or invalid ticket ID.'; + $errors['err']=lang('invalid_ticket_id'); }elseif(!$ticket->checkClientAccess($thisclient)) { - $errors['err']='Unknown or invalid ticket ID.'; //Using generic message on purpose! + $errors['err']=lang('invalid_ticket_id'); //Using generic message on purpose! $ticket=null; } } @@ -33,10 +34,10 @@ switch(strtolower($_POST['a'])){ case 'reply': if(!$ticket->checkClientAccess($thisclient)) //double check perm again! - $errors['err']='Access Denied. Possibly invalid ticket ID'; + $errors['err']=lang('access_denied').'. '.lang('posibly_invalid_id'); if(!$_POST['message']) - $errors['message']='Message required'; + $errors['message']=lang('message_required'); if(!$errors) { //Everything checked out...do the magic. @@ -45,17 +46,17 @@ $vars['files'] = AttachmentFile::format($_FILES['attachments'], true); if(($msgid=$ticket->postMessage($vars, 'Web'))) { - $msg='Message Posted Successfully'; + $msg=lang('message_posted'); } else { - $errors['err']='Unable to post the message. Try again'; + $errors['err']=lang('cant_post_message'); } } elseif(!$errors['err']) { - $errors['err']='Error(s) occurred. Please try again'; + $errors['err']=lang('errors_occurred'); } break; default: - $errors['err']='Unknown action'; + $errors['err']=lang('unknown_action_only'); } $ticket->reload(); endif; diff --git a/view.php b/view.php index 10e5374f..bcfeaa6a 100644 --- a/view.php +++ b/view.php @@ -18,7 +18,7 @@ require_once('client.inc.php'); //If the user is NOT logged in - try auto-login (if params exists). -if(!$thisclient || !$thisclient->isValid()) { +if((!$thisclient || !$thisclient->isValid()) || isset($_GET['login']) ) { // * On login Client::login will redirect the user to tickets.php view. // * See TODO above for planned multi-view. $user = null;