$this->whereAddIn('comptype', explode(',', $q['query']['comptype']), 'string');
}
- /*if (!empty($q['query']['deleted_by'])) {
- $deleted_by = $this->escape($q['query']['deleted_by']);
- $this->whereAdd("deleted_by = '$deleted_by'");
- }*/
+
// depricated - should be moved to module specific (texon afair)
if (!empty($q['query']['province'])) {
{$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)
{
+ // 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'])){
+ $this->deleted_dt = "";
+ $this->deleted_by = 0;
+ }
if(!empty($q['_check_name'])){
if($this->checkName()){
$roo->jok('OK');
){
$roo->jerr('This company is not allow to delete');
}
+
+
}
function onDelete($req, $roo)
{
-
$img = DB_DataObject::factory('Images');
$img->ontable = $this->tableName();
$img->onid = $this->id;
{
$affects = array();
- $all_links = $x->databaseLinks();
+ $all_links = $this->databaseLinks();
foreach($all_links as $tbl => $links) {
foreach($links as $col => $totbl_col) {