From e2de1404b93ee51bbc8d0636ce2e0e780e09546b Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Sun, 27 Mar 2016 19:25:16 +0000 Subject: [PATCH] FSN#35817 Autorisaties via API2/Scaffolding svn path=/Website/trunk/; revision=28651 --- APPL/API2/model_fac_functie.inc | 19 +- APPL/API2/model_fac_groeprechten.inc | 113 ----------- APPL/API2/model_ins_tab_discipline.inc | 5 +- APPL/MGT/fac_edit_groeprechten.asp | 245 ++++++++++++++++++------ APPL/MGT/fac_edit_groeprechten_save.asp | 101 ++++++++++ APPL/MGT/fac_functie.asp | 18 +- APPL/MGT/fac_functie.js | 2 +- APPL/MGT/fac_groep.asp | 33 +++- APPL/MGT/fac_groep.js | 2 +- APPL/MGT/ins_tab_discipline.asp | 33 +++- APPL/MGT/ins_tab_discipline.js | 2 +- APPL/MGT/mgt_tools.inc | 2 +- APPL/SCF/scaffolding_search.inc | 2 + APPL/Shared/iface.inc | 2 + 14 files changed, 366 insertions(+), 213 deletions(-) create mode 100644 APPL/MGT/fac_edit_groeprechten_save.asp diff --git a/APPL/API2/model_fac_functie.inc b/APPL/API2/model_fac_functie.inc index 6184c316e2..50a8c41884 100644 --- a/APPL/API2/model_fac_functie.inc +++ b/APPL/API2/model_fac_functie.inc @@ -22,12 +22,12 @@ function model_fac_functie (functie_key, params) this.primary = "fac_functie_key"; this.records_name = "fac_functies"; this.record_name = "fac_functie"; - var module = null; + this.module = null; if (params.disc_key > 0) { var sql = "SELECT ins_discipline_module FROM ins_tab_discipline WHERE ins_discipline_key = " + params.disc_key; var oRs = Oracle.Execute(sql); - var module = oRs("ins_discipline_module").Value; + this.module = oRs("ins_discipline_module").Value; oRs.Close(); } this.fields = { @@ -44,7 +44,7 @@ function model_fac_functie (functie_key, params) "label": L("fac_functie_module"), "readonly": true, "typ": "varchar", - "filterdefault": module?":!"+module:null, + "filterdefault": this.module?":!"+this.module:null, "foreign": { "tbl": "fac_module", "key": "fac_module_name", @@ -62,6 +62,7 @@ function model_fac_functie (functie_key, params) "label": L("fac_functie_min_level"), "readonly": true, "typ": "number", + "LOV": L("fac_functie_min_levelLOV"), "hidden_fld": true }, "discipline": { @@ -69,6 +70,7 @@ function model_fac_functie (functie_key, params) "label": L("fac_functie_discipline"), "readonly": true, "typ": "number", + "LOV": "0;Globaal;1;Per discipline", "hidden_fld": true }, "nn_discipline": { @@ -111,14 +113,15 @@ function model_fac_functie (functie_key, params) } var xparams = null; - if (module) + if (params.disc_key > 0) + { xparams = { GET: { wheres: ["fac_functie_module = " + safe.quoted_sql(module), "fac_functie_discipline = 1" // dan ook alleen de discipline gebonden functies ] } } - + } this.REST_GET = generic_REST_GET(this, xparams); - this.REST_POST = generic_REST_POST(this); - this.REST_PUT = generic_REST_PUT(this); - this.REST_DELETE = generic_REST_DELETE(this); + //this.REST_POST = generic_REST_POST(this); + //this.REST_PUT = generic_REST_PUT(this); + //this.REST_DELETE = generic_REST_DELETE(this); } %> \ No newline at end of file diff --git a/APPL/API2/model_fac_groeprechten.inc b/APPL/API2/model_fac_groeprechten.inc index 5509aad71c..7f12645c5f 100644 --- a/APPL/API2/model_fac_groeprechten.inc +++ b/APPL/API2/model_fac_groeprechten.inc @@ -272,63 +272,7 @@ sSQL = sSQL & " AND EXISTS"&_ " OR ff.fac_functie_code = 'WEB_' || m.fac_module_name || 'MSU'"&_ " ))" -if getParam("FAC_GROEP_KEY") <> "" then - fldFAC_GROEP_KEY = getParam("FAC_GROEP_KEY") -end if -sqlGroepOmschr = "select fac_groep_omschrijving from fac_groep where fac_groep_key = " & ToSQL(fldFAC_GROEP_KEY, "Number") -openrs rsGroep,sqlGroepOmschr -if not rsGroep.EOF then - sFormTitle = "Rechten van groep "& ToHTML(getValue(rsGroep,"fac_groep_omschrijving")) -end if -rsGroep.Close - -transit = "?sFAC_GROEP_UPPER=" & ToURL(GetParam("sFAC_GROEP_UPPER")) -setvar "Footer",""&FCLTLCL("Terug naar overzicht")&"" - ----------------------------- -Page event show: -if ((fldFAC_FUNCTIE_DISCIPLINE = "") or (fldFAC_FUNCTIE_DISCIPLINE="0")) then - 'Autorisatie is op functie niveau. Kijk of er al autorisaties aangegeven zijn. - sqlGroepRechten = "select * from fac_groeprechten where fac_groep_key = " & ToSQL(fldFAC_GROEP_KEY, "Number")&" and fac_functie_key = " & ToSQL(fldFAC_FUNCTIE_KEY, "Number") - openrs rsGroepRechten,sqlGroepRechten - if not rsGroepRechten.EOF then - 'Autorisaties bestaan - prs_read = decode_org_level(getValue(rsGroepRechten,"fac_gebruiker_prs_level_read")) - prs_write = decode_org_level(getValue(rsGroepRechten,"fac_gebruiker_prs_level_write")) - alg_read = decode_pos_level(getValue(rsGroepRechten,"fac_gebruiker_alg_level_read")) - alg_write = decode_pos_level(getValue(rsGroepRechten,"fac_gebruiker_alg_level_write")) - fldFAC_GEBRUIKER_PRS_LEVEL_READ = prs_read - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = prs_write - fldFAC_GEBRUIKER_ALG_LEVEL_READ = alg_read - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = alg_write - fldFAC_FUNCTIE_OMSCHRIJVING_FAC_GROEPRECHTEN_KEY = getValue(rsGroepRechten,"fac_groeprechten_key") - else - fldFAC_GEBRUIKER_PRS_LEVEL_READ = FCLTLCL("Geen") - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = FCLTLCL("Geen") - fldFAC_GEBRUIKER_ALG_LEVEL_READ = FCLTLCL("Geen") - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = FCLTLCL("Geen") - fldFAC_FUNCTIE_OMSCHRIJVING_FAC_GROEPRECHTEN_KEY = "" - end if - rsGroepRechten.Close -else - 'autorisatie is op discipline niveau - s_filter = "" - if getParam("FAC_FUNCTIE_MODULE") <> "" then - s_filter = "&fac_functie_module_filter="& ToURL(getParam("FAC_FUNCTIE_MODULE")) - end if - details = "" - fldFAC_FUNCTIE_OMSCHRIJVING = ""&fldFAC_FUNCTIE_OMSCHRIJVING&"" - fldFAC_FUNCTIE_OMSCHRIJVING = ""&details&fldFAC_FUNCTIE_OMSCHRIJVING&"" - fldFAC_GEBRUIKER_PRS_LEVEL_READ = "..." - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = "..." - fldFAC_GEBRUIKER_ALG_LEVEL_READ = "..." - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = "..." -end if ---------------------------- Page event customsecurity: @@ -348,62 +292,5 @@ sSQL = sSQL & " AND EXISTS"&_ " OR ff.fac_functie_code = 'WEB_' || m.fac_module_name || 'MSU'"&_ " ))" -if getParam("FAC_GROEP_KEY") <> "" then - fldFAC_GROEP_KEY = getParam("FAC_GROEP_KEY") -end if - -sqlGroepOmschr = "select fac_groep_omschrijving from fac_groep where fac_groep_key = " & ToSQL(fldFAC_GROEP_KEY, "Number") -openrs rsGroep,sqlGroepOmschr -if not rsGroep.EOF then - sFormTitle = "Rechten van groep "& ToHTML(getValue(rsGroep,"fac_groep_omschrijving")) -end if -rsGroep.Close - -transit = "?sFAC_GROEP_UPPER=" & ToURL(GetParam("sFAC_GROEP_UPPER")) -setvar "Footer",""&FCLTLCL("Terug naar overzicht")&"" - ----------------------------- -Form event show: -if ((fldFAC_FUNCTIE_DISCIPLINE = "") or (fldFAC_FUNCTIE_DISCIPLINE="0")) then - 'Autorisatie is op functie niveau. Kijk of er al autorisaties aangegeven zijn. - sqlGroepRechten = "select * from fac_groeprechten where fac_groep_key = " & ToSQL(fldFAC_GROEP_KEY, "Number")&" and fac_functie_key = " & ToSQL(fldFAC_FUNCTIE_KEY, "Number") - openrs rsGroepRechten,sqlGroepRechten - if not rsGroepRechten.EOF then - 'Autorisaties bestaan - prs_read = decode_org_level(getValue(rsGroepRechten,"fac_gebruiker_prs_level_read")) - prs_write = decode_org_level(getValue(rsGroepRechten,"fac_gebruiker_prs_level_write")) - alg_read = decode_pos_level(getValue(rsGroepRechten,"fac_gebruiker_alg_level_read")) - alg_write = decode_pos_level(getValue(rsGroepRechten,"fac_gebruiker_alg_level_write")) - fldFAC_GEBRUIKER_PRS_LEVEL_READ = prs_read - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = prs_write - fldFAC_GEBRUIKER_ALG_LEVEL_READ = alg_read - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = alg_write - fldFAC_FUNCTIE_OMSCHRIJVING_FAC_GROEPRECHTEN_KEY = getValue(rsGroepRechten,"fac_groeprechten_key") - else - fldFAC_GEBRUIKER_PRS_LEVEL_READ = FCLTLCL("Geen") - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = FCLTLCL("Geen") - fldFAC_GEBRUIKER_ALG_LEVEL_READ = FCLTLCL("Geen") - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = FCLTLCL("Geen") - fldFAC_FUNCTIE_OMSCHRIJVING_FAC_GROEPRECHTEN_KEY = "" - end if - rsGroepRechten.Close -else - 'autorisatie is op discipline niveau - s_filter = "" - if getParam("FAC_FUNCTIE_MODULE") <> "" then - s_filter = "&fac_functie_module_filter="& ToURL(getParam("FAC_FUNCTIE_MODULE")) - end if - details = "" - fldFAC_FUNCTIE_OMSCHRIJVING = ""&fldFAC_FUNCTIE_OMSCHRIJVING&"" - fldFAC_FUNCTIE_OMSCHRIJVING = ""&details&fldFAC_FUNCTIE_OMSCHRIJVING&"" - fldFAC_GEBRUIKER_PRS_LEVEL_READ = "..." - fldFAC_GEBRUIKER_PRS_LEVEL_WRITE = "..." - fldFAC_GEBRUIKER_ALG_LEVEL_READ = "..." - fldFAC_GEBRUIKER_ALG_LEVEL_WRITE = "..." -end if */ %> \ No newline at end of file diff --git a/APPL/API2/model_ins_tab_discipline.inc b/APPL/API2/model_ins_tab_discipline.inc index e30c5c1b52..829d13bb42 100644 --- a/APPL/API2/model_ins_tab_discipline.inc +++ b/APPL/API2/model_ins_tab_discipline.inc @@ -20,8 +20,8 @@ function model_ins_tab_discipline(disc_key, params) { this.table = "ins_tab_discipline"; this.primary = "ins_discipline_key"; - this.records_name = "reservationcatalogs"; - this.record_name = "reservationcatalog"; + this.records_name = "disciplines"; + this.record_name = "discipline"; this.fields = { "id": { "dbs": "ins_discipline_key", @@ -141,6 +141,7 @@ function model_ins_tab_discipline(disc_key, params) if (params.functie_key > 0) { this.module = Oracle.Get("fac_functie_module", "fac_functie", params.functie_key); + this.level = Oracle.Get("fac_functie_min_level", "fac_functie", params.functie_key); xparams = { GET: { wheres: ["ins_discipline_module = " + safe.quoted_sql(this.module)] } } } diff --git a/APPL/MGT/fac_edit_groeprechten.asp b/APPL/MGT/fac_edit_groeprechten.asp index e98268c1a7..67f85135ca 100644 --- a/APPL/MGT/fac_edit_groeprechten.asp +++ b/APPL/MGT/fac_edit_groeprechten.asp @@ -32,6 +32,7 @@ var fdisc = oRs("fac_functie_discipline").Value; if (fdisc) var disc_key = getQParamInt("ins_discipline"); var fdesc = oRs("fac_functie_omschrijving").Value; +var finfo = oRs("fac_functie_info").Value; oRs.Close(); var sql = "SELECT * " @@ -42,15 +43,40 @@ var gdesc = oRs("fac_groep_omschrijving").Value; var gremark = oRs("fac_groep_opmerking").Value; oRs.Close(); -function radioTD(name, label, LOV, val) +var transitParam = buildTransitParam(["fac_groep", "fac_functie", "ins_discipline"]); + +var prsread = 9; +var prswrite = 9; +var algread = 9; +var algwrite = 9; +var sql = "SELECT *" + + " FROM fac_groeprechten" + + " WHERE fac_groep_key = " + groep_key + + " AND fac_functie_key = " + functie_key; +if (fdisc) + sql += " AND ins_discipline_key = " + disc_key; +var oRs = Oracle.Execute(sql); +var gr_key = -1; +if (!oRs.Eof) { - Response.Write("\n"); + var grkey = oRs("fac_groeprechten_key").Value; + var prsread = oRs("fac_gebruiker_prs_level_read").Value; + var prswrite = oRs("fac_gebruiker_prs_level_write").Value; + var algread = oRs("fac_gebruiker_alg_level_read").Value; + var algwrite = oRs("fac_gebruiker_alg_level_write").Value; +} +oRs.Close(); + + +function radioTD(name, LOV, val) +{ + Response.Write("\n"); for (var i in LOV) { - Response.Write("\n
"); + Response.Write(safe.html(LOV[i]) + "
"); } Response.Write(""); @@ -59,8 +85,6 @@ function radioTD(name, label, LOV, val) <% FCLTHeader.Generate() - - %> -
- -<% BLOCK_START("grpRechten", L("lcl_res_deel_head1")); + + +<% BLOCK_START("grpRechten", L("lcl_auth_header")); ROFIELDTR("fldtxt", L("fac_groep"), gdesc); ROFIELDTR("fldtxt", L("fac_groep_opmerking"), gremark, { suppressEmpty: true} ); ROFIELDTR("fldtxt", L("fac_functie"), fdesc); + ROFIELDTR("fldtxt", L("fac_functie_info"), finfo); if (disc_key > 0) ROFIELDTR("fldtxt", L("ins_discipline_key"), Oracle.Get("ins_discipline_omschrijving", "ins_tab_discipline", "ins_discipline_key", disc_key)); @@ -88,74 +192,97 @@ function radioTD(name, label, LOV, val) var algLOV = api2.splitLOV(buildAlgLevelLOV()); var jnLOV = { "-1": L("lcl_Yes"), "9": L("lcl_No") }; - var prsread = 9; - var prswrite = 9; - var algread = 9; - var algwrite = 9; - var sql = "SELECT *" - + " FROM fac_groeprechten" - + " WHERE fac_groep_key = " + groep_key - + " AND fac_functie_key = " + functie_key; - if (fdisc) - sql += " AND ins_discipline_key = " + disc_key; - var oRs = Oracle.Execute(sql); - if (!oRs.Eof) - { - var prsread = oRs("fac_gebruiker_prs_level_read").Value; - var prswrite = oRs("fac_gebruiker_prs_level_write").Value; - var algread = oRs("fac_gebruiker_alg_level_read").Value; - var algwrite = oRs("fac_gebruiker_alg_level_write").Value; - } - oRs.Close(); - // 0 is Ja/Nee // 1 is Ja/Nee (alleen FAC_FAQUSE en PRS_MODAAN) // 3 is Lees Ja/Nee en Schrijf Ja/Nee // 7 is PRS lezen/schrijven WEB_FACMAN en WEB_BEZPAF // 11 is ALG lezen/schrijven diversen + // 13 is PRS+ALG lezen WEB_???BAC // 15 is PRS+ALG lezen/schrijven diversen + // Ofwel: +1 is bedacht als afzonderlijke leesrechten. Die is wat onzinnig + // +2 is afzonderlijke schrijfrechten + // +4 is PRS-scope + // +8 is ALG-scope + var advanced = getQParamInt("advanced", 0) == 1; + if ( prsread != prswrite && (flevel & 2) + || algread != algwrite && (flevel & 2) + || prsread != -1 && prsread != 9 + || algread != -1 && algread != 9 + ) + { + advanced = true; + var no_simpel = true; + } - Response.Write(""); - if (flevel & 4) // PRS + if (!advanced) { - if (prsread == prswrite) - { - radioTD("prsread", L("lcl_prs_organisatie"), prsLOV, prsread); - } - else - { - radioTD("prsread", L("fac_gebruiker_prs_level_read"), prsLOV, prsread); - radioTD("prswrite", L("fac_gebruiker_prs_level_write"), prsLOV, prswrite); - } + Response.Write(""); + var cparams = {}; + if (flevel > 1) + cparams.posthtml = " ".format(api2.splitLOV(L("fac_functie_min_levelLOV"))[flevel]); + RWCHECKBOXTR("allread", "fldcheck", L("fac_gebruiker_toegang"), algread==9?0:1, cparams) } - if (flevel & 8) // ALG + else { - if (flevel & 8) - Response.Write("") - if (algread == algwrite) + Response.Write(""); } - Response.Write("
           
