FSN#37352 Appl beheer: UDR rapport eenvoudiger van test in productie brengen
svn path=/Website/trunk/; revision=32899
This commit is contained in:
@@ -322,22 +322,25 @@ function model_reportcolumns(usrrap_key, params)
|
||||
oRs.Close();
|
||||
|
||||
// Vervallen kolommen
|
||||
for (var o = 0; o < oldcols.length; o++)
|
||||
if (lastrefresh) // Nieuwe (geimporteerde) report heeft geen vervallen kolommen, maar nieuwe kolommen moeten wel toegevoegd worden.
|
||||
{
|
||||
var found = false;
|
||||
for (var n = 0; !found && n < newcols.length; n++)
|
||||
for (var o = 0; o < oldcols.length; o++)
|
||||
{
|
||||
if (newcols[n].name == oldcols[o].name)
|
||||
found = true;
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
__Log("Dropping column {0}".format(oldcols[o].name));
|
||||
// We kennen geen REST_DELETE
|
||||
var sql = "DELETE fac_usrrap_cols"
|
||||
+ " WHERE fac_usrrap_cols_expression IS NULL"
|
||||
+ " AND fac_usrrap_cols_key = " + oldcols[o].id;
|
||||
Oracle.Execute(sql);
|
||||
var found = false;
|
||||
for (var n = 0; !found && n < newcols.length; n++)
|
||||
{
|
||||
if (newcols[n].name == oldcols[o].name)
|
||||
found = true;
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
__Log("Dropping column {0}".format(oldcols[o].name));
|
||||
// We kennen geen REST_DELETE
|
||||
var sql = "DELETE fac_usrrap_cols"
|
||||
+ " WHERE fac_usrrap_cols_expression IS NULL"
|
||||
+ " AND fac_usrrap_cols_key = " + oldcols[o].id;
|
||||
Oracle.Execute(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +411,7 @@ function model_reportcolumns(usrrap_key, params)
|
||||
if (!valid_char.test(jsondata.name))
|
||||
abort_with_warning(L("lcl_rap_column_invalid"));
|
||||
|
||||
if (user.has("WEB_FACTAB") && (jsondata.expression || !jsondata.id))
|
||||
if (user.has("WEB_FACTAB") && (jsondata.expression || jsondata.id == -1))
|
||||
{
|
||||
this.fields.expression.readonly = false;
|
||||
this.fields.name.insertonly = false;
|
||||
@@ -429,6 +432,9 @@ function model_reportcolumns(usrrap_key, params)
|
||||
// Only internally used by report_clone and _view2columns
|
||||
this._REST_POST = function (params, jsondata, parent_key) /* insert columns */
|
||||
{
|
||||
if (user.has("WEB_FACTAB") && jsondata.id == -1)
|
||||
this.fields.expression.readonly = false;
|
||||
|
||||
var valid_char = /^[_0-9a-zA-Z]+$/;
|
||||
if (!valid_char.test(jsondata.name))
|
||||
abort_with_warning(L("lcl_rap_column_invalid"));
|
||||
@@ -441,7 +447,6 @@ function model_reportcolumns(usrrap_key, params)
|
||||
|
||||
var rapIns = buildInsert("fac_usrrap_cols", dbfields, { noValidateToken: true });
|
||||
var col_key = rapIns.sequences["fac_usrrap_col_key"];
|
||||
|
||||
var err = Oracle.Execute(rapIns.sql, true);
|
||||
if (err.friendlyMsg)
|
||||
abort_with_warning(err.friendlyMsg);
|
||||
|
||||
Reference in New Issue
Block a user