Merge 2016.3 Gold C patches

svn path=/Website/trunk/; revision=32871
This commit is contained in:
Jos Groot Lipman
2017-02-20 08:29:59 +00:00
27 changed files with 1333 additions and 354 deletions

View File

@@ -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);
}
}
};
@@ -173,7 +175,23 @@ function model_reportcolumns(usrrap_key, params)
{
if (obj.id == -1)
this.fields.expression.readonly = false;
}
};
this.hook_pre_delete = function (params, columns_key)
{
var sql = "SELECT 1"
+ " FROM fac_usrrap_cols"
+ " WHERE fac_usrrap_cols_expression IS NOT NULL"
+ " AND fac_usrrap_cols_key = " + columns_key;
var oRs = Oracle.Execute(sql, true);
if (oRs.eof)
abort_with_warning(L("lcl_cnt_Del_Fails_Auth"));
oRs.Close();
user.checkAutorisation("WEB_FACTAB");
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 +379,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 +400,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 +422,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 +449,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