FCLT#75767 CAD thema's rekening laten houden met autorisaties

svn path=/Website/trunk/; revision=58814
This commit is contained in:
Jos Groot Lipman
2023-01-25 13:52:48 +00:00
parent b200e793e2
commit 618833a923
7 changed files with 43 additions and 25 deletions

View File

@@ -109,7 +109,7 @@ function DefineSymbol(cHandle, acadSymbol, acadInsertion)
{
cHandle.SetSymbolFont(S("fg_symbolfont"));
// scannen gebeurt elke page-request opnieuw maar duurt zo'n 20ms, acceptabel.
var cssfile = Server.MapPath("../FontAwesome/css/fontawesome.min.css");
var cssfile = Server.MapPath("../FontAwesome/css/all.min.css");
__Log("Scanning " + cssfile);
fa_symbol_codes = {};
var fso = new ActiveXObject("Scripting.FileSystemObject");
@@ -389,6 +389,7 @@ function addObjecten(cHandle, highlight_ins_deel_key)
+ " )"
+ " AND THEMA.ins_deel_key = id.ins_deel_key"
+ (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE') ? " AND THEMA.fclt_f_datum = " + datumfilter.toSQL():"")
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ " ORDER BY isd.ins_srtdeel_key"
}
}
@@ -508,6 +509,7 @@ function addWerkplekObjecten(cHandle)
+ " AND isg.ins_discipline_key in (" + pDiscs_arr.join(",") +")"
+ " AND THEMA.ins_deel_key = id.ins_deel_key"
+ (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE') ? " AND THEMA.fclt_f_datum = " + datumfilter.toSQL():"")
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ " ORDER BY isd.ins_srtdeel_key"
}
}
@@ -648,6 +650,7 @@ function addPRJObjecten(cHandle)
+ " AND THEMA.prj_deel_key = id.prj_deel_key"
+ " AND prj_scenario_key = " + scenario_key
+ (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE') ? " AND THEMA.fclt_f_datum = " + datumfilter.toSQL():"")
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ " ORDER BY isd.ins_srtdeel_key"
}
}
@@ -751,6 +754,7 @@ function addPRJWerkplekObjecten(cHandle)
+ " AND isg.ins_discipline_key in (" + pDiscs_arr.join(",") +")"
+ " AND THEMA.prj_deel_key = id.prj_deel_key"
+ (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE') ? " AND THEMA.fclt_f_datum = " + datumfilter.toSQL():"")
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ " ORDER BY isd.ins_srtdeel_key"
}
}

View File

@@ -56,7 +56,7 @@ function addWerkplekken(cHandle)
sql : "SELECT 'W:'||prs_werkplek_key key, "
+ safe.quoted_sql(S("fg_werkpleksymbool"))+" symbolname, " // Vooralsnog vast symbool
+ " prs_werkplek_omschrijving oms, prs_werkplek_type,"
+ " NULL orgx, NULL orgy, NULL color"
+ " NULL orgx, NULL orgy, NULL color"
+ " FROM prs_werkplek pw"
+ " WHERE pw.prs_alg_ruimte_key = " + oRsRuimte("prs_alg_ruimte_key").Value
+ " AND prs_werkplek_dwgx IS NULL AND prs_werkplek_dwgy IS NULL"
@@ -126,6 +126,7 @@ function addWerkplekken(cHandle)
+ " WHERE pw.prs_alg_ruimte_key = sync.alg_ruimte_key"
+ " AND alg_verdieping_key = " + pvKey
+ " AND THEMA.prs_werkplek_key = pw.prs_werkplek_key"
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ scenFilter
+ " ORDER BY pw.prs_werkplek_key"
}
@@ -250,6 +251,7 @@ function addPRJWerkplekken(cHandle, scenario_key)
+ " AND alg_verdieping_key = " + pvKey
+ " AND prj_werkplek_verwijder IS NULL"
+ " AND THEMA.prj_werkplek_key = pw.prj_werkplek_key"
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ " ORDER BY pw.prj_werkplek_key"
}
}

