FSN#31698 Rapportgenerator scaffolding aanscherpnig

svn path=/Website/trunk/; revision=24401
This commit is contained in:
Jos Groot Lipman
2015-03-10 20:05:18 +00:00
parent becca331df
commit 801728e045
9 changed files with 52 additions and 28 deletions

View File

@@ -92,7 +92,9 @@ return; // TODO?
var newcol = { sequence: (i+1) * 10,
name: column.column_name,
datatype: column.datatype||"varchar",
caption: column.caption
caption: column.caption,
visible: column.visible,
filter: column.filter
}
new_model.columns.push(newcol);
}

View File

@@ -4,6 +4,9 @@
<!-- #include file="../api2/model_reportsx.inc" -->
<%
if (getQParam("model", "") == "columns")
model_reportcolumns.REST_POST = false;
scaffolding(model_reportsx,
{
"search": {
@@ -11,8 +14,8 @@
},
"show": {
js: ["./fac_reportx.js"],
buttons: [{ title: L("lcl_show_report"), action: "show_report", icon: "doc_text_image.png" },
{ title: L("lcl_clone_report"), action: "clone_report", icon: "copy.png" }]
buttons: [{ title: L("lcl_usrrap_show"), action: "show_report", icon: "doc_text_image.png" },
{ title: L("lcl_usrrap_clone"), action: "clone_report", icon: "copy.png" }]
}
});
%>

View File

@@ -225,7 +225,7 @@ usrrap = {
filter: oRs("fac_usrrap_cols_filter").Value, // 'A'=Automatic
sequence: oRs("fac_usrrap_cols_volgnr").Value,
align: null,
visible: true
visible: 'V'
};
result.columns.push(colpar);
oRs.MoveNext()
@@ -256,7 +256,7 @@ usrrap = {
datatype: null,
group: 'G',
align: null,
visible: true
visible: 'V'
};
var special_cols = colpar.column_name.toUpperCase().match(/^(HIDE_F_|FCLT_X_|FCLT_3D_|FCLT_KEY|FCLT_F_|HTML_|FCLT_D_|FCLT_C_)/);
if (special_cols)
@@ -264,7 +264,10 @@ usrrap = {
var ucolname = colpar.column_name.toUpperCase();
if (ucolname.match(/^(HIDE_F_|FCLT_X_|FCLT_3D_|FCLT_KEY)/))
colpar.visible = false;
colpar.visible = 'H'; // Hidden
if (result.view_name_short.match(/_V_UDR/))
colpar.visible = 'H'; // Hidden, die hebben te veel kolommen
if (ucolname.match(/^(FCLT_F_|FCLT_D_)/))
colpar.filter = 'A';

View File

@@ -348,7 +348,7 @@ else { // In alle andere gevallen, dus normaliter (bij gevulde oRs) zijn dat nog
for (var i in fac_usrrap.columns)
{
var col = fac_usrrap.columns[i];
if (!col.visible)
if (col.visible != 'V')
continue; // HIDE_, FCLT_X, FCLT_3D niet tonen
var colpar = {caption: col.caption,

View File

@@ -37,7 +37,7 @@ var p_bAutoexec = (getQParamInt("autoexec", 0) == 1)
var fac_usrrap = usrrap.fac_usrrap_info(usrrap_key);
if (!fac_usrrap.fac_functie) // Ongestyled doen we altijd new-style
if (!fac_usrrap.functie) // Ongestyled doen we altijd new-style
Response.Redirect("../fac/fac_report.asp?usrrap_key=" + usrrap_key);
%>

View File

@@ -33,7 +33,7 @@ function scaffolding_list(model, scf_params)
var modal = (model.parent_key != null); // dan doen we een detailrecord altijd modal
FCLTHeader.Requires({js: []});
FCLTHeader.Requires({js: ["jquery-ui.js"]});
if (model.autfunction)
var authparams = user.checkAutorisation(model.autfunction);
@@ -59,6 +59,31 @@ function scaffolding_list(model, scf_params)
FcltMgr.openDetail(url, "<%=safe.jsstring(model.record_name)%>");
<% } %>
}
// Return a helper with preserved width of cells
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
ui.css('left', "-2px");
return ui;
};
$(function () {
if (0) // TODO: nog even uit
$("#<%=model.table%> tbody").sortable({
axis: "y",
helper: fixHelper,
stop: function( event, ui ) {
//ui.item.children('td').css('color', 'red');
var rows = [];
$("#<%=model.table%> tbody tr").each(function()
{
rows.push(this.getAttribute("ROWKEY"));
}
);
alert(rows);
}
}).disableSelection() });;
</script>
</head>
<body id="listbody">

View File

@@ -112,18 +112,6 @@ function scaffolding_m_list(model, scf_params)
outputmode: outputmode,
buttons: buttons
});
if (0)
var rst = new ResultsetTable({sql: modules[module].sql,
keyColumn: "item_key",
linkColumn: fncolLink,
headerColumn: fncolHeader,
detailColumn: "detail",
asideColumn: modules[module].fnStatus,
subheaderColumn: modules[module].fnSubheader || "datum",
ID: "factable",
showAll: true,
noSearch: true
});
function fnfncolCheck(fld)
{

View File

@@ -91,6 +91,9 @@ function scaffolding_search(model, scf_params)
for (var fld in model.fields)
{
var field = model.fields[fld];
if (field.visible == 'H') // Sommige FCLT_3D hebben een filter
continue;
if (field.filter == 'like' || field.filter == 'exact')
scf_RWFIELDTR(field, fld, null);
else if (field.filter == "range")
@@ -129,18 +132,18 @@ function scaffolding_search(model, scf_params)
continue;
var on = inArray(fld, scf_params.list.columns);
Response.Write("<tr id='" + fld + "'><td><label><input type='checkbox'" + (on?" checked='1'":"") + ">"
+ safe.html(model.fields[fld].label) + "</label></td>");
+ safe.html(field.label) + "</label></td>");
if (model.list && model.list.canGroup)
{
if (model.fields[fld].typ == "date" || model.fields[fld].typ == "datetime")
if (field.typ == "date" || field.typ == "datetime")
grp = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G,D,W,M,Y,H");
else if (model.fields[fld].typ == "time")
else if (field.typ == "time")
grp = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G,H");
else if (model.fields[fld].typ == 'varchar')
else if (field.typ == 'varchar')
grp = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G");
else
grp = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G,S,C,A");
Response.Write("<td>" + api2.splitLOV2select(grp , model.fields[fld].group.id) + "</td>")
Response.Write("<td>" + api2.splitLOV2select(grp , field.group.id) + "</td>")
}
Response.Write("</tr>")
}

View File

@@ -86,8 +86,8 @@ function scaffolding_show(model, scf_params)
}
}
buttons.push({title: L("lcl_change"), action: "xxx_change()", icon: "wijzigen.png" });
if (model["REST_DELETE"])
buttons.push({title: L("lcl_delete"), action: "xxx_delete()", icon: "delete.png" });
// if (model["REST_DELETE"])
// buttons.push({title: L("lcl_delete"), action: "xxx_delete()", icon: "delete.png" });
}
IFRAMER_HEADER(model.record_title, buttons);
%>