SVRZ#57061 Notificaties MLDNOT en MLDNOB nemen nu ook de juist afzender in acht.

svn path=/Website/branches/v2019.1/; revision=41845
This commit is contained in:
2019-03-28 14:31:10 +00:00
parent 1adfb5e143
commit 3b0301c5cb

View File

@@ -127,13 +127,14 @@ function note_save(mld_key, note, params)
if (txt.length > 80)
txt = txt.substr(0, 80);
txt = txt + "...";
var sender = getNotiSenderEmail(mld_key);
Oracle.Execute("BEGIN fac.putnotificationsrtprio("
+ "NULL, "
+ mld_info.melder_key
+ ", 'MLDNOT', "
+ mld_key
+ ", " + safe.quoted_sql(txt)
+ ", NULL, NULL, NULL, NULL, 2, NULL); END;");
+ ", NULL, NULL, NULL, NULL, 2, " + safe.quoted_sql(sender) + "); END;");
}
if (params.action2FE && (mld_info.actiecode & 2) != 2) // Misschien actie naar FE
{
@@ -182,6 +183,7 @@ function note_save(mld_key, note, params)
var oRs = Oracle.Execute(omssql);
var oms = L(oRs("fac_srtnotificatie_oms").Value, { autolcl: true });
oRs.Close();
var sender = getNotiSenderEmail(mld_key);
Oracle.Execute("BEGIN fac.putnotificationsrtprio("
+ "NULL"
+ ", "
@@ -190,7 +192,7 @@ function note_save(mld_key, note, params)
+ ", "
+ mld_key
+ ", mld.mldsprintf(" + safe.quoted_sql(oms) + ", " + mld_key + ")"
+ ", NULL, NULL, NULL, NULL, 2, NULL); END;");
+ ", NULL, NULL, NULL, NULL, 2, " + safe.quoted_sql(sender) + "); END;");
}
}
@@ -243,4 +245,29 @@ function note_recently_changed(mld_key, lastdate)
oRs_t.Close();
return changedby;
}
function getNotiSenderEmail(mldkey)
{ // Deze functie volgt dezelfde logica als fac.notifytracking wat betreft het ophalen van het afzend emailadres
var sql = "SELECT COALESCE (d.ins_discipline_email,"
+ " l1.alg_locatie_email,"
+ " l2.alg_locatie_email)"
+ " sender"
+ " FROM mld_melding m,"
+ " mld_stdmelding stdm,"
+ " ins_tab_discipline d,"
+ " mld_adres ma,"
+ " alg_locatie l1,"
+ " alg_locatie l2"
+ " WHERE stdm.mld_stdmelding_key = m.mld_stdmelding_key"
+ " AND d.ins_discipline_key = stdm.mld_ins_discipline_key"
+ " AND m.mld_adres_key = ma.mld_adres_key(+)"
+ " AND ma.alg_locatie_key = l1.alg_locatie_key(+)"
+ " AND m.mld_alg_locatie_key = l2.alg_locatie_key(+)"
+ " AND m.mld_melding_key = " + mldkey;
var oRs = Oracle.Execute(sql);
var sender = oRs("sender").Value;
oRs.Close();
return sender;
}
%>