FCLT#63770 savepoint conversie S(csstemplate) & INSDEEL -> INSPHD
svn path=/Website/trunk/; revision=60372
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<!-- #include file="../Shared/common.inc" -->
|
||||
<!-- #include file="../Shared/iface.inc" -->
|
||||
<!-- #include file="fac.inc" -->
|
||||
<!-- #include file="../Shared/FlexFiles.inc" -->
|
||||
<!-- #include file="../Shared/selector.inc" -->
|
||||
<!-- #include file="../Shared/autorisatieselector.inc" -->
|
||||
<%
|
||||
|
||||
@@ -72,6 +72,9 @@ function prettyJson(j)
|
||||
if (name in css)
|
||||
{
|
||||
$("td input[name="+name+"]").val(css[name]);
|
||||
if (name.slice(-5) === "image") {
|
||||
$("[type=button][aria-controls=" + name + "]").val(css[name]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -175,10 +178,29 @@ function prettyJson(j)
|
||||
con = S("csstemplate")[itm];
|
||||
// Voor kleurwaarden tonen we een kleurvoorbeeld, dat bepalen we aan de hand van onze defaultwaarde
|
||||
%><tr><td class='label'><label for='<%=safe.html(itm)%>'><%=safe.html(itm)%></label></td>
|
||||
<td style="text-align:right"><% =(FCLTHeader.defaultTemplate[itm]).match(/^#|^rgb/i) ? '<div class="color-preview" style="color:'+safe.htmlattr(FCLTHeader.defaultTemplate[itm])+'">' + I("fa-square fa-2x", { fastyle: "fas" }) + '</div>' : '' %></td>
|
||||
<td style="text-align:right"><% =(FCLTHeader.defaultTemplate[itm]).match(/^#(?!#)|^rgb/i) ? '<div class="color-preview" style="color:'+safe.htmlattr(FCLTHeader.defaultTemplate[itm])+'">' + I("fa-square fa-2x", { fastyle: "fas" }) + '</div>' : '' %></td>
|
||||
<td><%=safe.html(FCLTHeader.defaultTemplate[itm])%></td>
|
||||
<td><input class="fld" id='<%=safe.html(itm)%>' name='<%=safe.html(itm)%>' value='<%=safe.htmlattr(con)%>'></td>
|
||||
<td style="text-align:right"><% =(act && (FCLTHeader.defaultTemplate[itm]).match(/^#|^rgb/i) || act.match(/^#|^rgb/i)) ? '<div class="color-preview" style="color:'+safe.htmlattr(act)+'">' + I("fa-square fa-2x", { fastyle: "fas" }) + '</div>' : '' %></td>
|
||||
<% if (itm.slice(-5) === "image") {
|
||||
Response.Write(" <td class='filepicker'>"
|
||||
+ " <input type='hidden' id='" + safe.htmlattr(itm) + "' name='" + safe.htmlattr(itm) + "' value='" + safe.htmlattr(con) + "'>"
|
||||
+ " <span class='button-icon-wrapper file-picker'>"
|
||||
+ " <span class='starticon'>" + I("fa-file-image") + "</span>"
|
||||
+ " <input type='button' class='button symbol-upload' title='" + safe.htmlattr(itm) + "' value='" + safe.htmlattr(con || L("lcl_image")) + "'"
|
||||
+ " aria-controls='" + itm + "'"
|
||||
+ " data-default-title='" + safe.htmlattr(itm) + "'"
|
||||
+ " data-module='STYLE'"
|
||||
+ " data-upload-url='" + safe.htmlattr(protectQS.create("../shared/BijlagenForm.asp?module=STYLE&itm=" + Server.URLEncode(itm))) + "'>"
|
||||
+ " </span>"
|
||||
+ " <span class='default-clickable-icon symbol-delete' aria-controls='" + safe.htmlattr(itm) + "'"
|
||||
+ " data-delete-url='" + safe.htmlattr(protectQS.create(rooturl + "/appl/Shared/Bijlagenform_delete.asp?style=" + itm + "&module=STYLE" + (con ? "&DoDelete=" + Server.URLEncode(con) : ""))) + "'"
|
||||
+ " >"
|
||||
+ I("fa-trash-alt")
|
||||
+ " </span>"
|
||||
+ " </td>");
|
||||
} else { %>
|
||||
<td><input class="fld" id='<%=safe.htmlattr(itm)%>' name='<%=safe.htmlattr(itm)%>' value='<%=safe.htmlattr(con)%>'></td>
|
||||
<%} %>
|
||||
<td style="text-align:right"><% =(act && (FCLTHeader.defaultTemplate[itm]).match(/^#(?!#)|^rgb/i) || act.match(/^#(?!#)|^rgb/i)) ? '<div class="color-preview" style="color:'+safe.htmlattr(act)+'">' + I("fa-square fa-2x", { fastyle: "fas" }) + '</div>' : '' %></td>
|
||||
<td><%=safe.html(act)%></td>
|
||||
</tr><%
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<!-- #include file="../Shared/common.inc" -->
|
||||
<!-- #include file="../Shared/iface.inc" -->
|
||||
<!-- #include file="fac.inc" -->
|
||||
<!-- #include file="../Shared/FlexFiles.inc" -->
|
||||
<!-- #include file="../Shared/selector.inc" -->
|
||||
|
||||
<%
|
||||
|
||||
@@ -651,7 +651,7 @@ ins = {checkAutLevel:
|
||||
photoinfo: function _photoinfo(pins_deel_key)
|
||||
{
|
||||
// via S("prs_photo_kenmerk_key") == -1 is tonen/niet tonen te regelen. Daar doen we hier niets mee, dan upload je maar niet.
|
||||
var props = flexProps("INSDEEL", pins_deel_key, null, null, {getFiles: true});
|
||||
var props = flexProps("INSPHD", pins_deel_key, null, null, {getFiles: true});
|
||||
var result;
|
||||
if (props.files.length > 0)
|
||||
{
|
||||
|
||||
@@ -1021,8 +1021,6 @@ var ins_deel_aantal = 1;
|
||||
RWFIELDTR("uitvoertijd", "fld", L("lcl_ins_uitvoertijd"), uitvoertijd? Math.round(uitvoertijd * 100000) / 100000 : ""
|
||||
, {maxlength: 8, datatype: "float", html: "onChange='onChangeUitvoertijd();'", selector: selectparams
|
||||
, readonly: !this_ins.canChangeAlg, suppressEmpty: true});
|
||||
|
||||
RWSYMBOLTR("deel_image", L("lcl_ins_deel_image"), deel_image, { "key": ins_key, "module": "INSPHD" });
|
||||
BLOCK_END();
|
||||
|
||||
if (urole != "fo" || uitleen_flex_present) // FO ziet ze alleen als er uitleen flex zijn?
|
||||
|
||||
@@ -484,7 +484,7 @@ function ins_list (pautfunction, params)
|
||||
if (outputmode == 3 || !this_photoinfo.photopaththumb) // XML
|
||||
return this_photoinfo.photopaththumb;
|
||||
|
||||
var html = (this_photoinfo.isDefault ? "<img/>" : ("<img loading='lazy' class='objphoto' alt='"+L("lcl_ins_object")+"' src='"+safe.htmlattr(this_photoinfo.photopaththumb) +"'>"));
|
||||
var html = (this_photoinfo.isDefault ? "<img/>" : ("<img loading='lazy' class='objphoto' alt='"+L("lcl_image")+"' src='"+safe.htmlattr(this_photoinfo.photopaththumb) +"'>"));
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ oRs.Close();
|
||||
<script>
|
||||
function edit_photo(img)
|
||||
{
|
||||
var url = "<%=protectQS.create("../../appl/shared/BijlagenForm.asp?module=INSDEEL&key="+ins_key)%>";
|
||||
var url = "<%=protectQS.create("../../appl/shared/BijlagenForm.asp?module=INSPHD&key="+ins_key)%>";
|
||||
FcltMgr.openModalDetail(url, L("lcl_ins_upload_foto"),
|
||||
{ callback: FcltMgr.reload } );
|
||||
}
|
||||
@@ -570,7 +570,6 @@ oRs.Close();
|
||||
if (uitvoertijd)
|
||||
uitvoertijd = uitvoertijd + " " + (uitvoertijd_eenheid == 'D'? L("lcl_mld_days") : L("lcl_mld_hours"))
|
||||
ROFIELDTR("fldshort", L("lcl_ins_uitvoertijd"), uitvoertijd, {suppressEmpty: true});
|
||||
ROSYMBOLTR("fld", L("lcl_ins_deel_image"), deel_image, { "key": ins_key, "module": "INSPHD" });
|
||||
BLOCK_END();
|
||||
|
||||
// Note: levert op deze manier (soms?) ongeldige html op (tr zonder table)
|
||||
|
||||
@@ -524,7 +524,7 @@ var iface =
|
||||
iface.update_symbol_fld({ "delete": true }, fld);
|
||||
} else if (valType == 2) {
|
||||
let fileName = $val_fld.val();
|
||||
FcltMgr.confirm(L("lcl_delete") + " " + fileName + "?", function() {
|
||||
FcltMgr.confirm(L("lcl_delete") + " " + fileName + "?", { "autoconfirm": (fileName.match(/^## .* ##$/) !== null) }, function() {
|
||||
let data = {};
|
||||
protectRequest.dataToken(data);
|
||||
let url = $("[aria-controls=" + fld + "].symbol-delete").attr("data-delete-url");
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -64,7 +64,7 @@ var showFilter = getFParam("showFilter", ""); // zoek mogelijkheid binnen lijst
|
||||
var pAlgLevel = getQParam("kenmerk_module", "");
|
||||
|
||||
var transitParam = buildTransitParam(["key", "module", "niveau", "kenmerk_key", "encrypt", "extFilter", "pregexp",
|
||||
"showFilter", "reado", "multi", "tmpfolder", "kenmerk_module",
|
||||
"showFilter", "reado", "multi", "tmpfolder", "kenmerk_module", "itm",
|
||||
"zipfile", "autozipfile", "candelete", "imp_exp_key"]);
|
||||
|
||||
// Sorteer afhankelijk van de setting S("flexFilesOrdering") twee FileToAdd record's
|
||||
@@ -89,7 +89,7 @@ var transitParam = buildTransitParam(["key", "module", "niveau", "kenmerk_key",
|
||||
return 0;
|
||||
}
|
||||
|
||||
params = flexProps(pModule, pKey === -1 ? getQParam("newfilename", "") : pKey, String(pKenmerk_key), pNiveau, {getFiles: true, alglevel: pAlgLevel, imp_exp_key: imp_exp_key});
|
||||
params = flexProps(pModule, pKey === -1 ? getQParam("newfilename", getQParam("itm", "")) : pKey, String(pKenmerk_key), pNiveau, {getFiles: true, alglevel: pAlgLevel, imp_exp_key: imp_exp_key});
|
||||
|
||||
//var pregexp = getQParam("pregexp", null);
|
||||
var default_afmeting = (params.regexp ? params.regexp.substr(1) : "");
|
||||
@@ -489,20 +489,23 @@ __Log("Zoeken bestanden onder " + params.AttachPath);
|
||||
FcltMgr.topmanager().window.$.toast({ loaderBg: "#fff", text: L("lcl_appendix_added").format(safe.html(uploaded_files[i])), icon: "success", position: "top-center"});
|
||||
}
|
||||
let extraTransitParam = "";
|
||||
<% if (pKey === -1 && "linkImmediate" in params && !params.multi) { %>
|
||||
<% if (pKey === -1 && "linkImmediate" in params && !params.multi || pModule === "STYLE") { %>
|
||||
extraTransitParam = "&newfilename=" + encodeURIComponent(uploaded_files[0].replace(/\.dwf$/, ""));
|
||||
<% } %>
|
||||
window.location = "<%=protectQS.create("BijlagenForm.asp?x=x" + transitParam)%>" + extraTransitParam;
|
||||
}
|
||||
|
||||
function Sluiten()
|
||||
function Sluiten(defVal)
|
||||
{
|
||||
if ($("#closeButton").hasClass("btn_disabled"))
|
||||
{
|
||||
FcltMgr.alert(L("lcl_busy_upload_file"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (defVal) {
|
||||
window.return_data.org_data=FcltMgr.dialogArguments();
|
||||
window.return_data.fileName = defVal;
|
||||
FcltMgr.closeDetail(window, return_data);
|
||||
} else {
|
||||
var unUploadedFiles = (looseFiles.length ? looseFiles.length : (document.forms.u2.imgfile ? document.forms.u2.imgfile.files.length : 0));
|
||||
FcltMgr.confirm(L("lcl_shared_unfinished_uploads"),
|
||||
{ autoconfirm: !unUploadedFiles,
|
||||
@@ -652,6 +655,11 @@ MODAL_BLOCK_START("bijlagen", L("lcl_appendixes"), { icon: "fa-paperclip" });
|
||||
</script>
|
||||
<% MODAL_BLOCK_END();
|
||||
|
||||
if (pModule === "STYLE") {
|
||||
buttons.push({id: "greyscale", title: L("lcl_fac_template_greyscale"), action: "Sluiten('## grijstint ##')", icon: "fa-circle-half-stroke far"});
|
||||
buttons.push({id: "transparent", title: L("lcl_fac_template_transparent"), action: "Sluiten('## transparant ##')", icon: "fa-square-dashed"});
|
||||
}
|
||||
|
||||
buttons.push({id: "closeButton", title: L("lcl_window_done"), action: "Sluiten()", icon: "fa-fclt-save"});
|
||||
|
||||
SIMPLE_BLOCK_START();
|
||||
|
||||
@@ -51,6 +51,14 @@ if (pDoDelete === "" && "linkImmediate" in params) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pModule === "STYLE") {
|
||||
if (pDoDelete === "## grijstint ##" || pDoDelete === "## transparant ##") {
|
||||
Response.Write(JSON.stringify({ "success": true }));
|
||||
ASPPAGE_END();
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
result = { success: true, toaster: L("lcl_appendix_removed").format(safe.html(pDoDelete))};
|
||||
|
||||
if (pDoDelete != "")
|
||||
|
||||
@@ -387,7 +387,7 @@ function flexProps(pModule, pKey, pSubpath, pNiveau, params)
|
||||
// Bestanden zijn te vinden op ...cust/x/photos/ins
|
||||
result.AttachRootPath = Server.MapPath(S("ins_image_path"));
|
||||
result.RelativePath = S("ins_image_path");
|
||||
result.AttachPath = result.AttachRootPath + "/";
|
||||
result.AttachPath = result.AttachRootPath;
|
||||
result.extFilter = S("imgAllowedExt");
|
||||
result.regexp = S("ins_photo_size");
|
||||
result.directlink = true;
|
||||
@@ -619,18 +619,6 @@ function flexProps(pModule, pKey, pSubpath, pNiveau, params)
|
||||
result.regexp = S("sml_photo_size"); // "r200x150", Resized naar binnen 200x150 (zonder crop, met behoud aspect ratio)
|
||||
result.directlink = true;
|
||||
break;
|
||||
case "INSDEEL": // Flex oplossing voor een Image bij ins_srtdeel (ins_srtdeel_image) die getoond wordt bij een object (ins_deel).
|
||||
result.AttachRootPath = Server.MapPath(S("ins_image_path"));
|
||||
result.AttachPath = result.AttachRootPath + "/";
|
||||
result.AttachPath += subfolderKey("I", pKey);
|
||||
result.AttachPath += "/INSDEEL/";
|
||||
result.RelativePath = S("ins_image_path") + subfolderKey("I", pKey) + "/INSDEEL/";
|
||||
result.multi = false; // vooralsnog maar eentje
|
||||
result.forcesingle = true; // verwijder eventuele anderen
|
||||
result.extFilter = S("imgAllowedExt"); // alleen de extensies met een pipe gescheiden
|
||||
result.regexp = S("ins_photo_size"); // "r200x150", Resized naar binnen 200x150 (zonder crop, met behoud aspect ratio)
|
||||
result.directlink = true;
|
||||
break;
|
||||
case "INSPHD":
|
||||
// Deze vervangt de flexoplossing.
|
||||
// Bestanden zijn te vinden op ...cust/x/photos
|
||||
@@ -853,10 +841,19 @@ function flexProps(pModule, pKey, pSubpath, pNiveau, params)
|
||||
case "STYLE": /* TODO */
|
||||
result.AttachRootPath = Server.MapPath(S("style_image_path"));
|
||||
result.RelativePath = S("style_image_path");
|
||||
result.AttachPath = result.AttachRootPath + "/" + pKey + "/"; // pKey = de naam van het style-item
|
||||
result.AttachPath = result.AttachRootPath + "/";
|
||||
result.extFilter = S("imgAllowedExt");
|
||||
result.regexp = S("menu_photo_size"); // TODO
|
||||
result.directlink = true; // ?
|
||||
|
||||
if (typeof pKey === "string" && pKey in S("csstemplate")) {
|
||||
params.filter = "^" + safe.regexp(sharedTrim(S("csstemplate")[pKey])) + "$";
|
||||
} else if (typeof pKey === "string" && !(pKey in FCLTHeader.defaultTemplate)) {
|
||||
params.filter = "^" + safe.regexp(sharedTrim(pKey)) + "$";
|
||||
} else {
|
||||
params.filter = "$^"; // Matched niets
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
_AiAi("INTERNAL_ERROR, invalid module {0}".format(pModule));
|
||||
@@ -1208,7 +1205,7 @@ function resizePicture(pic)
|
||||
{
|
||||
switch(pic.module)
|
||||
{
|
||||
case "INSDEEL": // Thumb altijd voor zowel INSDEEL als SML
|
||||
case "INSPHD": // Thumb altijd voor zowel INSPHD als SML
|
||||
case "SML": // Thumb altijd
|
||||
try
|
||||
{
|
||||
@@ -1624,6 +1621,24 @@ function XXXXDecode(vCode, encoding)
|
||||
return BinaryStream;
|
||||
}
|
||||
|
||||
// Kijkt of bestand met naam fileName al bestaat in newFolder
|
||||
// en returnt een 'bestand.exe' dan in de variant 'bestand (2).exe'
|
||||
function uniqueFileName(newFolder, fileName) {
|
||||
if (fso.FolderExists(newFolder)) {
|
||||
var multiFileCount = 2;
|
||||
var extension = fileName.split(".").pop();
|
||||
var multiRegex = new RegExp("(\\s\\(\\d+\\))?\\." + extension + "$", "i");
|
||||
while (fso.fileExists(newFolder + "/" + fileName) && multiFileCount < 100) {
|
||||
fileName = fileName.replace(multiRegex, " (" + multiFileCount++ + ")." + extension);
|
||||
}
|
||||
if (multiFileCount === 100) {
|
||||
__DoLog("Er kon geen unieke naam gevonden worden voor dit bestand want zelfs " + fileName + " bestaat al", "#FF0000");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
// IE doet een beetje raar als er een puntkomma in de content-disposition filenaam zit, dan negeert hij de rest
|
||||
// Een bestand test.exe;.txt wordt dan zo maar 'uitgevoerd'
|
||||
// Een # in de naam gaat ook raar: IE9 vervangt die zelf al door een _ maar daar vertrouwen wij niet op
|
||||
|
||||
@@ -166,6 +166,9 @@ var oorzaak_bekend = false;
|
||||
else
|
||||
{
|
||||
var savedfilename = safefilename;
|
||||
if (("linkImmediate" in params)) { // Deze willen we niet overschrijven omdat meerdere instanties 1 map delen
|
||||
savedfilename = uniqueFileName(params.AttachPath, savedfilename);
|
||||
}
|
||||
var BinaryStream = Server.CreateObject("ADODB.Stream");
|
||||
BinaryStream.Type = 1; // adTypeBinary
|
||||
BinaryStream.Open();
|
||||
@@ -225,7 +228,7 @@ var oorzaak_bekend = false;
|
||||
result_digest = result.digest[i];
|
||||
switch(pModule)
|
||||
{
|
||||
case "INSDEEL": //Thumb altijd voor zowel INSDEEL ALS SML
|
||||
case "INSPHD": //Thumb altijd voor zowel INSPHD ALS SML
|
||||
case "SML":
|
||||
// Eerst Resize/crop
|
||||
var resize_params = { resizecode: clientresize?null:params.regexp // Als clientresize dan alleen nog voor thumb
|
||||
|
||||
@@ -3019,7 +3019,7 @@ input[type=file] {
|
||||
|
||||
/* Anders 1 knop met 1 'delete'-icoontje */
|
||||
:is([data-type="1"], [data-type="2"], .iconpicker, .filepicker) {
|
||||
grid-template-columns: 999fr 1fr;
|
||||
grid-template-columns: 10fr .01fr;
|
||||
}
|
||||
|
||||
[data-type="1"] > .file-picker,
|
||||
@@ -4010,7 +4010,7 @@ input.button {
|
||||
width: auto;
|
||||
} */
|
||||
|
||||
#template_css .button {
|
||||
#template_css th .button {
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ settings =
|
||||
// logischer is om ze ooit allemaal onder een /photos/ te plaatsen
|
||||
image_path_virtual: { v: custpath },
|
||||
menu_image_path: { v: custpath + "/flexfiles/menu/" },
|
||||
style_image_path: { v: custpath + "/flexfiles/FAC/style/" },
|
||||
style_image_path: { v: custpath + "/photos/styling/" },
|
||||
alg_image_path: { v: custpath + "/photos/" },
|
||||
prs_image_path: { v: custpath + "/flexfiles/prs/" },
|
||||
res_image_path: { v: custpath + "/photos/" },
|
||||
|
||||
@@ -4459,7 +4459,7 @@ END:VCALENDAR
|
||||
<tr>
|
||||
<td><xsl:element name="img">
|
||||
<xsl:attribute name="width">160px</xsl:attribute>
|
||||
<xsl:attribute name="frc">M=INSDEEL:K=<xsl:value-of select="key"/>:R=160x160</xsl:attribute>
|
||||
<xsl:attribute name="frc">M=INSPHD:K=<xsl:value-of select="key"/>:R=160x160</xsl:attribute>
|
||||
</xsl:element>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -393,19 +393,19 @@ FCLTHeader =
|
||||
fontfamily_alt: "Tahoma, Arial, Helvetica, sans-serif",
|
||||
fontfamily_titles: "fclt-skolar-sans, sans-serif",
|
||||
|
||||
headerimage: "../appl/pictures/banner.png",
|
||||
headerimage: "banner.png",
|
||||
|
||||
loginbgimage: "../appl/pictures/loginbg.jpg",
|
||||
loginbgimage: "loginbg.jpg",
|
||||
logincolor: "#A4B2C4",
|
||||
loginbackgroundcolor: "#CC5252",
|
||||
|
||||
newsbgimage: "../appl/pictures/loginbg.jpg",
|
||||
newsbgimage: "loginbg.jpg",
|
||||
newscolor: "#FFFFFF",
|
||||
|
||||
portalmenubgimage: "../appl/pictures/loginbg.jpg",
|
||||
portalmenucardbgimage: "../appl/pictures/portalcardbg.jpg",
|
||||
portalbgimage: "../appl/pictures/framebodybg.jpg",
|
||||
framebgimage: "../appl/pictures/framebodybg.jpg", //"../appl/pictures/nobg.jpg",
|
||||
portalmenubgimage: "loginbg.jpg",
|
||||
portalmenucardbgimage: "portalcardbg.jpg",
|
||||
portalbgimage: "framebodybg.jpg",
|
||||
framebgimage: "framebodybg.jpg",
|
||||
|
||||
textcolor: "#343F4D",
|
||||
inputbackgroundcolor: "#EBEFFF",
|
||||
@@ -501,9 +501,25 @@ FCLTHeader =
|
||||
val = custtemplate[itm];
|
||||
if (val) {
|
||||
if (itm.slice(-5) === "image") {
|
||||
// Vroeger stond de default.css in de ./CACHE/ folder, tegenwoordig in ./APPL/Shared/ (of ./APPL/PDA/),
|
||||
// dus traversen we 1 extra map omhoog (met de toegevoegde "../") om compatible te blijven
|
||||
inCss += "--" + itm + ": url(\"../" + val + "\");\n";
|
||||
if (itm in custtemplate) {
|
||||
if (custtemplate[itm].length > 6 && custtemplate[itm].slice(0, 3) == "## " && custtemplate[itm].slice(-3) == " ##") {
|
||||
switch (custtemplate[itm].slice(3, -3)) {
|
||||
case "grijstint":
|
||||
val = HTTP.urlzelfnoroot() + rooturl + "/APPL/Pictures/nobg.jpg";
|
||||
break;
|
||||
case "transparant":
|
||||
val = HTTP.urlzelfnoroot() + rooturl + "/APPL/Pictures/transparant.png";
|
||||
break;
|
||||
default:
|
||||
val = "../Pictures/" + val; // Hier staan de default plaatjes
|
||||
}
|
||||
} else {
|
||||
val = HTTP.urlzelfnoroot() + S("style_image_path") + sharedTrim(val); // Hier staan de custom plaatjes
|
||||
}
|
||||
} else {
|
||||
val = "../Pictures/" + val; // Hier staan de default plaatjes
|
||||
}
|
||||
inCss += "--" + itm + ": url(\"" + val + "\");\n";
|
||||
} else {
|
||||
inCss += "--" + itm + ": " + val + ";\n";
|
||||
}
|
||||
|
||||
@@ -3,12 +3,21 @@
|
||||
$Id$
|
||||
|
||||
File: upgrade20211.inc
|
||||
Description: 2021.1 json upgrade
|
||||
Description: 2023.2 file conversie
|
||||
Parameters:
|
||||
Context: (alleen) vanuit facilitor.inc
|
||||
Notes: 2021.1 conversie pas de S(csstemplate) aan zodat alles verwijderd wordt behalve de banner (headerimage)
|
||||
Notes: Verplaatst bestanden die gebruikt worden in de style-editor naar de S(style_image_path)
|
||||
past tevens de csstemplate instelling aan zodat alleen aan het bestand gerefereerd wordt (of een ## placeholder ##)
|
||||
INSDEEL module bestanden worden verplaatst naar de INSPHD-module-locatie, en de betandsnaam wordt ingevuld bij ins_deel.ins_srtdeel_image
|
||||
thumb idem
|
||||
|
||||
*/
|
||||
|
||||
%>
|
||||
<!-- #include file="../shared/FlexFiles.inc" -->
|
||||
<!-- #include file="../Shared/save2db.inc" -->
|
||||
<%
|
||||
|
||||
function upgrade20232()
|
||||
{
|
||||
var marker = "upgrade20232.inc";
|
||||
@@ -28,7 +37,12 @@ function upgrade20232()
|
||||
|
||||
var csstemplate = S("csstemplate");
|
||||
var fso = Server.CreateObject("Scripting.FileSystemObject");
|
||||
var style_image_path = Server.MapPath(S("style_image_path"));
|
||||
var newStyleImagePath = Server.MapPath(S("style_image_path"));
|
||||
|
||||
if (!fso.FolderExists(newStyleImagePath)) {
|
||||
fso.CreateFolder(newStyleImagePath);
|
||||
}
|
||||
|
||||
var value;
|
||||
|
||||
for (var x in csstemplate) {
|
||||
@@ -48,22 +62,23 @@ function upgrade20232()
|
||||
delete csstemplate[x];
|
||||
}
|
||||
}
|
||||
/* Nu de volgende varianten;
|
||||
../cust/XXXX/
|
||||
../cust/XXXX/images
|
||||
../cust/XXXX/flexfiles/menu/
|
||||
/* Nu de volgende varianten; TODO SVN
|
||||
../cust/XXXX/ OOK IN SVN
|
||||
../cust/XXXX/images OOK IN SVN
|
||||
../cust/XXXX/flexfiles/menu/ NOT IN SVN (?)
|
||||
*/
|
||||
else if (value.indexOf("../cust/" + customerId.toLowerCase()) > -1) { // Alle andere geldige varianten
|
||||
var filePath = Server.MapPath(rooturl + "/appl/" + value); // Veilig? Hier zit ook path traversal in
|
||||
value = uniqueFileName(newStyleImagePath, value.split(/\//g).pop());
|
||||
if (fso.fileExists(filePath)) {
|
||||
try {
|
||||
fso.MoveFile(filePath, style_image_path + value);
|
||||
__DoLog("moving " + filePath + " -> " + newStyleImagePath + "/" + value);
|
||||
fso.MoveFile(filePath, newStyleImagePath + "/" + value);
|
||||
} catch (e) {
|
||||
__DoLog(e);
|
||||
}
|
||||
}
|
||||
var tmp = value.split(/\//g);
|
||||
csstemplate[x] = tmp[tmp.length-1];
|
||||
csstemplate[x] = value;
|
||||
}
|
||||
/* Tot slot maken we de over ongeldige waarden transparant (leiden allen tot 404's)
|
||||
\t (tab; gevolg van een copy/paste)
|
||||
@@ -79,13 +94,13 @@ function upgrade20232()
|
||||
|
||||
var fields = [ { dbs: "fac_setting_pvalue", typ: "varchar", val: JSON.stringify(csstemplate) },
|
||||
{ dbs: "fac_setting_datum", typ: "sql", val: "SYSDATE" }];
|
||||
|
||||
sql = buildUpdate("fac_setting", fields)
|
||||
sql = buildUpdate("fac_setting", fields, { "noValidateToken": true })
|
||||
+ " fac_setting_name = 'csstemplate'";
|
||||
var err = Oracle.Execute(sql, true);
|
||||
if (err.friendlyMsg) {
|
||||
__DoLog(err.friendlyMsg);
|
||||
}
|
||||
settings.loadSET(true); // Forceer caching opnieuw
|
||||
|
||||
/* EIND CSSTEMPLATE CONVERSIE */
|
||||
|
||||
@@ -94,45 +109,70 @@ function upgrade20232()
|
||||
/* MoveFiles
|
||||
van S("ins_image_path") + subfolderKey("I", pKey) + /INSDEEL/ + file
|
||||
naar S("ins_image_path") + /deel/ + file
|
||||
idem voor de thumbnails
|
||||
En sla de fileName op in de ins_deel.ins_deel_image - kolom
|
||||
*/
|
||||
|
||||
var ins_deel_photo_folder = Server.MapPath(S("ins_image_path") + "/deel");
|
||||
if (!fso.FolderExists(ins_deel_photo_folder)) {
|
||||
fso.CreateFolder(ins_deel_photo_folder);
|
||||
var newInsDeelPhotoPath = Server.MapPath(S("ins_image_path") + "deel");
|
||||
if (!fso.FolderExists(newInsDeelPhotoPath)) {
|
||||
fso.CreateFolder(newInsDeelPhotoPath);
|
||||
}
|
||||
if (!fso.FolderExists(newInsDeelPhotoPath + "/thumb/")) {
|
||||
fso.CreateFolder(newInsDeelPhotoPath + "/thumb/");
|
||||
}
|
||||
|
||||
var fc1 = new Enumerator(Server.MapPath(S("ins_image_path")).SubFolders);
|
||||
var insPhotoFolder = fso.GetFolder(Server.MapPath(S("ins_image_path")));
|
||||
var fc1 = new Enumerator(insPhotoFolder.SubFolders);
|
||||
for (; !fc1.atEnd(); fc1.moveNext()) {
|
||||
var subFolder = fc1.item();
|
||||
if (subFolder.Name.match(/^I\d+___$/) === null) {
|
||||
continue;
|
||||
}
|
||||
var fc2 = new Enumerator(Server.MapPath(S("ins_image_path") + "/" + subFolder.Name).SubFolders);
|
||||
var fc2 = new Enumerator(subFolder.SubFolders);
|
||||
for (; !fc2.atEnd(); fc2.moveNext()) {
|
||||
var objFolder = fc2.item();
|
||||
if (objFolder.Name.match(/^I\d+$/) === null) {
|
||||
continue;
|
||||
}
|
||||
var imageFolderPath = Server.MapPath(S("ins_image_path") + "/" + subFolder.Name + "/" + objFolder.Name + "/INSDEEL/");
|
||||
if (fso.FolderExists(imageFolderPath)) {
|
||||
var imageFolder = fso.GetFolder(imageFolderPath);
|
||||
var oldInsDeelPhotoPath = Server.MapPath(S("ins_image_path") + subFolder.Name + "/" + objFolder.Name + "/INSDEEL");
|
||||
if (fso.FolderExists(oldInsDeelPhotoPath)) {
|
||||
var imageFolder = fso.GetFolder(oldInsDeelPhotoPath);
|
||||
var fc3 = new Enumerator(imageFolder.files);
|
||||
for (; !fc3.atEnd(); fc3.moveNext()) {
|
||||
try {
|
||||
var photo = fc3.item();
|
||||
var orgPhotoName = photo.Name;
|
||||
var newPhotoName = uniqueFileName(newInsDeelPhotoPath, orgPhotoName);
|
||||
|
||||
var ins_deel_key = objFolder.Name.slice(1);
|
||||
fso.MoveFile(imageFolderPath + photo.Name, ins_deel_photo_folder + photo.Name);
|
||||
Oracle.Execute("UPDATE ins_deel SET ins_deel_image = " + safe.quoted_sql(photo.Name) + " WHERE ins_deel_key = " + ins_deel_key);
|
||||
__DoLog("moving " + oldInsDeelPhotoPath + "/" + orgPhotoName + " -> " + newInsDeelPhotoPath + "/" + newPhotoName);
|
||||
fso.MoveFile(oldInsDeelPhotoPath + "/" + orgPhotoName, newInsDeelPhotoPath + "/" + newPhotoName);
|
||||
Oracle.Execute("UPDATE ins_deel SET ins_deel_image = " + safe.quoted_sql(newPhotoName) + " WHERE ins_deel_key = " + ins_deel_key);
|
||||
} catch (e) {
|
||||
__DoLog(e);
|
||||
}
|
||||
break; // Alleen de eerste
|
||||
if (fso.FolderExists(oldInsDeelPhotoPath + "/thumb/")) {
|
||||
if (fso.fileExists(oldInsDeelPhotoPath + "/thumb/" + orgPhotoName)) {
|
||||
try {
|
||||
__DoLog("moving " + oldInsDeelPhotoPath + "/thumb/" + orgPhotoName + " -> " + newInsDeelPhotoPath + "/thumb/" + newPhotoName);
|
||||
fso.MoveFile(oldInsDeelPhotoPath + "/thumb/" + orgPhotoName, newInsDeelPhotoPath + "/thumb/" + newPhotoName);
|
||||
} catch (e) {
|
||||
__DoLog(e.description);
|
||||
}
|
||||
}
|
||||
}
|
||||
break; // Alleen de eerste foto
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* EIND INSDEEL CONVERSIE */
|
||||
|
||||
// Track dat we ge-upgrade hebben, geen risico voor multi-user omgevingen
|
||||
sql = "INSERT INTO adm_tracking"
|
||||
+ " (adm_tracking_name, adm_tracking_revision)"
|
||||
+ " VALUES ({0}, {1})".format(safe.quoted_sql(marker), safe.quoted_sql("$Revision$".substr(11, 5)));
|
||||
Oracle.Execute(sql);
|
||||
}
|
||||
%>
|
||||
|
||||
Reference in New Issue
Block a user