* SPDX-License-Identifier: AGPL-3.0-only ************************************/ //Constructing the Role Array $roleDetails=getAllRoleDetails(); //Removing the Organisation role from the role array unset($roleDetails['H1']); $output=''; //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); } if($mode == 'create') { foreach($roleDetails as $roleid=>$rolename) { $combovalues .=''; //crmv@167234 } foreach($roleDetails as $roleid=>$rolename) { $combovalues .=''; //crmv@167234 } foreach($grpDetails as $groupid=>$groupname) { $combovalues .=''; //crmv@167234 } $fromComboValues=$combovalues; $toComboValues=$combovalues; } elseif($mode == 'edit') { //constructing the from combo values $fromtype=$shareInfo[3]; $fromid=$shareInfo[5]; foreach($roleDetails as $roleid=>$rolename) { $selected=''; if($fromtype == 'roles') { if($roleid == $fromid) { $selected='selected'; } } $fromComboValues .=''; //crmv@167234 } foreach($roleDetails as $roleid=>$rolename) { $selected=''; if($fromtype == 'rs') { if($roleid == $fromid) { $selected='selected'; } } $fromComboValues .=''; //crmv@167234 } foreach($grpDetails as $groupid=>$groupname) { $selected=''; if($fromtype == 'groups') { if($groupid == $fromid) { $selected='selected'; } } $fromComboValues .=''; //crmv@167234 } //constructing the to combo values $totype=$shareInfo[4]; $toid=$shareInfo[6]; foreach($roleDetails as $roleid=>$rolename) { $selected=''; if($totype == 'roles') { if($roleid == $toid) { $selected='selected'; } } $toComboValues .=''; //crmv@167234 } foreach($roleDetails as $roleid=>$rolename) { $selected=''; if($totype == 'rs') { if($roleid == $toid) { $selected='selected'; } } $toComboValues .=''; //crmv@167234 } foreach($grpDetails as $groupid=>$groupname) { $selected=''; if($totype == 'groups') { if($groupid == $toid) { $selected='selected'; } } $toComboValues .=''; //crmv@167234 } } $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.='