<%@ LANGUAGE = JavaScript %>
<% /*
    $Revision$
    $Id$

    File:           job_delete.asp
    Status:         100%
    Description:    Verwijderen van een (1) fac_activiteit

    Parameters:
    Context:        Vanuit show-schermen en of vanuit overzichten
    Result:         JSON object
    Note:

*/
var JSON_Result = true;
%>
<!--#include file="../Shared/common.inc"-->
<!--#include file="./job.inc"-->
<%
protectRequest.validateToken();

var job_key_arr = getFParamKeyArray("key");
// var level = getFParam("level"); // Unused

for (var i = 0; i < job_key_arr.length; i++)
{
	var this_job = job.func_enabled_job(job_key_arr[i]);
	user.auth_required_or_abort(this_job.canWrite);

	// We hebben er nu cascades op staan, en de historie is minder dan irrelevant.
	sql = "DELETE FROM fac_activiteit WHERE fac_activiteit_key = " + job_key_arr[i];

	result = { success: true, deleted: true };
	var err = Oracle.Execute(sql, true);
	if (err.friendlyMsg)
	{
		result.message = err.friendlyMsg;
		result.success = false;
		result.deleted = false;
	}
}

Response.Write(JSON.stringify(result));

ASPPAGE_END();
%>
