Merge branch 'master' of http://git.roojs.com/Pman.Core
authorbenny <benny@roojs.com>
Tue, 4 Sep 2018 02:38:09 +0000 (10:38 +0800)
committerbenny <benny@roojs.com>
Tue, 4 Sep 2018 02:38:09 +0000 (10:38 +0800)
1  2 
DataObjects/Core_company.php

@@@ -49,7 -49,7 +49,7 @@@ class Pman_Core_DataObjects_Core_Compan
          $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'])) {
@@@ -58,7 -58,6 +58,7 @@@
              if (!empty($q['query']['company_not_self'])) {
                  $add = " AND {$tn}.id != {$x->id}";
              }
 +            
              $pids = array();
              $pid = $q['query']['company_project_id'];
              if (strpos($pid, ',')) {
              $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'])) {
                  ) 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 beforeDelete($req, $roo)
      {
 +        
          // should check for members....
          if(!empty($this->is_system) && 
              ($old->code != $this->code || $old->name != $this->name)
          }
      }
      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) {