* 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.='