Files
Facilitor/APPL/FAC/fac_adres_list.asp

117 lines
5.4 KiB
Plaintext

<%@language="javascript"%>
<% /*
$Revision$
$Id$
File: fac_adres_list.asp (formerly part of mld_adres_search.asp)
Description: Toont de adress die voldoen aan de gegeven criteria
Parameters: districtkey
locatiekey
adressname (% is added)
bezoekpostcode (% is added)
bezoekplaats (% is added)
Context: -
*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/Suggest/plaatsFilter.inc" -->
<!-- #include file="../Shared/resultset_table_v2.inc" -->
<%
FCLTHeader.Requires({ plugins:["jQuery"] });
var autfunction = "WEB_ALGMSU"; // PF: was eerder en onlogisch PRSMAN, maar of dit goed is?
var authparams = user.checkAutorisation(autfunction);
var districtkey = getQParamInt("districtkey", -1);
var locatiekey = getQParamInt("locatiekey", -1);
var adressName = getQParam("adressName", "");
var bezoekPostcode = getQParam("bezoekPostcode", "");
var bezoekPlaats = getQParam("bezoekPlaats", "");
var outputmode = getQParamInt("outputmode", 0);
var showall = getQParamInt("showall", 0) == 1;
%>
<html>
<head>
<% FCLTHeader.Generate({outputmode: outputmode}); %>
<script type="text/javascript">
function adresedit(row)
{
$(row).addClass('dirty');
var adr_key = row.getAttribute("ROWKEY");
url = "appl/fac/fac_adres.asp?key=" + adr_key;
FcltMgr.openDetail(url, '<%=L("lcl_adress")%>');
}
</script>
</head>
<body id="searchbody">
<% var sql = " SELECT m.mld_adres_key, "
+ " m.mld_adres_naam, "
+ " m.mld_adres_bezoek_adres, "
+ " m.mld_adres_bezoek_postcode, "
+ " m.mld_adres_bezoek_plaats, "
+ " m.mld_adres_post_adres, "
+ " m.mld_adres_post_postcode, "
+ " m.mld_adres_post_plaats, "
+ " m.mld_adres_bezoek_land, "
+ " m.mld_adres_post_land, "
+ " m.mld_adres_telefoon, "
+ " m.mld_adres_email, "
+ " l.alg_locatie_omschrijving "
+ " FROM mld_adres m, alg_locatie l "
+ " WHERE l.alg_locatie_key(+) = m.alg_locatie_key AND m.mld_adres_verwijder IS NULL "
+ (authparams.ALGreadlevel > -1
? " AND l.alg_locatie_key IN (SELECT alg_locatie_key FROM fac_v_my_locations"
+ " WHERE prs_perslid_key = " + user_key + " AND niveau=" + authparams.ALGreadlevel + ")"
: "")
+ getFiltClauseLocatie("FAC", {}).where;
if (adressName != "")
sql+= " AND m.mld_adres_upper LIKE " + safe.quoted_sql_wild(adressName + "%");
if (locatiekey != -1)
sql+= " AND l.alg_locatie_key = " + locatiekey;
else if (districtkey != -1)
sql+= " AND l.alg_district_key = " + districtkey;
if (bezoekPostcode != "")
sql+= " AND UPPER(m.mld_adres_bezoek_postcode) LIKE " + safe.quoted_sql_wild(bezoekPostcode + "%");
if (bezoekPlaats != "")
sql+= " AND UPPER(m.mld_adres_bezoek_plaats) LIKE " + safe.quoted_sql_wild(bezoekPlaats + "%");
sql+= " ORDER BY UPPER (m.mld_adres_naam)";
var addurl = "appl/fac/fac_adres.asp";
var rst = new ResultsetTable({ sql: sql,
ID: "adrestable",
keyColumn: "mld_adres_key",
outputmode: outputmode,
showAll: showall,
buttons: [{icon: "plus.png", title: L("lcl_add"), action: "FcltMgr.openDetail('" + addurl + "', '" + L("lcl_add") + "')"}]
});
rst.addColumn(new Column({caption: L("lcl_prs_address_naam"), content: "mld_adres_naam"}));
rst.addColumn(new Column({caption: L("lcl_prs_address_bezoek_adres"), content: "mld_adres_bezoek_adres"}));
rst.addColumn(new Column({caption: L("lcl_prs_address_bezoek_postcode"), content: "mld_adres_bezoek_postcode"}));
rst.addColumn(new Column({caption: L("lcl_prs_address_bezoek_plaats"), content: "mld_adres_bezoek_plaats"}));
rst.addColumn(new Column({caption: L("lcl_estate_locatie_man_descr"), content: "alg_locatie_omschrijving"}));
rst.addColumn(new Column({caption: L("lcl_prs_address_bezoek_land"), content: "mld_adres_bezoek_land", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_post_adres"), content: "mld_adres_post_adres", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_post_postcode"), content: "mld_adres_post_postcode", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_post_plaats"), content: "mld_adres_post_plaats", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_post_land"), content: "mld_adres_post_land", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_phone"), content: "mld_adres_telefoon", purpose: PRINTING_ONLY}));
rst.addColumn(new Column({caption: L("lcl_prs_address_email"), content: "mld_adres_email", purpose: PRINTING_ONLY}));
rst.addAction({action: "adresedit", caption: L("lcl_edit"), isDefault: true});
rst.processResultset();
%>
</body>
</html>