View File

@@ -159,7 +159,8 @@ var datumfilter = getQParamDate("datumfilter", null);
+ " AND al.alg_locatie_key = ag.alg_locatie_key"
+ " AND ag.alg_gebouw_key = av.alg_gebouw_key"
+ " AND av.alg_verdieping_key = ar.alg_verdieping_key"
+ " AND (UPPER(th.waarde) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%");
+ " AND (UPPER(th.waarde) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%")
+ (hasColumn(labelviewNameR, 'fclt_f_3d_user_key', 'NUMBER') ? " AND th.fclt_f_3d_user_key = " + user_key:"");
if (hasColumn(labelviewNameR, 'tooltip', 'varchar2'))
sql += " OR UPPER(th.tooltip) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%");
sql += ")"
@@ -213,8 +214,9 @@ var datumfilter = getQParamDate("datumfilter", null);
+ " AND al.alg_locatie_key = ag.alg_locatie_key"
+ " AND ag.alg_gebouw_key = av.alg_gebouw_key"
+ " AND av.alg_verdieping_key = ar.alg_verdieping_key"
+ " AND (UPPER(th.waarde) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%");
if (hasColumn(labelviewNameR, 'tooltip', 'varchar2'))
+ " AND (UPPER(th.waarde) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%")
+ (hasColumn(labelviewNameI, 'fclt_f_3d_user_key', 'NUMBER') ? " AND th.fclt_f_3d_user_key = " + user_key:"");
if (hasColumn(labelviewNameI, 'tooltip', 'varchar2'))
sql += " OR UPPER(th.tooltip) LIKE " + safe.quoted_sql_wild("%" + zoektekst + "%");
sql += ")"

View File

@@ -65,6 +65,7 @@ var sql = "SELECT thema." + colKey
+ " WHERE thema." + colKey + "=sync." + colKey
+ " AND sync." + syncParent + "=" + pvKey
+ " AND thema.waarde = " + safe.quoted_sql(legenddesc)
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"")
+ scenFilter;
var keys = [];
var oRs = Oracle.Execute(sql);

View File

