FSN#37004: ins_srtcontrole autorisatie en terminologie.
svn path=/Website/trunk/; revision=30179
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
%>
|
||||
<!-- #include file="./model_ins_kenmerk.inc"-->
|
||||
<!-- #include file="../mgt/mgt_tools.inc" -->
|
||||
<!-- #include file="./model_ctr_discipline.inc" -->
|
||||
<%
|
||||
function model_ins_srtcontrole()
|
||||
{
|
||||
@@ -87,12 +88,11 @@ function model_ins_srtcontrole()
|
||||
"typ": "memo",
|
||||
"translate": true
|
||||
},
|
||||
"inspection_type": {
|
||||
"dbs": "ins_srtcontrole_type",
|
||||
"label": L("ins_srtcontrole_type"),
|
||||
"ctr_discipline": {
|
||||
"dbs": "ctr_discipline_key",
|
||||
"label": L("ctr_discipline"),
|
||||
"typ": "key",
|
||||
"required": true,
|
||||
"LOV": buildSrtcontroletypeList()
|
||||
"foreign": "ctr_discipline"
|
||||
},
|
||||
"inspection_mode": {
|
||||
"dbs": "ins_srtcontrole_mode",
|
||||
|
||||
@@ -548,6 +548,7 @@ ins = {checkAutLevel:
|
||||
+ " , insp.ins_deelsrtcontrole_status"
|
||||
+ " , insp.vervaldatum"
|
||||
+ " , insp.isc_mode"
|
||||
+" , insp.ctr_discipline_key"
|
||||
// Moment inspectie pas kunnen opslaan op of na geplande inspectiedatum.
|
||||
// Is in de moment modus de invoer na het volgende berekende inspectietijdstip? Voor interval modus is dit altijd het geval.
|
||||
// Als er nog nooit is geinspecteerd en er is er nog geen ingepland dan is het ook ok.
|
||||
@@ -580,10 +581,11 @@ ins = {checkAutLevel:
|
||||
+ " ELSE 0"
|
||||
+ " END invoerAfterNext"
|
||||
+ " FROM (SELECT idsc.ins_deelsrtcontrole_key"
|
||||
+ " , ins_deelsrtcontrole_datum"
|
||||
+ " , idsc.ins_deelsrtcontrole_datum"
|
||||
+ " , idsc.ins_deelsrtcontrole_status"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eind vervaldatum"
|
||||
+ " , isc.ins_srtcontrole_mode isc_mode"
|
||||
+ " , isc.ctr_discipline_key"
|
||||
+ " , COALESCE (xcp.ins_srtcontroledl_xcp_eenheid, isc.ins_srtcontrole_eenheid) eenheid"
|
||||
+ " , idsc.ins_deelsrtcontrole_plandatum plandatum"
|
||||
+ " , CASE"
|
||||
@@ -625,32 +627,43 @@ ins = {checkAutLevel:
|
||||
// Als de laatste inspectie is afgerond (stutus is 6) moet er een nieuwe inspectie gestart worden.
|
||||
var ins_deelsrtcontrole_status = oRs("ins_deelsrtcontrole_status").Value != null? oRs("ins_deelsrtcontrole_status").Value : -1;
|
||||
var vervaldatum = oRs("vervaldatum").Value != null? new Date(oRs("vervaldatum").Value) : null;
|
||||
var ctr_discipline_key = oRs("ctr_discipline_key").Value;
|
||||
var vervallen = vervaldatum != null && vervaldatum < new Date();
|
||||
var invoerAfterNext = oRs("invoerAfterNext").Value == 1;
|
||||
oRs.Close();
|
||||
|
||||
iresult.invoerAfterNext = invoerAfterNext;
|
||||
|
||||
// Voor CTR alleen discipline autorisatie met 3D ja/nee autorisatie (fac_functie_min_level = 0)
|
||||
ctrresult = user.func_enabled("CTR",
|
||||
ctr_discipline_key,
|
||||
null, // alg_key is nvt
|
||||
null, // prs_key in nvt
|
||||
false, // pessimist (checkOptimistic)
|
||||
true); // nog even optional (isOptional)
|
||||
|
||||
var hasCTRRights = ctrresult.canWrite("WEB_CTRUSE"); // Heb ik rechten om periodieke taken uit te voeren (Ja/Nee autorisatie (canRead = canWrite))?
|
||||
|
||||
// Als de inspectie vervallen is moet je alleen nog de lopende inspecties (ingepland of later) kunnen gereedmelden en/of afronden,
|
||||
// zodat deze inspectie afgerond kan worden. Nieuwe inspectie kunnen nooit meer beginnen.
|
||||
// Eerste inspectie of verwerkte inspectie kan niet gewijzigd worden.
|
||||
iresult.canMsuEdit = iresult.writemsu && ins_deelsrtcontrole_status == 6;
|
||||
iresult.canInspEdit = ((iresult.canInspect && ins_deelsrtcontrole_status != -1 && ins_deelsrtcontrole_status != 6) ||
|
||||
iresult.canMsuEdit) &&
|
||||
!vervallen && actief;
|
||||
iresult.canInspShow = iresult.readuse && !vervallen && (ins_deelsrtcontrole_status >= 0);
|
||||
!vervallen && actief && hasCTRRights;
|
||||
iresult.canInspShow = iresult.readuse && !vervallen && (ins_deelsrtcontrole_status >= 0) && hasCTRRights;
|
||||
// Bij eerste inspectie of verwerkte inspectie kan er gepland worden.
|
||||
iresult.canInspPlan = iresult.canInspect && !vervallen && (ins_deelsrtcontrole_status == -1 || ins_deelsrtcontrole_status == 6) && actief;
|
||||
iresult.canInspPlan = iresult.canInspect && !vervallen && (ins_deelsrtcontrole_status == -1 || ins_deelsrtcontrole_status == 6) && actief && hasCTRRights;
|
||||
// Bij eerste inspectie, geplande inspectie of verwerkte inspectie kan er gestart worden.
|
||||
iresult.canInspStart = iresult.canInspect && invoerAfterNext && !vervallen &&
|
||||
(ins_deelsrtcontrole_status <= 0 || ins_deelsrtcontrole_status == 6) && actief;
|
||||
(ins_deelsrtcontrole_status <= 0 || ins_deelsrtcontrole_status == 6) && actief && hasCTRRights;
|
||||
// Bij eerste inspectie, geplande inspectie, gestarte inspectie of verwerkte inspectie kan er gereedgemeld/afgerond worden.
|
||||
iresult.canInspClose = iresult.canInspect && invoerAfterNext &&
|
||||
((!vervallen && (ins_deelsrtcontrole_status < 5 || ins_deelsrtcontrole_status == 6)) ||
|
||||
(ins_deelsrtcontrole_status == 0 || ins_deelsrtcontrole_status == 2)) &&
|
||||
actief;
|
||||
actief && hasCTRRights;
|
||||
// Alleen als de inspectie gereedgemeld is kan afgerond worden.
|
||||
iresult.canInspFinish = iresult.canInspect && invoerAfterNext && ins_deelsrtcontrole_status == 5 && actief;
|
||||
iresult.canInspFinish = iresult.canInspect && invoerAfterNext && ins_deelsrtcontrole_status == 5 && actief && hasCTRRights;
|
||||
}
|
||||
else
|
||||
iresult.invoerAfterNext = true;
|
||||
@@ -691,7 +704,7 @@ ins = {checkAutLevel:
|
||||
iresult = user.func_enabled("INS",
|
||||
ins_discipline_key,
|
||||
null, // alg_key is nvt
|
||||
ins_alg_ruimte_key,
|
||||
ins_alg_ruimte_key, // prs_key
|
||||
false, // pessimist
|
||||
true); // nog even optional
|
||||
if (!iresult || !iresult.anyfound)
|
||||
@@ -731,7 +744,7 @@ ins = {checkAutLevel:
|
||||
iresult = user.func_enabled("INS",
|
||||
ins_discipline_key,
|
||||
alg_ruimte_key,
|
||||
null,
|
||||
null, // prs_key
|
||||
false, // Pessimist.
|
||||
true);
|
||||
if (!iresult || !iresult.anyfound)
|
||||
|
||||
@@ -236,6 +236,14 @@ var authparams = user.checkAutorisation("WEB_INSUSE");
|
||||
+ " WHERE idsc.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
||||
+ " AND idsc.ins_deelsrtcontrole_status NOT IN (6)"
|
||||
+ " AND idsc.ins_deel_key = di.ins_deel_key)"
|
||||
+ " AND di.ctr_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 + ")"
|
||||
+ " UNION ALL"
|
||||
// Combineren met uitgevoerde inspecties op dit object of lopende inspecties (ingepland(0), gestart(2) of gereedgemeld(5))
|
||||
+ " SELECT 2 seq"
|
||||
@@ -287,6 +295,14 @@ var authparams = user.checkAutorisation("WEB_INSUSE");
|
||||
+ " AND idsc.prs_perslid_key = p.prs_perslid_key(+)"
|
||||
+ " AND idsc.ins_controlemode_key = cm.ins_controlemode_key(+)"
|
||||
+ " AND di.ins_deel_key = " + ins_key
|
||||
+ " AND di.ctr_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 + ")"
|
||||
// Gedaande inspectie altijd tonen.
|
||||
+ " )"
|
||||
+ " ORDER BY seq, ins_deelsrtcontrole_key DESC, ins_deelsrtcontrole_datum DESC, inspectie_org DESC, inspectie_next, ins_srtcontrole_omschrijving";
|
||||
@@ -466,6 +482,14 @@ var authparams = user.checkAutorisation("WEB_INSUSE");
|
||||
+ " AND di.ins_deel_key = " + ins_key
|
||||
+ " AND COALESCE (xcp.ins_srtcontroledl_xcp_periode, di.ins_srtcontrole_periode) <= 0" // Inactieve soort controles tonen.
|
||||
+ " AND xcp.ins_srtcontroledl_xcp_periode IS NULL" // Soort controles die niet overruled zijn tonen.
|
||||
+ " AND di.ctr_discipline_key IN (SELECT w.ins_discipline_key" // Alleen van de disciplines waar ik schrijf rechten op heb meetellen.
|
||||
+ " 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_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_deel_key)";
|
||||
var boRs = Oracle.Execute(bsql);
|
||||
|
||||
@@ -111,7 +111,7 @@ function ins_list (pautfunction, params)
|
||||
var objsrt_key = params.objsrt_key;
|
||||
var objsrt_oms = params.objsrt_oms;
|
||||
var groep = params.groep;
|
||||
var controletype = params.controletype;
|
||||
var ctrdisc_key = params.ctrdisc_key;
|
||||
var dep_key = params.dep_key;
|
||||
var persoon_key = params.persoon_key;
|
||||
var beh_key = params.beh_key;
|
||||
@@ -524,11 +524,13 @@ function ins_list (pautfunction, params)
|
||||
+ " , groepoms"
|
||||
+ " , ins_srtcontrole_omschrijving"
|
||||
+ " , ins_srtcontrole_key"
|
||||
+ " , ins_srtcontrole_type"
|
||||
+ " , ins_deelsrtcontrole_status"
|
||||
+ " , ins_deelsrtcontrole_key"
|
||||
+ " , ins_deelsrtcontrole_plandatum"
|
||||
+ " , ins_controlemode_success"
|
||||
+ " , ctr_disc_key"
|
||||
+ " , ctr_disc_oms"
|
||||
+ " , ctr_controle_type"
|
||||
+ " FROM ("
|
||||
+ (inspDone
|
||||
? " SELECT 1 rn" // Afgehandelde inspecties.
|
||||
@@ -545,7 +547,6 @@ function ins_list (pautfunction, params)
|
||||
+ " , di.ins_srtcontrole_groep groepoms"
|
||||
+ " , " + lcl.xsqla('di.ins_srtcontrole_omschrijving', 'di.ins_srtcontrole_key')
|
||||
+ " , di.ins_srtcontrole_key"
|
||||
+ " , di.ins_srtcontrole_type"
|
||||
+ " , -1 ins_deelsrtcontrole_status"
|
||||
+ " , NULL ins_deelsrtcontrole_key"
|
||||
+ " , (SELECT idsc.ins_deelsrtcontrole_plandatum"
|
||||
@@ -566,6 +567,15 @@ function ins_list (pautfunction, params)
|
||||
+ " AND idsc2.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
||||
+ " AND idsc2.ins_deelsrtcontrole_status = 6))"
|
||||
+ " ins_controlemode_success"
|
||||
+ " , di.ctr_discipline_key ctr_disc_key"
|
||||
+ " , (SELECT ins_discipline_omschrijving"
|
||||
+ " FROM ctr_discipline"
|
||||
+ " WHERE ins_discipline_key = di.ctr_discipline_key) ctr_disc_oms"
|
||||
+ " , (SELECT ctr_disc_params_controle_type"
|
||||
+ " FROM ctr_discipline cd"
|
||||
+ " , ctr_disc_params cdp"
|
||||
+ " WHERE cdp.ctr_ins_discipline_key = cd.ins_discipline_key"
|
||||
+ " AND cd.ins_discipline_key = di.ctr_discipline_key) ctr_controle_type"
|
||||
+ " FROM ins_v_defined_inspect_xcp di"
|
||||
+ " WHERE EXISTS (SELECT ins_deelsrtcontrole_key"
|
||||
+ " FROM ins_deelsrtcontrole idsc"
|
||||
@@ -586,6 +596,14 @@ function ins_list (pautfunction, params)
|
||||
+ " WHERE idsc2.ins_deel_key = di.ins_deel_key"
|
||||
+ " AND idsc2.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
||||
+ " AND idsc2.ins_deelsrtcontrole_status = 6))" + (insSuccessY? " = 1" : " IS NULL"))
|
||||
+ " AND di.ctr_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 + ")"
|
||||
+ " ORDER BY inspectie_date)"
|
||||
: (inspSoon || (!inspSoon && !inspBusy && !inspClosed)
|
||||
? " SELECT 1 rn" // inspecties die nog nooit zijn uitgevoerd/ingepland. Er is nog geen ins_deelsrtcontrole regel aanwezig en dus ook geen plandatum/respijtdatum.
|
||||
@@ -603,11 +621,19 @@ function ins_list (pautfunction, params)
|
||||
+ " , di.ins_srtcontrole_groep groepoms"
|
||||
+ " , " + lcl.xsqla('di.ins_srtcontrole_omschrijving', 'di.ins_srtcontrole_key')
|
||||
+ " , di.ins_srtcontrole_key"
|
||||
+ " , di.ins_srtcontrole_type"
|
||||
+ " , -1 ins_deelsrtcontrole_status"
|
||||
+ " , NULL ins_deelsrtcontrole_key"
|
||||
+ " , NULL ins_deelsrtcontrole_plandatum"
|
||||
+ " , NULL ins_controlemode_success"
|
||||
+ " , di.ctr_discipline_key ctr_disc_key"
|
||||
+ " , (SELECT ins_discipline_omschrijving"
|
||||
+ " FROM ctr_discipline"
|
||||
+ " WHERE ins_discipline_key = di.ctr_discipline_key) ctr_disc_oms"
|
||||
+ " , (SELECT ctr_disc_params_controle_type"
|
||||
+ " FROM ctr_discipline cd"
|
||||
+ " , ctr_disc_params cdp"
|
||||
+ " WHERE cdp.ctr_ins_discipline_key = cd.ins_discipline_key"
|
||||
+ " AND cd.ins_discipline_key = di.ctr_discipline_key) ctr_controle_type"
|
||||
+ " FROM ins_v_defined_inspect_xcp di"
|
||||
+ " WHERE (di.ins_deel_key, di.ins_srtcontrole_key) NOT IN"
|
||||
+ " (SELECT ins_deel_key, ins_srtcontrole_key"
|
||||
@@ -615,6 +641,14 @@ function ins_list (pautfunction, params)
|
||||
+ (srtcontrole > -1
|
||||
? " AND di.ins_srtcontrole_key = " + srtcontrole
|
||||
: "")
|
||||
+ " AND di.ctr_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 + ")"
|
||||
+ " UNION ALL"
|
||||
: "")
|
||||
// Inspecties die al eens zijn uitgevoerd of inspecties die voor het eerst zijn ingepland(0) of gestart(2) maar nog geen uitgevoerde/afgemelde(6) inspectie hebben.
|
||||
@@ -647,11 +681,19 @@ function ins_list (pautfunction, params)
|
||||
+ " , di.ins_srtcontrole_groep groepoms"
|
||||
+ " , " + lcl.xsqla('di.ins_srtcontrole_omschrijving', 'di.ins_srtcontrole_key')
|
||||
+ " , di.ins_srtcontrole_key"
|
||||
+ " , di.ins_srtcontrole_type"
|
||||
+ " , idsc.ins_deelsrtcontrole_status"
|
||||
+ " , idsc.ins_deelsrtcontrole_key"
|
||||
+ " , CASE WHEN idsc.ins_deelsrtcontrole_status IN (0, 2) THEN idsc.ins_deelsrtcontrole_plandatum ELSE NULL END ins_deelsrtcontrole_plandatum"
|
||||
+ " , NULL ins_controlemode_success"
|
||||
+ " , di.ctr_discipline_key ctr_disc_key"
|
||||
+ " , (SELECT ins_discipline_omschrijving"
|
||||
+ " FROM ctr_discipline"
|
||||
+ " WHERE ins_discipline_key = di.ctr_discipline_key) ctr_disc_oms"
|
||||
+ " , (SELECT ctr_disc_params_controle_type"
|
||||
+ " FROM ctr_discipline cd"
|
||||
+ " , ctr_disc_params cdp"
|
||||
+ " WHERE cdp.ctr_ins_discipline_key = cd.ins_discipline_key"
|
||||
+ " AND cd.ins_discipline_key = di.ctr_discipline_key) ctr_controle_type"
|
||||
+ " FROM ins_deelsrtcontrole idsc"
|
||||
+ " , ins_v_defined_inspect_xcp di"
|
||||
+ " , ins_controlemode cm"
|
||||
@@ -661,6 +703,14 @@ function ins_list (pautfunction, params)
|
||||
+ (srtcontrole > -1
|
||||
? " AND di.ins_srtcontrole_key = " + srtcontrole
|
||||
: "")
|
||||
+ " AND di.ctr_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 + ")"
|
||||
+ " ORDER BY inspectie_next)")
|
||||
+ " WHERE rn = 1"
|
||||
// Voor afgehandelde inspecties ook inspecties met periode 0 tonen.
|
||||
@@ -679,11 +729,13 @@ function ins_list (pautfunction, params)
|
||||
+ " , ispn.inspectie_eenheid"
|
||||
+ " , ispn.inspectie_eind"
|
||||
+ " , ispn.groepoms"
|
||||
+ " , ispn.ins_srtcontrole_type"
|
||||
+ " , ispn.ins_deelsrtcontrole_status"
|
||||
+ " , ispn.ins_deelsrtcontrole_key"
|
||||
+ " , ispn.ins_deelsrtcontrole_plandatum"
|
||||
+ " , ispn.ins_controlemode_success";
|
||||
+ " , ispn.ins_controlemode_success"
|
||||
+ " , ispn.ctr_disc_key"
|
||||
+ " , ispn.ctr_disc_oms"
|
||||
+ " , ispn.ctr_controle_type";
|
||||
|
||||
sqlInspectie_from = ", (" + sqlNext + ") ispn"
|
||||
|
||||
@@ -1034,8 +1086,8 @@ function ins_list (pautfunction, params)
|
||||
+ " FROM ins_srtcontroledl_xcp"
|
||||
+ " WHERE ins_srtcontroledl_xcp_key = " + groep + "))";
|
||||
|
||||
if (inspect && controletype > -1)
|
||||
sql_ex += " AND ispn.ins_srtcontrole_type = " + controletype;
|
||||
if (inspect && ctrdisc_key > -1)
|
||||
sql_ex += " AND ispn.ctr_disc_key = " + ctrdisc_key;
|
||||
|
||||
// Nu filtercondities voor flexkenmerken toevoegen
|
||||
sql_ex += getKenmerkSql("INS", "i.ins_deel_key");
|
||||
@@ -1656,7 +1708,7 @@ function ins_list (pautfunction, params)
|
||||
var nonext = oRs("nonext").Value == 1;
|
||||
if (nonext)
|
||||
{ // Er is nog geen inspectie geweest. Eerste controle moet nog plaatsvinden.
|
||||
switch (oRs("ins_srtcontrole_type").Value)
|
||||
switch (oRs("ctr_controle_type").Value)
|
||||
{
|
||||
case 1: { txt = L("lcl_ins_controle_first"); break; } // Eerste controle.
|
||||
case 2:
|
||||
@@ -1725,19 +1777,6 @@ function ins_list (pautfunction, params)
|
||||
return "<span style='white-space: nowrap'>"+dttxt+"</span>";
|
||||
}
|
||||
|
||||
function fnSrtControleType(oRs)
|
||||
{
|
||||
var txt = "";
|
||||
switch (oRs("ins_srtcontrole_type").Value)
|
||||
{
|
||||
case 1: { txt = L("lcl_ins_srtcontrole_insp"); break; } // Controle.
|
||||
case 2: { txt = L("lcl_ins_srtcontrole_repl"); break; } // Vervanging.
|
||||
case 3: { txt = L("lcl_ins_srtcontrole_cert"); break; } // Certificering.
|
||||
}
|
||||
|
||||
return txt;
|
||||
}
|
||||
|
||||
if (koppel_key && ins.func_enabled_deel(koppel_key).canChange) // TODO (popup met objectselector (zoiets als bij meldingen?)
|
||||
{
|
||||
buttons = [{ icon: "wijzigen.png",
|
||||
@@ -1831,8 +1870,8 @@ function ins_list (pautfunction, params)
|
||||
}
|
||||
else // gewoon
|
||||
{
|
||||
if (inspect && controletype == -1)
|
||||
rst.addColumn(new Column({caption: L("lcl_ins_srtcontrole_type"), content: fnSrtControleType}));
|
||||
if (inspect && ctrdisc_key == -1)
|
||||
rst.addColumn(new Column({caption: L("ctr_discipline"), content: "ctr_disc_oms"}));
|
||||
rst.addColumn(new Column({caption: L("lcl_obj_identification"), content: "ins_deel_omschrijving"}));
|
||||
rst.addColumn(new Column({caption: L("lcl_ins_opmerking"), content: "ins_deel_opmerking", combine: inspect}));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ var srtgroep = getQParamInt("srtgroep", -1); // Groep
|
||||
var srtdeel = getQParamInt("srtdeel", -1); // Objectsoort
|
||||
var srtdeelomschr = getQParam("srtdeelomschr", ""); // Srtdeel code en/of omschrijving
|
||||
var groep = getQParam("groep", ""); // Groep
|
||||
var controletype = getQParamInt("controletype", -1); // Controle type
|
||||
var ctrdisc_key = getQParamInt("ctrdisc_key", -1); // Ctrdiscipline
|
||||
var dep_key = getQParamInt("dep_key", -1); // Organisatie key
|
||||
var prs_key = getQParamInt("prs_key", -1); // Persoon key
|
||||
var alg_startlevel = getQParamInt("alg_startlevel", 2); // Startlevel van plaatsselector (Locatie)
|
||||
@@ -293,22 +293,30 @@ var authparams = user.checkAutorisation(autfunction);
|
||||
|
||||
if (insInspect) // Ook inspectiezoekvelden
|
||||
{
|
||||
if (controletype == -1)
|
||||
if (ctrdisc_key == -1)
|
||||
{
|
||||
// <!-- Controle Type -->
|
||||
sql = "SELECT 1, " + safe.quoted_sql(L("lcl_ins_srtcontrole_insp")) + " FROM DUAL" // Controle.
|
||||
+ " UNION SELECT 2, " + safe.quoted_sql(L("lcl_ins_srtcontrole_repl")) + " FROM DUAL" // Vervanging.
|
||||
+ " UNION SELECT 3, " + safe.quoted_sql(L("lcl_ins_srtcontrole_cert")) + " FROM DUAL" // Certificering.
|
||||
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 + ")"
|
||||
+ " ORDER BY 2";
|
||||
FCLTselector("controletype",
|
||||
FCLTselector("ctr_discipline",
|
||||
sql,
|
||||
{ label: L("lcl_ins_srtcontrole_insptype"),
|
||||
{ label: L("ctr_discipline"),
|
||||
emptyOption: L("lcl_all")
|
||||
});
|
||||
}
|
||||
else
|
||||
{ %>
|
||||
<input type=hidden name="controletype" id="controletype" value="<%=controletype%>">
|
||||
<input type=hidden name="ctr_discipline" id="ctr_discipline" value="<%=ctrdisc_key%>">
|
||||
<% }
|
||||
|
||||
var sql = "SELECT ins_srtcontrole_key,"
|
||||
|
||||
@@ -50,7 +50,7 @@ var insgroup_key = getQParamInt("srtgroep", -1); // Groep
|
||||
var objsrt_key = getQParamIntArray("srtdeel", -1); // Objectsoort
|
||||
var objsrtomschr = getQParam("srtdeelomschr", ""); // Soortdeel code en/of omschrijving
|
||||
var groep = getQParamInt("groep", -1); // Groep
|
||||
var controletype = getQParamInt("controletype", -1); // Controle type
|
||||
var ctrdisc_key = getQParamInt("ctr_discipline", -1); // Ctrdiscipline
|
||||
var dep_key = getQParamInt("sDept_key", -1); // Organisatie key
|
||||
var persoon_key = getQParamInt("sName_key", -1); // Persoon key
|
||||
var okbutton = getQParamInt("okbutton", 0) == 1; // show okbutton
|
||||
@@ -121,7 +121,7 @@ ins_list ( autfunction,
|
||||
objsrt_key: (objsrt_key.length > 0 ? objsrt_key : null),
|
||||
objsrt_oms: objsrtomschr,
|
||||
groep: (groep != -1 ? groep : null),
|
||||
controletype: controletype,
|
||||
ctrdisc_key: ctrdisc_key,
|
||||
dep_key: (dep_key != -1 ? dep_key : null),
|
||||
persoon_key: (persoon_key != -1 ? persoon_key : null),
|
||||
beh_key: (beh_key != -1 ? beh_key : null),
|
||||
|
||||
@@ -31,6 +31,13 @@ FCLTHeader.Requires({ plugins: ["jQuery", "suggest", "kenmerk"],
|
||||
var ins_key = getQParamInt("ins_key");
|
||||
var srtcont_key = getQParamInt("srtcont_key");
|
||||
var deelsrtcont_key = getQParamInt("deelsrtcont_key", -1); // Bestaande inspectie indien meegegeven.
|
||||
|
||||
var this_ins = ins.func_enabled_deel(ins_key,
|
||||
{srtcont_key: srtcont_key,
|
||||
deelsrtcont_key: deelsrtcont_key
|
||||
});
|
||||
user.auth_required_or_abort(this_ins.canInspShow);
|
||||
|
||||
%>
|
||||
|
||||
<html>
|
||||
@@ -177,12 +184,6 @@ var deelsrtcont_key = getQParamInt("deelsrtcont_key", -1); // Bestaande inspecti
|
||||
canMelding = (oRs("aantal").Value > 0);
|
||||
oRs.Close();
|
||||
|
||||
// Als object is vervallen dan kun je niet meer inspecteren en uitstellen.
|
||||
var this_ins = ins.func_enabled_deel(ins_key,
|
||||
{srtcont_key: srtcont_key,
|
||||
deelsrtcont_key: deelsrtcont_key
|
||||
});
|
||||
|
||||
// Gedaande inspecties kunnen alleen geedit worden.
|
||||
// Ik zie alleen objecten waar ik read rechten (3d) op heb. Dan mag ik ze ook verder inzien.
|
||||
var canEdit = this_ins.canInspEdit;
|
||||
|
||||
@@ -360,6 +360,14 @@ user.anything_todo_or_abort(this_ins.canChangeXcp);
|
||||
+ (srtcont_key > 0
|
||||
? " AND di.ins_srtcontrole_key = " + srtcont_key
|
||||
: "")
|
||||
+ " AND di.ctr_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 + ")"
|
||||
+ " GROUP BY di.ins_srtcontrole_key"
|
||||
+ " , di.ins_srtcontrole_omschrijving"
|
||||
+ " , di.ins_srtcontrole_mode"
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
var kenmerk_params = {};
|
||||
kenmerk_params.niveau = getQParam("inspectie", "");
|
||||
|
||||
if (mode != "save")
|
||||
{
|
||||
%>
|
||||
<script>
|
||||
var srtinstallatieselector_available = 1; // toon alleen actuele disciplines/groepen en objecten.
|
||||
</script>
|
||||
<script>
|
||||
var srtinstallatieselector_available = 1; // toon alleen actuele disciplines/groepen en objecten.
|
||||
</script>
|
||||
<%
|
||||
}
|
||||
|
||||
var this_model = new model_ins_kenmerk(kenmerk_params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user