* SPDX-License-Identifier: AGPL-3.0-only ************************************/ //Constructing the Role Array $roleDetails=getAllRoleDetailsUser(); $output=''; $userid = $_REQUEST['userid']; //Constructing the Group Array $grpDetails=getAllGroupName(); $combovalues=''; global $mod_strings; global $app_strings; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; global $adb; $mode = $_REQUEST['mode']; if(isset($_REQUEST['shareid']) && $_REQUEST['shareid'] != '') { $shareid=$_REQUEST['shareid']; $shareInfo=getSharingRuleInfo($shareid); $tabid=$shareInfo[1]; $sharing_module=getTabModuleName($tabid); } else { $sharing_module=$_REQUEST['sharing_module']; $tabid=getTabid($sharing_module); } eval(Users::m_de_cryption()); eval($hash_version[10]); if($mode == 'create') { foreach($roleDetails as $roleid=>$rolename) { if ($roleid != $userid) $combovalues .=''; } $toComboValues=''; $fromComboValues=$combovalues; } elseif($mode == 'edit') { //constructing the from combo values $fromtype=$shareInfo[3]; $fromid=$shareInfo[5]; $toComboValues=''; //constructing the to combo values $totype=$shareInfo[4]; $toid=$shareInfo[6]; foreach($roleDetails as $roleid=>$rolename) { $selected=''; if($totype == 'usr' && $roleid !=$userid) { if($roleid == $fromid) { $selected='selected'; } $fromComboValues .=''; } } } $relatedmodule=''; $relatedlistscombo=''; $relatedModuleSharingArr=getRelatedSharingModules($tabid); $size=sizeof($relatedModuleSharingArr); if($size > 0) { if($mode=='edit') { $relatedModuleSharingPerrArr=getRelatedModuleSharingPermission($shareid); } foreach($relatedModuleSharingArr as $reltabid=>$relmode_shareid) { $rel_module=getTabModuleName($reltabid); $relatedmodule .=$rel_module.'###'; } foreach($relatedModuleSharingArr as $reltabid=>$relmode_shareid) { $ro_selected=''; $rw_selected=''; $rel_module=getTabModuleName($reltabid); if($mode=='create') { $ro_selected='selected'; } elseif($mode=='edit') { $perr=$relatedModuleSharingPerrArr[$reltabid]; if($perr == 0) { $ro_selected='selected'; } elseif($perr == 1) { $rw_selected='selected'; } } $relatedlistscombo.=''.$app_strings[$rel_module].' : '; $relatedlistscombo.='
'; } } if($mode == 'create') { $sharPerCombo = ''; $sharPerCombo .= ''; } elseif($mode == 'edit') { $selected1=''; $selected2=''; if($shareInfo[7] == 0) { $selected1='selected'; } elseif($shareInfo[7] == 1) { $selected2='selected'; } $sharPerCombo = ''; $sharPerCombo .= ''; } //crmv@167234 //crmv@171581 $output.='
'.$mod_strings['LBL_STEP'].' 1 : '.$display_module.' '.$app_strings['LBL_LIST_OF'].' ('.$mod_strings['LBL_SELECT_ENTITY'].')  
'; //combovalues $output .= '
'; $output.=''; $output .= '
'; $output.='
 
 
'.$mod_strings['LBL_STEP'].' 2 : '.$mod_strings['LBL_CAN_BE_ACCESSED_BY'].' ('.$mod_strings['LBL_SELECT_ENTITY'].')
 
'.$mod_strings['LBL_PERMISSIONS'].'
 
'.$mod_strings['LBL_STEP'].' 3 : '.$mod_strings['LBL_ACCESS_RIGHTS_FOR_MODULES'].'  
'; $output .=$relatedlistscombo.'
 
 
'.$mod_strings['LBL_RULE_CONSTRUCTION'].'
 
 
  
'; //crmv@167234e $output.='
'; // crmv@104853 if ($sharing_module == 'Accounts') { $display_module = $app_strings['Accounts'] . ' & ' . $app_strings['Contacts']; } else { $display_module = $app_strings[$sharing_module]; } $display_module .= ' - '; if ($mode == 'edit') { $display_module .= $mod_strings['LBL_EDIT_CUSTOM_RULE']; } else { $display_module .= $mod_strings['LBL_ADD_CUSTOM_RULE']; } $display_module = Zend_Json::encode($display_module); $output .= ''; // crmv@104853e echo $output;