From: vincent@cubedesigners.com Date: Thu, 23 Jun 2011 13:41:07 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4fcbd10f8f458af07cc696fc5dcb4daf4d146f02;p=cubeextranet.git --- diff --git a/fluidbook/compile/_js/fluidbook.js b/fluidbook/compile/_js/fluidbook.js index 7ad69ac65..5b16bf53f 100644 --- a/fluidbook/compile/_js/fluidbook.js +++ b/fluidbook/compile/_js/fluidbook.js @@ -67,10 +67,13 @@ function getCookie(nom) } function setCookie(nom, valeur) { + date=new Date; + date.setFullYear(date.getFullYear()+10); + var argv=setCookie.arguments; var argc=setCookie.arguments.length; - var expires=(argc > 2) ? argv[2] : null; - var path=(argc > 3) ? argv[3] : null; + var expires=(argc > 2) ? argv[2] : date; + var path=(argc > 3) ? argv[3] : '/'; var domain=(argc > 4) ? argv[4] : null; var secure=(argc > 5) ? argv[5] : false; document.cookie=nom+"="+escape(valeur)+ diff --git a/fluidbook/tools/fwstk/.classpath b/fluidbook/tools/fwstk/.classpath index e33b75030..bb0d6e4f9 100644 --- a/fluidbook/tools/fwstk/.classpath +++ b/fluidbook/tools/fwstk/.classpath @@ -1,10 +1,7 @@ - - - - - + + diff --git a/fluidbook/tools/fwstk/.project b/fluidbook/tools/fwstk/.project index 3fc75ba51..79960233b 100644 --- a/fluidbook/tools/fwstk/.project +++ b/fluidbook/tools/fwstk/.project @@ -20,10 +20,5 @@ 2 H:/Works/Java - - resources - 2 - WORKSPACE_LOC/Java/resources - diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index fb24921f0..b85e4e107 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -720,24 +720,27 @@ class wsDAOBook extends commonDAO { if (file_exists($referencesFile)) { $xml = simplexml_load_file($referencesFile); $i = 0; - $allref=array(); + $allref = array(); foreach ($xml->item as $item) { $ref = (string) $item['reference']; - if(isset($allref[$ref])){ + if (isset($allref[$ref])) { continue; } - $allref[$ref]=true; + $allref[$ref] = true; foreach ($formats as $f) { $refimage = $workingDir . 'commerce/' . $ref . '.' . $f; if (file_exists($refimage)) { - $flex->addBitmap($refimage, "basket_image_". $ref); + $flex->addBitmap($refimage, "basket_image_" . $ref); break; } } $i++; } } - $flex->addVariable('basketReferences', cubeXML::condense($xml->asXML()),false,true, "String"); + $flex->addVariable('basketReferences', cubeXML::condense($xml->asXML()), false, true, "String"); + if ($book->parametres->basketPDFBackground != '') { + $flex->addByteArray($workingDir . 'commerce/' . $book->parametres->basketPDFBackground, 'basket_pdf_background'); + } } // Fonts $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 6d4b8f877..58cfdac26 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -116,6 +116,10 @@ class wsBookParametres extends wsParametres { $imageFilter->name = __('Images') . ' (*.jpg, *.png)'; $imageFilter->extensions = '*.jpg;*.jpeg;*.png'; + $epsFilter = new stdClass(); + $epsFilter->name = __('Fichier vectoriel') . ' (*.ai, *.eps)'; + $epsFilter->extensions = '*.ai;*.eps'; + $this->fields['chaptersPage'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Faire pointer le sommaire sur la page'), 'grade' => 3, 'hint' => __('Laisser vide pour utiliser le sommaire classique'), 'size' => 5); $this->fields['displayChaptersAtStart'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Afficher le sommaire au chargement de la publication"), 'grade' => 3); $this->fields['externalChapters'] = array('type' => 'freefile', 'default' => '', 'editable' => true, @@ -143,13 +147,15 @@ class wsBookParametres extends wsParametres { 'datas' => array(__('Classic') => 'com.fluidbook.player.basket.BasketManager', __('Essilor') => 'com.fluidbook.player.basket.custom.essilor.EssilorBasketManager'), 'grade' => 5); $this->fields['basketReferences'] = array('type' => 'freefile', 'default' => '', 'editable' => true, - 'label' => __('Références produits'), 'grade' => 5, 'fileFilter' => $basketFilter, 'hint' => __('Fichier contenant les références produits'),'dir'=>'commerce'); + 'label' => __('Références produits'), 'grade' => 5, 'fileFilter' => $basketFilter, 'hint' => __('Fichier contenant les références produits'), 'dir' => 'commerce'); $this->fields['basketImages'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Images des produits'), 'grade' => 5, 'fileFilter' => $imageFilter, 'hint' => __('Chaque image doit avoir pour nom exact la référence du produit'), 'multiple' => true, 'dir' => 'commerce'); + $this->fields['basketPDFBackground'] = array('type' => 'freefile', 'default' => '', 'editable' => true, + 'label' => __('Fond du PDF (bon de commande)'), 'grade' => 5, 'fileFilter' => $epsFilter, 'hint' => __('Fond du bon de commande'), 'dir' => 'commerce'); $this->forms['basket'] = array('label' => __('Panier'), - 'fieldsnames' => array('basket', 'basketManager', 'basketReferences', 'basketImages')); + 'fieldsnames' => array('basket', 'basketManager', 'basketReferences', 'basketImages', 'basketPDFBackground')); // . $this->fields['offlineLink'] = array('type' => 'text', 'default' => 'http://', 'editable' => true, 'label' => __("URL du Fluidbook"), 'hint' => 'URL du fluidbook utilisée pour la version Offline (CD-ROM, clé USB, Exécutables)'); $this->forms['offline'] = array('label' => __('Version offline'), diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index 1f22c9ec1..ca61d45c0 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -168,8 +168,12 @@ class wsPackager { } protected function moveDatasSWF() { - rename($this->vdir . '/FluidbookDatas.swf', $this->vdir . '/data/FluidbookDatas.swf'); - rename($this->vdir . '/FluidbookDatasLight.swf', $this->vdir . '/data/FluidbookDatasLight.swf'); + if (file_exists($this->vdir . '/FluidbookDatas.swf')) { + rename($this->vdir . '/FluidbookDatas.swf', $this->vdir . '/data/FluidbookDatas.swf'); + } + if (file_exists($this->vdir . '/FluidbookDatasLight.swf')) { + rename($this->vdir . '/FluidbookDatasLight.swf', $this->vdir . '/data/FluidbookDatasLight.swf'); + } } protected function postPackage() { diff --git a/inc/ws/Util/packager/class.ws.packager.win.cd.php b/inc/ws/Util/packager/class.ws.packager.win.cd.php index 60f1a1f29..d3707f6c3 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.cd.php +++ b/inc/ws/Util/packager/class.ws.packager.win.cd.php @@ -11,8 +11,8 @@ class wsPackagerWinCD extends wsPackagerMacEXE { parent::preparePackage(); $this->copyOtherFiles(array( - 'fluidbook.ico' => 'data/fluidbook.ico', ' - autorun.inf', + 'fluidbook.ico' => 'data/fluidbook.ico', + 'autorun.inf', 'Fluidbook.exe' => 'Windows-PC-' . $this->exeName . '.exe', 'Fluidbook.app.zip')); $this->replaceAutorun(); @@ -21,7 +21,7 @@ class wsPackagerWinCD extends wsPackagerMacEXE { public function replaceAutorun() { $inf = file_get_contents($this->vdir . 'autorun.inf'); - $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName); + $toReplace = array('title' => $this->book->parametres->title, 'exe' => 'Windows-PC-' . $this->exeName . '.exe'); $inf = $this->replaceContents($inf, $toReplace); file_put_contents($this->vdir . 'autorun.inf', $inf); }