155 lines
4.8 KiB
XML
155 lines
4.8 KiB
XML
<?xml version="1.0"?>
|
|
<component>
|
|
<?component error="true" debug="true"?>
|
|
<registration
|
|
description="custfunctions"
|
|
progid="custfunction.wsc"
|
|
version="1.00"
|
|
classid="{0FA857ED-4450-4458-B9EF-EDE752350453}"
|
|
>
|
|
</registration>
|
|
|
|
<public>
|
|
|
|
<!-- properties -->
|
|
<property name="Oracle">
|
|
<put/>
|
|
</property>
|
|
<property name="__Log">
|
|
<put/>
|
|
</property>
|
|
<property name="__DoLog">
|
|
<put/>
|
|
</property>
|
|
<property name="safe">
|
|
<put/>
|
|
</property>
|
|
|
|
<!-- methods -->
|
|
<method name="API_PHONEBOOK">
|
|
<PARAMETER name="prs_key"/>
|
|
<PARAMETER name="data"/>
|
|
</method>
|
|
</public>
|
|
|
|
<script language="javascript">
|
|
<![CDATA[
|
|
|
|
/* properties */
|
|
function put_Oracle(newValue) {Oracle = newValue};
|
|
function put___Log(newValue) {__Log = newValue};
|
|
function put___DoLog(newValue) {__DoLog = newValue};
|
|
function put_safe(newValue) {safe = newValue};
|
|
|
|
/* methods */
|
|
/*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: AAES custfunction.wsc
|
|
|
|
*/
|
|
|
|
/* Dit zijn de enige drie functies die je mag gebruiken */
|
|
var Oracle;
|
|
var __Log;
|
|
var __DoLog;
|
|
var safe;
|
|
|
|
API_PHONEBOOK =
|
|
function (prs_key, data)
|
|
{
|
|
var result = {};
|
|
|
|
//
|
|
// Alt afdeling
|
|
//
|
|
result.aaxx_afdeling = data.afdeling;
|
|
var sql = "SELECT d.prs_afdeling_naam afd"
|
|
+ " FROM prs_v_afdeling d, prs_perslid p"
|
|
+ " WHERE prs_perslid_key = " + prs_key
|
|
+ " AND p.prs_afdeling_key = d.prs_afdeling_key"
|
|
var oRs = Oracle.Execute(sql);
|
|
if (!oRs.Eof)
|
|
{
|
|
result.aaxx_afdeling = safe.html(oRs("afd").Value);
|
|
}
|
|
//
|
|
// Alt functie
|
|
//
|
|
result.aaxx_functie = data.prs_srtperslid;
|
|
var sql = "SELECT prs_srtperslid_omschrijving fnc"
|
|
+ " FROM prs_srtperslid sp, prs_perslid p"
|
|
+ " WHERE prs_perslid_key = " + prs_key
|
|
+ " AND p.prs_srtperslid_key = sp.prs_srtperslid_key"
|
|
var oRs = Oracle.Execute(sql);
|
|
if (!oRs.Eof)
|
|
{
|
|
result.aaxx_functie = safe.html(oRs("fnc").Value);
|
|
}
|
|
//
|
|
// Hoofdlocatie
|
|
//
|
|
if (data.werkplekken.length)
|
|
{
|
|
var txt = "";
|
|
var wp;
|
|
var wplabel = "Hoofdlocatie:";
|
|
var loc_key = -1;
|
|
for (wp in data.werkplekken)
|
|
{
|
|
if (!data.werkplekken[wp].prs_werkplek_aanduiding.isVirtueel && wp < 1) // pak er maar eentje, TODO hoofdwerkplek
|
|
{
|
|
// trs += "<tr><td>"+wplabel+"</td><td>" + data.werkplekken[wp].prs_werkplek_aanduiding + "</td></tr>";
|
|
txt += data.werkplekken[wp].prs_werkplek_aanduiding.substring(0,5)
|
|
+ ", etage "+ data.werkplekken[wp].prs_werkplek_aanduiding.substring(6,8)
|
|
+ ", kamer "+ data.werkplekken[wp].prs_werkplek_aanduiding.substring(9);
|
|
loc_key = data.werkplekken[wp].alg_locatie_key;
|
|
|
|
}
|
|
}
|
|
result.aaxx_locatie = safe.html(txt);
|
|
// Postadres
|
|
var sql = " SELECT alg_locatie_omschrijving"
|
|
+ ", alg_locatie_post_adres"
|
|
+ ", alg_locatie_post_postcode"
|
|
+ ", alg_locatie_post_plaats"
|
|
+ ", alg_locatie_post_land"
|
|
+ ", l.alg_locatie_omschrijving || ' (' || l.alg_locatie_code || ')' locatie_string"
|
|
+ " FROM alg_locatie l"
|
|
+ " WHERE l.alg_locatie_key = " + loc_key;
|
|
var oRs = Oracle.Execute(sql);
|
|
result.aaxx_postadres = safe.html(oRs("alg_locatie_omschrijving").Value) + "<br>"
|
|
+ safe.html(oRs("alg_locatie_post_adres").Value) + "<br>"
|
|
+ safe.html(oRs("alg_locatie_post_postcode").Value) + " " + safe.html(oRs("alg_locatie_post_plaats").Value) + "<br>";
|
|
// Bezoekadres
|
|
var sql = " SELECT alg_locatie_omschrijving"
|
|
+ ", alg_locatie_adres"
|
|
+ ", alg_locatie_postcode"
|
|
+ ", alg_locatie_plaats"
|
|
+ ", alg_locatie_land"
|
|
+ ", l.alg_locatie_omschrijving || ' (' || l.alg_locatie_code || ')' locatie_string"
|
|
+ " FROM alg_locatie l"
|
|
+ " WHERE l.alg_locatie_key = " + loc_key;
|
|
var oRs = Oracle.Execute(sql);
|
|
result.aaxx_bezoekadres = safe.html(oRs("alg_locatie_omschrijving").Value) + "<br>"
|
|
+ safe.html(oRs("alg_locatie_adres").Value) + "<br>"
|
|
+ safe.html(oRs("alg_locatie_postcode").Value) + " " + safe.html(oRs("alg_locatie_plaats").Value) + "<br>";
|
|
|
|
}
|
|
//
|
|
// Klikbaar e-mailadres
|
|
//
|
|
if (data.prs_perslid_email)
|
|
{
|
|
result.aaxx_mailto = "<a href='mailto:" + safe.htmlattr(data.prs_perslid_email) + "'>" + safe.html(data.prs_perslid_email) + "</a>";
|
|
}
|
|
|
|
return result;
|
|
};
|
|
|
|
]]>
|
|
</script>
|
|
</component>
|
|
|