From 4acf5325b7de6aba1bea471f13cdfd5f32665513 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Thu, 11 Dec 2014 10:32:12 -0600 Subject: [PATCH] i18n: Localize the ticket view page --- include/class.dynamic_forms.php | 4 ++++ include/class.list.php | 9 ++++----- include/class.sla.php | 2 +- include/staff/ticket-view.inc.php | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index d8ce6d282..2aeacc7ac 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1097,6 +1097,10 @@ class DynamicFormEntryAnswer extends VerySimpleModel { return $this->_value; } + function getLocal($tag) { + return $this->field->getLocal($tag); + } + function getIdValue() { return $this->get('value_id'); } diff --git a/include/class.list.php b/include/class.list.php index a95429a6f..f5746f0ba 100644 --- a/include/class.list.php +++ b/include/class.list.php @@ -806,10 +806,6 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { const ENABLED = 0x0001; const INTERNAL = 0x0002; // Forbid deletion or name and status change. - function __construct() { - call_user_func_array(array('parent', '__construct'), func_get_args()); - } - protected function hasFlag($field, $flag) { return 0 !== ($this->get($field) & $flag); } @@ -1006,6 +1002,9 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { function getValue() { return $this->getName(); } + function getLocalName() { + return $this->getLocal('value'); + } function getAbbrev() { return ''; @@ -1138,7 +1137,7 @@ class TicketStatus extends VerySimpleModel implements CustomListItem { } function __toString() { - return __($this->getName()); + return $this->getName(); } static function create($ht) { diff --git a/include/class.sla.php b/include/class.sla.php index 083663695..8edb7a436 100644 --- a/include/class.sla.php +++ b/include/class.sla.php @@ -29,7 +29,7 @@ class SLA extends VerySimpleModel { } function getName() { - return $this->name; + return $this->getLocal('name'); } function getGracePeriod() { diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 4a2f57efa..abdb74ed1 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -169,7 +169,7 @@ if($ticket->isOverdue()) <table border="0" cellspacing="" cellpadding="4" width="100%"> <tr> <th width="100"><?php echo __('Status');?>:</th> - <td><?php echo $ticket->getStatus(); ?></td> + <td><?php echo ($S = $ticket->getStatus()) ? $S->getLocalName() : ''; ?></td> </tr> <tr> <th><?php echo __('Priority');?>:</th> @@ -356,7 +356,7 @@ foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { if (!($v = $a->display())) continue; ?> <tr> <th width="100"><?php - echo $a->getField()->get('label'); + echo $a->getLocal('label'); ?>:</th> <td><?php echo $v; -- GitLab