X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_company.php;h=cb0af57500e0197cbfa2ee8ae22517f84e9e9d96;hb=1007a3d809e851a97b49343af72cfb91079e7b21;hp=d6c27872d92b8272d850df0cb2f0f8a39379882f;hpb=ce0fdc55c2cf4d4f70d5f4076cba621c4e0d451e;p=Pman.Core diff --git a/DataObjects/Core_company.php b/DataObjects/Core_company.php index d6c27872..cb0af575 100644 --- a/DataObjects/Core_company.php +++ b/DataObjects/Core_company.php @@ -12,7 +12,7 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject public $__table = 'core_company'; // table name public $code; // string(32) not_null public $name; // string(128) - public $remarks; // blob(65535) blob + public $remarks; // blob(65535) blobeforeDeleteb public $owner_id; // int(11) not_null public $address; // blob(65535) blob public $tel; // string(32) @@ -104,20 +104,19 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject ) as comptype_display_name "); - if(!empty($q['query']['name'])){ - $s = $this->escape($q['query']['name']); - $this->whereAdd(" - {$tn}.name LIKE '%$s%' - "); - } - if(!empty($q['search']['name'])){ - $s = $this->escape($q['search']['name']); + if(!empty($q['query']['name']) || !empty($q['search']['name'])){ + + $s = (!empty($q['query']['name'])) ? $this->escape($q['query']['name']) : $this->escape($q['search']['name']); + $this->whereAdd(" {$tn}.name LIKE '%$s%' "); } - if(!empty($q['search']['name_starts'])){ - $s = $this->escape($q['search']['name_starts']); + + if(!empty($q['query']['name_starts']) || !empty($q['search']['name_starts'])){ + + $s = (!empty($q['query']['name_starts'])) ? $this->escape($q['query']['name_starts']) : $this->escape($q['search']['name_starts']); + $this->whereAdd(" {$tn}.name LIKE '$s%' "); @@ -329,7 +328,7 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject $img->onid = $this->id; $img->find(); while ($img->fetch()) { - $img->beforeDelete(); + $img->beforeDelete(array(), $roo); $img->delete(); } return true;