{$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['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');
function beforeUpdate($old, $q,$roo)
{
-
- if(!empty($q['_flag_delete']) && $q['_flag_delete'] * 1 == 1){
+ // we still use comptype in some old systems...
+
+ if (!empty($q['comptype_id'])) {
+ $en = DB_DataObject::Factory('core_enum');
+ $en->get($q['comptype_id']);
+ $this->comptype = $en->name;
+ }
+
+
+ if(!empty($q['_flag_delete'])){
$this->deleted_dt = $this->sqlValue("NOW()");
$this->deleted_by = $roo->getAuthUser()->id;
}
- if(!empty($q['_flag_undelete']) && $q['_flag_delete'] * 1 == 1){
+ if(!empty($q['_flag_undelete'])){
$this->deleted_dt = "";
$this->deleted_by = 0;
}