<%@ language="javascript"%> <% /* $Revision$ $Id$ File: cad/rap_prs.asp Description: Inhoud van het PRS-tabblad van FG Parameters: floorKey (required) highlight (optional list of room-keys to filter) Context: - Note: */%> <% var floorKey = getQParamInt("vKey", -1); var highlight_arr = getQParamIntArray("highlight", []); // Comma-separated room_key_list (terrains). Optional var outputmode = getQParamInt("outputmode", 0); var showall = getQParamInt("showall", 0) == 1; if (floorKey != -1) { // werkplekken: Personen binnen de geselecteerde ruimtes, of de werkplekken van gezochte personen sql = " SELECT l.alg_ruimte_aanduiding, pf.prs_perslid_naam_full naam, p.prs_perslid_telefoonnr,p.prs_perslid_mobiel," + " p.prs_perslid_email email, "+S("prs_dep_string")+" afd, " + lcl.xsqla('p.prs_srtperslid_omschrijving', 'p.prs_srtperslid_key') + ", p.prs_perslid_upper, pwp.prs_perslidwerkplek_key, p.prs_perslid_key" + " FROM (SELECT PRS_P.prs_perslid_key," + " PRS_P.prs_perslid_upper," + " PRS_P.prs_perslid_telefoonnr," + " PRS_P.prs_perslid_email," + " PRS_P.prs_perslid_mobiel," + " PRS_P.prs_afdeling_key," + " PRS_S.prs_srtperslid_omschrijving," + " PRS_S.prs_srtperslid_key" + " FROM prs_v_aanwezigperslid PRS_P," + " prs_afdeling PRS_A," + " prs_srtperslid PRS_S" + " WHERE PRS_P.prs_afdeling_key = PRS_A.prs_afdeling_key" + " AND PRS_P.prs_srtperslid_key = PRS_S.prs_srtperslid_key) P, " + " prs_v_aanwezigafdeling d," + " prs_v_perslid_fullnames pf," + " (select * from prs_werkplek where prs_werkplek_virtueel = 0) w," + " prs_perslidwerkplek pwp," + " (SELECT alg_r.alg_ruimte_key alg_ruimte_key," + " alg_g.alg_gebouw_code" + " || '-'" + " || TO_CHAR (alg_v.alg_verdieping_code)" + " || '-'" + " || alg_r.alg_ruimte_nr alg_ruimte_aanduiding" + " FROM alg_gebouw alg_g, alg_verdieping alg_v, alg_v_aanwezigruimte alg_r" + " WHERE alg_v.alg_verdieping_key = " + floorKey + " AND alg_v.alg_verdieping_key = alg_r.alg_verdieping_key" + " AND alg_g.alg_gebouw_key = alg_v.alg_gebouw_key) l" + " WHERE p.prs_afdeling_key = d.prs_afdeling_key" + " AND p.prs_perslid_key = pwp.prs_perslid_key" + " AND p.prs_perslid_key = pf.prs_perslid_key" + " AND pwp.prs_werkplek_key = w.prs_werkplek_key" + " AND w.prs_alg_ruimte_key = l.alg_ruimte_key" + " AND pwp.prs_perslid_key IS NOT NULL" + (highlight_arr.length > 0 && highlight_arr.join(",").indexOf("-1") == -1 ? " AND l.alg_ruimte_key IN (" + highlight_arr.join(",") + ")" : "") + " ORDER BY 1, 7"; } else { sql = "SELECT * FROM DUAL WHERE 1 = 0"; } %>
<% FCLTHeader.Generate({ outputmode: outputmode }); %>
<% var lastValue = null; function showRoomDesc(oRs) { // leek leuk om herhalingen te onderdrukken, maar sorteren maakt het waardeloos if (false && outputmode == 0 && safe.htmlattr(oRs("alg_ruimte_aanduiding").value) == lastValue) var result = null; else var result = safe.htmlattr(oRs("alg_ruimte_aanduiding").value); lastValue = result; return result; } function fnEmail(oRs) { if (oRs("email").value != null) return"" + safe.htmlattr(oRs("email").value) + ""; else return ""; } var rst = new ResultsetTable({ ID : "cadprstable", keyColumn: "prs_perslid_key", title: L("lcl_search_pers"), sql: sql, outputmode: outputmode, showAll: showall } ); rst.addColumn(new Column({caption: L("lcl_obj_inf_room"), content: showRoomDesc})); rst.addColumn(new Column({caption: L("lcl_name"), content: "naam"})); rst.addColumn(new Column({caption: L("lcl_phone"), content: "prs_perslid_telefoonnr"})); rst.addColumn(new Column({caption: L("lcl_prs_email"), content: fnEmail})); rst.addColumn(new Column({caption: L("lcl_prs_mobile"), content: "prs_perslid_mobiel"})); rst.addColumn(new Column({caption: L("lcl_prs_organisatie"), content: "afd"})); rst.addColumn(new Column({caption: L("lcl_fg_func_names"), content: "prs_srtperslid_omschrijving"})); rst.addAction({action: "onClickPerslid", caption: L("lcl_edit"), isDefault: true}); var cnt = rst.processResultset(); %>