* SPDX-License-Identifier: AGPL-3.0-only ************************************/ $output=''; $userid = $_REQUEST['userid']; $sharing_module=$_REQUEST['sharing_module']; $tabid=getTabid($sharing_module); $combovalues=''; global $mod_strings; global $app_strings; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; global $adb; $shareid=$_REQUEST['shareid']; $mode = $_REQUEST['mode']; $entity_id = $_REQUEST['userid']; if (!isset($_REQUEST['entity'])) $entity='Users'; else $entity = $_REQUEST['entity']; if($mode == 'create') { $shareInfo=getAllAdvSharingRulePerm($sharing_module,$entity_id); if (is_array($shareInfo)){ foreach($shareInfo as $details) { $fromtype=$details[1]; $fromid=$details[0]; $fromComboValues .=''; } } else { echo "false"; die; } } elseif($mode == 'edit') { $shareInfo=getAdvSharingRulePerm($shareid,$entity,$entity_id); //constructing the from combo values $fromtype=$shareInfo[2]; $fromid=$shareInfo[0]; $fromComboValues=''; } $relatedmodule=''; $relatedlistscombo=''; $relatedModuleSharingArr=getRelatedAdvSharingModules($tabid); $size=sizeof($relatedModuleSharingArr); if($size > 0) { if($mode=='edit') { $relatedModuleSharingPerrArr=getRelatedModuleAdvSharingPerm($shareid,$entity,$entity_id); } 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[4] == 0) { $selected1='selected'; } elseif($shareInfo[4] == 1) { $selected2='selected'; } $sharPerCombo = ''; $sharPerCombo .= ''; } //crmv@167234 //crmv@171581 $output.='
'.$mod_strings['LBL_STEP'].' 1 : '.$mod_strings['LBL_SELECT_FILTER'].'  
'; //combovalues $output .= '
'; $output.=''; $output .= '
'; $output.='
 
'.$mod_strings['LBL_STEP'].' 2 : '.$mod_strings['LBL_SELECT_PERM'].'  
'.$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; ?>