$x = DB_DataObject::factory('core_company');
$x->comptype= 'OWNER';
$x->find(true);
-
+
if (!empty($q['query']['company_project_id'])) {
$add = '';
if (!empty($q['query']['company_include_self'])) {
if (!empty($q['query']['company_not_self'])) {
$add = " AND {$tn}.id != {$x->id}";
}
+
$pids = array();
$pid = $q['query']['company_project_id'];
if (strpos($pid, ',')) {
) as comptype_display_name
");
- if(!empty($q['search']['name'])){
- $s = $this->escape($q['search']['name']);
+ if(!empty($q['query']['name'])){
+ $s = $this->escape($q['query']['name']);
$this->whereAdd("
{$tn}.name LIKE '%$s%'
");
function beforeUpdate($old, $q,$roo)
{
+
+ if(!empty($q['_flag_delete']) && $q['_flag_delete'] * 1 == 1){
+ $this->deleted_dt = $this->sqlValue("NOW()");
+ $this->deleted_by = $roo->getAuthUser()->id;
+ }
+
+ if(!empty($q['_flag_undelete']) && $q['_flag_undelete'] * 1 == 1){
+ $this->deleted_dt = "";
+ $this->deleted_by = 0;
+ }
if(!empty($q['_check_name'])){
if($this->checkName()){
$roo->jok('OK');
function beforeDelete($req, $roo)
{
+
// should check for members....
if(!empty($this->is_system) &&
($old->code != $this->code || $old->name != $this->name)
){
$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;
return true;
}
-
+ print_r($au->company()->comptype);exit;
if ($au->company()->comptype != 'OWNER') {