[Vtigercrm-commits] [Vtiger development] #7962: $currentModule in getListButtons() in CRMEntity.php out-of-scope

Vtiger development vtiger-tickets at trac.vtiger.com
Thu Feb 20 11:41:45 GMT 2014


#7962: $currentModule in getListButtons() in CRMEntity.php out-of-scope
------------------------+------------------------
 Reporter:  alanlord    |      Owner:  developer
     Type:  defect      |     Status:  new
 Priority:  unassigned  |  Milestone:  Unassigned
Component:  vtigercrm   |    Version:  5.4.0
 Severity:  Medium      |   Keywords:
------------------------+------------------------
 A customer said the Delete Button in List Views was not being hidden when
 a profile was set to disable deletion.

 Oddly, it works OK in Accounts, Contacts and Leads but not in any other
 module.


 {{{
 function getListButtons($app_strings) {
         $list_buttons = Array();

         if (isPermitted($currentModule, 'Delete', '') == 'yes')
                 $list_buttons['del'] = $app_strings[LBL_MASS_DELETE];
         if (isPermitted($currentModule, 'EditView', '') == 'yes') {
                 $list_buttons['mass_edit'] = $app_strings[LBL_MASS_EDIT];
                 // Mass Edit could be used to change the owner as well!
                 //$list_buttons['c_owner'] =
 $app_strings[LBL_CHANGE_OWNER];
         }
         return $list_buttons;
 }
 }}}

 Note that it is using the global var $currentModule but this is outside
 the scope of this function.

 Adding

 {{{
 global $currentModule;
 }}}

 to the top of the function fixes this bug.

--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7962>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM


More information about the vtigercrm-commits mailing list