HSLE#38450 Standaard "afmeld"teksten bij mailen

svn path=/Website/trunk/; revision=38092
This commit is contained in:
Erik Groener
2018-06-07 07:19:33 +00:00
parent 43ac3567e5
commit 4c144862f9
7 changed files with 133 additions and 48 deletions

View File

@@ -13,18 +13,18 @@
%>
<%
model_mld_afmeldtekst =
function model_mld_afmeldtekst()
{
"records_name": "issueclosingtexts",
"record_name": "issueclosingtext",
"table": "mld_afmeldtekst",
"primary": "mld_afmeldtekst_key",
"autfunction": "WEB_MLDMGT",
"record_title": L("mld_afmeldtekst"),
"records_title": L("mld_afmeldtekst_m"),
this.records_name = "issueclosingtexts";
this.record_name = "issueclosingtext";
this.table = "mld_afmeldtekst";
this.primary = "mld_afmeldtekst_key";
this.autfunction = "WEB_MLDMGT";
this.record_title = L("mld_afmeldtekst");
this.records_title = L("mld_afmeldtekst_m");
"fields": {
this.fields = {
"id": {
"dbs": "mld_afmeldtekst_key",
"label": L("lcl_key"),
@@ -62,32 +62,89 @@ model_mld_afmeldtekst =
"dbs": "mld_afmeldtekst_usefor",
"label": L("mld_afmeldtekst_usefor"),
"typ": "number",
"LOV": L("mld_afmeldtekst_useforLOV"),
"emptyoption": null
"bits": [
{
"name": "",
"label": "",
"typ": "check",
"mask": 15,
"radios": [
{
"name": "forclose",
"label": L("mld_afmeldtekst_usefor_close"),
"mask": 1,
"defaultvalue": 0
},
{
"name": "forreject",
"label": L("mld_afmeldtekst_usefor_reject"),
"mask": 2,
"defaultvalue": 0
},
{
"name": "fororder",
"label": L("mld_afmeldtekst_usefor_order"),
"mask": 4,
"defaultvalue": 0
},
{
"name": "forresponse",
"label": L("mld_afmeldtekst_usefor_response"),
"mask": 8,
"defaultvalue": 0
}
},
"list": {
"columns": [
"id",
"issuediscipline",
"issuetype",
"name",
"description"
]
}
],
"defaultvalue": 1,
"required": true
},
"search": {
"autosearch": true,
"filters": [
"issuediscipline",
"issuetype",
"name",
"description",
"usefor"
]
"useforclose": {
"dbs": "useformode.forclose",
"label": L("mld_afmeldtekst_usefor_close"),
"typ": "check0",
"hidden_fld": true
},
"useforreject": {
"dbs": "useformode.forreject",
"label": L("mld_afmeldtekst_usefor_reject"),
"typ": "check0",
"hidden_fld": true
},
"usefororder": {
"dbs": "useformode.fororder",
"label": L("mld_afmeldtekst_usefor_order"),
"typ": "check0",
"hidden_fld": true
},
"useforresponse": {
"dbs": "useformode.forresponse",
"label": L("mld_afmeldtekst_usefor_response"),
"typ": "check0",
"hidden_fld": true
}
};
// hashints: true
}
api2.generic_REST(model_mld_afmeldtekst);
var ext_sql = "(SELECT mld_afmeldtekst_key"
+ " , DECODE(BITAND(mld_afmeldtekst_usefor, 1), 1, 1, '') forclose"
+ " , DECODE(BITAND(mld_afmeldtekst_usefor, 2), 2, 1, '') forreject"
+ " , DECODE(BITAND(mld_afmeldtekst_usefor, 4), 4, 1, '') fororder"
+ " , DECODE(BITAND(mld_afmeldtekst_usefor, 8), 8, 1, '') forresponse"
+ " FROM mld_afmeldtekst"
+ ") useformode ";
var get_param = {
"GET": {
"tables": [ext_sql],
"wheres": ["mld_afmeldtekst.mld_afmeldtekst_key = useformode.mld_afmeldtekst_key"]
}
};
this.REST_GET = generic_REST_GET(this, get_param);
this.REST_PUT = generic_REST_PUT(this);
this.REST_POST = generic_REST_POST(this);
this.REST_DELETE = generic_REST_DELETE(this);
}
%>

View File

@@ -1,11 +1,41 @@
<%@language = "javascript" %>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_mld_afmeldtekst.inc" -->
<%
scaffolding(model_mld_afmeldtekst,
{ edit: { requires: { js: ["../mgt/mld_afmeldtekst.js"]}
var this_model = new model_mld_afmeldtekst();
scaffolding(this_model,
{
"search": {
"autosearch": true,
"filters": [
"issuediscipline",
"issuetype",
"name",
"description",
"useforclose",
"useforreject",
"usefororder",
"useforresponse"
]
},
"list": {
"columns": [
"id",
"issuediscipline",
"issuetype",
"name",
"description",
"useforclose",
"useforreject",
"usefororder",
"useforresponse"
]
},
"edit": {
"requires": {
"js": ["../mgt/mld_afmeldtekst.js"]
}
}
});
%>

View File

@@ -343,8 +343,7 @@ for (var i = 2; i >= 0; i--)
+ " WHERE ((mld_stdmelding_key IN (" + stdmld_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IN (" + disc_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IS NULL))"
+ " AND BITAND(mld_afmeldtekst_usefor, 1) = 1"
+ " AND mld_afmeldtekst_usefor < 4";
+ " AND BITAND(mld_afmeldtekst_usefor, 1) = 1";
var sql_from_o = " FROM mld_opdr mo"
+ " WHERE mo.mld_melding_key = " + ingesloten[0]

View File

@@ -323,8 +323,7 @@ for (var i = 2; i >= 0; i--)
+ " WHERE ((mld_stdmelding_key IN (" + stdmld_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IN (" + disc_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IS NULL))"
+ " AND BITAND(mld_afmeldtekst_usefor, 2) = 2"
+ " AND mld_afmeldtekst_usefor < 4";
+ " AND BITAND(mld_afmeldtekst_usefor, 2) = 2";
var sql_from_o = " FROM mld_opdr mo"
+ " WHERE mo.mld_melding_key = " + ingesloten[0].mld_key

View File

@@ -248,7 +248,7 @@ oRs.Close();
+ " WHERE ((mld_stdmelding_key IN (" + stdmld_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IN (" + disc_arr.join(",") + ") )"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IS NULL))"
+ " AND mld_afmeldtekst_usefor = 4";
+ " AND BITAND(mld_afmeldtekst_usefor, 4) = 4";
var sql = "SELECT 1"
+ sql_from_t;
oRs = Oracle.Execute(sql);

View File

@@ -765,7 +765,7 @@ else
+ " WHERE ((mld_stdmelding_key = " + mld_opdr.stdm_key + ")"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key = " + mld_opdr.dis_key + ")"
+ " OR (mld_stdmelding_key IS NULL AND mld_ins_discipline_key IS NULL))"
+ " AND mld_afmeldtekst_usefor = 4";
+ " AND BITAND(mld_afmeldtekst_usefor, 4) = 4";
var sql = "SELECT 1"
+ sql_from_t;
oRs = Oracle.Execute(sql);

View File

@@ -442,7 +442,7 @@ function bestandenlijstALL(pmodule, pniveau, pkey)
+ " OR (ma.mld_stdmelding_key IS NULL AND ma.mld_ins_discipline_key = sm.mld_ins_discipline_key)"
+ " OR (ma.mld_stdmelding_key IS NULL AND ma.mld_ins_discipline_key IS NULL)"
+ " )"
+ " AND ma.mld_afmeldtekst_usefor = 5"
+ " AND BITAND(ma.mld_afmeldtekst_usefor, 8) = 8"
+ " AND mm.mld_melding_key = " + pkey;
+ " UNION "
+ "SELECT mo.mld_opdr_key"