]> _ Git - fluidbook-html5.git/commitdiff
#7774
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Oct 2025 16:03:08 +0000 (18:03 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 3 Oct 2025 16:03:08 +0000 (18:03 +0200)
js/libs/fluidbook/cart/fluidbook.cart.puma.js
style/cart/puma.less

index 1d72fd0f7f4f1478c060d3a82c826e90b0d6fc3b..a8c433bcf20386b417f6de3dc4bcde6280bdbe0f 100644 (file)
@@ -4,6 +4,7 @@ function FluidbookCartPuma(cart) {
     this.fluidbook = this.cart.fluidbook;
     this.data = this.fluidbook.settings.basketReferences;
     this.exportFileName = '';
+    this.exportData;
     this.base64URL = {};
     this.base64Loading = 0;
     this.init();
@@ -16,7 +17,7 @@ FluidbookCartPuma.prototype = {
         $(document).on(this.fluidbook.input.clickEvent, '.exportCartPDF', function () {
             $this.chooseFileName(function () {
                 $this.exportPlanogramme();
-            });
+            }, '<h3 style="margin-top: 15px; font-weight: normal">Options</h3><label><input type="checkbox" name="pa" value="1" checked> Show PA</label><label><input type="checkbox" name="pvp" value="1" checked> Show PVP</label>');
             return false;
         });
 
@@ -247,9 +248,19 @@ FluidbookCartPuma.prototype = {
 
 
     exportPlanogramme: function () {
+        let GET = {};
+        $.each(this.exportData, function (k, v) {
+            GET[v.name] = v.value;
+        });
+        if(GET.pa===undefined){
+            GET.pa = 0;
+        }
+        if(GET.pvp===undefined){
+            GET.pvp = 0;
+        }
         this.fluidbook.displayLoader();
         this.fluidbook.hideLoader(3);
-        let url = this.fluidbook.service.getBaseURL(true) + 'puma/planogramme/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.cid + '/' + encodeURIComponent(this.getItemsReferences().join(',')) + '/pdf/' + encodeURIComponent(this.getExportFileName());
+        let url = this.fluidbook.service.getBaseURL(true) + 'puma/planogramme/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.cid + '/' + encodeURIComponent(this.getItemsReferences().join(',')) + '/pdf/' + encodeURIComponent(this.getExportFileName()) + '/' + (GET.pa == '1' ? '1' : '0') + '/' + (GET.pvp == '1' ? '1' : '0');
         console.log(url);
         $("#puma_planogramme").remove();
         $("body").append('<a href="' + url + '" download="' + this.getExportFileName() + '.pdf' + '" id="puma_planogramme"></a>');
@@ -344,15 +355,19 @@ FluidbookCartPuma.prototype = {
         });
     },
 
-    chooseFileName: function (callback) {
+    chooseFileName: function (callback, contents) {
+        if (contents === undefined) {
+            contents = '';
+        }
         var $this = this;
         $.confirm({
             title: 'Name your file',
-            content: '' + '<form action="" class="formName">' + '<div class="form-group">' + '<input type="text" value="' + this.getExportFileName() + '" placeholder="File name" class="name form-control" required />' + '</div>' + '</form>',
+            content: '' + '<form action="" class="formName">' + '<div class="form-group">' + '<input type="text" value="' + this.getExportFileName() + '" placeholder="File name" class="name form-control" required />' + contents + '</div>' + '</form>',
             buttons: {
                 formSubmit: {
                     text: 'Submit', btnClass: 'btn-ok', action: function () {
                         $this.exportFileName = this.$content.find('.name').val();
+                        $this.exportData = this.$content.find('form').serializeArray();
                         callback();
                     }
                 }, cancel: function () {
index 0dd69cc485cc14b411fa99a89aaadbece7c3910a..3a0bfde7ecf709e00d4b723812fca0fc07dcb01b 100644 (file)
     }
 
   }
+}
+
+
+.jconfirm .jconfirm-box .form-group {
+  label {
+    margin: 5px 0;
+    display: block;
+
+    input[type="checkbox"] {
+      width: auto;
+      display: inline-block;
+      accent-color: #af9471;
+      margin-right: 15px;
+    }
+  }
 }
\ No newline at end of file