X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FI18n.php;fp=DataObjects%2FI18n.php;h=c85a036b5e3bef46af8ad6c6c5af99746349307c;hp=3f52fb5a58c962a6ef643df2742cbfffe9b7fd79;hb=79741fba3c1ea2be48c0eb088161c5e97c4753f7;hpb=cd94d312a825c83ccc154c4b0c6bee4bb1d8c34c diff --git a/DataObjects/I18n.php b/DataObjects/I18n.php index 3f52fb5a..c85a036b 100644 --- a/DataObjects/I18n.php +++ b/DataObjects/I18n.php @@ -127,9 +127,23 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject $this->buildDB(); // ensure we have the full database... $this->selectAdd(" + id as id, i18n_translate(ltype, lkey, 'en') as lval_en "); } + + if (!empty($q['_as_code_and_title'])) { + $tn = $this->tableName(); + + $this->selectAdd(); + $this->selectAdd(" + {$tn}.lval as title, + {$tn}.lkey as code + "); + if (!empty($q['_title'])) { + $this->whereAdd("{$tn}.lval like '{$this->escape($_REQUEST['_title'])}%'"); + } + } if (!empty($q['!code'])) { $this->whereAddIn('!lkey', explode(',', $q['!code']), 'string'); @@ -140,6 +154,10 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject $this->whereAdd("upper(lval) LIKE '%{$v}%'"); } + if (!empty($q['query']['name_starts'])) { + $this->whereAdd("lval LIKE '". $this->escape($q['query']['name_starts']). "%'"); + } + if (!empty($q['_filtered']) && !empty($this->ltype)) { $cfg = $this->cfg(); $filter = $cfg[$this->ltype];