FCLT#81771 Aanpassen planning geschedulde rapportages

svn path=/Website/trunk/; revision=64283
This commit is contained in:
Erik Groener
2024-04-17 13:05:18 +00:00
parent 288f5a8f03
commit 8a90b8c9e7
6 changed files with 39 additions and 10 deletions

View File

@@ -13,7 +13,7 @@
%>
<%
function model_fac_notificatie_job(niveau) // J voor Jobs, S voor Scheduled mail
function model_fac_notificatie_job(usrrap_key, params) // J voor Jobs, S voor Scheduled mail
{
this.records_name = "notificationjobs";
this.record_name = "notificationjob";
@@ -129,10 +129,15 @@ function model_fac_notificatie_job(niveau) // J voor Jobs, S voor Scheduled mail
"label": L("fac_notificatie_job_queue"),
"typ": "varchar",
"defaultvalue": "DEFAULT"
},
"fac_usrrap_key": {
dbs: "fac_usrrap_key",
typ: "key",
hidden_fld: true
}
};
if (niveau == 'S')
if (params.niveau == 'S')
{
delete this.fields["flags"];
delete this.fields["jobmode"];
@@ -151,6 +156,16 @@ function model_fac_notificatie_job(niveau) // J voor Jobs, S voor Scheduled mail
gparams.GET.wheres.push("prs_perslid_key_receiver = " + user_key); // alleen van jezelf
this.autfunction = false;
}
this.list = {
columns: [
"person",
"receiver",
"interval",
"lastrun",
"nextrun"
]
};
}
else
{
@@ -161,14 +176,15 @@ function model_fac_notificatie_job(niveau) // J voor Jobs, S voor Scheduled mail
wheres: ["fac_notificatie_job_view IS NOT NULL"]
}
};
if (user.has("WEB_PRSSYS"))
{
this.REST_POST = generic_REST_POST(this);
}
}
this.REST_GET = generic_REST_GET(this, gparams);
if (user.has("WEB_PRSSYS"))
{
this.REST_POST = generic_REST_POST(this);
}
this.REST_PUT = generic_REST_PUT(this);
this.REST_PUT = generic_REST_PUT(this);
this.REST_DELETE = generic_REST_DELETE(this);
}
%>

View File

@@ -13,6 +13,7 @@
*/
%>
<!-- #include file="./model_reportcolumns.inc" -->
<!-- #include file="./model_fac_notificatie_job.inc" -->
<%
function model_reportsx(usrrap_key, rapparams)
@@ -267,6 +268,11 @@ function model_reportsx(usrrap_key, rapparams)
"model": new model_reportcolumns(usrrap_key, { internal: rapparams.internal }),
"joinfield": "fac_usrrap_key",
"enable_update": true
},
"notificationjobs": {
"model": new model_fac_notificatie_job(usrrap_key, { niveau: "S"}),
"joinfield": "fac_usrrap_key",
"enable_update": true
}
};
@@ -364,7 +370,7 @@ function model_reportsx(usrrap_key, rapparams)
+ (query.wheres.length ? " WHERE " + query.wheres.join(" AND " ) : "")
+ " ORDER BY fac_usrrap_volgnr NULLS LAST, fac_usrrap_omschrijving";
if (params.include && params.include.length)
if (params.include && params.include.length && inArray("columns", params.include))
sql += ", fac_usrrap_cols_volgnr";
var json = api2.sql2json (params, sql, this);

View File

@@ -17,7 +17,7 @@
<%
var niveau = getQParam("niveau", "J"); // J voor Jobs, S voor Scheduled mail
var this_model = new model_fac_notificatie_job(niveau);
var this_model = new model_fac_notificatie_job(-1, { niveau: niveau});
var scf_params =
{

View File

@@ -125,6 +125,7 @@ function scaffolding_list(model, scf_params)
}
<%
var urlMail = "../shared/queuemail_schedule.asp?pmodule=FAC&defemail_key=" + user_key
+ transit
+ "&subject=" + Server.URLencode(model.records_title);
// outputmode komt er in het save-script nog bij
var geturl = Request.ServerVariables("SCRIPT_NAME") + "?formail=1&showall=1" + transitQS();

View File

@@ -23,6 +23,7 @@ FCLTHeader.Requires({plugins:[],
js: ["jquery.timepicker-table.js"],
css: ["timePicker-table.css"]});
var usrrap_key = getQParamInt("usrrap_key", -1);
var subject = getQParam("subject", "");
%>
@@ -74,6 +75,7 @@ var subject = getQParam("subject", "");
<% MODAL_START(); %>
<form name="u2" id="u2" method="post">
<input type="hidden" name="geturl" id="geturl" value="">
<input type="hidden" name="fac_usrrap_key" id="fac_usrrap_key" value="<%=usrrap_key%>">
<%
MODAL_BLOCK_START("emailInput", subject, { icon: "fa-envelope" });

View File

@@ -21,6 +21,7 @@ var job_key = getQParamInt("key", -1);
var once = getFParamInt("fac_sched", 0) == 0;
var geturl = getFParam("geturl");
var usrrap_key = getFParamInt("fac_usrrap_key", -1);
geturl += "&outputmode=" + getFParamInt("q_outputmode", 1);
@@ -56,7 +57,10 @@ else
{ dbs: "fac_notificatie_job_interval", typ: "number", frm: "interval" },
{ dbs: "prs_perslid_key", typ: "key", val: user_key }, // eigenaar
{ dbs: "prs_perslid_key_receiver", typ: "key", frm: "sName_key" } ];
if (usrrap_key > 0)
{
fields.push({ dbs: "fac_usrrap_key", typ: "key", frm: "fac_usrrap_key" } );
}
if (job_key > 0)
{
jobUpd = buildTrackingUpdate("fac_notificatie_job", "fac_notificatie_job_key = " + job_key, fields);