AAIT#88271 Verschillende opties bij het scope van een contract

svn path=/Website/trunk/; revision=70867
This commit is contained in:
Erik Groener
2025-11-10 11:21:01 +00:00
parent e78a3c30ef
commit c3c49895ca
2 changed files with 46 additions and 13 deletions

View File

@@ -3,7 +3,7 @@
$Revision$
$Id$
File: CNT/cnt_show_contract.asp
File: CNT/cnt_contract.asp
Description: Functie bestaand contractrecord toont of nieuwe laat editen
Parameters: cnt_key Contract key
Context:
@@ -60,9 +60,16 @@ var pageTitle = L('lcl_contract');
var pageIcon = "fa-file-certificate"; // default
if (cnt_key > 0)
{
sql = "SELECT cnt_contract_nummer_intern, cnt_contract_versie, cnt_disc_params_factuurschema, cnt_contract_omschrijving, cs.ins_discipline_image"
sql = "SELECT cnt_contract_nummer_intern"
+ " , cnt_contract_versie"
+ " , cnt_disc_params_factuurschema"
+ " , cnt_contract_omschrijving"
+ " , dp.cnt_srtcontract_type"
+ " , cs.ins_discipline_image"
+ " , "+ lcl.xsqla('cs.ins_discipline_omschrijving','cs.ins_discipline_key')
+ " FROM cnt_contract c, cnt_disc_params dp, cnt_discipline cs"
+ " FROM cnt_contract c"
+ " , cnt_disc_params dp"
+ " , cnt_discipline cs"
+ " WHERE cnt_contract_key = " + cnt_key
+ " AND c.ins_discipline_key = cs.ins_discipline_key"
+ " AND c.ins_discipline_key = dp.cnt_ins_discipline_key";
@@ -70,6 +77,7 @@ if (cnt_key > 0)
if (oRs.eof)
shared.record_not_found();
hasFactuurschema = (oRs("cnt_disc_params_factuurschema").Value == 1);
var srtcontract_type = oRs("cnt_srtcontract_type").Value;
var cnt_contract_versie = oRs("cnt_contract_versie").Value;
if (copy)
tabtitle = L("lcl_cnt_copy") + " " + tabtitle.toLowerCase();
@@ -87,10 +95,25 @@ if (cnt_key > 0)
%>
<script type="text/javascript">
var cnt_key = <%=cnt_key%>;
var copy = (<%=(copy?1:0)%>)==1;
var verynew = (<%=(verynew?1:0)%>)==1;
var hasScope = (<%=((srtcontract_type != 4 && srtcontract_type != 6) ? 1 : 0)%>) == 1;
$(function ()
{
FcltMgr.setTitle("<%=safe.jsstring(tabtitle)%>", {hot: false});
<% if (cnt_key == -1) { %>FcltMgr.startEdit(window);<% } %>
if (cnt_key == -1)
{
FcltMgr.startEdit(window);
}
else
{
if (verynew && hasScope)
{ // Direct naar tab scope.
$("#frametabs").tabs({ "active": 1 }); // Open direct het scope subframe (2de frame/subtab, dus index == 1)
}
}
})
function contractClose(params)
@@ -98,12 +121,12 @@ if (cnt_key > 0)
if (params.close)
{
FcltMgr.closeDetail(window, { cancel: true } );
return true;;
return true;
}
if (params.keepForm)
return;
<% if (cnt_key == -1 || copy)
{ %>
if (cnt_key == -1 || copy)
{
if (params.cancel)
{
FcltMgr.closeDetail(window, params );
@@ -111,16 +134,14 @@ if (cnt_key > 0)
}
FcltMgr.setTitle(L("lcl_contract") + " " + params.cnt_key, {hot:false});
// TODO geleend van MLD. Is dit hier nodig? Ook is cnt_key niet de juiste tabtekst, maar zien we die?
// nieuw contract, ga verder in 'verynew' modus
// Nieuw contract, ga verder in 'verynew' modus
// Altijd complete reload, we hebben nu een cnt_key namelijk
window.location.href = "cnt_contract.asp?verynew=1&cnt_key=" + params.cnt_key;
<% }
}
else
{ // Bestaand contract bewerkt, switch naar show-mode
%>
$("#cntframe")[0].src = "cnt_show_contract.asp?cnt_key=<%=cnt_key%>";
<% } %>
$("#cntframe")[0].src = "cnt_show_contract.asp?cnt_key=" + cnt_key;
}
}
function scopeClose(params)
@@ -257,6 +278,9 @@ if (cnt_key > 0)
oRs.close();
if (cnt_typecontract != 4 && cnt_typecontract != 6) {
page = "cnt_show_scope.asp?cnt_key=" + cnt_key;
if (verynew) { // Open cnt_edit_scope door in cnt_show_scope gelijk de wijzig-button te activeren.
page += "&verynew=1";
}
IFRAMER("scopeframe", page, { icon: "fa-list", FcltClose: "scopeClose" } );
}

View File

@@ -29,6 +29,7 @@ user.auth_required_or_abort(this_cnt.canReadAny);
var showall = getQParamInt("showall", 0) == 1;
var outputmode = getQParamInt("outputmode", 0);
var verynew = getQParamInt("verynew", 0);
%>
<html>
<head>
@@ -57,6 +58,14 @@ var outputmode = getQParamInt("outputmode", 0);
}
FcltMgr.openDetail(url, "");
}
$(function () {
var scopeRequired = (<%=verynew%>==1); // Voor een nieuw contract waarbij de scope moet worden ingevuld
if (scopeRequired) { // gelijk doorsturen naar cnt_edit-scope.
cnt_scopechange();
}
});
</script>
</head>
<body id="listbody">