UWVA#40804 Mandatering in API2, savepoint, autorisaties en zo nog controleren
svn path=/Website/branches/v2017.1/; revision=34181
This commit is contained in:
@@ -104,6 +104,7 @@ var api2_mapper = {
|
|||||||
"costtypes" : { "filename": "appl/mgt/prs_kostensoort.asp" },
|
"costtypes" : { "filename": "appl/mgt/prs_kostensoort.asp" },
|
||||||
"costtypegroups" : { "filename": "appl/mgt/prs_kostensoortgrp.asp" },
|
"costtypegroups" : { "filename": "appl/mgt/prs_kostensoortgrp.asp" },
|
||||||
"persons" : { "filename": "appl/mgt/prs_perslid.asp", "nodoc": true },
|
"persons" : { "filename": "appl/mgt/prs_perslid.asp", "nodoc": true },
|
||||||
|
"mandates" : { "filename": "appl/mgt/prs_perslidkostenplaats.asp" },
|
||||||
"relationtypes" : { "filename": "appl/mgt/prs_relatietype.asp" },
|
"relationtypes" : { "filename": "appl/mgt/prs_relatietype.asp" },
|
||||||
"employeefunctions" : { "filename": "appl/mgt/prs_srtperslid.asp" },
|
"employeefunctions" : { "filename": "appl/mgt/prs_srtperslid.asp" },
|
||||||
"basispacelists" : { "filename": "appl/mgt/prs_staffel.asp" },
|
"basispacelists" : { "filename": "appl/mgt/prs_staffel.asp" },
|
||||||
@@ -141,6 +142,7 @@ var api2_mapper = {
|
|||||||
"invoices" : { "filename": "appl/api2/api_invoices.asp", "module": "FIN" },
|
"invoices" : { "filename": "appl/api2/api_invoices.asp", "module": "FIN" },
|
||||||
"objects" : { "filename": "appl/api2/api_objects.asp", "module": "INS" },
|
"objects" : { "filename": "appl/api2/api_objects.asp", "module": "INS" },
|
||||||
"companies" : { "filename": "appl/api2/api_companies.asp", "module": "PRS" },
|
"companies" : { "filename": "appl/api2/api_companies.asp", "module": "PRS" },
|
||||||
|
"departments" : { "filename": "appl/mgt/prs_afdeling.asp", "module": "PRS" },
|
||||||
|
|
||||||
"generictables" : { "filename": "appl/mgt/mgt_generic.asp", "hidden": true },
|
"generictables" : { "filename": "appl/mgt/mgt_generic.asp", "hidden": true },
|
||||||
"systemtables" : { "filename": "appl/mgt/user_tables.asp", "hidden": true },
|
"systemtables" : { "filename": "appl/mgt/user_tables.asp", "hidden": true },
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<% /*
|
|
||||||
$Revision$
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
File: model_departments.inc
|
|
||||||
|
|
||||||
Description: department model.
|
|
||||||
Parameters:
|
|
||||||
Context:
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
*/
|
|
||||||
101
APPL/API2/model_prs_afdeling.inc
Normal file
101
APPL/API2/model_prs_afdeling.inc
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<% /*
|
||||||
|
$Revision$
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
File: model_prs_afdeling.inc
|
||||||
|
|
||||||
|
Description: Afdelingen model.
|
||||||
|
Parameters:
|
||||||
|
Context:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
*/
|
||||||
|
%>
|
||||||
|
<!-- #include file="../prs/prs.inc" -->
|
||||||
|
<!-- #include file="./model_custom_fields.inc"-->
|
||||||
|
<!-- #include file="../mgt/mgt_tools.inc"-->
|
||||||
|
<!-- #include file="./model_prs_kenmerk.inc"-->
|
||||||
|
<%
|
||||||
|
|
||||||
|
function model_prs_afdeling()
|
||||||
|
{
|
||||||
|
this.table = "prs_afdeling";
|
||||||
|
this.primary = "prs_afdeling_key";
|
||||||
|
this.records_name = "companies";
|
||||||
|
this.record_name = "company";
|
||||||
|
|
||||||
|
|
||||||
|
this.fields = {
|
||||||
|
"id": {
|
||||||
|
"dbs": "prs_afdeling_key",
|
||||||
|
"typ": "key"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"dbs": "prs_afdeling_naam",
|
||||||
|
"typ": "varchar"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"dbs": "prs_afdeling_omschrijving",
|
||||||
|
"typ": "varchar"
|
||||||
|
},
|
||||||
|
"company": {
|
||||||
|
"dbs": "prs_afdeling_key",
|
||||||
|
"label": L("lcl_prs_company"),
|
||||||
|
"typ": "key",
|
||||||
|
"foreign": "prs_afdeling"
|
||||||
|
},
|
||||||
|
"parent": {
|
||||||
|
"dbs": "prs_afdeling_parentkey",
|
||||||
|
"label": L("lcl_prs_organisatie"),
|
||||||
|
"typ": "key",
|
||||||
|
"foreign": "prs_afdeling"
|
||||||
|
},
|
||||||
|
"costcentre": {
|
||||||
|
"dbs": "prs_kostenplaats_key",
|
||||||
|
"label": L("prs_kostenplaats_key"),
|
||||||
|
"typ": "key",
|
||||||
|
"foreign": {
|
||||||
|
"tbl": "prs_kostenplaats",
|
||||||
|
"key": "prs_kostenplaats_key",
|
||||||
|
"desc": "prs_kostenplaats_nr"
|
||||||
|
},
|
||||||
|
"multiedit": true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.includes = {
|
||||||
|
"custom_fields" : {
|
||||||
|
"model": new model_custom_fields(this, new model_prs_kenmerk("A", { internal: true }), { readman: true, readuse: true, pNiveau: "A" }),
|
||||||
|
"joinfield": "flexparentkey",
|
||||||
|
"enable_update": true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.REST_GET = function _GET(params)
|
||||||
|
{
|
||||||
|
var autfunction = "WEB_RELMAN";
|
||||||
|
params.authparams = user.checkAutorisation(autfunction, null, null, true); // pessimistisch
|
||||||
|
|
||||||
|
// TODO: Add authorization
|
||||||
|
var query = api2.sqlfields(params, this);
|
||||||
|
query.wheres.push("prs_afdeling_verwijder IS NULL");
|
||||||
|
|
||||||
|
var wheres = api2.sqlfilter(params, this)
|
||||||
|
query.wheres = query.wheres.concat(wheres);
|
||||||
|
|
||||||
|
var sql = "SELECT " + query.selects.join(", ")
|
||||||
|
+ " FROM " + query.tables.join(", ")
|
||||||
|
+ " WHERE " + query.wheres.join(" AND " )
|
||||||
|
+ " ORDER BY prs_afdeling_naam";
|
||||||
|
|
||||||
|
var json = api2.sql2json (params, sql, this);
|
||||||
|
|
||||||
|
return json;
|
||||||
|
};
|
||||||
|
|
||||||
|
// (even) nog geen updates
|
||||||
|
//this.REST_POST = generic_REST_POST(this);
|
||||||
|
//this.REST_PUT = generic_REST_PUT(this);
|
||||||
|
//this.REST_DELETE = generic_REST_DELETE(this);
|
||||||
|
}
|
||||||
|
%>
|
||||||
71
APPL/API2/model_prs_perslidkostenplaats.inc
Normal file
71
APPL/API2/model_prs_perslidkostenplaats.inc
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<% /*
|
||||||
|
$Revision$
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
File: model_prs_perslidkostenplaats.inc
|
||||||
|
|
||||||
|
Description: Model voor model_prs_perslidkostenplaats
|
||||||
|
|
||||||
|
Context:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
*/
|
||||||
|
%>
|
||||||
|
<%
|
||||||
|
|
||||||
|
function model_prs_perslidkostenplaats()
|
||||||
|
{
|
||||||
|
this.records_name = "mandates";
|
||||||
|
this.record_name = "mandate";
|
||||||
|
this.table = "prs_perslidkostenplaats";
|
||||||
|
this.primary = "prs_perslidkostenplaats_key";
|
||||||
|
this.autfunction = "WEB_FINMSU";
|
||||||
|
this.record_title = L("prs_perslidkostenplaats");
|
||||||
|
this.records_title = L("prs_perslidkostenplaats_m");
|
||||||
|
|
||||||
|
this.fields = {
|
||||||
|
"id": {
|
||||||
|
"dbs": "prs_perslidkostenplaats_key",
|
||||||
|
"label": L("lcl_key"),
|
||||||
|
"typ": "key",
|
||||||
|
"required": true,
|
||||||
|
"seq": "fac_s_prs_perslidkostenplaats_key"
|
||||||
|
},
|
||||||
|
"person": {
|
||||||
|
"dbs": "prs_perslid_key",
|
||||||
|
"label": L("lcl_user"),
|
||||||
|
"typ": "key",
|
||||||
|
"foreign" : "prs_perslid"
|
||||||
|
},
|
||||||
|
"costcentre": {
|
||||||
|
"dbs": "prs_kostenplaats_key",
|
||||||
|
"label": L("prs_kostenplaats_key"),
|
||||||
|
"typ": "key",
|
||||||
|
"foreign": {
|
||||||
|
"tbl": "prs_kostenplaats",
|
||||||
|
"key": "prs_kostenplaats_key",
|
||||||
|
"desc": "prs_kostenplaats_nr"
|
||||||
|
},
|
||||||
|
"multiedit": true
|
||||||
|
},
|
||||||
|
"charge": {
|
||||||
|
"dbs": "prs_perslidkostenplaats_boeken",
|
||||||
|
"label": L("prs_perslidkostenplaats_boeken"),
|
||||||
|
"typ": "check0",
|
||||||
|
"multiedit": true
|
||||||
|
},
|
||||||
|
"view": {
|
||||||
|
"dbs": "prs_perslidkostenplaats_inzage",
|
||||||
|
"label": L("prs_perslidkostenplaats_inzage"),
|
||||||
|
"typ": "check0",
|
||||||
|
"multiedit": true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.REST_GET = generic_REST_GET(this);
|
||||||
|
// (even) nog geen updates
|
||||||
|
//this.REST_POST = generic_REST_POST(this);
|
||||||
|
//this.REST_PUT = generic_REST_PUT(this);
|
||||||
|
//this.REST_DELETE = generic_REST_DELETE(this);
|
||||||
|
}
|
||||||
|
%>
|
||||||
38
APPL/MGT/prs_afdeling.asp
Normal file
38
APPL/MGT/prs_afdeling.asp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<%@language = "javascript" %>
|
||||||
|
<% /*
|
||||||
|
$Revision$
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
File: prs_afdeling.asp
|
||||||
|
|
||||||
|
Description: fac_management aanroep van model_prs_afdeling
|
||||||
|
|
||||||
|
Context:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
*/
|
||||||
|
%>
|
||||||
|
<!-- #include file="../scf/scaffolding.inc" -->
|
||||||
|
<!-- #include file="../api2/model_prs_afdeling.inc" -->
|
||||||
|
<%
|
||||||
|
var this_model = new model_prs_afdeling();
|
||||||
|
|
||||||
|
scaffolding(this_model,
|
||||||
|
{
|
||||||
|
"search": {
|
||||||
|
"autosearch": true,
|
||||||
|
"filters": [
|
||||||
|
"name",
|
||||||
|
"company"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"columns": [
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"parent",
|
||||||
|
"company"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
%>
|
||||||
38
APPL/MGT/prs_perslidkostenplaats.asp
Normal file
38
APPL/MGT/prs_perslidkostenplaats.asp
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<%@language = "javascript" %>
|
||||||
|
<% /*
|
||||||
|
$Revision$
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
File: prs_perslidkostenplaats.asp
|
||||||
|
|
||||||
|
Description: fac_management aanroep van model_prs_perslidkostenplaats
|
||||||
|
|
||||||
|
Context:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
*/
|
||||||
|
%>
|
||||||
|
<!-- #include file="../scf/scaffolding.inc" -->
|
||||||
|
<!-- #include file="../api2/model_prs_perslidkostenplaats.inc" -->
|
||||||
|
<%
|
||||||
|
var this_model = new model_prs_perslidkostenplaats();
|
||||||
|
|
||||||
|
scaffolding(this_model,
|
||||||
|
{
|
||||||
|
"search": {
|
||||||
|
"autosearch": true,
|
||||||
|
"filters": [
|
||||||
|
"person"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"columns": [
|
||||||
|
"id",
|
||||||
|
"person",
|
||||||
|
"costcenter",
|
||||||
|
"charge",
|
||||||
|
"view"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
%>
|
||||||
Reference in New Issue
Block a user