PCHD#35087 Waarschuwing bij gelijktijdig editen notities
svn path=/Website/trunk/; revision=29622
This commit is contained in:
@@ -151,4 +151,36 @@ function note_save(mld_key, note, params)
|
||||
}
|
||||
return note_key || params.note_key;
|
||||
}
|
||||
|
||||
function note_recently_changed(mld_key, lastdate)
|
||||
{
|
||||
// Is de melding recent nog gewijzigd.
|
||||
var changedby = "";
|
||||
var sql_t = "SELECT t.fac_tracking_datum"
|
||||
+ " , " + S("prs_pers_string") + " naam"
|
||||
+ " FROM (SELECT f.fac_tracking_datum"
|
||||
+ " , f.prs_perslid_key"
|
||||
+ " , f.fac_tracking_refkey mld_melding_key"
|
||||
+ " FROM fac_tracking f"
|
||||
+ " , fac_srtnotificatie n"
|
||||
+ " WHERE f.fac_srtnotificatie_key = n.fac_srtnotificatie_key"
|
||||
+ " AND n.fac_srtnotificatie_xmlnode = 'melding'"
|
||||
+ " UNION "
|
||||
+ "SELECT mld_melding_note_aanmaak"
|
||||
+ " , prs_perslid_key"
|
||||
+ " , mld_melding_key"
|
||||
+ " FROM mld_melding_note"
|
||||
+ ") t"
|
||||
+ " , prs_perslid p"
|
||||
+ " WHERE t.prs_perslid_key = p.prs_perslid_key"
|
||||
+ " AND t.mld_melding_key = " + mld_key
|
||||
+ " AND t.fac_tracking_datum > " + lastdate.toSQL(true)
|
||||
+ " ORDER BY t.fac_tracking_datum DESC";
|
||||
var oRs_t = Oracle.Execute(sql_t);
|
||||
if (!oRs_t.eof)
|
||||
{
|
||||
changedby = oRs_t("naam").Value;
|
||||
}
|
||||
return changedby;
|
||||
}
|
||||
%>
|
||||
@@ -22,6 +22,9 @@ var JSON_Result = true;
|
||||
<!-- #include file="mld_edit_note.inc" -->
|
||||
<%
|
||||
var mld_key = getQParamInt("mld_key");
|
||||
var notestamp = getFParamDate("notestamp", new Date);
|
||||
|
||||
var changedby = note_recently_changed(mld_key, notestamp);
|
||||
|
||||
var note_key =
|
||||
note_save(mld_key,
|
||||
@@ -32,7 +35,8 @@ var note_key =
|
||||
|
||||
var result = {success: true,
|
||||
mld_key: mld_key,
|
||||
note_key: note_key
|
||||
note_key: note_key,
|
||||
changedby: changedby
|
||||
};
|
||||
|
||||
Response.Write(JSON.stringify(result));
|
||||
|
||||
@@ -38,6 +38,7 @@ user.auth_required_or_abort(!mfe.haveOnlyFErights); // FE only mag hier helemaal
|
||||
|
||||
var eigenMelding = user_key == mld_info.melder_key || user.isCollega(mld_info.melder_key);
|
||||
var afgehandeld = (mld_info.mld_status == 1 || mld_info.mld_status == 5 || mld_info.mld_status == 6);
|
||||
var timestamp_notes = Date.parse(new Date());
|
||||
|
||||
%>
|
||||
<html>
|
||||
@@ -67,6 +68,8 @@ var afgehandeld = (mld_info.mld_status == 1 || mld_info.mld_status == 5 || mld_i
|
||||
}
|
||||
function note_submit_callback(json)
|
||||
{
|
||||
if (json.changedby != "")
|
||||
alert(L("lcl_mld_is_updatedby").format(json.changedby));
|
||||
window.location.href = "mld_show_note2.asp?urole=<%=urole%>&mld_key=<%=mld_key%>&tracking=<%=tracking?1:0%>";
|
||||
}
|
||||
|
||||
@@ -287,6 +290,7 @@ var afgehandeld = (mld_info.mld_status == 1 || mld_info.mld_status == 5 || mld_i
|
||||
<tr><td></td><td>
|
||||
<div class='mldhandlingdiv'>
|
||||
<form name=u2 method=post action="mld_edit_note_save.asp?mld_key=<%=mld_key%>&urole=<%=urole%>¬e_key=<%=note_key%>">
|
||||
<input type="hidden" name="notestamp" id="notestamp" value="<%=timestamp_notes%>">
|
||||
<textarea id='note' name='note' class='fldtxt' rows='4' cols='80' maxlength='4000'><%=safe.textarea(note_oms)%></textarea>
|
||||
<%
|
||||
if (mld_info.fenotes & 2 || mld_info.fenotes == 0)
|
||||
|
||||
Reference in New Issue
Block a user