* SPDX-License-Identifier: AGPL-3.0-only
************************************/
if (isPermitted('Calendar','Delete',$_REQUEST['related_id'] == 'no')) {
echo "";
echo "
";
die;
}
require_once('modules/Calendar/Activity.php');
$focus = CRMEntity::getInstance('Activity');
//Added to fix 4600
$url = getBasic_Advance_SearchURL();
if(!isset($_REQUEST['record']))
die($mod_strings['ERR_DELETE_RECORD']);
global $adb,$table_prefix;
if ($_REQUEST['type'] == 'children')
$adb->pquery('delete from '.$table_prefix.'_seactivityrel where crmid = ? and activityid = ?',array($_REQUEST['record'],$_REQUEST['related_id']));
elseif ($_REQUEST['type'] == 'fathers')
$adb->pquery('delete from '.$table_prefix.'_seactivityrel where crmid = ? and activityid = ?',array($_REQUEST['related_id'],$_REQUEST['record']));
header("Location: index.php?module=Calendar&action=DetailView&record=".$_REQUEST['record']);
//crmv@17001e
?>