@@ -49,7 +49,8 @@ if (thema_key > 0) // Alle(en) ruimtes in het thema gaan we highlighten
var sql = "SELECT r.alg_ruimte_key, alg_ruimte_nr, waarde"
+ " FROM alg_ruimte r," + viewName + " thema"
+ " WHERE thema.alg_ruimte_key = r.alg_ruimte_key"
+ " AND r.alg_verdieping_key = " + vKey;
+ " AND r.alg_verdieping_key = " + vKey
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND THEMA.fclt_f_3d_user_key = " + user_key:"");
var oRs = Oracle.Execute(sql);
while (!oRs.Eof)
@@ -87,7 +88,8 @@ if (label_key > 0) // Voor plaatsing infoborden
var sql = "SELECT r.alg_ruimte_key, alg_ruimte_nr, " + waardecol
+ " FROM alg_ruimte r," + viewName + " lbl"
+ " WHERE lbl.alg_ruimte_key = r.alg_ruimte_key"
+ " AND r.alg_verdieping_key = " + vKey;
+ " AND r.alg_verdieping_key = " + vKey
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND lbl.fclt_f_3d_user_key = " + user_key:"");
if (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE'))
sql += " AND lbl.fclt_f_datum = " + datumfilter.toSQL();
@@ -112,7 +114,8 @@ if (label_key > 0) // Voor plaatsing infoborden
+ " AND lbl.ins_deel_key = deel.ins_deel_key"
+ " AND r.alg_verdieping_key = " + vKey
+ " AND r.alg_ruimte_key = deel.ins_alg_ruimte_key"
+ " AND ins_alg_ruimte_type = 'R'";
+ " AND ins_alg_ruimte_type = 'R'"
+ (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER') ? " AND lbl.fclt_f_3d_user_key = " + user_key:"");
if (datumfilter && hasColumn(viewName, 'fclt_f_datum', 'DATE'))
sql += " AND lbl.fclt_f_datum = " + datumfilter.toSQL();
@@ -154,4 +157,4 @@ while (!oRs.Eof)
Response.Write(JSON.stringify(result));
%>
<% ASPPAGE_END(); %>
<% ASPPAGE_END(); %>

View File

@@ -10,7 +10,7 @@
// &01 = binnen
// &02 = buiten
// &04 = scenario
// &08 = werkplek
// &08 = werkplek
// &16 = object
// &128 = sleepbaar
Parameters: floorKey (required)
@@ -21,7 +21,7 @@
Note: UIT TE BREIDEN. BEPERKINGEN NU:
- werkplekthemas (op prs_werkplek) niet ondersteund
- de buitensituatie voor terreinen moet nog worden toegevoegd
- de ruwe waarde uit de view wordt getoond, niet de vertaling volgens de legenda. Vooralsnog ook ok
- de ruwe waarde uit de view wordt getoond, niet de vertaling volgens de legenda. Vooralsnog ook ok
- voor prj is deze nog niet goed genoeg, dus daarvoor gebruiken we hem ook (nog) niet.
*/%>
@@ -76,9 +76,9 @@ if (floorKey > 0 && lthema_key > 0)
var functie_key = oRs("fac_functie_key").value;
oRs.close();
sql="";
if (functie_key) user.checkAutorisation(functie_key); // als een autorisatie gedefinieerd is, controleren we die
// sleepbaar of scenario niet maakt niet uit
var isruimtethema = (thema_type&25)==1;
var isterreinthema = (thema_type&25)==2;
@@ -101,7 +101,8 @@ if (floorKey > 0 && lthema_key > 0)
+ " AND r.alg_ruimte_nr NOT LIKE '\\_%' ESCAPE '\\' " // suppress virtual rooms
+ " AND r.alg_srtruimte_key = sr.alg_srtruimte_key(+)"
+ " AND r.alg_ruimte_key = "+(isprjthema ? "th.prj_ruimte_key" : "th.alg_ruimte_key") // niet genoeg; moet dan denk ik ook prj_ruimte enzo
+ (withdatefilter
+ (hasColumn(thema_view, 'fclt_f_3d_user_key', 'NUMBER') ? " AND th.fclt_f_3d_user_key = " + user_key:"")
+ (withdatefilter
? " AND th.fclt_f_datum = " + datumfilter.toSQL()
: ""
)
@@ -110,7 +111,7 @@ if (floorKey > 0 && lthema_key > 0)
: ""
)
+ " ORDER BY r.alg_ruimte_nr";
}
}
else if (isobjectthema) // objecten binnen
{
sql = "SELECT id.ins_deel_key, ins_deel_omschrijving, waarde,"
@@ -122,7 +123,8 @@ if (floorKey > 0 && lthema_key > 0)
+ " AND id.ins_alg_ruimte_key = r.alg_ruimte_key" // zijn zo dus alleen ruimtegebonden objecten. Voorstelbaar dat wp-gebonden objecten erbij mogen
+ " AND r.alg_verdieping_key = " + floorKey
+ " AND id.ins_deel_key = " + (isprjthema ? "th.prj_deel_key" : "th.ins_deel_key") // niet genoeg; moet dan denk ik ook prj_deel enzo
+ (withdatefilter
+ (hasColumn(thema_view, 'fclt_f_3d_user_key', 'NUMBER') ? " AND th.fclt_f_3d_user_key = " + user_key:"")
+ (withdatefilter
? " AND th.fclt_f_datum = " + datumfilter.toSQL()
: ""
)
@@ -134,7 +136,7 @@ if (floorKey > 0 && lthema_key > 0)
? " AND r.alg_ruimte_key IN (" + highlight_arr.join(",") + ")"
: ""
)
+ " ORDER BY r.alg_ruimte_nr, ins_deel_omschrijving";
+ " ORDER BY r.alg_ruimte_nr, ins_deel_omschrijving";
}
else if (iswpthema) // werkplekken binnen
{
@@ -148,7 +150,8 @@ if (floorKey > 0 && lthema_key > 0)
? " AND ar.alg_ruimte_key IN (" + highlight_arr.join(",") + ")"
: ""
)
+ (withdatefilter
+ (hasColumn(thema_view, 'fclt_f_3d_user_key', 'NUMBER') ? " AND th.fclt_f_3d_user_key = " + user_key:"")
+ (withdatefilter
? " AND th.fclt_f_datum = " + datumfilter.toSQL()
: ""
)
@@ -160,7 +163,7 @@ if (floorKey > 0 && lthema_key > 0)
}
}
else
{
{
// Er is (nog) geen verdieping (of thema) bekend: no result
sql = "SELECT * FROM DUAL WHERE 1 = 0";
}
@@ -175,12 +178,12 @@ else
FcltMgr.openDetail("appl/alg/alg_ruimte.asp?key=" + row.getAttribute("ROWKEY"));
<% } else if (isobjectthema) { %>
FcltMgr.openDetail("appl/ins/ins_deel.asp?urole=bo&ins_key=" + row.getAttribute("ROWKEY"));
<% } else if (iswpthema) {
<% } else if (iswpthema) {
if (S("prs_werkplek_implicit") == 1) { %>
FcltMgr.openModalDetail("../prs/prs_edit_perslidwerkplek.asp?wp_key=" + row.getAttribute("ROWKEY"));
<% } else { %>
FcltMgr.openDetail("appl/alg/alg_wp.asp?mode=viewUpdate&key=" + row.getAttribute("ROWKEY"));
<% }
<% }
} %>
}
</script>
@@ -196,19 +199,19 @@ else
showAll: showall
});
if (isruimtethema)
if (isruimtethema)
{
rst.addColumn(new Column({caption: L("lcl_obj_inf_room"), content: "alg_ruimte_nr"}));
rst.addColumn(new Column({caption: L("lcl_descr"), content: "alg_ruimte_omschrijving"}));
rst.addColumn(new Column({caption: L("alg_srtruimte"), content: "alg_srtruimte_omschrijving"})); // ook een beetje voor de vulling
}
else if (isobjectthema)
else if (isobjectthema)
{
rst.addColumn(new Column({caption: L("lcl_obj_inf_room"), content: "alg_ruimte_nr"}));
rst.addColumn(new Column({caption: L("lcl_ins_object"), content: "ins_deel_omschrijving"}));
rst.addColumn(new Column({caption: L("lcl_descr"), content: "ins_srtdeel_omschrijving"}));
}
else if (iswpthema)
else if (iswpthema)
{
rst.addColumn(new Column({caption: L("lcl_obj_inf_room"), content: "alg_ruimte_nr"}));
rst.addColumn(new Column({caption: L("lcl_estate_wp_seq"), content: "prs_werkplek_volgnr"}));
@@ -223,4 +226,4 @@ else
%>
</body>
</html>
<% ASPPAGE_END(); %>
<% ASPPAGE_END(); %>

View File

@@ -203,6 +203,9 @@ imgurl += "&sizeY=" + (1*sizeY);
+ " and alg_verdieping_key = " + verdieping_key;
}
if (hasColumn(viewName, 'fclt_f_3d_user_key', 'NUMBER'))
waardenSQL += " AND th.fclt_f_3d_user_key = " + user_key;
if (discreet)
sql = "SELECT "+ lcl.xsqla('ti.CAD_LEGENDAWAARDE_OMSCHR','ti.cad_legendawaarde_key')
+ ", ti.CAD_LEGENDAWAARDE_RGB, TH2.WAARDE_KEY, COUNT(*) aantal"