<%@ language="javascript"%> <% /* $Revision$ $Id$ File: opdr_show_note.asp Description: Toont een overzicht van de notes die aan het filter voldoen Dit zal alleen zijn als Behorend bij een bepaalde opdracht Parameters: opdr_key Note: */%> <% FCLTHeader.Requires({ }) var opdr_key = getQParamInt("opdr_key"); var urole = getQParamSafe("urole", "fe"); var embedded = getQParamInt("embedded", -1); var outputmode = getQParamInt("outputmode", 0); var showall = getQParamInt("showall", 0) == 1; var tracking = getQParamInt("tracking", 1) == 1; // tracking erbij tonen? Onderdrukken met 0 cache.whenNoRecords("SELECT 1 FROM mld_opdr_note WHERE mld_opdr_key = " + opdr_key); var this_opdr = mld.func_enabled_opdracht(opdr_key); // wat mag ik zoal op deze opdracht user.auth_required_or_abort(this_opdr.canShowOpdrNote); mld_opdr = mld.mld_opdr_info(opdr_key); lcl.set_dialect(mld_opdr.opdr_type, "MLD_TYPEOPDR_KEY"); %>
<% FCLTHeader.Generate({outputmode: outputmode}); %>
<% function fnPerslidNaamFull(oRs) { var html = "" + safe.html(oRs("prs_perslid_naam_full").Value) + ""; return html; } var buttons = []; buttons.push({ icon: "page_refresh.png", title: L("lcl_refresh"), action: "FcltMgr.reload()" }); if (this_opdr.canEditOpdrNote) // Manual allowed { var sql = "SELECT mld_opdr_note_key, prs_perslid_key" + " FROM mld_opdr_note" + " WHERE mld_opdr_key =" + opdr_key + " ORDER BY mld_opdr_note_aanmaak DESC"; var oRs = Oracle.Execute(sql); if (!oRs.eof) { if (user.isCollega(oRs("prs_perslid_key").Value)) { buttons.push({title: L("lcl_change"), icon: "wijzigen.png", action: "opdr_notechange(" + oRs("mld_opdr_note_key").Value + ")", id: "bedit_opdr_note"}); } } oRs.Close(); buttons.push({title: L("lcl_add"), icon: "plus.png", action:"opdr_notechange()", id:"bchange_opdr_note" }); } function fnrowClass(oRs) { var rclass = "" if (oRs("prs_perslid_key").Value == user_key) rclass = rclass + "self"; if (oRs("fac_srtnotificatie_code").Value) rclass = rclass + " trtrack"; else rclass = rclass + " trnote"; return rclass; } function fnOmschrijving(oRs) { var html = ""; if (oRs("mld_opdr_note_omschrijving").Value) html = safe.mldlinkhtml(safe.html(oRs("mld_opdr_note_omschrijving").Value)); else if (oRs("fac_srtnotificatie_code").Value) html = status.getsrtnotificatietext(oRs("fac_srtnotificatie_code").Value); return html; } var sql = "SELECT n.mld_opdr_note_aanmaak" + ", n.mld_opdr_note_key" + ", pf.prs_perslid_key" + ", pf.prs_perslid_naam_full" + ", n.mld_opdr_note_omschrijving" + ", NULL fac_srtnotificatie_code" + " FROM mld_opdr_note n, prs_v_perslid_fullnames_all pf" + " WHERE n.prs_perslid_key = pf.prs_perslid_key (+)" + " AND n.mld_opdr_key = " + opdr_key; var sqls = [sql]; if (S("mld_opdr_merge_notes_and_tracking") == 1 && tracking) // tracking info erbij? { var sql = "SELECT tr.fac_tracking_datum" + " , tr.fac_tracking_key" + " , tr.prs_perslid_key" + " , pf.prs_perslid_naam_friendly" + " , tr.fac_tracking_oms" + " , str.fac_srtnotificatie_code" + " FROM fac_tracking tr, fac_srtnotificatie str, prs_v_perslid_fullnames_all pf" + " WHERE tr.fac_srtnotificatie_key = str.fac_srtnotificatie_key" + " AND tr.prs_perslid_key = pf.prs_perslid_key (+)" + " AND (tr.fac_tracking_refkey = " + opdr_key + " AND str.fac_srtnotificatie_xmlnode IN ('opdracht'))"; sqls.push(sql); } sql = "SELECT * FROM ("+ sqls.join(" UNION ") + ") ORDER BY 1" + (S("mld_note_sort_ascending") == 0 ? " DESC " : "") var rst = new ResultsetTable({ sql:sql, keyColumn: "mld_opdr_note_key", noPrint:(embedded != -1), ID: "notestable", buttons: buttons, title: (opdr_key == -1 || S("mld_opdr_merge_notes_and_tracking") == 0 ? L("lcl_opdr_frame_notes"): L("lcl_opdr_frame_trackandnotes")), rowClass: fnrowClass, outputmode: outputmode, showAll: showall, emptySetString : L("lcl_mld_note_emptyset") }); rst.addColumn(new Column({caption: L("lcl_date"), content: "mld_opdr_note_aanmaak", datatype:"date", prettydate: true, nowrap: true})); rst.addColumn(new Column({caption: L("lcl_time"), content: "mld_opdr_note_aanmaak", datatype:"time"})); rst.addColumn(new Column({caption: L("lcl_mld_changedby"), content: fnPerslidNaamFull})); rst.addColumn(new Column({caption: L("lcl_mld_note"), content: fnOmschrijving})); var cnt = rst.processResultset(); %>