diff --git a/APPL/API2/api2_dispatch.inc b/APPL/API2/api2_dispatch.inc index 3957ed7674..5b143b4c79 100644 --- a/APPL/API2/api2_dispatch.inc +++ b/APPL/API2/api2_dispatch.inc @@ -104,6 +104,7 @@ var api2_mapper = { "costtypes" : { "filename": "appl/mgt/prs_kostensoort.asp" }, "costtypegroups" : { "filename": "appl/mgt/prs_kostensoortgrp.asp" }, "persons" : { "filename": "appl/mgt/prs_perslid.asp", "nodoc": true }, + "mandates" : { "filename": "appl/mgt/prs_perslidkostenplaats.asp" }, "relationtypes" : { "filename": "appl/mgt/prs_relatietype.asp" }, "employeefunctions" : { "filename": "appl/mgt/prs_srtperslid.asp" }, "basispacelists" : { "filename": "appl/mgt/prs_staffel.asp" }, @@ -141,6 +142,7 @@ var api2_mapper = { "invoices" : { "filename": "appl/api2/api_invoices.asp", "module": "FIN" }, "objects" : { "filename": "appl/api2/api_objects.asp", "module": "INS" }, "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 }, "systemtables" : { "filename": "appl/mgt/user_tables.asp", "hidden": true }, diff --git a/APPL/API2/model_departments.inc b/APPL/API2/model_departments.inc deleted file mode 100644 index b7beb9784e..0000000000 --- a/APPL/API2/model_departments.inc +++ /dev/null @@ -1,12 +0,0 @@ -<% /* - $Revision$ - $Id$ - - File: model_departments.inc - - Description: department model. - Parameters: - Context: - - Notes: -*/ \ No newline at end of file diff --git a/APPL/API2/model_prs_afdeling.inc b/APPL/API2/model_prs_afdeling.inc new file mode 100644 index 0000000000..a11af9ceae --- /dev/null +++ b/APPL/API2/model_prs_afdeling.inc @@ -0,0 +1,101 @@ +<% /* + $Revision$ + $Id$ + + File: model_prs_afdeling.inc + + Description: Afdelingen model. + Parameters: + Context: + + Notes: +*/ +%> + + + + +<% + +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); +} +%> \ No newline at end of file diff --git a/APPL/API2/model_prs_perslidkostenplaats.inc b/APPL/API2/model_prs_perslidkostenplaats.inc new file mode 100644 index 0000000000..9e9fbf6d4e --- /dev/null +++ b/APPL/API2/model_prs_perslidkostenplaats.inc @@ -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); +} +%> \ No newline at end of file diff --git a/APPL/MGT/prs_afdeling.asp b/APPL/MGT/prs_afdeling.asp new file mode 100644 index 0000000000..082054b496 --- /dev/null +++ b/APPL/MGT/prs_afdeling.asp @@ -0,0 +1,38 @@ +<%@language = "javascript" %> +<% /* + $Revision$ + $Id$ + + File: prs_afdeling.asp + + Description: fac_management aanroep van model_prs_afdeling + + Context: + + Notes: +*/ +%> + + +<% +var this_model = new model_prs_afdeling(); + +scaffolding(this_model, + { + "search": { + "autosearch": true, + "filters": [ + "name", + "company" + ] + }, + "list": { + "columns": [ + "id", + "name", + "parent", + "company" + ] + } + }); +%> diff --git a/APPL/MGT/prs_perslidkostenplaats.asp b/APPL/MGT/prs_perslidkostenplaats.asp new file mode 100644 index 0000000000..0897894216 --- /dev/null +++ b/APPL/MGT/prs_perslidkostenplaats.asp @@ -0,0 +1,38 @@ +<%@language = "javascript" %> +<% /* + $Revision$ + $Id$ + + File: prs_perslidkostenplaats.asp + + Description: fac_management aanroep van model_prs_perslidkostenplaats + + Context: + + Notes: +*/ +%> + + +<% +var this_model = new model_prs_perslidkostenplaats(); + +scaffolding(this_model, + { + "search": { + "autosearch": true, + "filters": [ + "person" + ] + }, + "list": { + "columns": [ + "id", + "person", + "costcenter", + "charge", + "view" + ] + } + }); +%>