From 09b7b9f6c600b01db302051f24ba4d0f2e9be913 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Thu, 29 Sep 2016 14:00:05 +0000 Subject: [PATCH] FSN#37004 ins_srtcontrole autorisatie svn path=/Website/branches/v2016.2/; revision=30916 --- APPL/INS/ins_search.asp | 29 ++++++++++++++++++----------- APPL/INS/ins_xcp.asp | 4 ++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/APPL/INS/ins_search.asp b/APPL/INS/ins_search.asp index bd210df588..4100967c05 100644 --- a/APPL/INS/ins_search.asp +++ b/APPL/INS/ins_search.asp @@ -300,20 +300,25 @@ var authparams = user.checkAutorisation(autfunction); if (insInspect) // Ook inspectiezoekvelden { + if (ctrdisc_key > 0) + var ctr_disc_sql = " = " + ctrdisc_key; + else + ctr_disc_sql = " IN (SELECT w.ins_discipline_key" + + " FROM fac_v_webgebruiker w" + + " , fac_functie f" + + " WHERE w.fac_functie_key = f.fac_functie_key " + + " AND f.fac_functie_code = 'WEB_CTRUSE'" + + " AND w.fac_gebruiker_prs_level_read < 9" + + " AND w.fac_gebruiker_alg_level_read < 9" + + " AND w.prs_perslid_key = " + user_key + ")"; + if (ctrdisc_key == -1) { // sql = "SELECT ins_discipline_key" + " , ins_discipline_omschrijving" + " FROM ctr_discipline" - + " WHERE ins_discipline_key IN (SELECT w.ins_discipline_key" - + " FROM fac_v_webgebruiker w" - + " , fac_functie f" - + " WHERE w.fac_functie_key = f.fac_functie_key " - + " AND f.fac_functie_code = 'WEB_CTRUSE'" - + " AND w.fac_gebruiker_prs_level_read < 9" - + " AND w.fac_gebruiker_alg_level_read < 9" - + " AND w.prs_perslid_key = " + user_key + ")" + + " WHERE ins_discipline_key " + ctr_disc_sql + " ORDER BY 2"; FCLTselector("ctr_discipline", sql, @@ -334,7 +339,8 @@ var authparams = user.checkAutorisation(autfunction); + " ins_srtcontrole_periode" + " FROM ins_srtcontrole isc, ins_v_allsrtinstallatie asi" + " WHERE asi.ins_srtinstallatie_key = isc.ins_srtinstallatie_key" - + " AND asi.niveau = isc.ins_srtcontrole_niveau" + + " AND asi.niveau = isc.ins_srtcontrole_niveau" + + " AND ctr_discipline_key " + ctr_disc_sql + " ORDER BY UPPER("+lcl.xsql('ins_srtcontrole_omschrijving', 'ins_srtcontrole_key')+")"; FCLTselector("sel_srtcontrole", sql, @@ -347,9 +353,10 @@ var authparams = user.checkAutorisation(autfunction); + " , COALESCE(xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep)" + " FROM ins_srtcontrole isc" + " , ins_srtcontroledl_xcp xcp" - + " WHERE isc.ins_srtcontrole_key = xcp.ins_srtcontrole_key" + + " WHERE isc.ins_srtcontrole_key = xcp.ins_srtcontrole_key(+)" + + " AND ctr_discipline_key " + ctr_disc_sql + " AND COALESCE (xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep) IS NOT NULL" - + " ORDER BY UPPER (COALESCE(xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep))"; + + " ORDER BY UPPER (COALESCE(xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep))"; FCLTselector("groep", sql, { label: L("ins_srtcontrole_groep"), diff --git a/APPL/INS/ins_xcp.asp b/APPL/INS/ins_xcp.asp index 5aebf49eef..45a58a1339 100644 --- a/APPL/INS/ins_xcp.asp +++ b/APPL/INS/ins_xcp.asp @@ -638,8 +638,8 @@ if (srtcont_key > 0) + " , fac_functie f" + " WHERE w.fac_functie_key = f.fac_functie_key " + " AND f.fac_functie_code = 'WEB_CTRUSE'" - + " AND w.fac_gebruiker_prs_level_read < 9" - + " AND w.fac_gebruiker_alg_level_read < 9" + + " AND w.fac_gebruiker_prs_level_write < 9" + + " AND w.fac_gebruiker_alg_level_write < 9" + " AND w.prs_perslid_key = " + user_key + ")" + " GROUP BY di.ins_srtcontrole_key" + " , di.ins_srtcontrole_omschrijving"