{$tn}.name LIKE '%$s%'
");
}
+ if(!empty($q['search']['name'])){
+ $s = $this->escape($q['search']['name']);
+ $this->whereAdd("
+ {$tn}.name LIKE '%$s%'
+ ");
+ }
if(!empty($q['search']['name_starts'])){
$s = $this->escape($q['search']['name_starts']);
$this->whereAdd("
function beforeInsert($q, $roo)
{
+ // we still use comptype in some old systems...
+
+ if(!empty($q['_merge_id'])){
+ $this->merge($q['_merge_id'], $roo);
+ }
+
+ if (!empty($q['comptype_id'])) {
+ $en = DB_DataObject::Factory('core_enum');
+ $en->get($q['comptype_id']);
+ $this->comptype = $en->name;
+ }
+
if(!empty($q['_check_name'])){
if($this->checkName()){
$roo->jok('OK');
$roo->jerr('EXIST');
}
- if(!empty($q['_merge_id'])){
- $this->merge($q['_merge_id'], $roo);
- }
-
if(!empty($this->is_system) &&
($old->code != $this->code ) // used to be not allowed to change name..
){