From: vincent@cubedesigners.com Date: Tue, 26 Apr 2011 08:17:10 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4dac2a45d807697dfbb17ef81b143b51da54035f;p=cubeextranet.git --- diff --git a/inc/ws/DAO/class.ws.dao.document.php b/inc/ws/DAO/class.ws.dao.document.php index 7fea96e8c..82096b7e1 100644 --- a/inc/ws/DAO/class.ws.dao.document.php +++ b/inc/ws/DAO/class.ws.dao.document.php @@ -35,7 +35,8 @@ class wsDAODocument extends commonDAO { public function restoreLinksVersion($book_id, $update) { - $core->con->execute('INSERT INTO document_links_version SELECT document_id,links,rulers,' . TIME . ' FROM document_links_version WHERE `update`=' . $update . ' AND document_id IN (SELECT document_id FROM book_pages WHERE book_id=' . $book_id . ')'); + $sql = 'INSERT INTO document_links_versions SELECT document_id,links,rulers,' . TIME . ' FROM document_links_versions WHERE `update`=' . $update . ' AND document_id IN (SELECT document_id FROM book_pages WHERE book_id=' . $book_id . ')'; + $this->con->execute($sql); } public function putLinksFromCSV($document_id) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 80baf8327..88119da14 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -78,10 +78,11 @@ class wsBookParametres extends wsParametres { $this->forms['general_settings'] = array('label' => __('Paramètres généraux'), 'fieldsnames' => array('preload')); // . - $this->fields['pdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Export PDF')); - $this->fields['pdfComplex'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Export PDF avancé'), 'grade' => 3); - $this->forms['pdf'] = array('label' => __('Fonction Export PDF'), - 'fieldsnames' => array('pdf', 'pdfComplex')); + $this->fields['pdf'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Activer les fonctions de téléchargement")); + $this->fields['pdfComplex'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Téchargement de PDF avancé'), 'grade' => 3); + $this->fields['offlineExport'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Téléchargement des versions offline'), 'grade' => 3); + $this->forms['pdf'] = array('label' => __('Fonction de téléchargement'), + 'fieldsnames' => array('pdf', 'pdfComplex', 'offlineExport')); // . $this->fields['zoomMode'] = array('type' => 'combo', 'default' => '0', 'editable' => true, 'label' => __("Mode de zoom"), 'grade' => 5, 'datas' => array(__('Normal') => '0', diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 290dd16ba..b937dd3fe 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -12,6 +12,14 @@ class wsPackagerHTML extends wsPackager { { parent::preparePackage(); + if ($this->book->parametres->offlineExport) { + $versions = array('win-ins' => 'exe', 'mac-exe' => 'zip'); + foreach($versions as $v => $ext) { + $a = wsPackager::package($this->book_id, $v); + rename(ROOT . $a, $this->vdir . '/data/document.' . $ext); + } + } + $this->copyFluidbookFiles(); $this->mergeJavascript(); diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index 965fa3cb4..7bd07a24b 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -6,6 +6,7 @@ class wsPackager { protected $pages; protected $theme; protected $version; + protected $book_id; public static function package($book_id, $version) { @@ -30,6 +31,8 @@ class wsPackager { { global $core; + $this->book_id = $book_id; + $this->dir = WS_FILES . '/packager/' . $book_id . '/'; if (!file_exists($this->dir)) { @@ -147,7 +150,7 @@ class wsPackager { { $this->vdir = $this->dir . $this->version . '/'; $this->cleanVdir(); - mkdir($this->vdir, 0777, true); + mkdir($this->vdir . '/data', 0777, true); } protected function cleanVdir()