FSN#38916 FACFAC Superuser alle tabellen kunnen bekijken

svn path=/Website/trunk/; revision=32226
This commit is contained in:
Jos Groot Lipman
2017-01-05 13:21:17 +00:00
parent 587f6689d2
commit 65d1bcbf6e
4 changed files with 108 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<% /*
$Revision$
$Id$
File: model_user_tables.inc
Description: Tables model.
Parameters:
Context:
Notes:
*/
%>
<%
function model_user_tables()
{
this.table = "user_tables";
this.primary = "table_name";
this.records_name = "Tables";
this.record_name = "Table";
this.autfunction = "WEB_FACFAC";
this.fields = { "id" : { dbs: "table_name", typ: "varchar", label: "Table" },
"rows" : { dbs: "num_rows", typ: "number", label: "Estimated rows" },
"analyzed" : { dbs: "last_analyzed", typ: "datetime", label: "Last analyzed" }
};
this.REST_GET = generic_REST_GET(this);
this.list = { default_url: "appl/mgt/mgt_generic.asp?table={0}" };
}
%>

39
APPL/MGT/mgt_generic.asp Normal file
View File

@@ -0,0 +1,39 @@
<%@language = "javascript" %>
<% /*
$Revision$
$Id$
File: mgt_generic.asp
Description: Ingang om generiek tabel data te bekijken
Context: Vanuit user_tables.asp
Notes: Alleen voor FACFAC
Vooralsnog geforceerd readonly
*/
%>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_generic.inc" -->
<%
user.checkAutorisation("WEB_FACFAC");
var table = getQParam("table").toUpperCase();
var model = model_generic(table, "WEB_FACFAC");
var params = { "transit": { "table": table },
"show": {} // zodat je kunt doorklikken
};
if ("estimated_rows" in model && model.estimated_rows < S("qp_maxrows"))
params.search = { autosearch: true };
model.REST_GET = generic_REST_GET(model);
// geforceerd readonly
model.REST_POST = null;
model.REST_PUT = null;
model.REST_DELETE = null;
scaffolding(model, params);
%>

35
APPL/MGT/user_tables.asp Normal file
View File

@@ -0,0 +1,35 @@
<%@language = "javascript" %>
<% /*
$Revision$
$Id$
File: user_tables.asp
Description: Ingang generiek tabellen te bekijken
Context: Vanuit het menu
Notes: Alleen voor FACFAC
*/
%>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_user_tables.inc" -->
<%
user.checkAutorisation("WEB_FACFAC");
settings.overrule_setting("qp_maxrows", 500); // Toon alle tabellen direct
scaffolding(new model_user_tables(),
{
"search": {
autosearch: true,
"filters": [
//"id" werkt niet goed?
]
},
"list": {
columns: ["id", "analyzed", "rows"]
}
});
%>

View File

@@ -376,7 +376,7 @@ function scaffolding_list(model, scf_params)
else
if (field.typ == 'number' || field.typ == 'key')
coldata.datatype = 'number'; // Zo verwacht resultsettable dat
if (fld == 'id')
if (fld == 'id' && field.typ == "key")
coldata.tdClass = 'listid';
if (field.autofloat) // Vanuit model_reports hebben we niet altijd correct autodetect