diff --git a/APPL/API2/api2.inc b/APPL/API2/api2.inc index de4fe1966e..414923cf37 100644 --- a/APPL/API2/api2.inc +++ b/APPL/API2/api2.inc @@ -602,8 +602,13 @@ api2 = { orderbys.push(inc.model.aliasprefix + inc.model.primary); // simpel op joinfield var outer = "(+)"; - if ("outertoggle" in inc && params.filter.scf_outer != "on") - outer = inc.outertoggle.def?"(+)":""; + if ("outertoggle" in inc) + { + if (params.filter.has_scf_outer && params.filter.scf_outer != "on") + outer = ""; + else + outer = inc.outertoggle.def?"(+)":""; + } wheres.push ( model.table + "." + model.primary + "=" + inc.model.table + "." + inc.model.fields[inc.joinfield].dbs + outer); } } diff --git a/APPL/API2/model_fac_functie.inc b/APPL/API2/model_fac_functie.inc index 613b5f28b7..5ada1f050e 100644 --- a/APPL/API2/model_fac_functie.inc +++ b/APPL/API2/model_fac_functie.inc @@ -73,6 +73,14 @@ function model_fac_functie (functie_key, params) "LOV": "0;Globaal;1;Per discipline", "hidden_fld": true }, + "group": { + "dbs": "fac_functie_groep", + "label": L("fac_functie_groep"), + "readonly": true, + "typ": "number", + "LOV": "0;Personal;1;Professional;2;Application management;null;Other", + "hidden_fld": true + }, "nn_discipline": { "dbs": "nn_discipline", //"label": L("fac_functie_omschrijving"), @@ -100,7 +108,7 @@ function model_fac_functie (functie_key, params) this.includes = {"authorization": { "model": new model_fac_groeprechten(params), "joinfield": "fac_functie", - "outertoggle": { def: false, lbl: "Toon alle functies" } + "outertoggle": { def: true, lbl: L("fac_gebruiker_outerfunctie") } }}; } diff --git a/APPL/API2/model_fac_groep.inc b/APPL/API2/model_fac_groep.inc index 3c95db4bfb..196219ead2 100644 --- a/APPL/API2/model_fac_groep.inc +++ b/APPL/API2/model_fac_groep.inc @@ -63,7 +63,7 @@ function model_fac_groep(groep_key, params) = { "model": new model_fac_groeprechten(params), "joinfield": "fac_groep", - outertoggle: { def: false, lbl: "Toon alle groepen" } + outertoggle: { def: true, lbl: L("fac_gebruiker_outergroep") } }; } diff --git a/APPL/API2/model_ins_tab_discipline.inc b/APPL/API2/model_ins_tab_discipline.inc index f3ef2be2c5..eb2e213eeb 100644 --- a/APPL/API2/model_ins_tab_discipline.inc +++ b/APPL/API2/model_ins_tab_discipline.inc @@ -129,7 +129,7 @@ function model_ins_tab_discipline(disc_key, params) this.includes = {"authorization": { "model": new model_fac_groeprechten(params), "joinfield": "ins_discipline", - "outertoggle": { def: false, lbl: "Toon alle vakgroepen/catalogi" } + "outertoggle": { def: true, lbl: L("fac_gebruiker_outerdisc") } }}; } diff --git a/APPL/MGT/fac_edit_groeprechten.asp b/APPL/MGT/fac_edit_groeprechten.asp index c79ac46098..354667e45d 100644 --- a/APPL/MGT/fac_edit_groeprechten.asp +++ b/APPL/MGT/fac_edit_groeprechten.asp @@ -30,7 +30,7 @@ var oRs = Oracle.Execute(sql); var flevel = oRs("fac_functie_min_level").Value; var fdisc = oRs("fac_functie_discipline").Value; if (fdisc) - var disc_key = getQParamInt("ins_discipline"); + var disc_arr_key = getQParamIntArray("ins_discipline"); var fdesc = oRs("fac_functie_omschrijving").Value; var finfo = oRs("fac_functie_info").Value; oRs.Close(); @@ -54,12 +54,10 @@ var sql = "SELECT *" + " WHERE fac_groep_key = " + groep_key + " AND fac_functie_key = " + functie_key; if (fdisc) - sql += " AND ins_discipline_key = " + disc_key; + sql += " AND ins_discipline_key = " + disc_arr_key[0]; var oRs = Oracle.Execute(sql); -var gr_key = -1; if (!oRs.Eof) { - 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; @@ -185,17 +183,20 @@ function radioTD(name, LOV, val) -
- + <% 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)); - + if (fdisc) + { + if (disc_arr_key.length == 1) + ROFIELDTR("fldtxt", L("ins_discipline_key"), Oracle.Get("ins_discipline_omschrijving", "ins_tab_discipline", "ins_discipline_key", disc_arr_key[0])); + else + ROFIELDTR("fldtxt", L("ins_discipline_key"), "(" + disc_arr_key.length + ")"); + } var prsLOV = api2.splitLOV(buildPrsLevelLOV()); var algLOV = api2.splitLOV(buildAlgLevelLOV()); var jnLOV = { "-1": L("lcl_Yes"), "9": L("lcl_No") }; @@ -239,7 +240,10 @@ function radioTD(name, LOV, val) } else { - Response.Write(""); + if (flevel == 15) + Response.Write("
"); + else + Response.Write("
"); if (!(flevel & (4 | 8))) // niet gescoped { if (flevel & 2) // Schrijfrechten diff --git a/APPL/MGT/fac_edit_groeprechten_save.asp b/APPL/MGT/fac_edit_groeprechten_save.asp index bdf549fb3e..70e91a034c 100644 --- a/APPL/MGT/fac_edit_groeprechten_save.asp +++ b/APPL/MGT/fac_edit_groeprechten_save.asp @@ -24,8 +24,7 @@ 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 disc_arr_key = getQParamIntArray("ins_discipline", []); var simple_mode = getFParamInt("simple_mode", 0) == 1; if (simple_mode) @@ -67,35 +66,57 @@ else // Bij alleen Ja/Nee vullen we PRS in algread = prsread; algwrite = prswrite; } -if (algread == 9 || prsread == 9) // Geen rechten (over) + +var fdisc = disc_arr_key.length >= 1; // Blijkbaar met disciplines +if (!fdisc) + disc_arr_key = [-1]; +for (var i = 0; i < disc_arr_key.length; i++) { - if (gr_key > 0) + var disc_key = disc_arr_key[i]; + 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) { - var sql = "DELETE FROM fac_groeprechten WHERE fac_groeprechten_key = " + gr_key; - Oracle.Execute(sql); + gr_key = oRs("fac_groeprechten_key").Value; } -} -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) + oRs.Close(); + + if (algread == 9 || prsread == 9) // Geen rechten (over) { - var sql = buildUpdate("fac_groeprechten", fields) - + " fac_groeprechten_key = " + gr_key; - Oracle.Execute(sql); + if (gr_key > 0) + { + var sql = "DELETE FROM fac_groeprechten WHERE 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 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 }; diff --git a/APPL/MGT/fac_functie.asp b/APPL/MGT/fac_functie.asp index 978fda9391..8eb6ec644e 100644 --- a/APPL/MGT/fac_functie.asp +++ b/APPL/MGT/fac_functie.asp @@ -21,7 +21,7 @@ var scf_params = { "search": { - "autosearch": true, + "autosearch": !!model.module, "labels" : [], "filters": [ "module" diff --git a/APPL/MGT/ins_tab_discipline.asp b/APPL/MGT/ins_tab_discipline.asp index 2c62378604..612b0ff60c 100644 --- a/APPL/MGT/ins_tab_discipline.asp +++ b/APPL/MGT/ins_tab_discipline.asp @@ -23,15 +23,6 @@ var functie_key = getQParamInt("fac_functie", -1); var model = new model_ins_tab_discipline(null, { groep_key: groep_key, functie_key: functie_key }); - function fnrowData(oRs) - { - var data = { functie_key: functie_key, - groep_key: groep_key, - module: oRs.Fields("module").Value - }; - return JSON.stringify(data); - } - var scf_params = { "search": { @@ -50,10 +41,10 @@ "name" ], "default_action": "edit_rechten", - "fnRowData": fnrowData, "requires": { js: ["./ins_tab_discipline.js"] - } + }, + "script": "window.groep_key = " + groep_key + "; window.functie_key = " + functie_key }, "transit": { "fac_groep": groep_key, @@ -100,6 +91,10 @@ if (model.level & 2) // Schrijfrechten scf_params.list.columns.push("authorization.alg_level_write"); } + scf_params.list["actions"] + = [ + { action: "edit_rechten", caption: L("fac_groeprechten_m"), multi: true, multiOnce: true, single: false } + ] } scaffolding(model, scf_params); diff --git a/APPL/MGT/ins_tab_discipline.js b/APPL/MGT/ins_tab_discipline.js index 2db0b1d2a7..ee0621f792 100644 --- a/APPL/MGT/ins_tab_discipline.js +++ b/APPL/MGT/ins_tab_discipline.js @@ -5,17 +5,20 @@ function edit_rechten(row) { - var disc_key = row.getAttribute("ROWKEY"); - var grpData = eval("(" + row.getAttribute("ROWDATA") + ")"); +debugger; + if (row instanceof Array) + var discKeyString = getKeyString(row); + else + var disc_key = row.getAttribute("ROWKEY"); - if (grpData.functie_key > 0 && grpData.groep_key) + if (window.functie_key > 0 && window.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); + var url = "fac_edit_groeprechten.asp?fac_groep={0}&fac_functie={1}&ins_discipline={2}".format(window.groep_key, window.functie_key, discKeyString||disc_key); FcltMgr.openModalDetail(url, L("fac_groeprechten"), { callback: FcltCallbackRefresh }); } - else if (grpData.functie_key > 0) + else if (window.functie_key > 0) { - var url = "appl/mgt/ins_tab_discipline.asp?mode=list&fac_groep=" + grpData.groep_key + "&fac_functie=" + grpData.functie_key; + var url = "appl/mgt/ins_tab_discipline.asp?mode=list&fac_groep=" + window.groep_key + "&fac_functie=" + window.functie_key; FcltMgr.openDetail(url, { reuse: true }); } else // eerst nog een functie erbij kiezen diff --git a/APPL/SCF/scaffolding_list.inc b/APPL/SCF/scaffolding_list.inc index 4ef8b7624f..dd87bc242a 100644 --- a/APPL/SCF/scaffolding_list.inc +++ b/APPL/SCF/scaffolding_list.inc @@ -119,6 +119,7 @@ function scaffolding_list(model, scf_params) alert(rows); } }).disableSelection() });; + <%= scf_params.list.script %>