205 lines
8.0 KiB
C++
205 lines
8.0 KiB
C++
<% /*
|
|
$Revision: 2 $
|
|
$Modtime: 10/14/09 2:41p $
|
|
File: alg_locatie_list.inc
|
|
Status: 95%
|
|
Description: Show an overview of alg_locatie items in list-form,
|
|
which meets with the given requirements
|
|
Parameters:
|
|
Context: Include for locatie-overzichten, like Search action from alg_locatie_search_list.asp form
|
|
Note:
|
|
*/ %>
|
|
|
|
<% Response.Expires = 0; %>
|
|
<!-- #include file="../Shared/escape.inc" -->
|
|
<!-- #include file="../Shared/disCxprs3d.inc" -->
|
|
<!-- #include file="../Shared/json2.js" -->
|
|
<!-- #include file="../Shared/resultset_table_v2.inc" -->
|
|
<!-- #include file="../Shared/getkenmerksql.inc" -->
|
|
<!-- #include file="alg.inc" -->
|
|
|
|
<%
|
|
FCLTHeader.Requires({ plugins:["jQuery"],
|
|
js: []
|
|
})
|
|
|
|
function fnrowData(oRs)
|
|
{
|
|
var parent_key = oRs("alg_district_key").value;
|
|
var detail_key = oRs("alg_locatie_key").value;
|
|
var key = oRs("alg_locatie_key").value;
|
|
var oms = oRs("alg_locatie_omschrijving").value;
|
|
|
|
var data = {parent_key:parent_key, detail_key:detail_key, key:key, oms:oms};
|
|
|
|
return JSON.stringify(data);
|
|
}
|
|
|
|
%>
|
|
<script type="text/javascript">
|
|
var autosearch = 1; //automatisch laden van resultaat op search pagina
|
|
|
|
function gotoDetails(row)
|
|
{
|
|
var algData = eval('(' + row.ROWDATA + ')');
|
|
var url = "appl/ALG/alg_gebouw_search.asp?locatie_key="+algData.detail_key+"&autosearch="+autosearch;
|
|
FcltMgr.openDetail(url, "<%=lcl_building%>");
|
|
}
|
|
function gotoDetails2(row)
|
|
{
|
|
var algData = eval('(' + row.ROWDATA + ')');
|
|
var url = "appl/ALG/alg_terreinsector_search.asp?locatie_key="+algData.detail_key+"&autosearch="+autosearch;
|
|
FcltMgr.openDetail(url, "<%=lcl_terra%>");
|
|
}
|
|
function gotoParent(row)
|
|
{
|
|
var algData = eval('(' + row.ROWDATA + ')');
|
|
var url = "appl/ALG/alg_district_search.asp?district_key="+algData.parent_key+"&autosearch="+autosearch;
|
|
FcltMgr.openDetail(url, "<%=lcl_district%>");
|
|
}
|
|
function locatieEdit(row)
|
|
{
|
|
var algData = eval('(' + row.ROWDATA + ')');
|
|
var url = "appl/ALG/alg_locatie.asp?key="+algData.key;
|
|
FcltMgr.openDetail(url, "<%=lcl_location%>" + ' ' + algData.oms);
|
|
}
|
|
|
|
function doDelete(row, isMulti)
|
|
{
|
|
$(row).addClass('dirty');
|
|
var loc_key = row.ROWKEY;
|
|
if (isMulti || confirm("<%=lcl_alg_del_txt_locatie%>"))
|
|
$.post("alg_delete.asp",
|
|
{ key: loc_key,
|
|
level: "L" },
|
|
FcltCallback,
|
|
"json");
|
|
}
|
|
</script>
|
|
<%
|
|
|
|
function locatie_list(pautfunction, params)
|
|
{
|
|
// De functie checkAutorisation(autfunction) geeft een Response.End indien er geen autorisatie voor autfunction wordt gevonden
|
|
var addButton = [];
|
|
var authparams = alg.checkAutorisation();
|
|
var canAdd = (authparams.mALGwritelevel < 3);
|
|
|
|
// Voor resulttable de globalen zetten; zou ng anders moeten.
|
|
var outputmode = params.outputmode; // print to 0 = screen, 1 = printer, 2 = excel, etc.
|
|
var showall = params.showall;
|
|
|
|
var dis_key = params.dis_key;
|
|
var loc_key = params.loc_key;
|
|
|
|
function fnrowActionEnabler(oRs)
|
|
{
|
|
var eDelete = false;
|
|
if (alg.canWriteLocatie(oRs("alg_locatie_key").value, authparams.mALGwritelevel))
|
|
eDelete = true;
|
|
return ({eDelete: eDelete})
|
|
}
|
|
%>
|
|
|
|
<html>
|
|
<head>
|
|
<% FCLTHeader.Generate({outputmode:outputmode}) %>
|
|
</head>
|
|
<body id="listbody">
|
|
<%
|
|
var sqln = "SELECT l.alg_locatie_key, "
|
|
+ " l.alg_district_key, "
|
|
+ " l.alg_locatie_code, "
|
|
+ " l.alg_locatie_omschrijving, "
|
|
+ " d.alg_district_omschrijving, "
|
|
+ " l.alg_locatie_adres, "
|
|
+ " l.alg_locatie_post_adres, "
|
|
+ " l.alg_locatie_postcode, "
|
|
+ " l.alg_locatie_post_postcode, "
|
|
+ " l.alg_locatie_plaats, "
|
|
+ " l.alg_locatie_post_plaats, "
|
|
+ " l.alg_locatie_land, "
|
|
+ " l.alg_locatie_post_land, "
|
|
+ " l.alg_locatie_verantw, "
|
|
+ " l.alg_locatie_verantw_tel "
|
|
+ " FROM alg_v_aanweziglocatie l, "
|
|
+ " alg_district d "
|
|
+ " WHERE d.alg_district_key(+) = l.alg_district_key "
|
|
+ " AND l.alg_locatie_verwijder IS NULL ";
|
|
|
|
if ( authparams.ALGreadlevel > -1 )
|
|
{ // Er is een scope-beperking van kracht
|
|
sqln += " 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 + ")";
|
|
}
|
|
|
|
sqln += getKenmerkSql("ALG", "l.alg_locatie_key");
|
|
|
|
if (loc_key)
|
|
{
|
|
sqln += " AND l.alg_locatie_key = " + loc_key;
|
|
}
|
|
|
|
else if (dis_key)
|
|
{
|
|
sqln += " AND l.alg_district_key = " + dis_key;
|
|
}
|
|
|
|
|
|
sqln += " ORDER BY l.alg_locatie_upper ASC "
|
|
|
|
var addurl = "appl/alg/alg_locatie.asp";
|
|
// addurl += buildTransitParam(["loc_key", "bld_key", "flo_key", "room_key"], params) // TODO: welke allemaal?
|
|
|
|
if (canAdd)
|
|
{
|
|
addButton = [{ icon: "plus.png", title: lcl_add, action: "FcltMgr.openDetail('" + addurl + "', '" + lcl_add + "')" }]
|
|
}
|
|
|
|
var rst = new ResultsetTable({sql:sqln,
|
|
keyColumn: "alg_locatie_key",
|
|
ID: "algtable",
|
|
showAll: showall,
|
|
rowData: fnrowData,
|
|
rowActionEnabler: fnrowActionEnabler,
|
|
outputmode: outputmode,
|
|
flexModule: "ALG",
|
|
flexId: "alg_locatie_key",
|
|
filterParams: params,
|
|
buttons: addButton
|
|
});
|
|
|
|
rst.addColumn(new Column({caption: lcl_estate_district_man_descr, content: "alg_district_omschrijving"}));
|
|
rst.addColumn(new Column({caption: lcl_estate_locatie_man_code, content: "alg_locatie_code"}));
|
|
rst.addColumn(new Column({caption: lcl_estate_locatie_man_descr, content: "alg_locatie_omschrijving", hasActions:true}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_bezoek_adres, content: "alg_locatie_adres"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_bezoek_postcode, content: "alg_locatie_postcode"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_bezoek_plaats, content: "alg_locatie_plaats"}));
|
|
|
|
if (outputmode != 0)
|
|
{
|
|
rst.addColumn(new Column({caption: lcl_prs_address_bezoek_land, content: "alg_locatie_land"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_post_adres, content: "alg_locatie_post_adres"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_post_postcode, content: "alg_locatie_post_postcode"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_post_plaats, content: "alg_locatie_post_plaats"}));
|
|
rst.addColumn(new Column({caption: lcl_prs_address_post_land, content: "alg_locatie_post_land"}));
|
|
rst.addColumn(new Column({caption: lcl_estate_locatie_man_verantw, content: "alg_locatie_verantw"}));
|
|
rst.addColumn(new Column({caption: lcl_estate_locatie_man_verantw_tel, content: "alg_locatie_verantw_tel"}));
|
|
}
|
|
|
|
|
|
rst.addAction({ action: "locatieEdit", caption: lcl_edit, isDefault: true});
|
|
rst.addAction({ action: "doDelete", caption: lcl_delete, multi: true, enabler: "eDelete"});
|
|
rst.addAction({ action: "gotoDetails", caption: lcl_goto_gebouw_list});
|
|
rst.addAction({ action: "gotoDetails2", caption: lcl_goto_terreinsector_list});
|
|
rst.addAction({ action: "gotoParent", caption: lcl_goto_district_list});
|
|
|
|
var cnt = rst.processResultset();
|
|
%>
|
|
</body>
|
|
</html>
|
|
<%}%>
|
|
|