diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 8d0416011dac0f9f38f14236b88f23493cfe431c..7f62314d2596db6e4fcb30c146b4193731acd1cc 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -237,16 +237,16 @@ class UserForm extends DynamicForm { return static::$instance; } } -Filter::addSupportedMatches('User Data', function() { +Filter::addSupportedMatches(/* trans */ 'User Data', function() { $matches = array(); foreach (UserForm::getInstance()->getFields() as $f) { if (!$f->hasData()) continue; - $matches['field.'.$f->get('id')] = 'User / '.$f->getLabel(); + $matches['field.'.$f->get('id')] = __('User').' / '.$f->getLabel(); if (($fi = $f->getImpl()) instanceof SelectionField) { foreach ($fi->getList()->getProperties() as $p) { $matches['field.'.$f->get('id').'.'.$p->get('id')] - = 'User / '.$f->getLabel().' / '.$p->getLabel(); + = __('User').' / '.$f->getLabel().' / '.$p->getLabel(); } } } @@ -327,16 +327,16 @@ class TicketForm extends DynamicForm { } } // Add fields from the standard ticket form to the ticket filterable fields -Filter::addSupportedMatches('Ticket Data', function() { +Filter::addSupportedMatches(/* trans */ 'Ticket Data', function() { $matches = array(); foreach (TicketForm::getInstance()->getFields() as $f) { if (!$f->hasData()) continue; - $matches['field.'.$f->get('id')] = 'Ticket / '.$f->getLabel(); + $matches['field.'.$f->get('id')] = __('Ticket').' / '.$f->getLabel(); if (($fi = $f->getImpl()) instanceof SelectionField) { foreach ($fi->getList()->getProperties() as $p) { $matches['field.'.$f->get('id').'.'.$p->get('id')] - = 'Ticket / '.$f->getLabel().' / '.$p->getLabel(); + = __('Ticket').' / '.$f->getLabel().' / '.$p->getLabel(); } } } diff --git a/include/class.export.php b/include/class.export.php index 3860c80f803a8fbeebed01e1a7025b3077c810c7..78be2d43206f3dfb0b392ece15de5322c271a9a0 100644 --- a/include/class.export.php +++ b/include/class.export.php @@ -16,6 +16,14 @@ class Export { + // XXX: This may need to be moved to a print-specific class + static $paper_sizes = array( + /* trans */ 'Letter', + /* trans */ 'Legal', + 'A4', + 'A3', + ); + static function dumpQuery($sql, $headers, $how='csv', $options=array()) { $exporters = array( 'csv' => CsvResultsExporter, diff --git a/include/class.topic.php b/include/class.topic.php index ecaeb53b9ad2f7912e68033c48e75a3f2491a050..bfc1df37f3f710b2891ae8f906b382350ba50916 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -384,6 +384,9 @@ class Topic { foreach ($update as $idx=>&$id) { $id = sprintf("(%s,%s)", db_input($id), db_input($idx+1)); } + if (!count($update)) + return; + // Thanks, http://stackoverflow.com/a/3466 $sql = sprintf('INSERT INTO `%s` (topic_id,`sort`) VALUES %s ON DUPLICATE KEY UPDATE `sort`=VALUES(`sort`)', @@ -393,4 +396,4 @@ class Topic { } // Add fields from the standard ticket form to the ticket filterable fields -Filter::addSupportedMatches('Help Topic', array('topicId' => 'Topic ID'), 100); +Filter::addSupportedMatches(/* trans */ 'Help Topic', array('topicId' => 'Topic ID'), 100); diff --git a/include/staff/profile.inc.php b/include/staff/profile.inc.php index ff3053bdb10b3d805b039e6dd6094132808ae595..65d66172bfe8a897cc28a79a232ed80d19798895 100644 --- a/include/staff/profile.inc.php +++ b/include/staff/profile.inc.php @@ -185,10 +185,10 @@ $info['id']=$staff->getId(); <select name="default_paper_size"> <option value="none" selected="selected">— <?php echo __('None');?> —</option> <?php - $options=array('Letter', 'Legal', 'A4', 'A3'); - foreach($options as $v) { + + foreach(Export::$paper_sizes as $v) { echo sprintf('<option value="%s" %s>%s</option>', - $v,($info['default_paper_size']==$v)?'selected="selected"':'',$v); + $v,($info['default_paper_size']==$v)?'selected="selected"':'',__($v)); } ?> </select> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 3d0cd2a26c086e2e33ff87c6a303eb71c688e8fa..eb27fc2ce7bec1bbc9e9d50675cc77529f2761e9 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -915,11 +915,10 @@ $tcount+= $ticket->getNumNotes(); <select id="psize" name="psize"> <option value="">— <?php echo __('Select Print Paper Size');?> —</option> <?php - $options=array('Letter', 'Legal', 'A4', 'A3'); $psize =$_SESSION['PAPER_SIZE']?$_SESSION['PAPER_SIZE']:$thisstaff->getDefaultPaperSize(); - foreach($options as $v) { + foreach(Export::$paper_sizes as $v) { echo sprintf('<option value="%s" %s>%s</option>', - $v,($psize==$v)?'selected="selected"':'', $v); + $v,($psize==$v)?'selected="selected"':'', __($v)); } ?> </select> diff --git a/scp/profile.php b/scp/profile.php index 0914c49d814392d87b7c254f9a36998a09c6a84f..d25d545d45f374211756f638ba7ff8203b19bb56 100644 --- a/scp/profile.php +++ b/scp/profile.php @@ -15,6 +15,7 @@ **********************************************************************/ require_once('staff.inc.php'); +require_once(INCLUDE_DIR.'class.export.php'); // For paper sizes $msg=''; $staff=Staff::lookup($thisstaff->getId()); diff --git a/scp/tickets.php b/scp/tickets.php index 3664b6a1fa718807fe7789486a432ce1c46bd9d6..58aadfa3c0ffc83dadb1e37d3aa44ea95c0b807f 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -21,6 +21,7 @@ require_once(INCLUDE_DIR.'class.filter.php'); require_once(INCLUDE_DIR.'class.canned.php'); require_once(INCLUDE_DIR.'class.json.php'); require_once(INCLUDE_DIR.'class.dynamic_forms.php'); +require_once(INCLUDE_DIR.'class.export.php'); // For paper sizes $page=''; $ticket = $user = null; //clean start. @@ -616,7 +617,6 @@ if($ticket) { if($_REQUEST['a']=='open' && $thisstaff->canCreateTickets()) $inc = 'ticket-open.inc.php'; elseif($_REQUEST['a'] == 'export') { - require_once(INCLUDE_DIR.'class.export.php'); $ts = strftime('%Y%m%d'); if (!($token=$_REQUEST['h'])) $errors['err'] = __('Query token required');