';
+
+ // Modify this section to use anchor tags for edit and delete actions
+ print '';
+ print img_picto($langs->trans('Edit'), 'edit');
+ print ' ';
+ // Form for Remove action using a form with token and a styled submit button
+ print '';
+
+
+ print '
';
+ }
+ }
+}
+
+
+print '
';
+print '';
+
+print dol_get_fiche_end();
+llxFooter();
+$db->close();
+?>
diff --git a/class/saturneqrcode.class.php b/class/saturneqrcode.class.php
new file mode 100644
index 00000000..11578c98
--- /dev/null
+++ b/class/saturneqrcode.class.php
@@ -0,0 +1,163 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file class/saturneqrcode.class.php
+ * \ingroup saturne
+ * \brief This file is a CRUD class file for SaturneQRCode (Create/Read/Update/Delete).
+ */
+
+// Load Saturne libraries
+require_once __DIR__ . '/saturneobject.class.php';
+
+// Load QRCode library
+require_once DOL_DOCUMENT_ROOT . '/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php';
+
+class SaturneQRCode extends SaturneObject
+{
+ /**
+ * @var DoliDB Database handler
+ */
+ public $db;
+
+ /**
+ * @var string Module name
+ */
+ public $module = 'saturne';
+
+ /**
+ * @var string Element type of object
+ */
+ public $element = 'saturne_qrcode';
+
+ /**
+ * @var string Name of table without prefix where object is stored This is also the key used for extrafields management
+ */
+ public $table_element = 'saturne_qrcode';
+
+ /**
+ * @var int Does this object support multicompany module ?
+ * 0 = No test on entity, 1 = Test with field entity, 'field@table' = Test with link by field@table
+ */
+ public $ismultientitymanaged = 1;
+
+ /**
+ * @var int Does object support extrafields ? 0 = No, 1 = Yes
+ */
+ public $isextrafieldmanaged = 0;
+
+ /**
+ * @var string Last output from end job execution
+ */
+ public $output = '';
+
+ /**
+ * @var string Name of icon for certificate Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'certificate@saturne' if picto is file 'img/object_certificatepng'
+ */
+ public string $picto = 'fontawesome_fa-forward_fas_#d35968';
+
+ /**
+ * @var array Array with all fields and their property Do not use it as a static var It may be modified by constructor
+ */
+ public $fields = [
+ 'rowid' => ['type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => 'Id'],
+ 'entity' => ['type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 0, 'index' => 1],
+ 'date_creation' => ['type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 0],
+ 'tms' => ['type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0],
+ 'import_key' => ['type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'index' => 0],
+ 'module_name' => ['type' => 'varchar(128)', 'label' => 'ModuleName', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0],
+ 'url' => ['type' => 'text', 'label' => 'Url', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'index' => 0],
+ 'encoded_qr_code' => ['type' => 'text', 'label' => 'EncodedData', 'enabled' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 0, 'index' => 0],
+ 'fk_user_creat' => ['type' => 'integer:User:user/class/userclassphp', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'position' => 220, 'notnull' => 1, 'visible' => 0, 'foreignkey' => 'userrowid'],
+ ];
+
+ /**
+ * @var int ID
+ */
+ public int $rowid;
+
+ /**
+ * @var int Entity
+ */
+ public $entity;
+
+ /**
+ * @var int|string Creation date
+ */
+ public $date_creation;
+
+ /**
+ * @var int|string Timestamp
+ */
+ public $tms;
+
+ /**
+ * @var string Import key
+ */
+ public $import_key;
+
+ /**
+ * @var string Module name
+ */
+ public $module_name;
+
+ /**
+ * @var string URL
+ */
+ public $url;
+
+ /**
+ * @var string QR Code encoded
+ */
+ public $encoded_qr_code;
+
+ /**
+ * @var int User creator
+ */
+ public $fk_user_creat;
+
+ /**
+ * Constructor
+ *
+ * @param DoliDb $db Database handler
+ * @param string $moduleNameLowerCase Module name
+ * @param string $objectType Object element type
+ */
+ public function __construct(DoliDB $db, string $moduleNameLowerCase = 'saturne', string $objectType = 'saturne_qrcode')
+ {
+ parent::__construct($db, $moduleNameLowerCase, $objectType);
+ }
+
+ /**
+ * Get QR Code base64
+ *
+ * @param string $url URL to encode
+ *
+ * @return string Encoded QR Code
+ */
+ public function getQRCodeBase64(string $url): string
+{
+ // Create QR Code
+ $barcodeObject = new TCPDF2DBarcode($url, 'QRCODE,H');
+ $qrCodePng = $barcodeObject->getBarcodePngData(6, 6);
+ $qrCodeBase64 = 'data:image/png;base64,' . base64_encode($qrCodePng);
+
+ return $qrCodeBase64;
+ }
+}
+
+?>
diff --git a/js/modules/document.js b/js/modules/document.js
index 51f305fd..43679bbc 100644
--- a/js/modules/document.js
+++ b/js/modules/document.js
@@ -55,6 +55,11 @@ window.saturne.document.event = function() {
$(document).on('click', '#builddoc_generatebutton', window.saturne.document.displayLoader);
$(document).on('click', '.pdf-generation', window.saturne.document.displayLoader);
$(document).on('click', '.download-template', window.saturne.document.autoDownloadTemplate);
+ $(document).on( 'keydown', '#change_pagination', window.saturne.document.changePagination );
+ $(document).on( 'keydown', '.saturne-search', window.saturne.document.saturneSearch );
+ $(document).on( 'click', '.saturne-search-button', window.saturne.document.saturneSearch );
+ $(document).on( 'click', '.saturne-cancel-button', window.saturne.document.saturneCancelSearch );
+
};
/**
@@ -103,3 +108,97 @@ window.saturne.document.autoDownloadTemplate = function() {
error: function () {}
});
};
+
+/**
+ * Manage documents list pagination
+ *
+ * @memberof Saturne_Framework_Document
+ *
+ * @since 1.6.0
+ * @version 1.6.0
+ *
+ * @return {void}
+ */
+window.saturne.document.changePagination = function (event) {
+ if (event.keyCode === 13) {
+ event.preventDefault();
+
+ var input = event.target;
+ var pageNumber = $('#page_number').val();
+ var pageValue = parseInt(input.value) <= parseInt(pageNumber) ? input.value : pageNumber;
+ var currentUrl = new URL(window.location.href);
+
+ if (currentUrl.searchParams.has('page')) {
+ currentUrl.searchParams.set('page', pageValue);
+ } else {
+ currentUrl.searchParams.append('page', pageValue);
+ }
+
+ window.location.replace(currentUrl.toString());
+ }
+}
+
+/**
+ * Manage search on documents list
+ *
+ * @memberof Saturne_Framework_Document
+ *
+ * @since 1.6.0
+ * @version 1.6.0
+ *
+ * @return {void}
+ */
+window.saturne.document.saturneSearch = function (event) {
+ if (event.keyCode === 13 || $(this).hasClass('saturne-search-button')) {
+ event.preventDefault();
+
+ var currentUrl = new URL(window.location.href);
+
+ let name = $('#search_name').val();
+ let date = $('#search_date').val();
+
+ if (name === '' && date === '') {
+ return;
+ }
+ if (name.length > 0) {
+ if (currentUrl.searchParams.has('search_name')) {
+ currentUrl.searchParams.set('search_name', name);
+ } else {
+ currentUrl.searchParams.append('search_name', name);
+ }
+ }
+ if (date.length > 0) {
+ if (currentUrl.searchParams.has('search_date')) {
+ currentUrl.searchParams.set('search_date', date);
+ } else {
+ currentUrl.searchParams.append('search_date', date);
+ }
+ }
+ window.location.replace(currentUrl.toString());
+
+ }
+}
+
+/**
+ * Cancel search on documents list
+ *
+ * @memberof Saturne_Framework_Document
+ *
+ * @since 1.6.0
+ * @version 1.6.0
+ *
+ * @return {void}
+ */
+window.saturne.document.saturneCancelSearch = function (event) {
+ event.preventDefault();
+
+ var currentUrl = new URL(window.location.href);
+
+ if (currentUrl.searchParams.has('search_name')) {
+ currentUrl.searchParams.delete('search_name');
+ }
+ if (currentUrl.searchParams.has('search_date')) {
+ currentUrl.searchParams.delete('search_date');
+ }
+ window.location.replace(currentUrl.toString());
+}
diff --git a/js/modules/qrcode.js b/js/modules/qrcode.js
new file mode 100644
index 00000000..c0a3da86
--- /dev/null
+++ b/js/modules/qrcode.js
@@ -0,0 +1,85 @@
+/* Copyright (C) 2024 EVARISK
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * Library javascript to enable Browser notifications
+ */
+
+/**
+ * \file js/modules/qrcode.js
+ * \ingroup saturne
+ * \brief JavaScript qrcode file for module Saturne
+ */
+
+/**
+ * Init qrcode JS
+ *
+ * @since 1.2.0
+ * @version 1.2.0
+ */
+window.saturne.qrcode = {};
+
+/**
+ * QR Code init
+ *
+ * @since 1.2.0
+ * @version 1.2.0
+ *
+ * @return {void}
+ */
+window.saturne.qrcode.init = function() {
+ window.saturne.qrcode.event();
+};
+
+/**
+ * QR Code event
+ *
+ * @since 1.2.0
+ * @version 1.2.0
+ *
+ * @return {void}
+ */
+window.saturne.qrcode.event = function() {
+ $(document).on('click', '.preview-qr-code', window.saturne.qrcode.previewQRCode);
+};
+
+
+// Fonction pour afficher le QR code dans une modal
+window.saturne.qrcode.previewQRCode = function() {
+ // Obtenir l'image du QR code à partir des données de l'élément
+ let QRCodeBase64 = $(this).find('.qrcode-base64').val();
+
+ // Créer un élément d'image
+ const img = document.createElement('img');
+ img.src = QRCodeBase64;
+ img.alt = 'QR Code';
+ img.style.maxWidth = '100%';
+
+ // Insérer l'image dans le conteneur désigné
+ const pdfPreview = document.getElementById('pdfPreview');
+ pdfPreview.innerHTML = ''; // Vider le conteneur d'abord
+ pdfPreview.appendChild(img);
+
+ // Afficher la modal
+ $('#pdfModal').addClass('modal-active');
+
+ // Ajouter un bouton de téléchargement
+ const downloadBtn = document.getElementById('downloadBtn');
+ downloadBtn.onclick = function() {
+ const a = document.createElement('a');
+ a.href = QRCodeBase64;
+ a.download = 'QRCode.png';
+ a.click();
+ };
+};
diff --git a/js/saturne.min.js b/js/saturne.min.js
index fd81cbea..00fe52aa 100644
--- a/js/saturne.min.js
+++ b/js/saturne.min.js
@@ -1 +1 @@
-window.saturne||(window.saturne={},window.saturne.scriptsLoaded=!1),window.saturne.scriptsLoaded||(window.saturne.init=function(){window.saturne.load_list_script()},window.saturne.load_list_script=function(){if(!window.saturne.scriptsLoaded){var e=void 0,t=void 0;for(e in window.saturne)for(t in window.saturne[e].init&&window.saturne[e].init(),window.saturne[e])window.saturne[e]&&window.saturne[e][t]&&window.saturne[e][t].init&&window.saturne[e][t].init();window.saturne.scriptsLoaded=!0}},window.saturne.refresh=function(){var e=void 0,t=void 0;for(e in window.saturne)for(t in window.saturne[e].refresh&&window.saturne[e].refresh(),window.saturne[e])window.saturne[e]&&window.saturne[e][t]&&window.saturne[e][t].refresh&&window.saturne[e][t].refresh()},$(document).ready(window.saturne.init)),window.saturne.button={},window.saturne.button.init=function(){window.saturne.button.event()},window.saturne.button.event=function(){$(document).on("click",".wpeo-button:submit, .wpeo-button.auto-download",window.saturne.button.addLoader)},window.saturne.button.addLoader=function(){$(this).hasClass("no-load")||(window.saturne.loader.display($(this)),$(this).toggleClass("button-blue button-disable"))},window.saturne.dashboard={},window.saturne.dashboard.init=function(){window.saturne.dashboard.event()},window.saturne.dashboard.event=function(){$(document).on("change",".add-dashboard-widget",window.saturne.dashboard.addDashBoardInfo),$(document).on("click",".close-dashboard-widget",window.saturne.dashboard.closeDashBoardInfo),$(document).on("click",".select-dataset-dashboard-info",window.saturne.dashboard.selectDatasetDashboardInfo)},window.saturne.dashboard.addDashBoardInfo=function(){var e=document.getElementById("dashBoardForm"),e=new FormData(e).get("boxcombo"),t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+n+"action=adddashboardinfo&token="+t,type:"POST",processData:!1,data:JSON.stringify({dashboardWidgetName:e}),contentType:!1,success:function(){window.location.reload()},error:function(){}})},window.saturne.dashboard.closeDashBoardInfo=function(){let t=$(this);var e=t.attr("data-widgetname"),n=window.saturne.toolbox.getToken(),o=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+o+"action=closedashboardinfo&token="+n,type:"POST",processData:!1,data:JSON.stringify({dashboardWidgetName:e}),contentType:!1,success:function(e){t.closest(".box-flex-item").fadeOut(400),$(".add-widget-box").attr("style",""),$(".add-widget-box").html($(e).find(".add-widget-box").children())},error:function(){}})},window.saturne.dashboard.selectDatasetDashboardInfo=function(){var e=$("#search_userid").val(),t=$("#search_year").val(),n=$("#search_month").val(),o=window.saturne.toolbox.getToken(),a=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.loader.display($(".fichecenter")),$.ajax({url:document.URL+a+"token="+o+"&search_userid="+e+"&search_year="+t+"&search_month="+n,type:"POST",processData:!1,contentType:!1,success:function(e){$(".fichecenter").replaceWith($(e).find(".fichecenter"))},error:function(){}})},window.saturne.document={},window.saturne.document.init=function(){window.saturne.document.event()},window.saturne.document.event=function(){$(document).on("click","#builddoc_generatebutton",window.saturne.document.displayLoader),$(document).on("click",".pdf-generation",window.saturne.document.displayLoader),$(document).on("click",".download-template",window.saturne.document.autoDownloadTemplate)},window.saturne.document.displayLoader=function(){window.saturne.loader.display($(this).closest(".div-table-responsive-no-min"))},window.saturne.document.autoDownloadTemplate=function(){let t=window.saturne.toolbox.getToken();var e=document.URL.replace(/#.*$/,"");let n=window.saturne.toolbox.getQuerySeparator(e),o=$(this).closest(".file-generation");var a=o.find(".template-type").attr("value");let i=o.find(".template-name").attr("value");$.ajax({url:e+n+"action=download_template&filename="+i+"&type="+a+"&token="+t,type:"POST",success:function(){var e=o.find(".template-path").attr("value");window.saturne.signature.download(e+i,i),$.ajax({url:document.URL+n+"action=remove_file&filename="+i+"&token="+t,type:"POST",success:function(){},error:function(){}})},error:function(){}})},window.saturne.dropdown={},window.saturne.dropdown.init=function(){window.saturne.dropdown.event()},window.saturne.dropdown.event=function(){$(document).on("keyup",window.saturne.dropdown.keyup),$(document).on("keypress",window.saturne.dropdown.keypress),$(document).on("click",".wpeo-dropdown:not(.dropdown-active) .dropdown-toggle:not(.disabled)",window.saturne.dropdown.open),$(document).on("click",".wpeo-dropdown.dropdown-active .saturne-dropdown-content",function(e){e.stopPropagation()}),$(document).on("click",".wpeo-dropdown.dropdown-active:not(.dropdown-force-display) .saturne-dropdown-content .dropdown-item",window.saturne.dropdown.close),$(document).on("click",".wpeo-dropdown.dropdown-active",function(e){window.saturne.dropdown.close(e),e.stopPropagation()}),$(document).on("click","body",window.saturne.dropdown.close)},window.saturne.dropdown.keyup=function(e){27===e.keyCode&&window.saturne.dropdown.close()},window.saturne.dropdown.keypress=function(e){var t=localStorage.currentString||"",n=localStorage.keypressNumber?+localStorage.keypressNumber:0;t+=e.keyCode,++n,localStorage.setItem("currentString",t),localStorage.setItem("keypressNumber",n),9body{"+e+n+e+t+n+t)},window.saturne.dropdown.open=function(e){var n=$(this),o=n.find("[data-fa-i2svg]"),t={},a=void 0;window.saturne.dropdown.close(e,$(this)),n.attr("data-action")?(window.saturne.loader.display(n),n.get_data(function(e){for(a in t)e[a]||(e[a]=t[a]);window.saturne.request.send(n,e,function(e,t){n.closest(".wpeo-dropdown").find(".saturne-dropdown-content").html(t.data.view),n.closest(".wpeo-dropdown").addClass("dropdown-active"),o&&window.saturne.dropdown.toggleAngleClass(o)})})):(n.closest(".wpeo-dropdown").addClass("dropdown-active"),o&&window.saturne.dropdown.toggleAngleClass(o)),e.stopPropagation()},window.saturne.dropdown.close=function(e){var n=$(this);$(".wpeo-dropdown.dropdown-active:not(.no-close)").each(function(){var e=$(this),t={close:!0};n.trigger("dropdown-before-close",[e,n,t]),t.close&&(e.removeClass("dropdown-active"),t=$(this).find(".dropdown-toggle").find("[data-fa-i2svg]"))&&window.saturne.dropdown.toggleAngleClass(t)})},window.saturne.dropdown.toggleAngleClass=function(e){e.hasClass("fa-caret-down")||e.hasClass("fa-caret-up")?e.toggleClass("fa-caret-down").toggleClass("fa-caret-up"):e.hasClass("fa-caret-circle-down")||e.hasClass("fa-caret-circle-up")?e.toggleClass("fa-caret-circle-down").toggleClass("fa-caret-circle-up"):e.hasClass("fa-angle-down")||e.hasClass("fa-angle-up")?e.toggleClass("fa-angle-down").toggleClass("fa-angle-up"):(e.hasClass("fa-chevron-circle-down")||e.hasClass("fa-chevron-circle-up"))&&e.toggleClass("fa-chevron-circle-down").toggleClass("fa-chevron-circle-up")},window.saturne.keyEvent={},window.saturne.keyEvent.init=function(){window.saturne.keyEvent.event()},window.saturne.keyEvent.event=function(){$(document).on("keydown",window.saturne.keyEvent.keyActions),$(document).on("keyup",".url-container",window.saturne.keyEvent.checkUrlFormat)},window.saturne.keyEvent.keyActions=function(e){0<$(this).find(".modal-active").length?("Escape"===e.key&&$(this).find(".modal-active .modal-close .fas.fa-times").first().click(),"Enter"!==e.key||$("input, textarea").is(":focus")||$(this).find(".modal-active .modal-footer .wpeo-button").not(".button-disable").first().click()):$(e.target).is("input, textarea")||("Enter"===e.key&&$(this).find(".button_search").click(),e.shiftKey&&"Enter"===e.key&&$(this).find(".button_removefilter").click())},window.saturne.keyEvent.checkUrlFormat=function(){$(this).val().match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?$(this).attr("style","border: solid; border-color: green"):0<$("input:focus").val().length&&$(this).attr("style","border: solid; border-color: red")},window.saturne.loader={},window.saturne.loader.init=function(){window.saturne.loader.event()},window.saturne.loader.event=function(){},window.saturne.loader.display=function(e){var t;e.hasClass("button-progress")?e.addClass("button-load"):(e.addClass("wpeo-loader"),t=$(''),e[0].loaderElement=t,e.append(e[0].loaderElement))},window.saturne.loader.remove=function(e){0"),i===a&&($(".wpeo-loader").removeClass("wpeo-loader"),$("#progressBarContainer").fadeOut(800),$("#progressBarContainer").find(".loader-spin").remove(),window.saturne.loader.display(o.find(".ecm-photo-list-content")),setTimeout(()=>{o.html($(e).find("#media_gallery").children()).promise().done(()=>{1==a&&($("#media_gallery").find(".save-photo").removeClass("button-disable"),$("#media_gallery").find(".delete-photo").removeClass("button-disable"),$("#media_gallery").find(".clickable-photo0").addClass("clicked-photo")),($(e).find(".error-medias").length?($(".messageErrorSendPhoto").find(".notice-subtitle").html(m),$(".messageErrorSendPhoto")):$(".messageSuccessSendPhoto")).removeClass("hidden"),o.attr("data-from-id",r),o.attr("data-from-type",s),o.attr("data-from-subtype",l),o.attr("data-from-subdir",c),o.find(".wpeo-button").attr("value",r)})},800))}})})},window.saturne.mediaGallery.previewPhoto=function(e){var t=setInterval(function(){$(".ui-dialog").length&&(clearInterval(t),$(document).find(".ui-dialog").addClass("preview-photo"))},100)},window.saturne.mediaGallery.unlinkFile=function(e){e.preventDefault();let t=window.saturne.toolbox.getToken();var e=$(this).closest(".modal-active"),n=0<$(this).closest(".modal-active").length;let o=null,a=(o=(n?e:$(this).closest(".linked-medias")).find(".modal-options")).attr("data-from-subtype"),i=o.attr("data-from-type"),d=o.attr("data-from-subdir"),r=o.attr("data-from-id"),s=o.attr("data-photo-class");n=$(this).closest(".media-container");let l=n.find(".file-path").val(),c=n.find(".file-name").val(),u=$(this).closest(".linked-medias").find(".media-gallery-favorite.favorite").closest(".media-container").find(".file-name").val(),w=(window.saturne.loader.display(n),window.saturne.toolbox.getQuerySeparator(document.URL));$(".card__confirmation").css("display","flex"),$(document).on("click",".confirmation-close",function(){$(".wpeo-loader").removeClass("wpeo-loader"),$(".card__confirmation").css("display","none")}),$(document).on("click",".confirmation-delete",function(){$.ajax({url:document.URL+w+"subaction=unlinkFile&token="+t,type:"POST",data:JSON.stringify({filepath:l,filename:c,objectSubtype:a,objectType:i,objectSubdir:d,objectId:r}),processData:!1,success:function(e){$(".card__confirmation").css("display","none"),$("#media_gallery .modal-container").replaceWith($(e).find("#media_gallery .modal-container")),u==c&&(void 0!==s&&0"))[1].match(/>/)&&(n[1]=n[1].replace(/>/,"")),$(this).attr("title",n[1]),$(this).html(n[0])}),t.css("width","30px"),t.find(".blockvmenusearch").hide(),$("span.vmenu").attr("title"," Agrandir le menu"),$("span.vmenu").html($("span.vmenu").html()),$(this).find("span.vmenu").find(".fa-chevron-circle-left").removeClass("fa-chevron-circle-left").addClass("fa-chevron-circle-right"),localStorage.setItem("maximized","false")):0<$(this).find("span.vmenu").find(".fa-chevron-circle-right").length&&(e.each(function(){$(this).html($(this).html().replace(">","")+" "+$(this).attr("title"))}),t.css("width","188px"),t.find(".blockvmenusearch").show(),$("div.menu_titre").attr("style","width: 188px !important; cursor : pointer"),$("span.vmenu").attr("title"," Réduire le menu"),$("span.vmenu").html(' Réduire le menu'),localStorage.setItem("maximized","true"),$(this).find("span.vmenu").find(".fa-chevron-circle-right").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-left"))},window.saturne.menu.setMenu=function(){var e,t,n;0<$(".blockvmenu.blockvmenulast .saturne-toggle-menu").length&&($(".blockvmenu.blockvmenulast .saturne-toggle-menu").closest(".menu_titre").attr("style","cursor:pointer ! important"),"false"==localStorage.maximized&&$("#id-left").attr("style","display:none !important"),"false"==localStorage.maximized&&(e="",t=$("#id-left").find("a.vmenu, span.vmenudisabled, span.vmenu, a.vsmenu"),n=$(document).find("div.vmenu"),t.each(function(){e=$(this).html().split(""),$(this).attr("title",e[1]),$(this).html(e[0]),console.log(e)}),$("#id-left").attr("style","display:block !important"),$("div.menu_titre").attr("style","width: 50px !important"),$("span.vmenu").attr("title"," Agrandir le menu"),$("span.vmenu").html($("span.vmenu").html()),$("span.vmenu").find(".fa-chevron-circle-left").removeClass("fa-chevron-circle-left").addClass("fa-chevron-circle-right"),n.css("width","30px"),n.find(".blockvmenusearch").hide()),localStorage.setItem("currentString",""),localStorage.setItem("keypressNumber",0))},window.saturne.modal={},window.saturne.modal.init=function(){window.saturne.modal.event()},window.saturne.modal.event=function(){$(document).on("click",".modal-close, .modal-active:not(.modal-container)",window.saturne.modal.closeModal),$(document).on("click",".modal-open",window.saturne.modal.openModal),$(document).on("click",".modal-refresh",window.saturne.modal.refreshModal)},window.saturne.modal.openModal=function(e){var t=$(this).find(".modal-options"),n=t.attr("data-modal-to-open"),o=t.attr("data-from-id"),a=t.attr("data-from-type"),i=t.attr("data-from-subtype"),d=t.attr("data-from-subdir"),r=t.attr("data-from-module"),t=t.attr("data-photo-class");let s="";s=document.URL.match(/#/)?document.URL.split(/#/)[0]:document.URL,history.pushState({path:document.URL},"",s),$("#"+n).attr("data-from-id",o),$("#"+n).attr("data-from-type",a),$("#"+n).attr("data-from-subtype",i),$("#"+n).attr("data-from-subdir",d),$("#"+n).attr("data-photo-class",t),r&&"function"==typeof window.saturne.modal.addMoreOpenModalData&&window.saturne.modal.addMoreOpenModalData(n,$(this)),$("#"+n).find(".wpeo-button").attr("value",o),$("#"+n).addClass("modal-active"),$(".notice").addClass("hidden")},window.saturne.modal.closeModal=function(e){$("input:focus").length<1&&$("textarea:focus").length<1&&($(e.target).hasClass("modal-active")||$(e.target).hasClass("modal-close")||$(e.target).parent().hasClass("modal-close"))&&($(this).closest(".modal-active").removeClass("modal-active"),$(".clicked-photo").attr("style",""),$(".clicked-photo").removeClass("clicked-photo"),$(".notice").addClass("hidden"))},window.saturne.modal.refreshModal=function(e){window.location.reload()},window.saturne.notice={},window.saturne.notice.init=function(){window.saturne.notice.event()},window.saturne.notice.event=function(){$(document).on("click",".notice-close",window.saturne.notice.closeNotice)},window.saturne.notice.closeNotice=function(){$(this).closest(".wpeo-notice").fadeOut(function(){$(this).closest(".wpeo-notice").addClass("hidden")}),$(this).hasClass("notice-close-forever")&&window.saturne.utils.reloadPage("close_notice",".fiche")},window.saturne.object={},window.saturne.object.init=function(){window.saturne.object.event()},window.saturne.object.event=function(){$(document).on("click",".toggle-object-infos",window.saturne.object.toggleObjectInfos)},window.saturne.object.toggleObjectInfos=function(){$(this).hasClass("fa-minus-square")?($(this).removeClass("fa-minus-square").addClass("fa-caret-square-down"),$(this).closest(".fiche").find(".fichecenter.object-infos").addClass("hidden")):($(this).removeClass("fa-caret-square-down").addClass("fa-minus-square"),$(this).closest(".fiche").find(".fichecenter.object-infos").removeClass("hidden"))},window.saturne.signature={},window.saturne.signature.canvas={},window.saturne.signature.init=function(){window.saturne.signature.event()},window.saturne.signature.event=function(){$(document).on("click",".signature-erase",window.saturne.signature.clearCanvas),$(document).on("click",".signature-validate:not(.button-disable)",window.saturne.signature.createSignature),$(document).on("click",".auto-download",window.saturne.signature.autoDownloadSpecimen),$(document).on("click",".copy-signatureurl",window.saturne.signature.copySignatureUrlClipboard),$(document).on("click",".set-attendance",window.saturne.signature.setAttendance),document.querySelector('script[src*="signature-pad.min.js"]')&&window.saturne.signature.drawSignatureOnCanvas(),$(document).on("touchstart mousedown",".canvas-signature",function(){window.saturne.toolbox.removeAddButtonClass("signature-validate","button-grey button-disable","button-blue")})},window.saturne.signature.drawSignatureOnCanvas=function(){var e;window.saturne.signature.canvas=document.querySelector(".canvas-signature"),window.saturne.signature.canvas&&(e=Math.max(window.devicePixelRatio||1,1),window.saturne.signature.canvas.signaturePad=new SignaturePad(window.saturne.signature.canvas,{penColor:"rgb(0, 0, 0)"}),window.saturne.signature.canvas.width=window.saturne.signature.canvas.offsetWidth*e,window.saturne.signature.canvas.height=window.saturne.signature.canvas.offsetHeight*e,window.saturne.signature.canvas.getContext("2d").scale(e,e))},window.saturne.signature.clearCanvas=function(){window.saturne.signature.canvas.signaturePad.clear(),window.saturne.toolbox.removeAddButtonClass("signature-validate","button-blue","button-grey button-disable")},window.saturne.signature.createSignature=function(){var e,t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.signature.canvas.signaturePad.isEmpty()||(e=window.saturne.signature.canvas.toDataURL()),window.saturne.loader.display($(this)),$.ajax({url:document.URL+n+"action=add_signature&token="+t,type:"POST",processData:!1,contentType:"application/octet-stream",data:JSON.stringify({signature:e}),success:function(e){!0===$(".public-card__container").data("public-interface")?($(".card__confirmation").removeAttr("style"),$(".signature-confirmation-close").attr("onclick","window.close()"),$(".public-card__container").replaceWith($(e).find(".public-card__container"))):window.location.reload()},error:function(){}})},window.saturne.signature.download=function(e,t){var n=document.createElement("a");n.href=e,n.setAttribute("download",t),n.click()},window.saturne.signature.autoDownloadSpecimen=function(){let o=$(this).closest(".file-generation"),a=window.saturne.toolbox.getToken(),i=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+i+"action=builddoc&token="+a,type:"POST",success:function(e){var t=o.find(".specimen-name").attr("data-specimen-name"),n=o.find(".specimen-path").attr("data-specimen-path");window.saturne.signature.download(n+t,t),$(".file-generation").replaceWith($(e).find(".file-generation")),$.ajax({url:document.URL+i+"action=remove_file&token="+a,type:"POST",success:function(){},error:function(){}})},error:function(){}})},window.saturne.signature.copySignatureUrlClipboard=function(){var e=$(this).attr("data-signature-url");navigator.clipboard.writeText(e).then(()=>{$(this).attr("class","fas fa-check copy-signatureurl"),$(this).css("color","#59ed9c"),$(this).closest(".copy-signatureurl-container").find(".copied-to-clipboard").attr("style",""),$(this).closest(".copy-signatureurl-container").find(".copied-to-clipboard").fadeOut(2500,()=>{$(this).attr("class","fas fa-clipboard copy-signatureurl"),$(this).css("color","#666")})})},window.saturne.signature.setAttendance=function(){var e=$(this).closest(".attendance-container").find('input[name="signatoryID"]').val(),t=$(this).attr("value"),n=window.saturne.toolbox.getToken(),o=window.saturne.toolbox.getQuerySeparator(document.URL),a=String(document.location.href).replace(/#formmail/,"");$.ajax({url:a+o+"action=set_attendance&token="+n,type:"POST",processData:!1,contentType:"",data:JSON.stringify({signatoryID:e,attendance:t}),success:function(e){$(".signatures-container").html($(e).find(".signatures-container"))},error:function(){}})},window.saturne.toolbox={},window.saturne.toolbox.init=function(){},window.saturne.toolbox.getQuerySeparator=function(e){return e.match(/\?/)?"&":"?"},window.saturne.toolbox.getToken=function(){return $('input[name="token"]').val()},window.saturne.toolbox.toggleButtonClass=function(e,t){$("."+e).toggleClass(t)},window.saturne.toolbox.removeAddButtonClass=function(e,t,n){$("."+e).removeClass(t).addClass(n)},window.saturne.tooltip||(window.saturne.tooltip={},window.saturne.tooltip.init=function(){window.saturne.tooltip.event()},window.saturne.tooltip.tabChanged=function(){$(".wpeo-tooltip").remove()},window.saturne.tooltip.event=function(){$(document).on("mouseenter touchstart",'.wpeo-tooltip-event:not([data-tooltip-persist="true"])',window.saturne.tooltip.onEnter),$(document).on("mouseleave touchend",'.wpeo-tooltip-event:not([data-tooltip-persist="true"])',window.saturne.tooltip.onOut)},window.saturne.tooltip.onEnter=function(e){window.saturne.tooltip.display($(this))},window.saturne.tooltip.onOut=function(e){window.saturne.tooltip.remove($(this))},window.saturne.tooltip.display=function(e){var t=$(e).data("direction")?$(e).data("direction"):"top",n=$(''+$(e).attr("aria-label")+""),o=($(e).position(),$(e).offset()),a=($(e)[0].tooltipElement=n,$("body").append($(e)[0].tooltipElement),$(e).data("color")&&n.addClass("tooltip-"+$(e).data("color")),0),i=0;switch($(e).data("direction")){case"left":a=o.top-n.outerHeight()/2+$(e).outerHeight()/2+"px",i=o.left-n.outerWidth()-10+3+"px";break;case"right":a=o.top-n.outerHeight()/2+$(e).outerHeight()/2+"px",i=o.left+$(e).outerWidth()+8+"px";break;case"bottom":a=o.top+$(e).height()+10+10+"px",i=o.left-n.outerWidth()/2+$(e).outerWidth()/2+"px";break;default:a=o.top-n.outerHeight()-4+"px",i=o.left-n.outerWidth()/2+$(e).outerWidth()/2+"px"}n.css({top:a,left:i,opacity:1}),$(e).on("remove",function(){$($(e)[0].tooltipElement).remove()})},window.saturne.tooltip.remove=function(e){$(e)[0]&&$(e)[0].tooltipElement&&$($(e)[0].tooltipElement).remove()}),window.saturne.utils={},window.saturne.utils.init=function(){window.saturne.utils.event()},window.saturne.utils.event=function(){$(document).on("mouseenter",".move-line.ui-sortable-handle",window.saturne.utils.draganddrop),$(document).on("change","#element_type",window.saturne.utils.reloadField)},window.saturne.utils.draganddrop=function(){$(this).css("cursor","pointer"),$("#tablelines tbody").sortable(),$("#tablelines tbody").sortable({handle:".move-line",connectWith:"#tablelines tbody .line-row",tolerance:"intersect",over:function(){$(this).css("cursor","grabbing")},stop:function(){$(this).css("cursor","default");var e=$(".fiche").find('input[name="token"]').val();let t="&",n=(document.URL.match(/action=/)&&(document.URL=document.URL.split(/\?/)[0],t="?"),[]);$(".line-row").each(function(){n.push($(this).attr("id"))}),$.ajax({url:document.URL+t+"action=moveLine&token="+e,type:"POST",data:JSON.stringify({order:n}),processData:!1,contentType:!1,success:function(){},error:function(){}})}})},window.saturne.utils.reloadPage=function(e,t,n="",o=""){var a=window.saturne.toolbox.getToken(),i=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+i+"action="+e+n+"&token="+a,type:"POST",processData:!1,contentType:!1,success:function(e){window.saturne.utils.checkMoreParams(o),$(t).replaceWith($(e).find(t))},error:function(){}})},window.saturne.utils.reloadField=function(){var e=$(this).val(),t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.loader.display($(".field_element_type")),window.saturne.loader.display($(".field_fk_element")),$.ajax({url:document.URL+n+"element_type="+e+"&token="+t,type:"POST",processData:!1,contentType:!1,success:function(e){$(".field_element_type").replaceWith($(e).find(".field_element_type")),$(".field_fk_element").replaceWith($(e).find(".field_fk_element"))},error:function(){}})},window.saturne.utils.enforceMinMax=function(e){""!==e.value&&(parseInt(e.value)parseInt(e.max))&&(e.value=e.max)},window.saturne.utils.checkMoreParams=function(e){e&&e.removeAttr&&$(e.removeAttr.element).removeAttr(e.removeAttr.value)};
\ No newline at end of file
+window.saturne||(window.saturne={},window.saturne.scriptsLoaded=!1),window.saturne.scriptsLoaded||(window.saturne.init=function(){window.saturne.load_list_script()},window.saturne.load_list_script=function(){if(!window.saturne.scriptsLoaded){var e=void 0,t=void 0;for(e in window.saturne)for(t in window.saturne[e].init&&window.saturne[e].init(),window.saturne[e])window.saturne[e]&&window.saturne[e][t]&&window.saturne[e][t].init&&window.saturne[e][t].init();window.saturne.scriptsLoaded=!0}},window.saturne.refresh=function(){var e=void 0,t=void 0;for(e in window.saturne)for(t in window.saturne[e].refresh&&window.saturne[e].refresh(),window.saturne[e])window.saturne[e]&&window.saturne[e][t]&&window.saturne[e][t].refresh&&window.saturne[e][t].refresh()},$(document).ready(window.saturne.init)),window.saturne.button={},window.saturne.button.init=function(){window.saturne.button.event()},window.saturne.button.event=function(){$(document).on("click",".wpeo-button:submit, .wpeo-button.auto-download",window.saturne.button.addLoader)},window.saturne.button.addLoader=function(){$(this).hasClass("no-load")||(window.saturne.loader.display($(this)),$(this).toggleClass("button-blue button-disable"))},window.saturne.dashboard={},window.saturne.dashboard.init=function(){window.saturne.dashboard.event()},window.saturne.dashboard.event=function(){$(document).on("change",".add-dashboard-widget",window.saturne.dashboard.addDashBoardInfo),$(document).on("click",".close-dashboard-widget",window.saturne.dashboard.closeDashBoardInfo),$(document).on("click",".select-dataset-dashboard-info",window.saturne.dashboard.selectDatasetDashboardInfo)},window.saturne.dashboard.addDashBoardInfo=function(){var e=document.getElementById("dashBoardForm"),e=new FormData(e).get("boxcombo"),t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+n+"action=adddashboardinfo&token="+t,type:"POST",processData:!1,data:JSON.stringify({dashboardWidgetName:e}),contentType:!1,success:function(){window.location.reload()},error:function(){}})},window.saturne.dashboard.closeDashBoardInfo=function(){let t=$(this);var e=t.attr("data-widgetname"),n=window.saturne.toolbox.getToken(),o=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+o+"action=closedashboardinfo&token="+n,type:"POST",processData:!1,data:JSON.stringify({dashboardWidgetName:e}),contentType:!1,success:function(e){t.closest(".box-flex-item").fadeOut(400),$(".add-widget-box").attr("style",""),$(".add-widget-box").html($(e).find(".add-widget-box").children())},error:function(){}})},window.saturne.dashboard.selectDatasetDashboardInfo=function(){var e=$("#search_userid").val(),t=$("#search_year").val(),n=$("#search_month").val(),o=window.saturne.toolbox.getToken(),a=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.loader.display($(".fichecenter")),$.ajax({url:document.URL+a+"token="+o+"&search_userid="+e+"&search_year="+t+"&search_month="+n,type:"POST",processData:!1,contentType:!1,success:function(e){$(".fichecenter").replaceWith($(e).find(".fichecenter"))},error:function(){}})},window.saturne.document={},window.saturne.document.init=function(){window.saturne.document.event()},window.saturne.document.event=function(){$(document).on("click","#builddoc_generatebutton",window.saturne.document.displayLoader),$(document).on("click",".pdf-generation",window.saturne.document.displayLoader),$(document).on("click",".download-template",window.saturne.document.autoDownloadTemplate),$(document).on("keydown","#change_pagination",window.saturne.document.changePagination),$(document).on("keydown",".saturne-search",window.saturne.document.saturneSearch),$(document).on("click",".saturne-search-button",window.saturne.document.saturneSearch),$(document).on("click",".saturne-cancel-button",window.saturne.document.saturneCancelSearch)},window.saturne.document.displayLoader=function(){window.saturne.loader.display($(this).closest(".div-table-responsive-no-min"))},window.saturne.document.autoDownloadTemplate=function(){let t=window.saturne.toolbox.getToken();var e=document.URL.replace(/#.*$/,"");let n=window.saturne.toolbox.getQuerySeparator(e),o=$(this).closest(".file-generation");var a=o.find(".template-type").attr("value");let i=o.find(".template-name").attr("value");$.ajax({url:e+n+"action=download_template&filename="+i+"&type="+a+"&token="+t,type:"POST",success:function(){var e=o.find(".template-path").attr("value");window.saturne.signature.download(e+i,i),$.ajax({url:document.URL+n+"action=remove_file&filename="+i+"&token="+t,type:"POST",success:function(){},error:function(){}})},error:function(){}})},window.saturne.document.changePagination=function(e){var t;13===e.keyCode&&(e.preventDefault(),e=e.target,t=$("#page_number").val(),e=parseInt(e.value)<=parseInt(t)?e.value:t,(t=new URL(window.location.href)).searchParams.has("page")?t.searchParams.set("page",e):t.searchParams.append("page",e),window.location.replace(t.toString()))},window.saturne.document.saturneSearch=function(e){var t,n;13!==e.keyCode&&!$(this).hasClass("saturne-search-button")||(e.preventDefault(),e=new URL(window.location.href),t=$("#search_name").val(),n=$("#search_date").val(),""===t&&""===n)||(0body{"+e+n+e+t+n+t)},window.saturne.dropdown.open=function(e){var n=$(this),o=n.find("[data-fa-i2svg]"),t={},a=void 0;window.saturne.dropdown.close(e,$(this)),n.attr("data-action")?(window.saturne.loader.display(n),n.get_data(function(e){for(a in t)e[a]||(e[a]=t[a]);window.saturne.request.send(n,e,function(e,t){n.closest(".wpeo-dropdown").find(".saturne-dropdown-content").html(t.data.view),n.closest(".wpeo-dropdown").addClass("dropdown-active"),o&&window.saturne.dropdown.toggleAngleClass(o)})})):(n.closest(".wpeo-dropdown").addClass("dropdown-active"),o&&window.saturne.dropdown.toggleAngleClass(o)),e.stopPropagation()},window.saturne.dropdown.close=function(e){var n=$(this);$(".wpeo-dropdown.dropdown-active:not(.no-close)").each(function(){var e=$(this),t={close:!0};n.trigger("dropdown-before-close",[e,n,t]),t.close&&(e.removeClass("dropdown-active"),t=$(this).find(".dropdown-toggle").find("[data-fa-i2svg]"))&&window.saturne.dropdown.toggleAngleClass(t)})},window.saturne.dropdown.toggleAngleClass=function(e){e.hasClass("fa-caret-down")||e.hasClass("fa-caret-up")?e.toggleClass("fa-caret-down").toggleClass("fa-caret-up"):e.hasClass("fa-caret-circle-down")||e.hasClass("fa-caret-circle-up")?e.toggleClass("fa-caret-circle-down").toggleClass("fa-caret-circle-up"):e.hasClass("fa-angle-down")||e.hasClass("fa-angle-up")?e.toggleClass("fa-angle-down").toggleClass("fa-angle-up"):(e.hasClass("fa-chevron-circle-down")||e.hasClass("fa-chevron-circle-up"))&&e.toggleClass("fa-chevron-circle-down").toggleClass("fa-chevron-circle-up")},window.saturne.keyEvent={},window.saturne.keyEvent.init=function(){window.saturne.keyEvent.event()},window.saturne.keyEvent.event=function(){$(document).on("keydown",window.saturne.keyEvent.keyActions),$(document).on("keyup",".url-container",window.saturne.keyEvent.checkUrlFormat)},window.saturne.keyEvent.keyActions=function(e){0<$(this).find(".modal-active").length?("Escape"===e.key&&$(this).find(".modal-active .modal-close .fas.fa-times").first().click(),"Enter"!==e.key||$("input, textarea").is(":focus")||$(this).find(".modal-active .modal-footer .wpeo-button").not(".button-disable").first().click()):$(e.target).is("input, textarea")||("Enter"===e.key&&$(this).find(".button_search").click(),e.shiftKey&&"Enter"===e.key&&$(this).find(".button_removefilter").click())},window.saturne.keyEvent.checkUrlFormat=function(){$(this).val().match(/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi)?$(this).attr("style","border: solid; border-color: green"):0<$("input:focus").val().length&&$(this).attr("style","border: solid; border-color: red")},window.saturne.loader={},window.saturne.loader.init=function(){window.saturne.loader.event()},window.saturne.loader.event=function(){},window.saturne.loader.display=function(e){var t;e.hasClass("button-progress")?e.addClass("button-load"):(e.addClass("wpeo-loader"),t=$(''),e[0].loaderElement=t,e.append(e[0].loaderElement))},window.saturne.loader.remove=function(e){0"),i===a&&($(".wpeo-loader").removeClass("wpeo-loader"),$("#progressBarContainer").fadeOut(800),$("#progressBarContainer").find(".loader-spin").remove(),window.saturne.loader.display(o.find(".ecm-photo-list-content")),setTimeout(()=>{o.html($(e).find("#media_gallery").children()).promise().done(()=>{1==a&&($("#media_gallery").find(".save-photo").removeClass("button-disable"),$("#media_gallery").find(".delete-photo").removeClass("button-disable"),$("#media_gallery").find(".clickable-photo0").addClass("clicked-photo")),($(e).find(".error-medias").length?($(".messageErrorSendPhoto").find(".notice-subtitle").html(m),$(".messageErrorSendPhoto")):$(".messageSuccessSendPhoto")).removeClass("hidden"),o.attr("data-from-id",r),o.attr("data-from-type",s),o.attr("data-from-subtype",l),o.attr("data-from-subdir",c),o.find(".wpeo-button").attr("value",r)})},800))}})})},window.saturne.mediaGallery.previewPhoto=function(e){var t=setInterval(function(){$(".ui-dialog").length&&(clearInterval(t),$(document).find(".ui-dialog").addClass("preview-photo"))},100)},window.saturne.mediaGallery.unlinkFile=function(e){e.preventDefault();let t=window.saturne.toolbox.getToken();var e=$(this).closest(".modal-active"),n=0<$(this).closest(".modal-active").length;let o=null,a=(o=(n?e:$(this).closest(".linked-medias")).find(".modal-options")).attr("data-from-subtype"),i=o.attr("data-from-type"),d=o.attr("data-from-subdir"),r=o.attr("data-from-id"),s=o.attr("data-photo-class");n=$(this).closest(".media-container");let l=n.find(".file-path").val(),c=n.find(".file-name").val(),u=$(this).closest(".linked-medias").find(".media-gallery-favorite.favorite").closest(".media-container").find(".file-name").val(),w=(window.saturne.loader.display(n),window.saturne.toolbox.getQuerySeparator(document.URL));$(".card__confirmation").css("display","flex"),$(document).on("click",".confirmation-close",function(){$(".wpeo-loader").removeClass("wpeo-loader"),$(".card__confirmation").css("display","none")}),$(document).on("click",".confirmation-delete",function(){$.ajax({url:document.URL+w+"subaction=unlinkFile&token="+t,type:"POST",data:JSON.stringify({filepath:l,filename:c,objectSubtype:a,objectType:i,objectSubdir:d,objectId:r}),processData:!1,success:function(e){$(".card__confirmation").css("display","none"),$("#media_gallery .modal-container").replaceWith($(e).find("#media_gallery .modal-container")),u==c&&(void 0!==s&&0"))[1].match(/>/)&&(n[1]=n[1].replace(/>/,"")),$(this).attr("title",n[1]),$(this).html(n[0])}),t.css("width","30px"),t.find(".blockvmenusearch").hide(),$("span.vmenu").attr("title"," Agrandir le menu"),$("span.vmenu").html($("span.vmenu").html()),$(this).find("span.vmenu").find(".fa-chevron-circle-left").removeClass("fa-chevron-circle-left").addClass("fa-chevron-circle-right"),localStorage.setItem("maximized","false")):0<$(this).find("span.vmenu").find(".fa-chevron-circle-right").length&&(e.each(function(){$(this).html($(this).html().replace(">","")+" "+$(this).attr("title"))}),t.css("width","188px"),t.find(".blockvmenusearch").show(),$("div.menu_titre").attr("style","width: 188px !important; cursor : pointer"),$("span.vmenu").attr("title"," Réduire le menu"),$("span.vmenu").html(' Réduire le menu'),localStorage.setItem("maximized","true"),$(this).find("span.vmenu").find(".fa-chevron-circle-right").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-left"))},window.saturne.menu.setMenu=function(){var e,t,n;0<$(".blockvmenu.blockvmenulast .saturne-toggle-menu").length&&($(".blockvmenu.blockvmenulast .saturne-toggle-menu").closest(".menu_titre").attr("style","cursor:pointer ! important"),"false"==localStorage.maximized&&$("#id-left").attr("style","display:none !important"),"false"==localStorage.maximized&&(e="",t=$("#id-left").find("a.vmenu, span.vmenudisabled, span.vmenu, a.vsmenu"),n=$(document).find("div.vmenu"),t.each(function(){e=$(this).html().split(""),$(this).attr("title",e[1]),$(this).html(e[0]),console.log(e)}),$("#id-left").attr("style","display:block !important"),$("div.menu_titre").attr("style","width: 50px !important"),$("span.vmenu").attr("title"," Agrandir le menu"),$("span.vmenu").html($("span.vmenu").html()),$("span.vmenu").find(".fa-chevron-circle-left").removeClass("fa-chevron-circle-left").addClass("fa-chevron-circle-right"),n.css("width","30px"),n.find(".blockvmenusearch").hide()),localStorage.setItem("currentString",""),localStorage.setItem("keypressNumber",0))},window.saturne.modal={},window.saturne.modal.init=function(){window.saturne.modal.event()},window.saturne.modal.event=function(){$(document).on("click",".modal-close, .modal-active:not(.modal-container)",window.saturne.modal.closeModal),$(document).on("click",".modal-open",window.saturne.modal.openModal),$(document).on("click",".modal-refresh",window.saturne.modal.refreshModal)},window.saturne.modal.openModal=function(e){var t=$(this).find(".modal-options"),n=t.attr("data-modal-to-open"),o=t.attr("data-from-id"),a=t.attr("data-from-type"),i=t.attr("data-from-subtype"),d=t.attr("data-from-subdir"),r=t.attr("data-from-module"),t=t.attr("data-photo-class");let s="";s=document.URL.match(/#/)?document.URL.split(/#/)[0]:document.URL,history.pushState({path:document.URL},"",s),$("#"+n).attr("data-from-id",o),$("#"+n).attr("data-from-type",a),$("#"+n).attr("data-from-subtype",i),$("#"+n).attr("data-from-subdir",d),$("#"+n).attr("data-photo-class",t),r&&"function"==typeof window.saturne.modal.addMoreOpenModalData&&window.saturne.modal.addMoreOpenModalData(n,$(this)),$("#"+n).find(".wpeo-button").attr("value",o),$("#"+n).addClass("modal-active"),$(".notice").addClass("hidden")},window.saturne.modal.closeModal=function(e){$("input:focus").length<1&&$("textarea:focus").length<1&&($(e.target).hasClass("modal-active")||$(e.target).hasClass("modal-close")||$(e.target).parent().hasClass("modal-close"))&&($(this).closest(".modal-active").removeClass("modal-active"),$(".clicked-photo").attr("style",""),$(".clicked-photo").removeClass("clicked-photo"),$(".notice").addClass("hidden"))},window.saturne.modal.refreshModal=function(e){window.location.reload()},window.saturne.notice={},window.saturne.notice.init=function(){window.saturne.notice.event()},window.saturne.notice.event=function(){$(document).on("click",".notice-close",window.saturne.notice.closeNotice)},window.saturne.notice.closeNotice=function(){$(this).closest(".wpeo-notice").fadeOut(function(){$(this).closest(".wpeo-notice").addClass("hidden")}),$(this).hasClass("notice-close-forever")&&window.saturne.utils.reloadPage("close_notice",".fiche")},window.saturne.object={},window.saturne.object.init=function(){window.saturne.object.event()},window.saturne.object.event=function(){$(document).on("click",".toggle-object-infos",window.saturne.object.toggleObjectInfos)},window.saturne.object.toggleObjectInfos=function(){$(this).hasClass("fa-minus-square")?($(this).removeClass("fa-minus-square").addClass("fa-caret-square-down"),$(this).closest(".fiche").find(".fichecenter.object-infos").addClass("hidden")):($(this).removeClass("fa-caret-square-down").addClass("fa-minus-square"),$(this).closest(".fiche").find(".fichecenter.object-infos").removeClass("hidden"))},window.saturne.qrcode={},window.saturne.qrcode.init=function(){window.saturne.qrcode.event()},window.saturne.qrcode.event=function(){$(document).on("click",".preview-qr-code",window.saturne.qrcode.previewQRCode)},window.saturne.qrcode.previewQRCode=function(){let t=$(this).find(".qrcode-base64").val();var e=document.createElement("img"),n=(e.src=t,e.alt="QR Code",e.style.maxWidth="100%",document.getElementById("pdfPreview"));n.innerHTML="",n.appendChild(e),$("#pdfModal").addClass("modal-active"),document.getElementById("downloadBtn").onclick=function(){var e=document.createElement("a");e.href=t,e.download="QRCode.png",e.click()}},window.saturne.signature={},window.saturne.signature.canvas={},window.saturne.signature.init=function(){window.saturne.signature.event()},window.saturne.signature.event=function(){$(document).on("click",".signature-erase",window.saturne.signature.clearCanvas),$(document).on("click",".signature-validate:not(.button-disable)",window.saturne.signature.createSignature),$(document).on("click",".auto-download",window.saturne.signature.autoDownloadSpecimen),$(document).on("click",".copy-signatureurl",window.saturne.signature.copySignatureUrlClipboard),$(document).on("click",".set-attendance",window.saturne.signature.setAttendance),document.querySelector('script[src*="signature-pad.min.js"]')&&window.saturne.signature.drawSignatureOnCanvas(),$(document).on("touchstart mousedown",".canvas-signature",function(){window.saturne.toolbox.removeAddButtonClass("signature-validate","button-grey button-disable","button-blue")})},window.saturne.signature.drawSignatureOnCanvas=function(){var e;window.saturne.signature.canvas=document.querySelector(".canvas-signature"),window.saturne.signature.canvas&&(e=Math.max(window.devicePixelRatio||1,1),window.saturne.signature.canvas.signaturePad=new SignaturePad(window.saturne.signature.canvas,{penColor:"rgb(0, 0, 0)"}),window.saturne.signature.canvas.width=window.saturne.signature.canvas.offsetWidth*e,window.saturne.signature.canvas.height=window.saturne.signature.canvas.offsetHeight*e,window.saturne.signature.canvas.getContext("2d").scale(e,e))},window.saturne.signature.clearCanvas=function(){window.saturne.signature.canvas.signaturePad.clear(),window.saturne.toolbox.removeAddButtonClass("signature-validate","button-blue","button-grey button-disable")},window.saturne.signature.createSignature=function(){var e,t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.signature.canvas.signaturePad.isEmpty()||(e=window.saturne.signature.canvas.toDataURL()),window.saturne.loader.display($(this)),$.ajax({url:document.URL+n+"action=add_signature&token="+t,type:"POST",processData:!1,contentType:"application/octet-stream",data:JSON.stringify({signature:e}),success:function(e){!0===$(".public-card__container").data("public-interface")?($(".card__confirmation").removeAttr("style"),$(".signature-confirmation-close").attr("onclick","window.close()"),$(".public-card__container").replaceWith($(e).find(".public-card__container"))):window.location.reload()},error:function(){}})},window.saturne.signature.download=function(e,t){var n=document.createElement("a");n.href=e,n.setAttribute("download",t),n.click()},window.saturne.signature.autoDownloadSpecimen=function(){let o=$(this).closest(".file-generation"),a=window.saturne.toolbox.getToken(),i=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+i+"action=builddoc&token="+a,type:"POST",success:function(e){var t=o.find(".specimen-name").attr("data-specimen-name"),n=o.find(".specimen-path").attr("data-specimen-path");window.saturne.signature.download(n+t,t),$(".file-generation").replaceWith($(e).find(".file-generation")),$.ajax({url:document.URL+i+"action=remove_file&token="+a,type:"POST",success:function(){},error:function(){}})},error:function(){}})},window.saturne.signature.copySignatureUrlClipboard=function(){var e=$(this).attr("data-signature-url");navigator.clipboard.writeText(e).then(()=>{$(this).attr("class","fas fa-check copy-signatureurl"),$(this).css("color","#59ed9c"),$(this).closest(".copy-signatureurl-container").find(".copied-to-clipboard").attr("style",""),$(this).closest(".copy-signatureurl-container").find(".copied-to-clipboard").fadeOut(2500,()=>{$(this).attr("class","fas fa-clipboard copy-signatureurl"),$(this).css("color","#666")})})},window.saturne.signature.setAttendance=function(){var e=$(this).closest(".attendance-container").find('input[name="signatoryID"]').val(),t=$(this).attr("value"),n=window.saturne.toolbox.getToken(),o=window.saturne.toolbox.getQuerySeparator(document.URL),a=String(document.location.href).replace(/#formmail/,"");$.ajax({url:a+o+"action=set_attendance&token="+n,type:"POST",processData:!1,contentType:"",data:JSON.stringify({signatoryID:e,attendance:t}),success:function(e){$(".signatures-container").html($(e).find(".signatures-container"))},error:function(){}})},window.saturne.toolbox={},window.saturne.toolbox.init=function(){},window.saturne.toolbox.getQuerySeparator=function(e){return e.match(/\?/)?"&":"?"},window.saturne.toolbox.getToken=function(){return $('input[name="token"]').val()},window.saturne.toolbox.toggleButtonClass=function(e,t){$("."+e).toggleClass(t)},window.saturne.toolbox.removeAddButtonClass=function(e,t,n){$("."+e).removeClass(t).addClass(n)},window.saturne.tooltip||(window.saturne.tooltip={},window.saturne.tooltip.init=function(){window.saturne.tooltip.event()},window.saturne.tooltip.tabChanged=function(){$(".wpeo-tooltip").remove()},window.saturne.tooltip.event=function(){$(document).on("mouseenter touchstart",'.wpeo-tooltip-event:not([data-tooltip-persist="true"])',window.saturne.tooltip.onEnter),$(document).on("mouseleave touchend",'.wpeo-tooltip-event:not([data-tooltip-persist="true"])',window.saturne.tooltip.onOut)},window.saturne.tooltip.onEnter=function(e){window.saturne.tooltip.display($(this))},window.saturne.tooltip.onOut=function(e){window.saturne.tooltip.remove($(this))},window.saturne.tooltip.display=function(e){var t=$(e).data("direction")?$(e).data("direction"):"top",n=$(''+$(e).attr("aria-label")+""),o=($(e).position(),$(e).offset()),a=($(e)[0].tooltipElement=n,$("body").append($(e)[0].tooltipElement),$(e).data("color")&&n.addClass("tooltip-"+$(e).data("color")),0),i=0;switch($(e).data("direction")){case"left":a=o.top-n.outerHeight()/2+$(e).outerHeight()/2+"px",i=o.left-n.outerWidth()-10+3+"px";break;case"right":a=o.top-n.outerHeight()/2+$(e).outerHeight()/2+"px",i=o.left+$(e).outerWidth()+8+"px";break;case"bottom":a=o.top+$(e).height()+10+10+"px",i=o.left-n.outerWidth()/2+$(e).outerWidth()/2+"px";break;default:a=o.top-n.outerHeight()-4+"px",i=o.left-n.outerWidth()/2+$(e).outerWidth()/2+"px"}n.css({top:a,left:i,opacity:1}),$(e).on("remove",function(){$($(e)[0].tooltipElement).remove()})},window.saturne.tooltip.remove=function(e){$(e)[0]&&$(e)[0].tooltipElement&&$($(e)[0].tooltipElement).remove()}),window.saturne.utils={},window.saturne.utils.init=function(){window.saturne.utils.event()},window.saturne.utils.event=function(){$(document).on("mouseenter",".move-line.ui-sortable-handle",window.saturne.utils.draganddrop),$(document).on("change","#element_type",window.saturne.utils.reloadField)},window.saturne.utils.draganddrop=function(){$(this).css("cursor","pointer"),$("#tablelines tbody").sortable(),$("#tablelines tbody").sortable({handle:".move-line",connectWith:"#tablelines tbody .line-row",tolerance:"intersect",over:function(){$(this).css("cursor","grabbing")},stop:function(){$(this).css("cursor","default");var e=$(".fiche").find('input[name="token"]').val();let t="&",n=(document.URL.match(/action=/)&&(document.URL=document.URL.split(/\?/)[0],t="?"),[]);$(".line-row").each(function(){n.push($(this).attr("id"))}),$.ajax({url:document.URL+t+"action=moveLine&token="+e,type:"POST",data:JSON.stringify({order:n}),processData:!1,contentType:!1,success:function(){},error:function(){}})}})},window.saturne.utils.reloadPage=function(e,t,n="",o=""){var a=window.saturne.toolbox.getToken(),i=window.saturne.toolbox.getQuerySeparator(document.URL);$.ajax({url:document.URL+i+"action="+e+n+"&token="+a,type:"POST",processData:!1,contentType:!1,success:function(e){window.saturne.utils.checkMoreParams(o),$(t).replaceWith($(e).find(t))},error:function(){}})},window.saturne.utils.reloadField=function(){var e=$(this).val(),t=window.saturne.toolbox.getToken(),n=window.saturne.toolbox.getQuerySeparator(document.URL);window.saturne.loader.display($(".field_element_type")),window.saturne.loader.display($(".field_fk_element")),$.ajax({url:document.URL+n+"element_type="+e+"&token="+t,type:"POST",processData:!1,contentType:!1,success:function(e){$(".field_element_type").replaceWith($(e).find(".field_element_type")),$(".field_fk_element").replaceWith($(e).find(".field_fk_element"))},error:function(){}})},window.saturne.utils.enforceMinMax=function(e){""!==e.value&&(parseInt(e.value)parseInt(e.max))&&(e.value=e.max)},window.saturne.utils.checkMoreParams=function(e){e&&e.removeAttr&&$(e.removeAttr.element).removeAttr(e.removeAttr.value)};
\ No newline at end of file
diff --git a/langs/fr_FR/saturne.lang b/langs/fr_FR/saturne.lang
index c29a723a..f454230c 100644
--- a/langs/fr_FR/saturne.lang
+++ b/langs/fr_FR/saturne.lang
@@ -217,6 +217,19 @@ Tools = Outils
ExportData = Exporter mes données
+#
+#
+#
+
+QRCode = QR Code
+URLToEncode = URL à encoder
+HowToUseURLToEncode = Ecrivez l'URL vers laquelle le QR Code doit pointer
+QRCodeCreated = QR Code créé
+QRCodeUpdated = QR Code mis à jour
+QRCodeRemoved = QR Code supprimé
+URLToEncodeRequired = L'URL à encoder est obligatoire
+QRCodeGenerationTooltip = Appuyez sur ce bouton pour voir le QR Code
+
#
# Other - Autres
diff --git a/lib/documents.lib.php b/lib/documents.lib.php
index 2ac4b817..481bf1c4 100644
--- a/lib/documents.lib.php
+++ b/lib/documents.lib.php
@@ -46,16 +46,21 @@
* @param string $removeaction (optional) The action to remove a file
* @param int $active (optional) To show gen button disabled
* @param string $tooltiptext (optional) Tooltip text when gen button disabled
+ * @param string $sortfield (optional) Allows to sort the list of files by a field
+ * @param string $sortorder (optional) Allows to sort the list of files with a specific order
* @return string Output string with HTML array of documents (might be empty string)
*/
-function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, string $urlsource, $genallowed, int $delallowed = 0, string $modelselected = '', int $allowgenifempty = 1, int $forcenomultilang = 0, int $notused = 0, int $noform = 0, string $param = '', string $title = '', string $buttonlabel = '', string $codelang = '', string $morepicto = '', $object = null, int $hideifempty = 0, string $removeaction = 'remove_file', int $active = 1, string $tooltiptext = ''): string
+function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, string $urlsource, $genallowed, int $delallowed = 0, string $modelselected = '', int $allowgenifempty = 1, int $forcenomultilang = 0, int $notused = 0, int $noform = 0, string $param = '', string $title = '', string $buttonlabel = '', string $codelang = '', string $morepicto = '', $object = null, int $hideifempty = 0, string $removeaction = 'remove_file', int $active = 1, string $tooltiptext = '', string $sortfield = '', string $sortorder = ''): string
{
- global $conf, $db, $form, $hookmanager, $langs;
+ global $conf, $db, $form, $hookmanager, $langs, $user;
if (!is_object($form)) {
$form = new Form($db);
}
+ require_once __DIR__ . '/../class/saturneqrcode.class.php';
+ $QRCode = new SaturneQRCode($db);
+
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
// Add entity in $param if not already exists
@@ -63,6 +68,23 @@ function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, str
$param .= ($param ? '&' : '') . 'entity=' . (!empty($object->entity) ? $object->entity : $conf->entity);
}
+ if (empty($sortfield)) {
+ if (GETPOST('sortfield')) {
+ $sortfield = GETPOST('sortfield');
+ } else {
+ $sortfield = 'name';
+ }
+ }
+
+
+ if (empty($sortorder)) {
+ if (GETPOST('sortorder')) {
+ $sortorder = GETPOST('sortorder');
+ } else {
+ $sortorder = 'desc';
+ }
+ }
+
$hookmanager->initHooks(['formfile']);
// Get list of files
@@ -75,7 +97,37 @@ function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, str
} else {
$fileList = dol_dir_list($filedir, 'files', 0, '(\.jpg|\.jpeg|\.png|\.odt|\.zip|\.pdf)', '', 'date', SORT_DESC, 1);
}
- }
+ }
+
+ if (GETPOST('search_name')) {
+ $fileList = array_filter($fileList, function($file) {
+ return strpos($file['name'], GETPOST('search_name')) !== false;
+ });
+ }
+
+ if (GETPOST('search_date')) {
+ $search_date = GETPOST('search_date');
+ $fileList = array_filter($fileList, function($file) use ($search_date) {
+ $file_date = date('Y-m-d', $file['date']);
+ return $file_date === $search_date;
+ });
+ }
+
+
+ $fileList = dol_sort_array($fileList, $sortfield, $sortorder);
+
+ $page = GETPOST('page', 'int') ?: 1;
+ $filePerPage = 20;
+ $fileListLength = 0;
+ if (is_array($fileList) && !empty($fileList)) {
+ $fileListLength = count($fileList);
+ }
+
+ if ($fileListLength > $filePerPage) {
+ $fileList = array_slice($fileList, ($page - 1 ) * $filePerPage, $filePerPage);
+ }
+
+ $pageNumber = ceil($fileListLength / $filePerPage);
if ($hideifempty && empty($fileList)) {
return '';
@@ -215,6 +267,20 @@ function saturne_show_documents(string $modulepart, $modulesubdir, $filedir, str
$genbutton = '';
}
$out .= $genbutton;
+ $querySeparator = (strpos($_SERVER['REQUEST_URI'], '?') === false) ? '?' : '&';
+
+ $out .= '
';
+ return $out;
+}
+
/**
* Exclude index.php files from list of models for document generation
*
diff --git a/lib/saturne.lib.php b/lib/saturne.lib.php
index 797ca035..767bc574 100644
--- a/lib/saturne.lib.php
+++ b/lib/saturne.lib.php
@@ -53,6 +53,11 @@ function saturne_admin_prepare_head(): array
$head[$h][2] = 'information';
$h++;
+ $head[$h][0] = dol_buildpath('/saturne/admin/qrcode.php', 1);
+ $head[$h][1] = '' . $langs->trans('QRCode');
+ $head[$h][2] = 'qrcode';
+ $h++;
+
$head[$h][0] = dol_buildpath('/saturne/admin/information.php', 1) . '?filename=evarisk_modules&tab_name=evariskModule';
$head[$h][1] = '' . $langs->trans('SaturneModule', 'Evarisk');
$head[$h][2] = 'evariskModule';
diff --git a/lib/saturne_functions.lib.php b/lib/saturne_functions.lib.php
index 96ff40c6..8f027707 100644
--- a/lib/saturne_functions.lib.php
+++ b/lib/saturne_functions.lib.php
@@ -348,7 +348,6 @@ function saturne_load_langs(array $domains = [])
global $langs, $moduleNameLowerCase;
$langs->loadLangs(['saturne@saturne', 'object@saturne', 'signature@saturne', 'medias@saturne', $moduleNameLowerCase . '@' . $moduleNameLowerCase]);
-
if (!empty($domains)) {
foreach ($domains as $domain) {
$langs->load($domain);
diff --git a/sql/qrcode/index.php b/sql/qrcode/index.php
new file mode 100644
index 00000000..eda62848
--- /dev/null
+++ b/sql/qrcode/index.php
@@ -0,0 +1,2 @@
+
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+ALTER TABLE llx_saturne_qrcode ADD INDEX idx_saturne_object_qrcode_rowid (rowid);
+ALTER TABLE llx_saturne_qrcode ADD CONSTRAINT llx_saturne_qrcode_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
diff --git a/sql/qrcode/llx_saturne_qrcode.sql b/sql/qrcode/llx_saturne_qrcode.sql
new file mode 100644
index 00000000..3b795690
--- /dev/null
+++ b/sql/qrcode/llx_saturne_qrcode.sql
@@ -0,0 +1,26 @@
+-- Copyright (C) 2024 EVARISK
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+CREATE TABLE llx_saturne_qrcode(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ entity integer DEFAULT 1 NOT NULL,
+ date_creation datetime NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ import_key varchar(14),
+ module_name varchar(255),
+ url text,
+ encoded_qr_code longtext,
+ fk_user_creat integer NOT NULL
+) ENGINE=innodb;