* SPDX-License-Identifier: AGPL-3.0-only
************************************/
require_once('modules/CustomView/CustomView.php');
global $adb,$log,$table_prefix;
$cvid = $_REQUEST["record"];
$status = $_REQUEST["status"];
$module = $_REQUEST["dmodule"];
$now_action = $_REQUEST["action"];
if(isset($cvid) && $cvid != '')
{
$oCustomView = CRMEntity::getInstance('CustomView', $module); // crmv@115329
if($oCustomView->isPermittedCustomView($cvid,$now_action,$oCustomView->customviewmodule) == 'yes')
{
$updateStatusSql = "update ".$table_prefix."_customview set status=? where cvid=? and entitytype=?";
$updateresult = $adb->pquery($updateStatusSql, array($status, $cvid, $module));
if(!$updateresult)
echo ':#:FAILURE:#:';
else {
// crmv@49398
global $metaLogs;
if ($metaLogs) $metaLogs->log($metaLogs::OPERATION_EDITFILTER, $cvid, array('action'=>'changestatus'));
// crmv@49398e
echo ':#:SUCCESS:#:' . $module . ':#:';
}
}
else
{
global $theme, $app_strings;
echo "
";
exit;
}
}
?>