Commit da546c47 authored by Ghislain Loas's avatar Ghislain Loas

Merge branch 'hotline' into 'master'

Hotline

See merge request !3502
parents 1358ec47 1c7f1faf
Pipeline #10092 passed with stage
in 45 minutes and 48 seconds
13/05/2020 - v8.0.57 - v8.0.58
- ticket #105706 : Magasin de thèmes : correction des forumlaires dans IOS
- ticket #108607 : Magasin de thèmes : automatisation de la mise à jour des thèmes lors d'ume mise à jour.
11/05/2020 - v8.0.56
- ticket #108948 : Magasin de thèmes : correction de l'affichage des horaires
- ticket #109177 : Magasin de thèmes : correction des liens SSO pour les ressources numériques
- ticket #109495 : SIGB Koha : correctif sur connecteur à l'API communautaire
- ticket #108763 : SIGB Pergame : Les prêts compte lecteur ne s'affichaient plus
28/04/2020 - v8.0.55
- Magasin de thèmes : correction de l'ordre de chargement des fichiers CSS.
27/04/2020 - v8.0.54
- ticket #104297 : Ressources numériques : ToutApprendre : possibilité de lien (pkGroup) pointant sur des catégories spécifiques de ToutApprendre
......
......@@ -321,6 +321,7 @@ class Admin_ProfilController extends ZendAfi_Controller_Action {
}
$enreg = $this->_updateBannerWidgets($profil, $enreg);
$enreg = $this->_updateFooterWidgets($profil, $enreg);
if($profil->setCfgAccueil($enreg)->save()) {
$this->_helper->notify($this->view->_('Page ' . $profil->getLibelle() . ' sauvegardée'));
......@@ -345,6 +346,19 @@ class Admin_ProfilController extends ZendAfi_Controller_Action {
}
protected function _updateFooterWidgets($profil, $enreg) {
if(!$parent_profil = $profil->getParentProfil())
return $this->_injectDefaultsBannerWidgets($profil, $enreg);
$temp_profil = (new Class_Profil())->setCfgAccueil($enreg);
$parent_profil
->setFooterBoxes($temp_profil->getFooterBoxes())
->save();
return $enreg;
}
protected function _injectDefaultsBannerWidgets($profil, $enreg) {
$required_widgets = $this->getSearchAndLoginWidget($profil->getBoitesDivision(Class_Profil::DIV_BANNIERE));
foreach( $required_widgets as $id => $module) {
......
......@@ -586,9 +586,21 @@ class NoticeAjaxController extends ZendAfi_Controller_Action {
->setModel($this->notice)
->collection();
$html = [$this->view->renderTracks($tracks),
$this->view->renderPictures($pictures),
$this->view->renderTrailers($trailers)];
$viewer = ($viewer = (new Class_Notice_Numel($this->notice))->getViewer())
? $viewer
: (new Class_Notice_Gallica($this->notice))->getViewer();
$html = [];
if ($viewer)
$html = [$viewer->renderOn($this->view)];
$html = array_merge($html,
[$this->view->renderAlbum($this->notice->getAlbum()),
$this->view->recordAlbums($this->notice),
$this->view->renderTracks($tracks),
$this->view->renderPictures($pictures),
$this->view->renderTrailers($trailers)]);
$html = array_filter($html);
......
<?php
$basePath = dirname(realpath(__FILE__));
require_once 'classes/classe_cosmopaths.php';
$cosmo_path = new CosmoPaths();
define('BASE_URL', $cosmo_path->getBaseUrl());
require_once($basePath.'/../storm_init.php');
(new Class_Migration_ScriptPatchs())->runFrom(262);
(new Class_Migration_ScriptPatchs())->runFrom(262);
(new Class_Template_Update)->run();
?>
\ No newline at end of file
......@@ -613,15 +613,21 @@ class Class_Profil extends Storm_Model_Abstract {
return Class_Url::absolute('');
}
protected function isModulePreferencesSharedBetweenProfils($module, $type_module) {
protected function _isModulePreferencesSharedBetweenProfils($module, $type_module) {
if (isset($module['parent_id']))
return false;
return '';
return (
(isset($module['division']) && ($module['division'] == self::DIV_BANNIERE))
||
(!isset($module['division']) && ($this->isTypeBoiteInBanniere($type_module)))
);
if (isset($module['division']) && ($module['division'] == self::DIV_BANNIERE))
return self::DIV_BANNIERE;
if (isset($module['division']) && ($module['division'] == self::DIV_FOOTER))
return self::DIV_FOOTER;
if (!isset($module['division']) && ($this->isTypeBoiteInBanniere($type_module)))
return self::DIV_BANNIERE;
return '';
}
......@@ -637,8 +643,8 @@ class Class_Profil extends Storm_Model_Abstract {
$cfg_accueil['modules'][$id_module] :
['preferences' => []];
if ($this->isModulePreferencesSharedBetweenProfils($module, $type_module))
return $this->getModuleAccueilPreferencesByType($type_module, self::DIV_BANNIERE, $id_module);
if ($division_shared = $this->_isModulePreferencesSharedBetweenProfils($module, $type_module))
return $this->getModuleAccueilPreferencesByType($type_module, $division_shared, $id_module);
$preferences = [];
if (array_isset('preferences', $module))
......@@ -678,6 +684,15 @@ class Class_Profil extends Storm_Model_Abstract {
return $this;
}
if (isset($module_config['division'])
&& (self::DIV_FOOTER == $module_config['division'])
&& $this->hasParentProfil()) {
$this->getParentProfil()
->updateModuleConfigAccueil($id_module, $module_config)
->save();
return $this;
}
$cfg_accueil = $this->getCfgAccueilAsArray();
$cfg_accueil['modules'][$id_module] = $module_config;
$this->setCfgAccueil($cfg_accueil);
......@@ -755,8 +770,8 @@ class Class_Profil extends Storm_Model_Abstract {
: ['type_module' => $type_module,
'preferences' => Class_Systeme_ModulesAccueil::getInstance()->getValeursParDefaut($type_module)];
if ($this->isModulePreferencesSharedBetweenProfils($module, $type_module))
return $this->getModuleAccueilConfigByType($type_module, self::DIV_BANNIERE);
if ($division_shared = $this->_isModulePreferencesSharedBetweenProfils($module, $type_module))
return $this->getModuleAccueilConfigByType($type_module, $division_shared);
if ($local_config = $this->getLocalModuleAccueilConfig($id_module))
return $local_config;
......@@ -778,6 +793,18 @@ class Class_Profil extends Storm_Model_Abstract {
}
public function getFooterBoxes() {
$cfg_accueil = $this->getCfgAccueilAsArray();
$_boxes = [];
foreach ($cfg_accueil['modules'] as $id => $module) {
if (isset($module['division']) && ($module['division'] == self::DIV_FOOTER))
$_boxes[$id] = $module;
}
return $_boxes;
}
public function setBannerBoxes($widgets) {
$cfg_accueil = $this->getCfgAccueilAsArray();
foreach ($cfg_accueil['modules'] as $id => $module) {
......@@ -793,15 +820,33 @@ class Class_Profil extends Storm_Model_Abstract {
}
public function setFooterBoxes($widgets) {
$cfg_accueil = $this->getCfgAccueilAsArray();
foreach ($cfg_accueil['modules'] as $id => $module) {
if ($module['division'] == self::DIV_FOOTER)
unset($cfg_accueil['modules'][$id]);
}
foreach($widgets as $id => $config)
$cfg_accueil['modules'][$id] = $config;
$this->setCfgAccueil($cfg_accueil);
return $this;
}
/** @return array */
public function getLocalModuleAccueilConfig($id_module) {
$cfg_accueil = $this->getCfgAccueilAsArray();
$banner_boxes = [];
if ($this->hasParentProfil())
$footer_boxes = [];
if ($this->hasParentProfil()) {
$banner_boxes = $this->getParentProfil()->getBannerBoxes();
$footer_boxes = $this->getParentProfil()->getFooterBoxes();
}
$modules_config = $cfg_accueil['modules'] + $banner_boxes;
$modules_config = $cfg_accueil['modules'] + $banner_boxes + $footer_boxes;
$module = ['type_module' => null,
'preferences' => [],
......@@ -1570,9 +1615,15 @@ class Class_Profil extends Storm_Model_Abstract {
public function hasBoiteInDivision($division, $type_module) {
$cfg_accueil = null;
if ($division == self::DIV_BANNIERE and $this->hasParentProfil())
$cfg_accueil = $this->getParentProfil()->getCfgAccueilAsArray();
else
if ($division == self::DIV_FOOTER and $this->hasParentProfil())
$cfg_accueil = $this->getParentProfil()->getCfgAccueilAsArray();
if (!$cfg_accueil)
$cfg_accueil = $this->getCfgAccueilAsArray();
$boites = $this->_filterCfgAccueilByDivision($cfg_accueil, $division);
......@@ -1592,6 +1643,9 @@ class Class_Profil extends Storm_Model_Abstract {
if ($division == self::DIV_BANNIERE and $this->hasParentProfil())
return $this->getParentProfil()->getBoitesDivision($division);
if ($division == self::DIV_FOOTER and $this->hasParentProfil())
return $this->getParentProfil()->getBoitesDivision($division);
if ($division == '5' && Class_AdminVar::isBoitePanierAutoEnabled())
$this->setBoitePanierInDivisionFive();
......@@ -1964,10 +2018,15 @@ class Class_Profil extends Storm_Model_Abstract {
if(!$this->hasParentProfil())
return;
if(!$parent_banner_modules = $this->getParentProfil()->getBoitesDivision(self::DIV_BANNIERE))
$parent_modules = $this->getParentProfil()->getBoitesDivision(self::DIV_BANNIERE)
+ $this->getParentProfil()->getBoitesDivision(self::DIV_FOOTER);
$parent_modules = array_filter($parent_modules);
if (!$parent_modules)
return;
if(!$ids_used_by_parent_profil = array_keys($parent_banner_modules))
if(!$ids_used_by_parent_profil = array_keys($parent_modules))
return;
return $this->doNotUseIds($ids_used_by_parent_profil);
......
......@@ -629,8 +629,13 @@ class Class_ScriptLoader {
* @return String
*/
public function styleSheetsHTML() {
return implode('', $this->styleSheetsArray());
}
public function styleSheetsArray() {
$this->_deferredLoadAmber();
return implode('',array_unique($this->_css_lines));
return array_unique($this->_css_lines);
}
......@@ -647,11 +652,16 @@ class Class_ScriptLoader {
* @return String
*/
public function javaScriptsHTML() {
return implode('', $this->javaScriptsArray());
}
public function javaScriptsArray() {
$this
->_deferredLoadAmber()
->_injectJQueryReadyScripts();
return implode('',array_unique($this->_script_lines));
return array_unique($this->_script_lines);
}
......
......@@ -104,4 +104,9 @@ class Class_Systeme_Widget_Section extends Class_Systeme_Widget_Abstract {
public function isMain() {
return $this->getResourcesDefinition()->isMain();
}
public function isShared() {
return false;
}
}
\ No newline at end of file
......@@ -30,4 +30,9 @@ class Class_Systeme_Widget_Section_Footer extends Class_Systeme_Widget_Section {
public function getResourcesDefinition() {
return new Class_Systeme_ModulesAccueil_Section_Footer;
}
public function isShared() {
return true;
}
}
\ No newline at end of file
......@@ -30,4 +30,9 @@ class Class_Systeme_Widget_Section_Header extends Class_Systeme_Widget_Section {
public function getResourcesDefinition() {
return new Class_Systeme_ModulesAccueil_Section_Header;
}
public function isShared() {
return true;
}
}
\ No newline at end of file
......@@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Template_Settings extends Storm_Model_Abstract {
protected
......
<?php
/**
* Copyright (c) 2012-2020, 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 Class_Template_Update {
use Trait_EchoError;
public function run() {
$this->echoError("\nMise à jour des thèmes du magasin.\n");
$templates = (new Class_Template_Loader)->getTemplates();
array_walk($templates,
function($template)
{
$template->updateSettings();
$this->echoError(sprintf("Mise à jour du thème %s\n", $template->getId()));
});
$this->echoError("Mise à jour des thèmes du magasin terminée.\n");
}
}
......@@ -1945,6 +1945,9 @@ class Class_Users extends Storm_Model_Abstract {
public function updateFromPatron() {
if (! $this->getSIGBComm() || !$this->getSIGBComm()->providesAuthentication())
return $this;
if (!$borrower = $this->getEmprunteur())
return $this;
......
......@@ -58,6 +58,12 @@ class Class_WebService_SIGB_Koha_CommunityService
}
protected function _getAuthForEmprunteur($emprunteur) {
return [$emprunteur->getLogin(),
$emprunteur->getPreviousPassword()];
}
public function providesChangePasswordService() {
return true;
}
......@@ -69,21 +75,20 @@ class Class_WebService_SIGB_Koha_CommunityService
$password = $emprunteur->getPassword();
$datas = ['password' => $password,
'password_2' => $password];
$auth_token = md5($emprunteur->getLogin().
":".$emprunteur->getPreviousPassword());
$auth = $this->_getAuthForEmprunteur($emprunteur);
$response = $this->getWebClient()
->postRawDataResponse($url,
json_encode($datas),
Zend_Http_Client::ENC_URLENCODED,
['headers' =>
['Authorization' => 'Basic '.$auth_token ]]);
json_encode($datas),
Zend_Http_Client::ENC_URLENCODED,
['auth' => $auth]);
if ($response->isError())
throw new Class_WebService_Exception($this->_('Erreur de mise à jour du mot de passe : %s', $response->getMessage()));
if ($response->isSuccessful()
&& '' == ($body = $response->getRawBody()))
&& '""' == ($body = $response->getRawBody()))
return $emprunteur;
if (null === ($json = json_decode($body,TRUE)))
......
......@@ -93,6 +93,9 @@ class Class_WebService_SimpleWebClient {
if (isset($options['headers']))
$httpClient->setHeaders($options['headers']);
if (isset($options['auth']))
$httpClient->setAuth($options['auth']['user'], $options['auth']['password']);
return $httpClient->request();
}
......
......@@ -109,7 +109,6 @@ class ZendAfi_Form_Configuration_Widget_Search
['label' => $this->_('Mode de sélection des domaines'),
'multiOptions' => $simple_search->getSelectionModeOptions(),
'value' => $simple_search->getSelectionModeDefault()]);
}
......
......@@ -25,6 +25,6 @@ class ZendAfi_Form_Decorator_Custom extends Zend_Form_Decorator_HtmlTag {
public function render($content) {
$view = $this->_element->getView();
$render = $this->_element->getAttrib('render');
return parent::render($render());
return parent::render($render($view));
}
}
\ No newline at end of file
......@@ -22,6 +22,9 @@
class ZendAfi_View_Helper_Div extends ZendAfi_View_Helper_BaseHelper {
public function div($attributes = [], $content = '') {
if ( null === $content)
$content = '';
return $this->_tag('div',
$content,
$attributes);
......
......@@ -226,6 +226,10 @@ class ZendAfi_View_Helper_FonctionsAdmin extends ZendAfi_View_Helper_BaseHelper
&& ($parent = Class_Profil::getCurrentProfil()->getParentProfil()))
$id_profil = $parent->getId();
if(Class_Profil::DIV_FOOTER == $this->division
&& ($parent = Class_Profil::getCurrentProfil()->getParentProfil()))
$id_profil = $parent->getId();
return $id_profil;
}
}
\ No newline at end of file
......@@ -81,7 +81,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.54');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.58');
defineConstant('BOKEH_REMOTE_FILES', 'https://git.afi-sa.net/afi/opacce/');
......
......@@ -88,6 +88,7 @@ div:hover > .img_as_background {
i:first-child,
.widget.rech_simple .dropdown-menu i:first-child,
.widget.rech_simple .criteres_recherche i:first-child,
.card-link + .card-link,
.badge,
p > i {
......@@ -245,6 +246,23 @@ pre {
background: none !important;
}
.transparent_background .breadcrumb,
.transparent_background {
background: var(--front-transparent-background) !important;
}
.limit_badges_10 .badge-group .badge:nth-child(n + 11) {
display: none;
}
.limit_badges_5 .badge-group .badge:nth-child(n + 6) {
display: none;
}
.limit_badges_3 .badge-group .badge:nth-child(n + 4) {
display: none;
}
.no_border,
.no_border * {
border: 0px solid rgba(0,0,0,0) !important;
......@@ -429,7 +447,7 @@ label[data-name=note] ~ div label.multi-element-label + br {
padding: 5%;
top: 0;
left: 0;
background-color: var(--front-background-modale);
background-color: var(--front-background-modale) !important;
z-index: 20;
text-align: center;
flex: 100%;
......@@ -437,8 +455,10 @@ label[data-name=note] ~ div label.multi-element-label + br {
max-height: 100%;
}
.modal_image img {
width: auto !important;
.modal_image * {
width: 100% !important;
height: 100% !important;
object-fit: contain;
}
.blockquote-footer {
......@@ -783,16 +803,10 @@ input[id^="select_record"] + * {
min-width: 1px;
}
.only_visible_in_viewnotice {
display: none;
.z_index_11 {
z-index: 11;
}
.recherche_viewnotice .only_visible_in_viewnotice {
display: block;
.menu_buttons .button_text {
display: none !important;
}
.badge.only_visible_in_viewnotice .text-truncate {
width: auto;
max-width: none;
white-space: normal;
}
\ No newline at end of file
......@@ -83,7 +83,7 @@ class Intonation_Library_FormCustomizer {
protected function _getStrategyFor($form) {
$strategies = ['ZendAfi_Form_Configuration_Widget_Login' => 'FormStyle',
'ZendAfi_Form_Configuration_Widget_Search' => 'FormStyle'];
'Intonation_Library_Widget_Search_Form' => 'FormStyle'];
if (!in_array(get_class($form), array_keys($strategies)))
return false;
......
......@@ -55,6 +55,29 @@ class Intonation_Library_FormCustomizer_Abstract {
['label' => $this->_('Classe CSS personnalisée'),
'separator' => ' ',
'multiOptions' => $css]]);
$this->_form
->addElement('custom',
'classes_documentation',
['render' => function($view)
{
$html =
$view->tagAnchor('http://wiki.bokeh-library-portal.org/index.php?title=Classes_CSS',
Class_Admin_Skin::current()->renderActionIconOn('help', $view),
['class' => 'ardans_help',
'style' => 'margin-left: 5px',
'title' => $this->_('Consulter la documentation sur les classes dans le Wiki Bokeh'),
'target' => '_blank']);
return $view->tag('script',
sprintf('$(function() {$("[data-name*=%s]").append("%s");});',
'boite',
str_replace('"', "'", $html)));
}]);
$this->_form
->addToStyleGroup(['boite',
'classes_documentation']);
return $this;
}
......@@ -327,7 +350,7 @@ class Intonation_Library_FormCustomizer_Abstract {
->addToDisplayGroup(array_map(function($element)
{
return $this->_template->withNameSpace($element);
},$elements),
}, $elements),
$this->_template->withNameSpace('group'));
return $this;
}
......@@ -336,7 +359,7 @@ class Intonation_Library_FormCustomizer_Abstract {
->addDisplayGroup(array_map(function($element)
{
return $this->_template->withNameSpace($element);
},$elements),
}, $elements),
$this->_template->withNameSpace('group'),
['legend' => $this->_('Thème'),
'order' => static::FIRST]);
......
......@@ -82,7 +82,24 @@ class Intonation_Library_FormCustomizer_Template extends Intonation_Library_Form
'fields' => [['name' => $this->_template->withNameSpace('custom_css_class'),
'label' => $this->_('classe')]],
'values' => [$this->_template->withNameSpace('custom_css_class') => $this->_template->getCustomCssClass()],
'deleteMessage' => $this->_('cette classe')]);
'deleteMessage' => $this->_('cette classe')])
->addElement('custom',
$this->_template->withNameSpace('classes_documentation'),
['render' => function($view)
{
$html =
$view->tagAnchor('http://wiki.bokeh-library-portal.org/index.php?title=Classes_CSS',
Class_Admin_Skin::current()->renderActionIconOn('help', $view),
['class' => 'ardans_help',
'style' => 'margin-left: 5px',
'title' => $this->_('Consulter la documentation sur les classes dans le Wiki Bokeh'),
'target' => '_blank']);
return $view->tag('script',
sprintf('$(function() {$("[for*=%s]").append("%s");});',
$this->_template->withNameSpace('custom_css_classes'),
str_replace('"', "'", $html)));
}]);
$this
->_addToTemplateGroup(['core_css',
......@@ -97,6 +114,7 @@ class Intonation_Library_FormCustomizer_Template extends Intonation_Library_Form
'custom_css',
'custom_js',
'nb_cols',
'classes_documentation',
'custom_css_classes'])
->_addHydratingMappingGroupTo()
->_addResponsiveGroupTo()
......
......@@ -38,6 +38,7 @@ class Intonation_Library_FormCustomizer_Widget_Default extends Intonation_Librar
$this->_template->withNameSpace('show_footer'),
['label' => $this->_('Afficher le pied'),
'value' => 1]);
$this->_addCustomElement();
$this->_addToTemplateGroup($this->_getDefaultElementsNames());
......
......@@ -54,9 +54,16 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'z_index_2',
'z_index_3',