]> _ Git - cubeextranet.git/commitdiff
Grdf 2015
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Mar 2015 15:19:28 +0000 (15:19 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Mar 2015 15:19:28 +0000 (15:19 +0000)
inc/ws/Controlleur/class.ws.services.php
inc/ws/Metier/class.ws.book.parametres.php

index 6c0f743eecbbe6b6ca39118ed15df6af3b1b7dd6..9b01f2c3997bed369360888c732ad82d74c79ad0 100644 (file)
@@ -532,9 +532,47 @@ class wsServices extends cubeFlashGateway {
                $mail->send();
        }
 
+       public function grdfCoupon2015() {
+               $id = $this->args['id'];
+
+               $this->outputXML = false;
+               $couponsRoot = WS_BOOKS . '/working/' . $id . '/commerce/';
+
+               $xml = simplexml_load_file($couponsRoot . 'references.xml');
+               // Check hash
+               $hash = md5('ae' . $_GET['nom'] . '25' . $_GET['ref']);
+               if ($hash != $_GET['h']) {
+                       exit;
+               }
+               $refs = explode(',', $_GET['ref']);
+
+               $tmp = cubeFiles::tempnam();
+               $pdftk = new CubeIT_CommandLine('pdftk');
+               $pdftk->setPath(CONVERTER_PATH);
+               foreach ($refs as $ref) {
+                       $file = $couponsRoot . $ref . '.pdf';
+                       $pdftk->setArg(null, $file);
+               }
+               $pdftk->setArg(null, 'output');
+               $pdftk->setArg(null, $tmp);
+               $pdftk->execute();
+
+               header('Content-Type: application/pdf');
+               header('Content-Disposition: inline; filename="CouponChequier.pdf"');
+
+               readfile($tmp);
+               unlink($tmp);
+               exit;
+       }
+
        public function grdfCoupon() {
+
                $id = $this->args['id'];
 
+               if ($id == 13372) {
+                       return $this->grdfCoupon2015();
+               }
+
                $this->outputXML = false;
                $couponsRoot = WS_BOOKS . '/working/' . $id . '/commerce/';
 
index 59ab227a33e9e023098111ec37b0319bb56c69da..2db5f396e07bb4c0f0f850bd5fc17126dd8d64e4 100644 (file)
@@ -268,6 +268,7 @@ class wsBookParametres extends wsParametres {
                                                       'datas' => array(__('Classic') => 'com.fluidbook.player.basket.BasketManager',
                                                                        'Grdf' => 'com.fluidbook.player.basket.custom.grdf.GrdfBasketManager',
                                                                        'Grdf 2013' => 'com.fluidbook.player.basket.custom.grdf.grdf2013.GrdfBasketManager2013',
+                                                                       'Grdf 2015' => 'com.fluidbook.player.basket.custom.grdf.grdf2015.GrdfBasketManager2015',
                                                                        'Essilor' => 'com.fluidbook.player.basket.custom.essilor.EssilorBasketManager',
                                                                        'Essilor Recap' => 'com.fluidbook.player.basket.cursor.essilorrecap.EssilorRecapBasketManager'), 'grade' => 5);
                $this->fields['basketReferences'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
@@ -393,5 +394,3 @@ class wsBookParametres extends wsParametres {
        }
 
 }
-
-?>
\ No newline at end of file