From bdea5cc5bc636c6006e211a21acb79c7d58b7b1c Mon Sep 17 00:00:00 2001 From: Koen Reefman Date: Wed, 10 May 2023 15:19:31 +0000 Subject: [PATCH] FCLT#63770 savepoint conversie S(csstemplate) & INSDEEL -> INSPHD svn path=/Website/trunk/; revision=60372 --- APPL/FAC/fac_edit_menu.asp | 1 + APPL/FAC/fac_edit_template.asp | 28 ++++++++- APPL/FAC/fac_show_menu.asp | 1 + APPL/INS/ins.inc | 2 +- APPL/INS/ins_edit_deel.asp | 2 - APPL/INS/ins_list.inc | 2 +- APPL/INS/ins_show_deel.asp | 3 +- APPL/Localscripts/iface.js | 2 +- APPL/Pictures/portalnoimage.png | Bin 1195 -> 0 bytes APPL/Shared/BijlagenForm.asp | 20 +++++-- APPL/Shared/BijlagenForm_delete.asp | 8 +++ APPL/Shared/FlexFiles.inc | 45 ++++++++++----- APPL/Shared/UploadForm_save.asp | 5 +- APPL/Shared/default.css | 4 +- APPL/Shared/default.inc | 2 +- APPL/Shared/default.xsl | 2 +- APPL/Shared/header.inc | 36 ++++++++---- APPL/UPG/upgrade20232.inc | 86 ++++++++++++++++++++-------- 18 files changed, 180 insertions(+), 69 deletions(-) delete mode 100644 APPL/Pictures/portalnoimage.png diff --git a/APPL/FAC/fac_edit_menu.asp b/APPL/FAC/fac_edit_menu.asp index e1a013898e..6889dda2ff 100644 --- a/APPL/FAC/fac_edit_menu.asp +++ b/APPL/FAC/fac_edit_menu.asp @@ -12,6 +12,7 @@ + <% diff --git a/APPL/FAC/fac_edit_template.asp b/APPL/FAC/fac_edit_template.asp index 86b1e01a48..fb7fe19d5a 100644 --- a/APPL/FAC/fac_edit_template.asp +++ b/APPL/FAC/fac_edit_template.asp @@ -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 %> - <% =(FCLTHeader.defaultTemplate[itm]).match(/^#|^rgb/i) ? '
' + I("fa-square fa-2x", { fastyle: "fas" }) + '
' : '' %> + <% =(FCLTHeader.defaultTemplate[itm]).match(/^#(?!#)|^rgb/i) ? '
' + I("fa-square fa-2x", { fastyle: "fas" }) + '
' : '' %> <%=safe.html(FCLTHeader.defaultTemplate[itm])%> - - <% =(act && (FCLTHeader.defaultTemplate[itm]).match(/^#|^rgb/i) || act.match(/^#|^rgb/i)) ? '
' + I("fa-square fa-2x", { fastyle: "fas" }) + '
' : '' %> +<% if (itm.slice(-5) === "image") { + Response.Write(" " + + " " + + " " + + " " + I("fa-file-image") + "" + + " " + + " " + + " " + + I("fa-trash-alt") + + " " + + " "); +} else { %> + +<%} %> + <% =(act && (FCLTHeader.defaultTemplate[itm]).match(/^#(?!#)|^rgb/i) || act.match(/^#(?!#)|^rgb/i)) ? '
' + I("fa-square fa-2x", { fastyle: "fas" }) + '
' : '' %> <%=safe.html(act)%> <% } diff --git a/APPL/FAC/fac_show_menu.asp b/APPL/FAC/fac_show_menu.asp index 14fae5576c..4a602615b3 100644 --- a/APPL/FAC/fac_show_menu.asp +++ b/APPL/FAC/fac_show_menu.asp @@ -12,6 +12,7 @@ + <% diff --git a/APPL/INS/ins.inc b/APPL/INS/ins.inc index 7bcba1b9d4..d470e76f6c 100644 --- a/APPL/INS/ins.inc +++ b/APPL/INS/ins.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) { diff --git a/APPL/INS/ins_edit_deel.asp b/APPL/INS/ins_edit_deel.asp index dc46face9f..cb690133a1 100644 --- a/APPL/INS/ins_edit_deel.asp +++ b/APPL/INS/ins_edit_deel.asp @@ -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? diff --git a/APPL/INS/ins_list.inc b/APPL/INS/ins_list.inc index b38a8cee1e..ad17e9f935 100644 --- a/APPL/INS/ins_list.inc +++ b/APPL/INS/ins_list.inc @@ -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 ? "" : (""+L("lcl_ins_object")+"")); + var html = (this_photoinfo.isDefault ? "" : (""+L("lcl_image")+"")); return html; } diff --git a/APPL/INS/ins_show_deel.asp b/APPL/INS/ins_show_deel.asp index 95fb78c82f..921a91a14d 100644 --- a/APPL/INS/ins_show_deel.asp +++ b/APPL/INS/ins_show_deel.asp @@ -360,7 +360,7 @@ oRs.Close(); <% 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(); diff --git a/APPL/Shared/BijlagenForm_delete.asp b/APPL/Shared/BijlagenForm_delete.asp index 853ae96903..32c28c3bb8 100644 --- a/APPL/Shared/BijlagenForm_delete.asp +++ b/APPL/Shared/BijlagenForm_delete.asp @@ -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 != "") diff --git a/APPL/Shared/FlexFiles.inc b/APPL/Shared/FlexFiles.inc index 8ef7336d96..8d909c2e34 100644 --- a/APPL/Shared/FlexFiles.inc +++ b/APPL/Shared/FlexFiles.inc @@ -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 diff --git a/APPL/Shared/UploadForm_save.asp b/APPL/Shared/UploadForm_save.asp index e335f251ef..2722a6c5fd 100644 --- a/APPL/Shared/UploadForm_save.asp +++ b/APPL/Shared/UploadForm_save.asp @@ -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 diff --git a/APPL/Shared/default.css b/APPL/Shared/default.css index d89e34e047..3780e414ad 100644 --- a/APPL/Shared/default.css +++ b/APPL/Shared/default.css @@ -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; } diff --git a/APPL/Shared/default.inc b/APPL/Shared/default.inc index bb6fa4d11a..86ce357d8b 100644 --- a/APPL/Shared/default.inc +++ b/APPL/Shared/default.inc @@ -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/" }, diff --git a/APPL/Shared/default.xsl b/APPL/Shared/default.xsl index d7413bcda7..b7742cf233 100644 --- a/APPL/Shared/default.xsl +++ b/APPL/Shared/default.xsl @@ -4459,7 +4459,7 @@ END:VCALENDAR 160px - M=INSDEEL:K=:R=160x160 + M=INSPHD:K=:R=160x160 diff --git a/APPL/Shared/header.inc b/APPL/Shared/header.inc index f48a66f6a5..71b88f5a4f 100644 --- a/APPL/Shared/header.inc +++ b/APPL/Shared/header.inc @@ -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"; } diff --git a/APPL/UPG/upgrade20232.inc b/APPL/UPG/upgrade20232.inc index 0c25b28119..9ec07b1e32 100644 --- a/APPL/UPG/upgrade20232.inc +++ b/APPL/UPG/upgrade20232.inc @@ -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 + */ +%> + + +<% + 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); } %>