167 lines
6.6 KiB
Plaintext
167 lines
6.6 KiB
Plaintext
<%@ language="javascript"%>
|
|
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: bes_fe_menu.asp
|
|
Description: Alternatieve interface om (eenvoudig) een bestelartikel te kunnen kiezen
|
|
Veronderstelt wel dat er niet al te schrikbarend veel meldingen zijn.
|
|
Parameters:
|
|
|
|
Context: -
|
|
Note: TODO: als er maar weinig groepen zijn: allemaal uitklappen, als er weinig artikelen zijn: combineren oid
|
|
|
|
*/%>
|
|
<!-- #include file="../Shared/common.inc" -->
|
|
<!-- #include file="../shared/iface.inc" -->
|
|
|
|
<%
|
|
FCLTHeader.Requires({ plugins: ["jQuery"],
|
|
js: ["jQuery-ui.js"]
|
|
});
|
|
|
|
var disckey = getQParamInt("disc",0);
|
|
%>
|
|
|
|
<html>
|
|
<head>
|
|
<% FCLTHeader.Generate(); %>
|
|
<script type="text/javascript">
|
|
function run_create_bes (p_disc_key, p_product_key)
|
|
{
|
|
|
|
//urole=func_enabled["WEB_BESUSE"]?"fe":"fo"; // fe-menu, dus wat willen we hier nou echt?
|
|
urole="fe";
|
|
FcltMgr.openDetail("appl/bes/bes_bestelling.asp?urole="+urole+"&artikel_key="+p_product_key+"&dis_key="+p_disc_key);
|
|
}
|
|
|
|
$(function ()
|
|
{ // Noot: vrijwel identieke code te vinden in mld_fe_menu.asp
|
|
var accord = $('#accordion');
|
|
var nnheads = accord.children("h3").length; // Voordat accordion de DOM heeft aangepast
|
|
|
|
accord.accordion({collapsible: true,
|
|
active: false,
|
|
heightStyle: "content",
|
|
autoHeight: false,
|
|
activate: FcltMgr.resized,
|
|
beforeActivate: function(event, ui)
|
|
{ // delay load images
|
|
$("img", ui.newPanel ).each(function ()
|
|
{
|
|
this.src = this.getAttribute("theSrc");
|
|
}
|
|
);
|
|
}
|
|
});
|
|
|
|
if (nnheads == 1) // Dan direct openklappen
|
|
accord.accordion({ active: 0 });
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body id="iconbody">
|
|
<%
|
|
var buttons = [];
|
|
IFRAMER_HEADER(L("lcl_bes_fe_menu_frame"), buttons);
|
|
%>
|
|
<div id='accordion'>
|
|
<%
|
|
|
|
var sql = "SELECT bes_srtdeel_key product_key, "
|
|
+ lcl.xsql('sd.bes_srtdeel_omschrijving', 'sd.bes_srtdeel_key')+" product,"
|
|
+ " 'besartikel' soort, 3 rang, bes.getsrtdeelprijs(sd.bes_srtdeel_key, null) prijs,"
|
|
+ lcl.xsql('sd.bes_srtdeel_eenheid', 'sd.bes_srtdeel_key') + " eenheid,"
|
|
+ " p.prs_bedrijf_naam extra,"
|
|
+ " sg.ins_discipline_key disc_key, "
|
|
+ " null vakgroeptype,"
|
|
+ " sg.bes_srtgroep_key,"
|
|
+ lcl.xsql('sg.bes_srtgroep_omschrijving', 'sg.bes_srtgroep_key') + " groep,"
|
|
+ lcl.xsql('d.ins_discipline_omschrijving', 'd.ins_discipline_key') + " vakgroep,"
|
|
+ lcl.xsql('sd.bes_srtdeel_opmerking', 'sd.bes_srtdeel_key')+ " opmerking,"
|
|
+ " NVL2(sd.bes_srtdeel_image, p.prs_bedrijf_image_loc || sd.bes_srtdeel_image, NULL) foto"
|
|
+ " FROM bes_v_aanwezigsrtdeel sd"
|
|
+ ", bes_srtgroep sg"
|
|
+ ", bes_v_aanwezigdiscipline d"
|
|
+ ", prs_bedrijf p"
|
|
+ ", fac_v_webgebruiker fvw"
|
|
+ ", fac_functie f"
|
|
+ " WHERE sd.bes_srtgroep_key = sg.bes_srtgroep_key"
|
|
+ " AND sg.ins_discipline_key = d.ins_discipline_key"
|
|
+ " AND (sd.bes_srtdeel_vervaldatum IS NULL OR sd.bes_srtdeel_vervaldatum > SYSDATE)"
|
|
+ " AND sd.prs_bedrijf_key IS NOT NULL"
|
|
+ " AND sd.prs_bedrijf_key = p.prs_bedrijf_key"
|
|
+ " AND fvw.ins_discipline_key = d.ins_discipline_key"
|
|
+ " AND fvw.fac_functie_key = f.fac_functie_key"
|
|
+ " AND fvw.fac_gebruiker_alg_level_write < 9"
|
|
+ " AND fvw.fac_gebruiker_prs_level_write < 9"
|
|
+ " AND f.fac_functie_code = 'WEB_BESUSE'"
|
|
+ " AND fvw.prs_perslid_key = " + user_key;
|
|
|
|
if (disckey != 0){
|
|
sql += " AND d.ins_discipline_key = " + disckey;
|
|
}
|
|
|
|
sql += " ORDER BY sg.bes_srtgroep_volgnr"
|
|
+ " , " + lcl.xsql('sg.bes_srtgroep_omschrijving', 'sg.bes_srtgroep_key')
|
|
+ " , sd.bes_srtdeel_volgnr"
|
|
+ " , " + lcl.xsql('sd.bes_srtdeel_omschrijving', 'sd.bes_srtdeel_key');
|
|
|
|
var oRs = Oracle.Execute(sql)
|
|
|
|
var last_groep = -1;
|
|
while (!oRs.Eof)
|
|
{
|
|
if (last_groep != oRs("bes_srtgroep_key").Value)
|
|
{ // Vakgroep header. Is denkbaar dat we hier het aantal items tonen?
|
|
%>
|
|
<h3><a><%=safe.html(oRs("groep").Value)%></a></h3>
|
|
<div style='display:none'>
|
|
<table width="100%" class="besaccordeon"><tr>
|
|
<%
|
|
pos = 0;
|
|
}
|
|
// Wel erg hard...
|
|
if (oRs("foto").Value)
|
|
{
|
|
icon = oRs("foto").Value;
|
|
if (icon.indexOf("/") == -1) // Nog geen enkele slash? Dan moet het wel lokaal zijn.
|
|
icon = S("bes_image_path") + oRs("disc_key").Value + "/" + icon;
|
|
l_icon = icon;
|
|
l_index = l_icon.lastIndexOf('.');
|
|
if (l_index != -1){
|
|
l_icon=l_icon.substr(l_index+1);
|
|
if (l_icon.toUpperCase() == 'PDF'){
|
|
icon="../Pictures/pdf.jpg";
|
|
}
|
|
}
|
|
var url = icon;
|
|
}
|
|
else
|
|
var url = "../Pictures/mld_stdm_default.jpg"; // Leuker: een rondje met de eerste letter oid.
|
|
|
|
var maxcol = S("iconcolumns"); // setting
|
|
if (pos > 0 && pos%maxcol == 0) {
|
|
%></tr><tr><%
|
|
}
|
|
%><td class='iconmenu' width='<%=Math.floor(100/maxcol)%>%'
|
|
onclick='run_create_bes (<%=oRs("disc_key").Value%>,<%=oRs("product_key").Value%>);'>
|
|
<img theSrc='<%=safe.htmlattr(url)%>'>
|
|
<div class="iconlabel">
|
|
<%="<span class='iprd'>"+safe.html(oRs("product").value) + "</span><br>" +(safe.curr(oRs("prijs").value) != 0 ? "<span class='iprs'>"+S("currency_pref") + safe.curr(oRs("prijs").value)+"</span>" : "") + (oRs("eenheid").value ? ("<span class='ieenh'> / " + safe.html(oRs("eenheid").value)+"</span>") : "") + (oRs("opmerking").value ? ("<br><span class='iopm'>" + safe.html(oRs("opmerking").value)+"</span>") : "") %>
|
|
</div>
|
|
</td><%
|
|
pos ++;
|
|
last_groep = oRs("bes_srtgroep_key").Value;
|
|
oRs.MoveNext();
|
|
if (oRs.Eof || last_groep != oRs("bes_srtgroep_key").Value)
|
|
{
|
|
%></tr></table></div><%
|
|
}
|
|
}
|
|
%></div>
|
|
</body>
|
|
</html>
|
|
|