UWVA#52916 Voortgang/notities toevoegen aan overzichtsschermen opdrachten

svn path=/Website/trunk/; revision=38482
This commit is contained in:
Alex Tiehuis
2018-07-12 10:20:13 +00:00
parent 1c2016ea1e
commit c692d0e85b

View File

@@ -427,6 +427,57 @@ function opdr_list(params)
return txt;
}
function fnLeesLaatsteNote(mld_key)
{
var noteResult;
var sqlNote = "SELECT note.mld_opdr_note_omschrijving notitie, note.mld_opdr_note_aanmaak notitiedatum" +
" FROM mld_opdr_note note" +
" WHERE note.mld_opdr_key = " + mld_key +
" AND note.mld_opdr_note_key = (SELECT MAX (n.mld_opdr_note_key)" +
" FROM mld_opdr_note n" +
" WHERE n.mld_opdr_key = " + mld_key + ")";
var oRsNote = Oracle.Execute(sqlNote);
if (oRsNote.eof)
{
noteResult = { eof: oRsNote.eof, notitie: "", notitiedatum: "" };
}
else
{
noteResult = { eof: oRsNote.eof, notitie: oRsNote("notitie").Value, notitiedatum: oRsNote("notitiedatum").Value };
}
oRsNote.Close();
return noteResult;
}
function fncolNote(oRs)
{
var noteResult = fnLeesLaatsteNote(oRs("mld_opdr_key").Value);
if (noteResult.eof)
{
return "";
}
else
{
return (outputmode == 0? I("fa-comment"): Server.HTMLEncode(noteResult.notitie)); // Hier geen safe.html omdat we voor Excel de <br> naar \n vertaling niet kunnen hebben.
// Met <br> krijg je een nieuwe rij in excel
// Zie ook ResultsetTable.formatValue (kunnen we die niet eens gaan inzetten :-)
}
}
function fncolNoteTooltip(oRs)
{
var noteResult = fnLeesLaatsteNote(oRs("mld_opdr_key").Value);
if (noteResult.eof)
{
return "";
}
else
{
var notitietext = (noteResult.notitie.length > 30? noteResult.notitie.substr(0, 30) + "..." : noteResult.notitie)
return (outputmode == 0? toDateTimeString(noteResult.notitiedatum) + ": " + notitietext : "");
}
}
function fncolObject(oRs)
{
if (oRs("objCount").Value > 20)
@@ -648,9 +699,11 @@ function opdr_list(params)
}
if (!tiny)
rst.addColumn(new Column({caption: (cnt_key? L("lcl_cnt_service_name") : L("lcl_complain")), content: "mld_stdmelding_omschrijving"}));
rst.addColumn(new Column({caption: (cnt_key? L("lcl_cnt_service_name") : L("lcl_complain")), content: "mld_stdmelding_omschrijving", tooltip: (outputmode == 0 && !frontend? fncolNoteTooltip : null)}));
if (!frontend)
rst.addColumn(new Column({caption: L("lcl_fin_note"), content: fncolNote, combine: outputmode == 0}));
else
rst.addColumn(new Column({caption: L("lcl_mld_opdr_description"), content: "mld_opdr_omschrijving"}));
rst.addColumn(new Column({caption: L("lcl_mld_opdr_description"), content: "mld_opdr_omschrijving", tooltip: (outputmode == 0 && !frontend? fncolNoteTooltip : null)}));
rst.addColumn(new Column({caption: L("lcl_orderdate"), content: "mld_opdr_datumbegin", datatype: "date", nowrap: true}));
rst.addColumn(new Column({caption: L("lcl_time"), content: "mld_opdr_datumbegin", datatype: "time", combine: true, nomidnight: true}));