@@ -17,9 +17,7 @@
|
||||
var reportsx = new model_reportsx();
|
||||
|
||||
var show_buttons = [{ title: L("lcl_usrrap_show"), action: "show_report", icon: "fa-file-text" }];
|
||||
if (S("fac_usrrap_mode") == 1)
|
||||
show_buttons.push({ title: L("lcl_usrrap_clone"), action: "clone_report", icon: "copy.png" });
|
||||
else
|
||||
if (S("fac_usrrap_mode") != 1)
|
||||
reportsx.includes = []; // Geen kolom details laten zien
|
||||
|
||||
scaffolding(reportsx,
|
||||
|
||||
@@ -35,11 +35,3 @@ function show_report(key)
|
||||
var url = "appl/fac/fac_report.asp?usrrap_key=" + key;
|
||||
FcltMgr.openDetail(url);
|
||||
}
|
||||
|
||||
function clone_report(key)
|
||||
{
|
||||
FcltMgr.confirm(L("lcl_usrrap_clone_confirm"), function() {
|
||||
var url = "appl/fac/fac_usrrapx_clone.asp?usrrap_key=" + key;
|
||||
FcltMgr.openDetail(url);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<%@language = "javascript" %>
|
||||
<% /*
|
||||
$Revision$
|
||||
$Id$
|
||||
|
||||
File: fac_usrrapx_clone.asp
|
||||
Description: Maakt een kopie van een rapport definitie
|
||||
|
||||
Parameters:
|
||||
Context:
|
||||
Note:
|
||||
*/
|
||||
%>
|
||||
<!-- #include file="../Shared/common.inc" -->
|
||||
<!-- #include file="../shared/save2db.inc" -->
|
||||
<!-- #include file="../api2/api2.inc" -->
|
||||
<!-- #include file="../api2/model_reportsx.inc" -->
|
||||
<%
|
||||
|
||||
var authparamsPRSSYS = user.checkAutorisation("WEB_UDRMAN");
|
||||
|
||||
var usrrap_key = getQParamInt("usrrap_key");
|
||||
|
||||
var oldrap = new model_reportsx(usrrap_key, { include: ["columns"] });
|
||||
oldrap.data.name = "Clone: " + toDateTimeString(new Date, true) + " " + oldrap.data.name;
|
||||
if (oldrap.data.styling)
|
||||
oldrap.data.styling.id = (oldrap.data.styling.id & (~32)); // Template bitje er af strippen
|
||||
|
||||
var newrap = new model_reportsx(-1, { internal: true }); // internal zodat POST op kolommen wordt geaccepteerd
|
||||
var params = { isNew: true };
|
||||
var new_key = newrap.REST_POST(params, oldrap.data );
|
||||
|
||||
Response.Redirect("../fac/fac_reportx.asp?mode=wrap&id=" + new_key.key);
|
||||
%>
|
||||
@@ -70,6 +70,11 @@ function scaffolding_edit(model, scf_params)
|
||||
|
||||
if (cloning && (field.clone === false || fld == "id"))
|
||||
xxx_data[fld] = field.defaultvalue;
|
||||
if (typeof field.clone == "function")
|
||||
xxx_data[fld] = field.clone(xxx_data);
|
||||
|
||||
if (field.required && !xxx_data[fld] )
|
||||
xxx_data[fld] = field.defaultvalue;
|
||||
|
||||
if (field.uniquewith)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,8 @@ function scaffolding_save(model, scf_params)
|
||||
var field = model.fields[fld];
|
||||
if (field.insertonly)
|
||||
jsondata[fld] = olddata[fld];
|
||||
else if (field.required && !(fld in jsondata)) // Bijvoorbeeld kenmerktypeLOV's die je niet mag togglen
|
||||
jsondata[fld] = olddata[fld];
|
||||
}
|
||||
for (var inc in model.includes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user