From: vincent@cubedesigners.com Date: Tue, 20 Dec 2016 17:39:55 +0000 (+0000) Subject: done #1049 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b3c943d3373e71c0f6f3ded98261794593344c31;p=cubeextranet.git done #1049 @3 --- diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index f0444726b..b568d4bc3 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1240,6 +1240,13 @@ class wsDAOBook extends commonDAO { $imagesassets[$assetId] = true; } + if ($link['type'] == 16 && $book->parametres->linkFilePrefix) { + if (!CubeIT_Util_Url::isDistant($link['to'])) { + $link['to'] = $book->parametres->linkFilePrefix . $link['to']; + $links[$id] = $link; + } + } + if ($link['type'] == 15) { if (isset($imagesassets[$id])) { continue; diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index fde55e1ed..4b6a794c1 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -136,7 +136,7 @@ class wsBookParametres extends wsParametres { $this->fields['pdfThumbnails'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('PDF utilisé pour générer les miniatures'), 'grade' => 1, 'fileFilter' => $pdfFilter); - $this->forms['index'] = array('label' => __('Index'), 'fieldsnames' => array('indexAutoScroll','pdfThumbnails')); + $this->forms['index'] = array('label' => __('Index'), 'fieldsnames' => array('indexAutoScroll', 'pdfThumbnails')); // . // @@ -247,6 +247,7 @@ class wsBookParametres extends wsParametres { $this->fields['linkTooltipManager'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Gestionnaire des info-bulles"), 'grade' => 5); $this->fields['linkTracker'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Tracking des liens'), 'grade' => 5); $this->fields['linkTrackerRegexp'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Tracking des liens applicables aux liens du domaine'), 'grade' => 5); + $this->fields['linkFilePrefix'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Préfixer les liens de téléchargement')); $this->fields['linkMultimediaPerformanceMode'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Mode perfomance pour les liens multimédia'), 'grade' => 5); $this->fields['linkMultimediaQuality'] = array('type' => 'float', 'default' => 1.0, 'editable' => true, 'label' => __('Qualité de rendu des animations'), 'grade' => 5); $this->fields['linkCornerSize'] = array('type' => 'integer', 'default' => '10', 'editable' => true, 'label' => __('Taille des liens de coins de page'), 'hint' => __("Pourcentage de la largeur de la page")); @@ -256,7 +257,7 @@ class wsBookParametres extends wsParametres { $this->fields['brightcovePlayerId'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Id'), 'grade' => 3); $this->fields['brightcovePlayerSecret'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Secret'), 'grade' => 3); $this->forms['multimedia'] = array('label' => __('Liens et multimédia'), - 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret')); + 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret')); //. $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter); diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index c3c9c4333..95c2a04b5 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -663,6 +663,9 @@ class imageLink extends contentLink { class fileLink extends normalLink { public function getURL() { + if ($this->compiler->book->parametres->linkFilePrefix && !CubeIT_Util_Url::isDistant($this->to)) { + return $this->compiler->book->parametres->linkFilePrefix . $this->to; + } $this->copyExternalFile($this->to); return wsHTML5Link::getUniversalLocation($this->to); } diff --git a/js/common.js b/js/common.js index 3fe67954a..ec5cd915f 100644 --- a/js/common.js +++ b/js/common.js @@ -184,7 +184,7 @@ function load_common_extranet() { status.html('Chargement en cours | ' + percentVal + ''); }, complete: function (xhr) { - window.location = window.location; + window.location.reload(); } });