[Vtigercrm-developers] Question on Role based Picklists
Alan Lord
alanslists at gmail.com
Fri Feb 27 15:03:57 GMT 2015
In Vtiger_Module_Model you get the User_Record_model twice where only
once seems necessary to me...:
> public function getPicklistValues() {
> $fieldDataType = $this->getFieldDataType();
> if($this->getName() == 'hdnTaxType') return null;
>
> if($fieldDataType == 'picklist' || $fieldDataType == 'multipicklist') {
> $currentUser = Users_Record_Model::getCurrentUserModel();
^^^ Get current User Record Model ^^^
> if($this->isRoleBased()) {
> $userModel = Users_Record_Model::getCurrentUserModel();
^^^Get current User Record Model again ^^^
> $picklistValues = Vtiger_Util_Helper::getRoleBasedPicklistValues($this->getName(), $userModel->get('roleid'));
> }else{
> $picklistValues = Vtiger_Util_Helper::getPickListValues($this->getName());
> }
> foreach($picklistValues as $value) {
> $fieldPickListValues[$value] = vtranslate($value,$this->getModuleName());
> }
> return $fieldPickListValues;
> }
> return null;
> }
Cheers
Al
More information about the vtigercrm-developers
mailing list