function applyFilters($q, $au)
{
- DB_DataObject::debugLevel(1);
+// DB_DataObject::debugLevel(1);
if (!empty($q['query']['empty_etype'])) {
$this->whereAdd("etype = ''");
}
}
- $this->autoJoin();
+ if(!empty($q['query']['search'])) {
+ $name = $this->escape($q['query']['search']);
+ // ilike on postgres?!?
+ $this->whereAdd("
+ core_enum.name LIKE '%{$name}%'
+ OR
+ core_enum.display_name LIKE '%{$name}%'
+ ");
+ }
+
// print_r($this);
if(!empty($q['id'])){
$this->id = $q['id'];
CASE WHEN
'$l' = 'en' THEN display_name
ELSE
- cms_templatestr.txt
+ CASE WHEN cms_templatestr.txt IS NOT NULL AND cms_templatestr.txt != '' THEN
+ cms_templatestr.txt
+ ELSE
+ display_name
+ END
END as display_name_tr
");
* @return array ID of core_enum
*/
- function lookupAllByName($etype,$name) {
+ function lookupAllByName($etype,$names) {
$ce = DB_DataObject::Factory('core_enum');
$ce->etype = $etype;
- $ce->whereAddIn('name', $name, 'string');
+ $ce->whereAddIn('name', $names, 'string');
if ($ce->count() > 0) {
return $ce->fetchAll('id');