diff --git a/APPL/API2/model_reportcolumns.inc b/APPL/API2/model_reportcolumns.inc index f35c86c13f..9ae435113b 100644 --- a/APPL/API2/model_reportcolumns.inc +++ b/APPL/API2/model_reportcolumns.inc @@ -122,7 +122,7 @@ function model_reportcolumns(usrrap_key, params) rowClass: this.fnrowClass }; - this.hook_pre_edit = function (obj) + this.hook_pre_edit = function (obj, fld) { this.fields.filter.LOV = api2.filterLOV(L("lcl_rap_filterLOV"), "A,E,R"); // De meesten mogen L(ike) niet if ((obj.datatype && !obj.expression) || !user.has("WEB_FACTAB")) @@ -165,7 +165,9 @@ function model_reportcolumns(usrrap_key, params) this.fields.name.insertonly = false; // Een zelf toegevoegd veld mag ook verwijderd worden. if (obj.expression) - this.REST_DELETE = this._REST_DELETE; + { + this.REST_DELETE = generic_REST_DELETE(this); //this._REST_DELETE; + } } }; @@ -173,7 +175,12 @@ function model_reportcolumns(usrrap_key, params) { if (obj.id == -1) this.fields.expression.readonly = false; - } + }; + + this.hook_pre_delete = function (params, columns_key) + { + this.REST_DELETE = generic_REST_DELETE(this); + }; // Maakt de default fac_usrrap_cols records aan aan de hand van de view of werk ze bij this._view2columns = function (usrrap_key, lastrefresh, oldcols) @@ -361,7 +368,7 @@ function model_reportcolumns(usrrap_key, params) + " SET fac_usrrap_col_refresh = SYSDATE" + " WHERE fac_usrrap_key = " + usrrap_key; Oracle.Execute(sql); - }, + } this.REST_GET = function _GET(params) { @@ -382,7 +389,8 @@ function model_reportcolumns(usrrap_key, params) } return json; - }; + } + this.REST_PUT = function (params, jsondata, the_key) /* update columns */ { var valid_char = /^[_0-9a-zA-Z]+$/; // Alleen deze tekens zijn geldig! @@ -403,7 +411,8 @@ function model_reportcolumns(usrrap_key, params) abort_with_warning(err.friendlyMsg); return { key: the_key }; - }; + } + this._REST_PUT = this.REST_PUT; // Interne is er altijd // Only internally used by report_clone and _view2columns @@ -429,9 +438,6 @@ function model_reportcolumns(usrrap_key, params) return { key: col_key, warning: "" }; } - this._REST_DELETE = generic_REST_DELETE(this); - - if (rap_key > 0) { // var rap_data = model_reportsx(rap_key); te veel recursie diff --git a/APPL/SCF/scaffolding_delete.inc b/APPL/SCF/scaffolding_delete.inc index 769a5d7ceb..ed45f570fa 100644 --- a/APPL/SCF/scaffolding_delete.inc +++ b/APPL/SCF/scaffolding_delete.inc @@ -18,6 +18,8 @@ function scaffolding_delete(model, scf_params) var key = getQParamInt( "id" ); var params = { }; + if ("hook_pre_delete" in model) + model.hook_pre_delete(params, key); var xxx_array = model.REST_DELETE(params, key); var warning = xxx_array.warning;