Commit b1a8507c authored by Ghislain Loas's avatar Ghislain Loas
Browse files

version 7.11.20

Merge remote-tracking branch 'refs/remotes/origin/stable' into origin-hotline-master

Conflicts:
	VERSIONS
	library/startup.php
parents e0a414e8 0aed8c2f
12/02/2018 - v7.11.20
- ticket #70867 : Ressources numériques Dilicom : amélioration des boutons d'emprunt ou de consultation d'un document PNB.
- ticket #70772 : Administration : correction du formulaire de modification des "adminVar".
- ticket #67188 : Administration : les bibliothèques sont triées par nom dans le sélecteur de catégorie du formulaire de modification des articles.
30/01/2018 - v7.11.19
- ticket #56107 : Articles : ajout d'un plugin à l'éditeur des articles pour insérer un kiosque de notices
......@@ -13,7 +22,6 @@
- ticket #69594 : Articles : correction de l'affichage des listes d'articles.
24/01/2018 - v7.11.18
- ticket #70308 : Administration : correction de l'enregistrement des boîtes.
......
......@@ -77,8 +77,16 @@ class Admin_IndexController extends ZendAfi_Controller_Action {
public function adminvareditAction() {
$id = $this->_getParam('cle');
$var = Class_AdminVar::find($id);
if(!$id = $this->_getParam('cle')) {
$this->_helper->notify($this->_('Veuillez renseigner le paramètre "cle".'));
return $this->_redirectClose($this->_getReferer());
}
if(!$var = Class_AdminVar::find($id)) {
$this->_helper->notify($this->_('La clé "%s" n\'existe pas.', $id));
return $this->_redirectClose($this->_getReferer());
}
$form = $var->getForm();
$form->setAction($this->getUrlWithHttpsIfNeeded($id));
$form->setAttrib('data-backurl',
......
......@@ -6,11 +6,11 @@ $skin = Class_Admin_Skin::current();
echo $skin->renderMenuIconOn('tag', $this,
['style' => 'vertical-align:middle'])
. ' '
. $this->_('Nouvelle version');
. $this->_('Journée communautaire Bokeh 2018');
$button = (new Class_Entity())->setText($this->_('Découvrir les nouveautés de la version 7.10'))
$button = (new Class_Entity())->setText($this->_('Jeudi 15 mars'))
->setAttribs(['id' => 'learn_more',
'onclick' => 'window.open(\'http://wiki.bokeh-library-portal.org/index.php?title=7.10.0\'); return false']);
'onclick' => 'window.open(\'http://bokeh-library-portal.org/journee_bokeh_2018\'); return false']);
echo $this->Button($button);
?>
</h2>
......
......@@ -286,8 +286,8 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
if($this->_userShouldBeRedirect())
return;
return $this->renderPopupResult($this->_('Emprunter le livre au format EPUB'),
$this->view->render('bib-numerique/loan-book.phtml'));
$this->view->titre = $this->_('Emprunter le livre au format EPUB');
$this->renderScript('bib-numerique/loan-book.phtml');
}
......@@ -295,8 +295,8 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
if($this->_userShouldBeRedirect())
return;
return $this->renderPopupResult($this->_('Consulter le livre en ligne'),
$this->view->render('bib-numerique/consult-book.phtml'));
$this->view->titre = $this->_('Consulter le livre en ligne');
$this->renderScript('bib-numerique/consult-book.phtml');
}
......
<?php
echo '<div class="popup-content">';
echo $this->tag('p', $this->_('Êtes vous sûr de vouloir consulter ce document ?'));
echo $this->tagAnchor($this->url(['action' => 'consult-book-open-ajax']), $this->_('oui'), ['data-popup' => 'true',
'class' => 'button blue']);
echo $this->tagAnchor('', $this->_('non'), ['onclick' => 'opacDialogClose();return false',
'class' => 'button red']);
echo '</div>';
?>
$html = [$this->tag('p', $this->_('Êtes vous sûr de vouloir consulter ce document ?')),
$this->button((new Class_Entity())
->setUrl($this->url(['action' => 'consult-book-open-ajax']))
->setText($this->_('Oui'))
->setAttribs(['data-popup' => 'true',
'class' => 'bouton validate'])),
$this->Button_Back((new Class_Entity())
->setUrl($this->url(['controller' => 'recherche',
'action' => 'viewnotice']))
->setAttribs(['title' => $this->_('Non je ne veux pas')])
->setText($this->_('Non')))];
echo $this->tag('div', implode($html), ['class' => 'popup-content']);
<?php
echo '<div class="popup-content">';
echo $this->tag('p', $this->_('Êtes vous sûr de vouloir emprunter ce document ?'));
echo $this->tagAnchor($this->url(['action' => 'download-loan-book-ajax']), $this->_('oui'), ['data-popup' => 'true',
'class' => 'button blue']);
echo $this->tagAnchor('', $this->_('non'), ['onclick' => 'opacDialogClose();return false',
'class' => 'button red']);
echo $this->tag('p', Class_AdminVar::getValueOrDefault('DILICOM_PNB_LOAN_WARNING_MESSAGE'));
echo '</div>';
?>
$html = [$this->tag('p', $this->_('Êtes vous sûr de vouloir emprunter ce document ?')),
$this->button((new Class_Entity())
->setUrl($this->url(['action' => 'download-loan-book-ajax']))
->setText($this->_('Oui'))
->setAttribs(['data-popup' => 'true',
'class' => 'bouton validate'])),
$this->Button_Back((new Class_Entity())
->setUrl($this->url(['controller' => 'recherche',
'action' => 'viewnotice']))
->setAttribs(['title' => $this->_('Non je ne veux pas')])
->setText($this->_('Non'))),
$this->tag('p', Class_AdminVar::getValueOrDefault('DILICOM_PNB_LOAN_WARNING_MESSAGE'))];
echo $this->tag('div', implode($html), ['class' => 'popup-content']);
<?php $profil = Class_Profil::getCurrentProfil();?>
<div class="footer" style="overflow:hidden;clear:both;width:<?php echo $profil->getWidthSite() ?>">
<table style="boder-spacing:0; border-collapse:collapse; width:100%">
<table style="border-spacing:0; border-collapse:collapse; width:100%">
<tr>
<td style="padding-left:15px;">
<?php
......
......@@ -121,8 +121,14 @@ class Class_AdminVar_Meta {
if (!$validator_class = $this->getAttribute('validate', null))
return;
$validate = new $validator_class($var->getPreviousValue());
if ($validate->isValid($var->getValeur()))
$previous_value = $var->getPreviousValue();
$new_value = $var->getValeur();
if($previous_value == $new_value)
return;
$validate = new $validator_class($previous_value);
if ($validate->isValid($new_value))
return;
array_map([$var, 'addError'], $validate->getMessages());
......
......@@ -34,7 +34,7 @@ class BibLoader extends Storm_Model_Loader {
protected $_portail;
public function findAllWithPortail() {
$all_bibs = Class_Bib::getLoader()->findAll();
$all_bibs = Class_Bib::findAllBy(['order' => 'libelle']);
array_unshift($all_bibs, $this->getPortail());
return $all_bibs;
}
......
......@@ -51,6 +51,4 @@ class ZendAfi_Validate_Dilicom_IpAdresses extends Zend_Validate_Abstract{
}
return true;
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -28,8 +28,8 @@ class ZendAfi_View_Helper_Admin_Button_Back extends ZendAfi_View_Helper_Button_B
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setImage($this->view->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons',
'back')));
......
......@@ -30,8 +30,8 @@ class ZendAfi_View_Helper_Admin_Button_Cancel extends ZendAfi_View_Helper_Button
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setImage($this->view->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons',
'remove')))
......
......@@ -30,8 +30,8 @@ class ZendAfi_View_Helper_Admin_Button_Continue extends ZendAfi_View_Helper_Butt
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setImage($this->view->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons',
'validate')))
......
......@@ -28,10 +28,10 @@ class ZendAfi_View_Helper_Admin_Button_New extends ZendAfi_View_Helper_Button_Ne
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setImage($this->view->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons',
'add')));
'add')));
}
}
\ No newline at end of file
......@@ -30,8 +30,8 @@ class ZendAfi_View_Helper_Admin_Button_Submit extends ZendAfi_View_Helper_Button
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setImage($this->view->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons',
'validate')))
......
......@@ -93,7 +93,7 @@ class ZendAfi_View_Helper_Bouton extends ZendAfi_View_Helper_BaseHelper {
$html[]= ' onmouseup="javascript:PicToolbarOver( this, \'' . $rootName . '\')"';
$html[]= ' onclick="'.$onclick.'">';
$html[]= '<a href="#">';
$html[]= '<table style="boder-spacing:0px; border-collapse:collapse; '.$align.'" >';
$html[]= '<table style="border-spacing:0px; border-collapse:collapse; '.$align.'" >';
$html[]= '<tr>';
$html[]= '<td>';
$html[]= '<img id="' . $rootName . '_gauche" src="' . URL_ADMIN_IMG . '/bouton/bouton_gauche.gif" style="border:0" alt="" />';
......
......@@ -20,32 +20,27 @@
*/
class ZendAfi_View_Helper_Button_Back extends ZendAfi_View_Helper_BaseHelper {
class ZendAfi_View_Helper_Button_Back extends ZendAfi_View_Helper_Button_Helper {
public function Button_Back($settings = null) {
$button = $this->_getDefaultButton($this->_getDefaultAttribs());
if($settings)
$button->updateAttributes($settings->toArray());
return $this->view->button($button);
return $this->render($settings);
}
protected function _getDefaultAttribs() {
$attribs = ['class' => 'bouton back'];
$defaults_attribs = ['class' => 'bouton back'];
if($this->view->isPopup())
$attribs['onclick'] = 'opacDialogClose();';
$defaults_attribs['onclick'] = 'opacDialogClose();';
return $attribs;
return $defaults_attribs;
}
protected function _getDefaultButton($attribs) {
protected function _getDefaultButton() {
return (new Class_Entity())
->setUrl($this->view->url(['action' => 'index',
'render' => null]))
->setAttribs($attribs)
->setAttribs($this->_getDefaultAttribs())
->setText($this->view->isPopup() ? $this->_('Fermer') : $this->_('Retour'))
->setOnFormChange(sprintf('$("button.back").attr("onclick", "if(confirm(\'%s\')) { eval($(this).attr(\'data-script\')); }");',
$this->_('Le formulaire a été modifié. Etes vous sûr de vouloir partir ?')));
......
......@@ -20,15 +20,10 @@
*/
class ZendAfi_View_Helper_Button_Cancel extends ZendAfi_View_Helper_BaseHelper {
class ZendAfi_View_Helper_Button_Cancel extends ZendAfi_View_Helper_Button_Helper {
public function Button_Cancel($settings = null) {
$button = $this->_getDefaultButton($this->_getDefaultAttribs());
if($settings)
$button->updateAttributes($settings->toArray());
return $this->view->button($button);
return $this->render($settings);
}
......@@ -43,10 +38,10 @@ class ZendAfi_View_Helper_Button_Cancel extends ZendAfi_View_Helper_BaseHelper {
}
protected function _getDefaultButton($attribs) {
protected function _getDefaultButton() {
return (new Class_Entity())
->setText($this->_('Annuler'))
->setAttribs($attribs)
->setAttribs($this->_getDefaultAttribs())
->setUrl($this->view->url(['render' => null]));
}
}
\ No newline at end of file
......@@ -22,17 +22,12 @@
class ZendAfi_View_Helper_Button_Continue extends ZendAfi_View_Helper_Button_Submit {
public function Button_Continue($settings = null) {
$button = $this->_getDefaultButton($this->_getDefaultAttribs());
if($settings)
$button->updateAttributes($settings->toArray());
return $this->view->button($button);
return $this->render($settings);
}
protected function _getDefaultButton($attribs) {
return parent::_getDefaultButton($attribs)
protected function _getDefaultButton() {
return parent::_getDefaultButton()
->setText($this->_('Valider et continuer'));
}
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Button_Helper extends ZendAfi_View_Helper_BaseHelper {
public function render($settings) {
$button = $this->_getDefaultButton();
if(!$settings)
return $this->view->button($button);
if(!$settings->getAttribs()) {
$button->updateAttributes($settings->toArray());
return $this->view->button($button);
}
$settings->setAttribs(array_merge($button->getAttribs(),
$settings->getAttribs()));
$button->updateAttributes($settings->toArray());
return $this->view->button($button);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment