FCLT#63770 Savepoint, GUI voor single file upload varianten

svn path=/Website/trunk/; revision=60299
This commit is contained in:
2023-05-05 09:52:40 +00:00
parent e60110c485
commit 1d05c37397
10 changed files with 31 additions and 99 deletions

View File

@@ -106,17 +106,6 @@ else
{
FcltMgr.closeDetail(window, { cancel: true } );
}
function UploadImage()
{
url = "<%=protectQS.create("../shared/BijlagenForm.asp?module=ALGPHT")%>";
FcltMgr.openModalDetail(url, L("lcl_change"),
{ callback: function (data)
{
if (data.filenaam)
$("#ter_image").val(data.filenaam); }
} );
}
</script>
</head>

View File

@@ -646,17 +646,6 @@ var ins_deel_aantal = 1;
return -1;
<% } %>
}
function UploadImage()
{
url = "<%=protectQS.create("../shared/BijlagenForm.asp?module=INSPHD")%>";
FcltMgr.openModalDetail(url, L("lcl_change"),
{ callback: function (data)
{
if (data.filenaam)
$("#deel_image").val(data.filenaam); }
} );
}
</script>
</head>

View File

@@ -7,7 +7,6 @@ $(function ()
{ // initialisatie
$("#disciplinetype").change( change_disciplinetype );
$("#discipline").change( change_discipline );
$("#_upload").addClass("stdmsymbol_button").click( Upload );
$("#autoorder").change( onChangeAutoorder );
$("#autoorderamount").change( onChangeAutoorderAmount );
$("#accepttime").change( onChangeAccepttime );
@@ -179,16 +178,3 @@ function process_stdminfo(data)
if (sel_key.length)
select.val(sel_key);
}
function Upload()
{
parent.FcltMgr.openModalDetail( proturl_bijlage
, L("lcl_change")
, { callback: function (data)
{ if (data.filenaam)
$("#symbolname").val(data.filenaam.replace(/.dwf$/i,'')); // strip extensie
}
}
);
}

View File

@@ -79,21 +79,7 @@ else // Nieuw bericht. Defaults bepalen
<%
FCLTHeader.Generate();
%>
<script type="text/javascript" >
var mrk_key = <%=mrk_key%>;
function fotoUpload()
{
var url = "<%=protectQS.create("../shared/BijlagenForm.asp?module=MRK&key="+mrk_key)%>";
FcltMgr.openModalDetail(url, L("lcl_mrk_upload_foto"),
{ callback: function (data)
{ if (data.fileName)
$("input[name=fotoupload]").val(data.fileName.replace(/.jpg$/i, "")); // Toon bestandsnaam
else
$("input[name=fotoupload]").val(L("lcl_mrk_upload")); // Toon upload
}
} );
}
<script>
$(function()
{
@@ -171,18 +157,7 @@ var buttons = [{ title: L("lcl_submit"), icon: "fa-fclt-save", action:"mrk_subm
BLOCK_END();
BLOCK_START("mrkFoto", L("lcl_image"), { icon: "fa-image" });
var props = flexProps("MRK", mrk_key, null, null, {getFiles: true});
var vBestandnaam = (props.files.length > 0 ? props.files[0].name : "")
// Foto upload
RWFIELDTR("mrkfoto_button",
"button",
L("lcl_mrk_upload_foto"),
vBestandnaam == ""? L("lcl_mrk_upload") : vBestandnaam,
{ datatype: "button",
html: 'onClick="fotoUpload();return false;"',
endicon: "fa-cloud-upload"
});
FILEPICKERTR("mrkfoto_button", L("lcl_mrk_upload_foto"), null, { "key": mrk_key, "module": "MRK" });
BLOCK_END();
IFACE.FORM_END();

View File

@@ -94,22 +94,9 @@ user.auth_required_or_abort(this_mrk.canReadAny);
{id: "omschrijving"});
BLOCK_END();
var props = flexProps("MRK", mrk_key, null, null, {getFiles: true});
var vBestandnaam = (props.files.length > 0 ? props.files[0].name : "")
if (vBestandnaam != "")
{ // Foto Show
BLOCK_START("mrkFoto", L("lcl_image"), {icon: "fa-image"});
var imagePathFile = props.RelativePath + props.files[0].name;
%><tr><td class='label'><label><%=L("lcl_mrk_foto")%></label></td>
<td><img title='<%=safe.htmlattr(vBestandnaam)%>'
alt='<%=safe.htmlattr(vBestandnaam)%>'
onclick='FcltMgr.windowopen("<%=safe.jsstring(imagePathFile)%>")'
class='photo' src='<%=safe.htmlattr(imagePathFile)%>'></td>
</tr>
<%
FILEPICKERTR("mrkfoto_button", L("lcl_mrk_upload_foto"), null, { "key": mrk_key, "module": "MRK", "readonly": true });
BLOCK_END();
}
IFACE.FORM_END();
%>
</form>

View File

@@ -638,8 +638,8 @@ MODAL_BLOCK_START("bijlagen", L("lcl_appendixes"), { icon: "fa-paperclip" });
success: true,
cnt: <%=fileArray.length%>,
fileName: "<%=safe.jsstring(fileArray.length > 0? fileArray[0].name : "")%>"
<% if (fileArray.length > 0) { %>
, deleteUrl: "<%=protectQS.create(rooturl + "/appl/Shared/Bijlagenform_delete.asp?x=x"+transitParam)%>"
<% if (fileArray.length === 1) { %>
, deleteUrl: "<%=protectQS.create(rooturl + "/appl/Shared/Bijlagenform_delete.asp?DoDelete=" + Server.URLEncode(fileArray[0].name) + transitParam)%>"
<% } %>
};
FcltMgr.setCloseParams(window.return_data); // Zelfs als je kruisje gebruikt

View File

@@ -13,7 +13,6 @@
Globals:
Context:
Note:
TODO: Vergelijk autorisatie in ../MLD/UploadDisciplines.asp
*/ %>
<%

View File

@@ -13,7 +13,6 @@
Globals:
Context:
Note:
TODO: Vergelijk autorisatie in ../MLD/UploadDisciplines.asp
*/ %>
<%

View File

@@ -954,13 +954,16 @@ div.mldicmenu div.iconitem {
border: 1px solid rgba(52, 63, 77, 0.2);
}
.mld-menu-col .row:hover .iconitem:not(:hover),
.bes-menu-col .row:hover .iconitem:not(:hover),
:is(.mld-menu-col, .bes-menu-col) .row:hover .iconitem:not(:hover),
.res-menu-flex:hover > :not(.no-action) > :is(.iconitem:not(:hover), .res-flex-recent-card:not(:hover)),
.res-flex-recent-card:hover > .res-flex-recent-item:not(:hover) {
opacity: .65;
}
:is(.mld-menu-col, .bes-menu-col) .row:hover .iconitem:hover :is(i, img) {
scale: 1.025;
}
div.iconimg,
div.bes-icon-wrapper,
div.mld-icon-wrapper,
@@ -968,6 +971,7 @@ div.mld-icon-wrapper,
width: 100%;
height: 60%;
text-align: center;
overflow: hidden;
color: var(--menuiconcolor);
}
.res-flex-recent-label {
@@ -986,14 +990,12 @@ div.iconimg > img,
max-height: 100%;
max-width: 100%;
}
.mld-icon-wrapper img,
.bes-icon-wrapper img,
.mld-icon-wrapper i,
.bes-icon-wrapper i,
:is(.mld-icon-wrapper, .bes-icon-wrapper) :is(i, img),
.iconimg > * {
position: relative;
top: 50%;
transform: translateY(-50%);
transition: 150ms scale;
}
.res-iconlabel,

View File

@@ -1076,9 +1076,15 @@ function ICONPICKERTR_HTML(pname, plabel, pvalue, params) {
}
function FILEPICKERTR_HTML(pname, plabel, pvalue, params) {
if (params.readonly || pvalue === null) {
var fileProps = flexProps(params.module, params.key, null, null, { getFiles: true });
if (pvalue === null && fileProps.files.length > 0) { // Geen waarde, wel files gevonden; 1 map per 'key' -> pak de eerste (Todo; multi variant)
pvalue = fileProps.files[0].name;
params.addDeleteUrl = "&DoDelete=" + Server.URLEncode(pvalue);
}
}
if (params.readonly) {
var preview_url = "../Shared/BijlagenPreview.asp?key=" + params.key + "&module=" + params.module;
var fileProps = flexProps(params.module, params.key, null, null, { getFiles: true });
if (fileProps.files.length == 0 && (params.suppressEmpty && !(__Logging & 64)))
return; // Early exit
@@ -1091,7 +1097,7 @@ function FILEPICKERTR_HTML(pname, plabel, pvalue, params) {
+ " </td>"
+ " <td>"
+ (fileProps.files.length
? "<span class='details' onclick='FcltMgr.windowopen(\"" + safe.htmlattr(safe.jsstring(fileProps.files[0].deepurl)) + "\", \"" + safe.htmlattr(plabel) + "\")'>" + safe.html(pvalue) + "</span>"
? "<span class='details' onclick='FcltMgr.windowopen(\"" + safe.htmlattr(safe.jsstring(fileProps.files[0].deepurl)) + "\", \"" + safe.htmlattr(plabel) + "\")'>" + safe.html(pvalue || fileProps.files[0].name) + "</span>"
: "")
+ " </td>"
+ "</tr>";
@@ -1104,7 +1110,7 @@ function FILEPICKERTR_HTML(pname, plabel, pvalue, params) {
+ " <input type='hidden' id='" + pname + "' name='" + pname + "' value='" + safe.htmlattr(pvalue) + "'>"
+ FILEPICKER_HTML(pname, plabel, pvalue, params)
+ " <span class='default-clickable-icon symbol-delete' aria-controls='" + pname + "'"
+ " data-delete-url='" + safe.htmlattr(protectQS.create(rooturl + "/appl/Shared/Bijlagenform_delete.asp?key=" + (params.key || -1) + "&module=" + params.module)) + "'"
+ " data-delete-url='" + safe.htmlattr(protectQS.create(rooturl + "/appl/Shared/Bijlagenform_delete.asp?key=" + (params.key || -1) + "&module=" + params.module + (params.addDeleteUrl || ""))) + "'"
+ ">"
+ I("fa-trash-alt")
+ " </span>"