diff --git a/VERSIONS b/VERSIONS index c35f03d67cfcc85c2f3b5ee363ab3aa793aa2c72..0b380c4a4dc4453bc8bb9b194b725c721dcc8994 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,9 @@ +16/02/2016 - v7.5.10 + + - ticket #37996 : Correction des liens Premier Chapitre + + + 15/02/2016 - v7.5.9 - ticket #37288 : Correction de la localisation des exemplaires diff --git a/application/modules/admin/controllers/PremierChapitreController.php b/application/modules/admin/controllers/PremierChapitreController.php index e3c9aa79e2ca80ca083633230cffe4c2fb6b4b93..a521e3a416c3fa1d1cde36c4ad11f57590084e5d 100644 --- a/application/modules/admin/controllers/PremierChapitreController.php +++ b/application/modules/admin/controllers/PremierChapitreController.php @@ -18,9 +18,9 @@ * along with BOKEH; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -class Admin_PremierChapitreController extends Zend_Controller_Action { - use Trait_Translator; - protected $_baseUrlOptions = ['module' => 'admin', 'controller' => 'premier-chapitre']; +class Admin_PremierChapitreController extends ZendAfi_Controller_Action { + protected $_baseUrlOptions = ['module' => 'admin', 'controller' => 'premier-chapitre'], + $_back_to_index; private $active; private $pc_bib_id; @@ -35,6 +35,7 @@ class Admin_PremierChapitreController extends Zend_Controller_Action { $this->pc_bmid = Class_AdminVar::get('PREMIERCHAPITRE_BMID'); $this->pc_bmkey = Class_AdminVar::get('PREMIERCHAPITRE_BMKEY'); $this->active = (!empty($this->pc_bib_id) && !empty($this->pc_bmid) && !empty($this->pc_bmkey)); + $this->_back_to_index = $this->view->tagAnchor(['action' => 'index'] , $this->_('Retour à l\'index du service Premier-chapitre')); } public function preDispatch() { @@ -73,11 +74,11 @@ class Admin_PremierChapitreController extends Zend_Controller_Action { $data = $pc_ws->getDatafile(); if ($data){ $contenu = date('H:i:s')." Le référentiel a bien été téléchargé sur le serveur\nIl est possible de procéder à la mise à jour de la base\n"; - $contenu .= '<a href="/admin/premier-chapitre/maj-db/">Mise à jour de la base</a>'; + $contenu .= $this->view->tagAnchor(['action' => 'maj-db'], $this->_('Mise à jour de la base')); } else $contenu = "Une erreur est survenue\nle référentiel n'a pas pu être téléchargé\nVeuillez réessayer ultérieurement"; $this->view->contenu = '<pre>'.$contenu.'</pre>'; - $this->view->contenu .= "<br/><a href='/admin/premier-chapitre/'>Retour à l'index du service Premier-chapitre</a>"; + $this->view->contenu .= "<br/>" . $this->back_to_index; $this->view->titre .= ' :: Téléchargement du référentiel'; } @@ -92,11 +93,11 @@ class Admin_PremierChapitreController extends Zend_Controller_Action { if ($data['new']) $contenu .= '* '.$data['new'].(($data['new']>1)?" ont été ajoutées":" a été ajoutée")."\n"; if ($data['maj']) $contenu .= '* '.$data['maj'].(($data['maj']>1)?" ont été mises":" a été mise")." à jour\n"; if ($data['err']) $contenu .= '* '.$data['err'].(($data['err']>1)?" erreurs n'ont pas été traitées":" erreur n'a pas été traitée")."\n"; - $contenu .= '<a href="/admin/premier-chapitre/link-notices/">Lier les notices</a>'; + $contenu .= $this->view->tagAnchor(['action' => 'link-notices'], $this->_('Lier les notices')); } else $contenu = "Une erreur est survenue\nLa base n'a pu être mise à jour\nVeuillez réessayer ultérieurement"; $this->view->contenu = '<pre>'.$contenu.'</pre>'; - $this->view->contenu .= "<br/><a href='/admin/premier-chapitre/'>Retour à l'index du service Premier-chapitre</a>"; + $this->view->contenu .= "<br/>" . $this->_back_to_index; $this->view->titre .= ' :: Mise à jour de la base'; } @@ -111,7 +112,7 @@ class Admin_PremierChapitreController extends Zend_Controller_Action { } else $contenu = "Une erreur est survenue\nLes liaisons n'ont pu être faites\nVeuillez réessayer ultérieurement"; $this->view->contenu = '<pre>'.$contenu.'</pre>'; - $this->view->contenu .= "<br/><a href='/admin/premier-chapitre/'>Retour à l'index du service Premier-chapitre</a>"; + $this->view->contenu .= "<br/>" . $this->_back_to_index; $this->view->titre .= ' :: Liaison aux notices'; } diff --git a/application/modules/admin/views/scripts/accueil/premier-chapitre.phtml b/application/modules/admin/views/scripts/accueil/premier-chapitre.phtml index 8c18b86fa5312e58c6d42eab972c0027e2dfa046..5ee9ef4ecb2b5c30b28340339e2ea7d32d6ea58f 100644 --- a/application/modules/admin/views/scripts/accueil/premier-chapitre.phtml +++ b/application/modules/admin/views/scripts/accueil/premier-chapitre.phtml @@ -18,7 +18,7 @@ pc_ref_url(); } function pc_ref_url() { - var urlref = "/premier-chapitre" + var urlref = baseUrl + "/premier-chapitre" var type = $("#type")[0].value; var format = $("#format")[0].value; if (type == 0) { @@ -92,7 +92,7 @@ <tr id="pc_conf_panier"> <td class="droite">Panier </td> <td class="gauche"><?php echo $this->formSelect("id_panier", $this->preferences["id_panier"],['onchange'=>'pc_ref_url();'],$this->paniers) ?></td> - </tr> + </tr> <tr id="pc_conf_format"> <td class="droite" valign="top">Format d'affichage</td> <td class="gauche"> diff --git a/application/modules/opac/controllers/PremierChapitreController.php b/application/modules/opac/controllers/PremierChapitreController.php index 498c04bb5f4abd668b3311234cd49930aa232bae..56a65a0e1e9c482c09e38c5b32bc728ede49e67e 100644 --- a/application/modules/opac/controllers/PremierChapitreController.php +++ b/application/modules/opac/controllers/PremierChapitreController.php @@ -71,13 +71,13 @@ class PremierChapitreController extends Zend_Controller_Action { $pc = Class_PremierChapitre::findFirstBy(['ean' => $ean]); if ($pc) { $ntc = $pc->getNotice(); - $url_notice = ZendAfi_View_Helper_UrlNotice::urlNotice($ntc); + $url_notice = Class_Url::absolute(ZendAfi_View_Helper_UrlNotice::urlNotice($ntc)); $this->_redirect($url_notice); } - else + else $this->_redirect('/'); } - else + else $this->_redirect('/'); } @@ -107,7 +107,7 @@ class PremierChapitreController extends Zend_Controller_Action { $format = $this->_request->getParam('format'); if (!preg_match('@^\d+$@',$nb)) $pcs = Class_PremierChapitre::getAleatoire(); - else + else $pcs = Class_PremierChapitre::getAleatoire($nb); $preferences = []; if ($format == 1 || $format == 2) $preferences['target'] = 'frame'; @@ -139,7 +139,7 @@ class PremierChapitreController extends Zend_Controller_Action { $this->getResponse()->setHeader('Pragma', 'no-cache', true); $this->getResponse()->setBody($html . Class_ScriptLoader::getInstance()->loadJQuery()->html()); } - + public function __call($method, $args) { if ('Action' == substr($method, -6)) { // Si une méthode d'action n'est pas trouvée, diff --git a/application/modules/opac/views/scripts/premier-chapitre/index.phtml b/application/modules/opac/views/scripts/premier-chapitre/index.phtml index f1e43c1af948e25fae44ebae62eeda0f30342e37..7d9acfa910bd35ec695cc11537d9507eccbaa696 100644 --- a/application/modules/opac/views/scripts/premier-chapitre/index.phtml +++ b/application/modules/opac/views/scripts/premier-chapitre/index.phtml @@ -10,7 +10,7 @@ <div> <p><img src="/public/opac/images/lireavecpremierchapitre.png" alt="premierchapitre" style="position:relative;top:-5px;"></p> <p><span style="font-size:12px">Cliquez sur une couverture pour lire un extrait. Vous pouvez ensuite récupérer le livre à la bibliothèque.</span></p> - <p><span style="font-size:12px"><a href="/premier-chapitre/liste-complete/">Cliquez ici Pour voir la liste complète <img src="/public/opac/images/buttons/2rightarrow.png"></a></span></p> + <p><span style="font-size:12px"><?php echo $this->tagAnchor(['action' => 'liste-complete'], $this->_('Cliquez ici pour voir la liste complète') . '<img src="/public/opac/images/buttons/2rightarrow.png">')?> </span></p> </div> <?php echo $this->premierChapitre_Vignettes($this->pc_ids,['target' => 'frame', 'linkNotice' => 1]); ?> </div> diff --git a/library/ZendAfi/View/Helper/PremierChapitre/Lien.php b/library/ZendAfi/View/Helper/PremierChapitre/Lien.php index 803893bdf4b63d14a73586ccc284f71d79ade1aa..8ad3e9c213c32eaa8e6e24617d316d5ecd8daa1d 100644 --- a/library/ZendAfi/View/Helper/PremierChapitre/Lien.php +++ b/library/ZendAfi/View/Helper/PremierChapitre/Lien.php @@ -39,7 +39,9 @@ class ZendAfi_View_Helper_PremierChapitre_Lien protected function _getHref($model, $preferences) { if ($this->_isLinkToRecord($preferences)) - return '/premier-chapitre/notice/ean/' . $model->getId(); + return Class_Url::absolute(['controller' => 'premier-chapitre', + 'action' => 'notice', + 'ean' => $model->getId()]); return ($this->_isLinkToTarget($preferences)) ? '#pc_ancre' : $model->getUrl(); diff --git a/library/ZendAfi/View/Helper/PremierChapitre/Vignettes.php b/library/ZendAfi/View/Helper/PremierChapitre/Vignettes.php index 9f83521639ef9cd61e03345b084a27a4ae2137f3..258106d1cd366b2e3ef89ae2b1087e85537de4c5 100644 --- a/library/ZendAfi/View/Helper/PremierChapitre/Vignettes.php +++ b/library/ZendAfi/View/Helper/PremierChapitre/Vignettes.php @@ -72,8 +72,12 @@ class ZendAfi_View_Helper_PremierChapitre_Vignettes protected function _vignetteFrame($model, $preferences){ $onclick = "\$('#pc_frame')[0].src='".$model->getUrl()."';"; - if ($this->_isLinkToRecord($preferences)) - $onclick .= "\$('#pc_lienNotice')[0].href='/premier-chapitre/notice/ean/" . $model->getId()."';"; + if ($this->_isLinkToRecord($preferences)) { + $url = $this->view->url(['controller'=>'premier-chapitre', + 'action' => 'notice', + 'ean' => $model->getId()], null ,true); + $onclick .= sprintf("\$('#pc_lienNotice')[0].href='%s';", $url); + } return $this->_tag('a', $this->_vignetteImg($model), ['onclick' => $onclick, @@ -87,10 +91,12 @@ class ZendAfi_View_Helper_PremierChapitre_Vignettes protected function _vignetteNotice($model, $preferences){ - $lnk_attribs = ['href' => '/premier-chapitre/notice/ean/' . $model->getId()]; + $lnk_attribs = $this->view->url(['controller' => 'premier-chapitre', + 'action' => 'notice', + 'ean' => $model->getId()], null, true); return $this->_tag('a', $this->_vignetteImg($model), - $lnk_attribs); + ['href' => $lnk_attribs]); } diff --git a/library/startup.php b/library/startup.php index 99b4701c1aa819714ece9f12e744728ef1641d09..bddb56e35f7e54f93838e835ce859960491819f7 100644 --- a/library/startup.php +++ b/library/startup.php @@ -65,7 +65,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.5'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.9'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.10'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');