186 lines
6.0 KiB
HTML
186 lines
6.0 KiB
HTML
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: model_fac_srtnotificatie.inc
|
|
|
|
Description: Vanuit CodeCharge gegenereerd model voor fac_srtnotificatie
|
|
|
|
Context:
|
|
|
|
Notes:
|
|
*/
|
|
%>
|
|
<%
|
|
|
|
function model_fac_srtnotificatie()
|
|
{
|
|
this.table = "fac_srtnotificatie";
|
|
this.primary = "fac_srtnotificatie_key";
|
|
this.records_name = "fac_srtnotificaties";
|
|
this.record_name = "fac_srtnotificatie";
|
|
this.autfunction = "WEB_PRSSYS";
|
|
this.record_title = L("fac_srtnotificatie");
|
|
this.records_title = L("fac_srtnotificatie_m");
|
|
|
|
this.fields = {
|
|
"id": {
|
|
"dbs": "fac_srtnotificatie_key",
|
|
"label": "Key",
|
|
"typ": "key",
|
|
"required": true,
|
|
"filter": "exact"
|
|
},
|
|
"code": {
|
|
"dbs": "fac_srtnotificatie_code",
|
|
"label": L("fac_srtnotificatie_code"),
|
|
"typ": "varchar",
|
|
"insertonly": true
|
|
},
|
|
"name": {
|
|
"dbs": "fac_srtnotificatie_oms",
|
|
"label": L("fac_srtnotificatie_oms"),
|
|
"typ": "memo",
|
|
"translate": true,
|
|
"filter": "like"
|
|
},
|
|
"xmlnode": {
|
|
"dbs": "fac_srtnotificatie_xmlnode",
|
|
"label": L("fac_srtnotificatie_xmlnode"),
|
|
"typ": "varchar",
|
|
"insertonly": true,
|
|
"LOV": fill_srtnotificatie_LOV(),
|
|
"emptyoption": null
|
|
},
|
|
"notification_url": {
|
|
"dbs": "fac_srtnotificatie_url",
|
|
"label": L("fac_srtnotificatie_url"),
|
|
"typ": "varchar",
|
|
"insertonly": true,
|
|
"defaultvalue": "1"
|
|
},
|
|
"group": {
|
|
"dbs": "fac_srtnotificatie_groep",
|
|
"label": L("fac_srtnotificatie_groep"),
|
|
"typ": "varchar",
|
|
"insertonly": true
|
|
},
|
|
"notification_mode": {
|
|
"dbs": "fac_srtnotificatie_mode",
|
|
"label": L("fac_srtnotificatie_mode"),
|
|
"typ": "number",
|
|
"bits": [
|
|
{
|
|
"name": "",
|
|
"label": "",
|
|
"typ": "check",
|
|
"mask": 31,
|
|
"radios": [
|
|
{
|
|
"name": "portal_statusinfo",
|
|
"label": L("fac_srtnotificatie_portal_statusinfo"),
|
|
"mask": 1
|
|
},
|
|
{
|
|
"name": "send_email",
|
|
"label": L("fac_srtnotificatie_send_email"),
|
|
"mask": 2
|
|
},
|
|
{
|
|
"name": "send_sms",
|
|
"label": L("fac_srtnotificatie_send_sms"),
|
|
"mask": 4
|
|
},
|
|
{
|
|
"name": "stylesheet",
|
|
"label": L("fac_srtnotificatie_stylesheet"),
|
|
"mask": 8
|
|
},
|
|
{
|
|
"name": "portal_popup",
|
|
"label": L("fac_srtnotificatie_portal_popup"),
|
|
"mask": 16
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"usermode": {
|
|
"dbs": "fac_srtnotificatie_usermode",
|
|
"label": L("fac_srtnotificatie_usermode"),
|
|
"typ": "check0",
|
|
"listfunction": fnshowusermode
|
|
},
|
|
"mail_building": {
|
|
"dbs": "fac_srtnotificatie_gebouw",
|
|
"label": L("fac_srtnotificatie_gebouw"),
|
|
"typ": "check0",
|
|
"listfunction": fnshowmailbuilding
|
|
},
|
|
"delay": {
|
|
"dbs": "fac_srtnotificatie_delay",
|
|
"label": L("fac_srtnotificatie_delay"),
|
|
"typ": "number",
|
|
"required": true,
|
|
"defaultvalue": "0"
|
|
},
|
|
"mode_status": {
|
|
"dbs": "notimode.status",
|
|
"label": L("fac_srtnotificatie_status"),
|
|
"typ": "varchar",
|
|
"hidden_fld": true
|
|
},
|
|
"mode_email": {
|
|
"dbs": "notimode.email",
|
|
"label": L("fac_srtnotificatie_mail"),
|
|
"typ": "varchar",
|
|
"hidden_fld": true
|
|
},
|
|
"mode_sms": {
|
|
"dbs": "notimode.sms",
|
|
"label": L("fac_srtnotificatie_sms"),
|
|
"typ": "varchar",
|
|
"hidden_fld": true
|
|
},
|
|
"mode_alert": {
|
|
"dbs": "notimode.portal",
|
|
"label": L("fac_srtnotificatie_alert"),
|
|
"typ": "varchar",
|
|
"hidden_fld": true
|
|
}
|
|
};
|
|
|
|
if (!S("puo_smsaccount"))
|
|
this.fields.notification_mode.bits[0].radios.splice(2, 1);
|
|
|
|
|
|
var ext_sql = "(SELECT fac_srtnotificatie_key"
|
|
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 1), 1,"+ safe.qL("lcl_on") +", '') status"
|
|
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 2), 2,"+ safe.qL("lcl_on") +", '') email"
|
|
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 4), 4,"+ safe.qL("lcl_on") +", '') sms"
|
|
+ " , DECODE(BITAND(fac_srtnotificatie_mode, 8), 8,"+ safe.qL("lcl_on") +", '') portal"
|
|
+ " FROM fac_srtnotificatie) notimode ";
|
|
|
|
|
|
this.REST_GET = generic_REST_GET(this, {
|
|
"GET": {
|
|
"tables": [ext_sql],
|
|
"wheres": ["fac_srtnotificatie.fac_srtnotificatie_key = notimode.fac_srtnotificatie_key"]
|
|
}
|
|
});
|
|
this.REST_POST = generic_REST_POST(this);
|
|
this.REST_PUT = generic_REST_PUT(this);
|
|
// Verwijderen niet toegestaan.
|
|
|
|
|
|
function fnshowusermode(oRs)
|
|
{
|
|
return (oRs.Fields("usermode").Value == 1 ? L("lcl_Yes") : "");
|
|
}
|
|
|
|
function fnshowmailbuilding(oRs)
|
|
{
|
|
return (oRs.Fields("mail_building").Value == 1 ? L("lcl_Yes") : "");
|
|
}
|
|
}
|
|
%> |