"); + if (!(flevel & (4 | 8))) // niet gescoped { - radioTD("algread", L("lcl_place"), algLOV, algread); + if (flevel & 2) // Schrijfrechten + Response.Write(""); + radioTD("algread", jnLOV, algread); + if (flevel & 2) // Schrijfrechten + radioTD("algwrite", jnLOV, algwrite); } else { - radioTD("algread", L("fac_gebruiker_alg_level_read"), algLOV, algread); - radioTD("algwrite", L("fac_gebruiker_alg_level_write"), algLOV, algwrite); - } - } - if ((flevel & (4 + 8)) == 0) - { - if (flevel == 1) - radioTD("algread", L("fac_gebruiker_toegang"), jnLOV, algread); - else - { - radioTD("algread", L("fac_gebruiker_lezen"), jnLOV, algread); - radioTD("algwrite", L("fac_gebruiker_schrijven"), jnLOV, algwrite); - } + if (flevel & (4 | 8)) // scope kopjes + { + Response.Write(""); + var spanner = ""; + if (flevel & 2) // read/write kopjes + spanner = " colspan='2' style='text-align:center'"; + if (flevel & 4) + Response.Write("" + L("lcl_prs_organisatie") + ""); + if (flevel & 8) + Response.Write("" + L("lcl_place") + ""); + Response.Write(""); + } + if (flevel & 2) // read/write kopjes + { + Response.Write(""); + Response.Write(""); + if ((flevel & 4) && (flevel & 8)) + Response.Write(""); + Response.Write(""); + } + if (flevel & 4) // PRS + { + radioTD("prsread", prsLOV, prsread); + if (flevel & 2) // Schrijfrechten + radioTD("prswrite", prsLOV, prswrite); + } + if (flevel & 8) // ALG + { + radioTD("algread", algLOV, algread); + if (flevel & 2) // Schrijfrechten + radioTD("algwrite", algLOV, algwrite); + } + } + Response.Write("
" + L("fac_gebruiker_lezen") + "" + L("fac_gebruiker_schrijven") + "
" + L("fac_gebruiker_lezen") + "" + L("fac_gebruiker_schrijven") + "" + L("fac_gebruiker_lezen") + "" + L("fac_gebruiker_schrijven") + "
"); BLOCK_END(); buttons = []; + if (flevel > 1) + { + if (advanced) + { + if (!no_simpel) + buttons.push ( {title: L("lcl_auth_simple"), action:"auth_advanced(0)" } ); + } + else + buttons.push ( {title: L("lcl_auth_advanced"), action:"auth_advanced(1)" } ); + } buttons.push({ title: L("lcl_submit"), action: "grp_submit()" }); buttons.push({ title: L("lcl_cancel"), action: "gen_cancel()" }); diff --git a/APPL/MGT/fac_edit_groeprechten_save.asp b/APPL/MGT/fac_edit_groeprechten_save.asp new file mode 100644 index 0000000000..ca45ec3725 --- /dev/null +++ b/APPL/MGT/fac_edit_groeprechten_save.asp @@ -0,0 +1,101 @@ +<%@language = "javascript" %> +<% /* + $Revision$ + $Id$ + + File: fac_edit_groeprechten_save.asp.asp + Description: Het echte bewaren van een autorisatie + Parameters: fac_groep + fac_functie + ins_discipline optioneel + simplemode optioneel, 1 voor alleen 'Toegang' vinkje + Context: Vanuit fac_edit_groeprechten.asp + +*/ +var JSON_Result = true; +%> + + + +<% +protectRequest.validateToken(); + +user.checkAutorisation("WEB_PRSSYS"); // TODO Minder scherp + +var groep_key = getQParamInt("fac_groep"); +var functie_key = getQParamInt("fac_functie"); +var disc_key = getQParamInt("ins_discipline", -1); +var gr_key = getQParamInt("gr_key", -1); + +var simple_mode = getFParamInt("simple_mode", 0) == 1; +if (simple_mode) +{ + var lvl = (getFParam("allread", "off") == 'on')?-1:9; + var prsread = lvl; + var prswrite = lvl; + var algread = lvl; + var algwrite = lvl; +} +else +{ + var prsread = getFParamInt("prsread", -2); + var prswrite = getFParamInt("prswrite", -2); + var algread = getFParamInt("algread", -2); + var algwrite = getFParamInt("algwrite", -2); +} + +var level = Oracle.Get("fac_functie_min_level", "fac_functie", functie_key); +if (!(level & 2)) // geen aparte schrijfrechten +{ + prswrite = -1; + algwrite = -1; +} +if (level & ( 4 | 8)) +{ + if (!(level & 4)) // geen PRS scope + { + prsread = -1; + prswrite = algwrite < 9?-1:9; // waarschijnlijk don't care + } + if (!(level & 8)) // geen ALG scope + { + algread = -1; + algwrite = prswrite < 9?-1:9; // waarschijnlijk don't care + } +} +if (algread == 9 || prsread == 9) // Geen rechten (over) +{ + if (gr_key > 0) + { + var sql = "DELETE FROM fac_groeprechten WHERE fac_groeprechten_key = " + gr_key; + Oracle.Execute(sql); + } +} +else +{ + var fields = [ { dbs: "fac_gebruiker_prs_level_read", typ: "number", val: prsread }, + { dbs: "fac_gebruiker_prs_level_write", typ: "number", val: prswrite }, + { dbs: "fac_gebruiker_alg_level_read", typ: "number", val: algread }, + { dbs: "fac_gebruiker_alg_level_write", typ: "number", val: algwrite } + ] + if (gr_key > -1) + { + var sql = buildUpdate("fac_groeprechten", fields) + + " fac_groeprechten_key = " + gr_key; + Oracle.Execute(sql); + } + else + { + fields.push({ dbs: "fac_functie_key", typ: "key", val: functie_key }, + { dbs: "fac_groep_key", typ: "key", val: groep_key }, + { dbs: "ins_discipline_key", typ: "key", val: disc_key } + ); + var grpIns = buildInsert("fac_groeprechten", fields); + Oracle.Execute(grpIns.sql); + } +} +var result = {success: true }; + +Response.Write(JSON.stringify(result)); +Response.End; +%> \ No newline at end of file diff --git a/APPL/MGT/fac_functie.asp b/APPL/MGT/fac_functie.asp index 02f7ae889e..978fda9391 100644 --- a/APPL/MGT/fac_functie.asp +++ b/APPL/MGT/fac_functie.asp @@ -9,11 +9,11 @@ var disc_key = getQParamInt("ins_discipline", -1); var model = new model_fac_functie(null, { groep_key: groep_key, disc_key: disc_key }); - settings.overrule_setting("qp_maxrows", 250); // Toon alle 186 (2015.6) functies direkt + settings.overrule_setting("qp_maxrows", 250); // Toon alle 186 (DB28) functies direct function fnrowData(oRs) { - var funcdisc = oRs.Fields("discipline").Value; + var funcdisc = oRs.Fields("discipline").Value.id; var data = {funcdisc: funcdisc, groep_key: groep_key, disc_key: disc_key}; return JSON.stringify(data); } @@ -54,28 +54,28 @@ }; if (groep_key > 0) { - scf_params.search.labels.push({ "lbl": L("fac_groep"), "txt" : Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key)}); + var groep_desc = Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key); + scf_params.search.title = groep_desc; + scf_params.search.labels.push({ "lbl": L("fac_groep"), "txt" : groep_desc}); scf_params.search.labels.push({ "lbl": L("fac_groep_opmerking"), "txt" : Oracle.Get("fac_groep_opmerking", "fac_groep", groep_key)}); - scf_params.list.columns = - scf_params.list.columns.concat([ + scf_params.list.columns.push( "authorization.ins_discipline", "authorization.prs_level_read", "authorization.prs_level_write", "authorization.alg_level_read", "authorization.alg_level_write" - ]); + ); } if (disc_key > 0) { scf_params.search.labels.push({ "lbl": L("ins_discipline_key"), "txt" : Oracle.Get("ins_discipline_omschrijving", "ins_tab_discipline", "ins_discipline_key", disc_key)}); - scf_params.list.columns = - scf_params.list.columns.concat([ + scf_params.list.columns.push( "authorization.fac_groep", "authorization.prs_level_read", "authorization.prs_level_write", "authorization.alg_level_read", "authorization.alg_level_write" - ]); + ); } scaffolding(model, scf_params); %> diff --git a/APPL/MGT/fac_functie.js b/APPL/MGT/fac_functie.js index 227cd43b82..83816cccce 100644 --- a/APPL/MGT/fac_functie.js +++ b/APPL/MGT/fac_functie.js @@ -16,7 +16,7 @@ function edit_rechten(row) else if (funData.groep_key > 0) { var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}".format(funData.groep_key, functie_key); - FcltMgr.openModalDetail(url, L("fac_groeprechten")); + FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); } else // eerst nog een groep erbij kiezen { diff --git a/APPL/MGT/fac_groep.asp b/APPL/MGT/fac_groep.asp index 8023f9c072..5a6592e137 100644 --- a/APPL/MGT/fac_groep.asp +++ b/APPL/MGT/fac_groep.asp @@ -65,15 +65,30 @@ if (functie_key > 0) { - scf_params.search.labels.push({ "lbl": L("fac_functie"), "txt" : Oracle.Get("fac_functie_omschrijving", "fac_functie", functie_key)}); - scf_params.list.columns = - scf_params.list.columns.concat([ - //"authorization.ins_discipline", - "authorization.prs_level_read", - "authorization.prs_level_write", - "authorization.alg_level_read", - "authorization.alg_level_write" - ]); + var func_desc = Oracle.Get("fac_functie_omschrijving", "fac_functie", functie_key); + scf_params.search.title = func_desc; + scf_params.search.labels.push({ "lbl": L("fac_functie"), "txt" : func_desc }); + scf_params.search.labels.push({ "lbl": L("fac_functie_info"), "txt" : Oracle.Get("fac_functie_info", "fac_functie", functie_key)}); + + model.level = Oracle.Get("fac_functie_min_level", "fac_functie", functie_key); + if (model.level & 4) + { + scf_params.list.columns.push("authorization.prs_level_read"); + if (model.level & 2) + scf_params.list.columns.push("authorization.prs_level_write"); + } + if (model.level & 8) + { + scf_params.list.columns.push("authorization.alg_level_read") + if (model.level & 2) + scf_params.list.columns.push("authorization.alg_level_write"); + } + if (!(model.level & (4 | 8))) + { + scf_params.list.columns.push("authorization.prs_level_read"); + if (model.level & 2) // Schrijfrechten + scf_params.list.columns.push("authorization.alg_level_write"); + } } if (disc_key > 0) { diff --git a/APPL/MGT/fac_groep.js b/APPL/MGT/fac_groep.js index 9da8935178..ba60f3e257 100644 --- a/APPL/MGT/fac_groep.js +++ b/APPL/MGT/fac_groep.js @@ -16,7 +16,7 @@ function edit_rechten(row) else if (grpData.functie_key > 0) { var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(groep_key, grpData.functie_key, grpData.disc_key); - FcltMgr.openModalDetail(url, L("fac_groeprechten")); + FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); } else // eerst nog een functie erbij kiezen { diff --git a/APPL/MGT/ins_tab_discipline.asp b/APPL/MGT/ins_tab_discipline.asp index a863872d0a..2c62378604 100644 --- a/APPL/MGT/ins_tab_discipline.asp +++ b/APPL/MGT/ins_tab_discipline.asp @@ -75,16 +75,31 @@ if (groep_key > 0 && functie_key > 0) { - scf_params.search.labels.push({ "lbl": L("fac_groep"), "txt" : Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key)}); + var groep_desc = Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key); + var func_desc = Oracle.Get("fac_functie_omschrijving", "fac_functie", functie_key); + scf_params.search.title = groep_desc + "/" + func_desc; + scf_params.search.labels.push({ "lbl": L("fac_groep"), "txt" : groep_desc }); scf_params.search.labels.push({ "lbl": L("fac_groep_opmerking"), "txt" : Oracle.Get("fac_groep_opmerking", "fac_groep", groep_key)}); - scf_params.search.labels.push({ "lbl": L("fac_functie"), "txt" : Oracle.Get("fac_functie_omschrijving", "fac_functie", functie_key)}); - scf_params.list.columns = - scf_params.list.columns.concat([ - "authorization.prs_level_read", - "authorization.prs_level_write", - "authorization.alg_level_read", - "authorization.alg_level_write" - ]); + scf_params.search.labels.push({ "lbl": L("fac_functie"), "txt" : func_desc}); + scf_params.search.labels.push({ "lbl": L("fac_functie_info"), "txt" : Oracle.Get("fac_functie_info", "fac_functie", functie_key)}); + if (model.level & 4) + { + scf_params.list.columns.push("authorization.prs_level_read"); + if (model.level & 2) + scf_params.list.columns.push("authorization.prs_level_write"); + } + if (model.level & 8) + { + scf_params.list.columns.push("authorization.alg_level_read") + if (model.level & 2) + scf_params.list.columns.push("authorization.alg_level_write"); + } + if (!(model.level & (4 | 8))) + { + scf_params.list.columns.push("authorization.prs_level_read"); + if (model.level & 2) // Schrijfrechten + scf_params.list.columns.push("authorization.alg_level_write"); + } } scaffolding(model, scf_params); diff --git a/APPL/MGT/ins_tab_discipline.js b/APPL/MGT/ins_tab_discipline.js index 01c22b2f92..2db0b1d2a7 100644 --- a/APPL/MGT/ins_tab_discipline.js +++ b/APPL/MGT/ins_tab_discipline.js @@ -11,7 +11,7 @@ function edit_rechten(row) if (grpData.functie_key > 0 && grpData.groep_key) { var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(grpData.groep_key, grpData.functie_key, disc_key); - FcltMgr.openModalDetail(url, L("fac_groeprechten")); + FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); } else if (grpData.functie_key > 0) { diff --git a/APPL/MGT/mgt_tools.inc b/APPL/MGT/mgt_tools.inc index d05aa801ad..9f2e4cc6f6 100644 --- a/APPL/MGT/mgt_tools.inc +++ b/APPL/MGT/mgt_tools.inc @@ -306,7 +306,7 @@ function buildAlgLevelLOV() + ";1;" + L("lcl_district") + ";2;" + L("lcl_location") + ";3;" + L("lcl_building") - + ";4;" + L("lcl_building") + + ";4;" + L("lcl_floor") + ";5;" + L("lcl_room") + ";9;" + L("fac_functie_auth_none"); return AlgLevelLOV; diff --git a/APPL/SCF/scaffolding_search.inc b/APPL/SCF/scaffolding_search.inc index 8faac65076..e59087d65e 100644 --- a/APPL/SCF/scaffolding_search.inc +++ b/APPL/SCF/scaffolding_search.inc @@ -170,6 +170,8 @@ function scaffolding_search(model, scf_params) var est_title = ""; if ("estimated_rows" in model) est_title = " estimated {0} rows as of {1}".format(model.estimated_rows, toDateTimeString(model.last_analyzed)); + else + est_title = " " + model.records_title; BLOCK_START("searchtable", L("lcl_filterblok") + est_title); diff --git a/APPL/Shared/iface.inc b/APPL/Shared/iface.inc index 8853237888..7e5d7b27c6 100644 --- a/APPL/Shared/iface.inc +++ b/APPL/Shared/iface.inc @@ -414,6 +414,8 @@ function RWCHECKBOXTR(pname, pclass, plabel, pvalue, params) %><% } CHECKBOX(pclass, pname, pvalue, params) + if (params.posthtml) + Response.Write(params.posthtml); if (plabel) { %><% } } else { %><% CHECKBOX(pclass, pname, pvalue, params) %><%