[Vtigercrm-commits] [vtiger development] #7027: Accounts without a Contact are not listed in an Accounts report

vtiger development vtiger-tickets at trac.vtiger.com
Fri Feb 25 11:39:51 PST 2011


#7027: Accounts without a Contact are not listed in an Accounts report
-------------------------+--------------------------------------------------
  Reporter:  lucvanhove  |       Owner:  developer
      Type:  defect      |      Status:  new      
  Priority:  major       |   Milestone:           
 Component:  vtigercrm   |     Version:  5.2.1    
Resolution:              |    Keywords:           
-------------------------+--------------------------------------------------
Comment (by lucvanhove):

 Replying to [ticket:7027 lucvanhove]:

 The cause of this problem is the use of '''INNER JOIN''' in the query to
 include data from '''related modules''' to which the user has access. In
 this case one should use a '''LEFT JOIN'''.

 The generation of this part of the query is done by function
 '''getNonAdminAccessControlQuery''' located in '''data\CRMEntity.php'''.

 I need an immediate solution to this problem. This is how i did it:

 1
 {{{
 In data\CRMEntity.php, function getNonAdminAccessControlQuery:

 function getNonAdminAccessControlQuery($module,$user,$scope=''){
 becomes:
 function
 getNonAdminAccessControlQuery($module,$user,$scope='',$secondary=False){

         $query = " INNER JOIN $tableName $tableName$scope ON
 $tableName$scope.id = ".
         "vtiger_crmentity$scope.smownerid ";
 becomes:
         if ($secondary) {
         $query = " LEFT JOIN";
         } else {
         $query = " INNER JOIN";
         }
         $query .= " $tableName $tableName$scope ON $tableName$scope.id =
 ".
         "vtiger_crmentity$scope.smownerid ";

 }}}


 2
 {{{
 In include\utils\UserInfoUtil.php, function getNonAdminAccessControlQuery:

 function getNonAdminAccessControlQuery($module,$user,$scope='')
 becomes:
 function
 getNonAdminAccessControlQuery($module,$user,$scope='',$secondary=false)

 $instance->getNonAdminAccessControlQuery($module,$user,$scope);
 becomes:
 $instance->getNonAdminAccessControlQuery($module,$user,$scope,$secondary);
 }}}

 3

 {{{
 In modules\Reports\ReportRun.php, function getRelatedModulesQuery:

 $query .= getNonAdminAccessControlQuery($value,$current_user,$value);
 becomes
 $query .= getNonAdminAccessControlQuery($value,$current_user,$value,True);
 }}}

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7027#comment:1>
vtiger development <http://trac.vtiger.com/>
vtigerCRM



More information about the vtigercrm-commits mailing list