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

Merge branch 'dev#99489_magasin_de_themes_bases_sur_bootstrap' into 'master'

Dev#99489 magasin de themes bases sur bootstrap

See merge request !3395
parents 010de29b 2c6df4a8
Pipeline #9406 failed with stage
in 40 minutes and 55 seconds
......@@ -541,12 +541,10 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
public function applyToAction() {
$module = new Class_Profil_ModuleDefinition($this->_getParam('type_module'),
$this->_getParam('action1'),
$this->_getParam('action2'));
$module = $this->_getProfileModuleDefinition();
$this->view->titre = $this->_('Étendre le paramétrage');
$this->view->form = $form = $module->getApplyToForm($this->view->url);
$this->view->form = $form = $module->getApplyToForm($this->view->url());
if ($this->_request->isPost()
&& $form->isValid($this->_request->getPost())) {
......@@ -556,4 +554,17 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
$this->render->renderScript('modules/_retour.phtml');
}
}
protected function _getProfileModuleDefinition() {
if (!$id = $this->_getParam('id'))
return new Class_Profil_ModuleDefinition($this->_getParam('type_module'),
$this->_getParam('action1'),
$this->_getParam('action2'));
$id = explode('_', $id);
return new Class_Profil_ModuleDefinition((isset($id[0]) ? $id[0] : ''),
(isset($id[1]) ? $id[1] : ''),
(isset($id[2]) ? $id[2] : ''));
}
}
\ No newline at end of file
......@@ -243,6 +243,12 @@ class Class_Calendar {
}
public function setSize($size) {
$this->preferences['size'] = $size;
return $this;
}
public function getAdminSelectedCategories() {
if (isset($this->admin_selected_categories))
return $this->admin_selected_categories;
......
<?php
/**
* Copyright (c) 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 Class_Systeme_ModulesAccueil_Action_AdvancedSearch extends Class_Systeme_ModulesAccueil_Action {
public function __construct() {
parent::__construct();
$this->_form = 'ZendAfi_Form_Configuration_Widget_Action_AdvancedSearch';
}
}
\ No newline at end of file
<?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 Class_Systeme_Widget_Action_AdvancedSearch extends Class_Systeme_Widget_Action {
public function getResourcesDefinition() {
return new Class_Systeme_ModulesAccueil_Action_AdvancedSearch;
}
public function _getTitle() {
return $this->_('Configuration de la page de recherche avancée');
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@
class Class_Systeme_Widget_ActionLoader {
public function find($id) {
$actions = $this->_getActions();
if (!isset($actions[$id]))
return (new Class_Systeme_Widget_Action)->setId($id);
......@@ -36,6 +37,7 @@ class Class_Systeme_Widget_ActionLoader {
$actions = ['recherche_resultat_simple' => 'Class_Systeme_Widget_Action_SearchResult',
'recherche_viewnotice' => 'Class_Systeme_Widget_Action_Record',
'recherche_avancee' => 'Class_Systeme_Widget_Action_AdvancedSearch',
'abonne_fiche' => 'Class_Systeme_Widget_Action_User',
'author_view' => 'Class_Systeme_Widget_Action_Author',
'bib_en-lire-plus' => 'Class_Systeme_Widget_Action_Library'];
......
......@@ -27,9 +27,10 @@ class Class_Template_Loader {
public function getTemplates() {
return [new Historic_Template,
new Intonation_Template,
new Muscle_Template,
new MyBibApp_Template,
new Polygone_Template,
new TerreDuMilieu_Template,
new Muscle_Template
];
}
......
......@@ -66,8 +66,7 @@ class ZendAfi_Controller_Plugin_DefineURLs extends Zend_Controller_Plugin_Abstra
}
$detector = new ZendAfi_Controller_Plugin_DefineURLs_ProfileDetector();
Class_Profil::setCurrentProfil($detector->detectFrom($request));
$profil = Class_Profil::getCurrentProfil();
$profil = Class_Profil::setCurrentProfil($detector->detectFrom($request));
Class_Template::setCurrentFrom($request->getParam('id_profil', $request->getParam('profile_id', $profil->getId())));
......@@ -241,7 +240,7 @@ class ZendAfi_Controller_Plugin_DefineURLs_ProfileDetector {
}
if ($request->getModuleName() !== ZendAfi_Controller_Plugin_DefineURLs::PHONE
&& ($profil = Class_Profil::find((int)$session->id_profil)))
&& ($profil = Class_Profil::find((int) $session->id_profil)))
return $profil;
if ($this->shouldSelectTelephone($request)
......
<?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_Form_Configuration_Widget_Action_AdvancedSearch extends ZendAfi_Form_Configuration_Widget_Action {
public function init() {
parent::init();
if (Class_AdminVar::isCustomSearchFormEnabled())
$this->addElement('sortableConnectLists',
'forms',
['label' => $this->_('Formulaires à afficher'),
'displayInline' => true,
'selectedLabel' => $this->_('Affichés'),
'availableLabel' => $this->_('Disponibles'),
'multiOptions' => Class_SearchForm::getMultiOptions()]);
}
public function initDisplayGroups() {
$this->addDisplayGroup(['forms'],
'custom_forms',
['Legend' => $this->_('Formulaires personnalisés')]);
parent::initDisplayGroups();
}
}
\ No newline at end of file
......@@ -21,6 +21,25 @@
class ZendAfi_Form_Configuration_Widget_Action_Record extends ZendAfi_Form_Configuration_Widget_Action_Tabs {
public function init() {
parent::init();
$this
->addElement('userfile',
Class_Notice_Xsl::KEY,
['label' => $this->_('Fichier XSL'),
'allowEmpty' => true,
'validators' => [(new Zend_Validate_Regex('/^.*\.xsl$/i'))
->setMessage($this->_('Le fichier doit être de type "xsl"'))]]);
}
public function initDisplayGroups() {
$this->addToDisplaySettingsGroup([Class_Notice_Xsl::KEY]);
parent::initDisplayGroups();
}
protected function _getRichContentInstance() {
return (new Intonation_Library_View_Wrapper_Record_RichContent)
->setView(new Class_Entity)
......
......@@ -41,7 +41,14 @@ class ZendAfi_Form_Configuration_Widget_Action_SearchResult extends ZendAfi_Form
->addElement('codeList',
'facettes_codes',
['label' => $this->_('Facettes à afficher'),
'field' => 'facettes']);
'field' => 'facettes'])
->addElement('userfile',
Class_Notice_Xsl::KEY,
['label' => $this->_('Fichier XSL'),
'allowEmpty' => true,
'validators' => [(new Zend_Validate_Regex('/^.*\.xsl$/i'))
->setMessage($this->_('Le fichier doit être de type "xsl"'))]]);
}
......@@ -51,7 +58,9 @@ class ZendAfi_Form_Configuration_Widget_Action_SearchResult extends ZendAfi_Form
'facettes_nombre',
'facettes_codes'],
'facettes',
['legend' => $this->_('Facettes')]);
['legend' => $this->_('Facettes')])
->addToDisplaySettingsGroup([Class_Notice_Xsl::KEY]);
parent::initDisplayGroups();
Class_Template::current()->customActionForm($this);
......
......@@ -417,6 +417,11 @@ label[data-name=note] ~ div label.multi-element-label + br {
font-size: 1.5em;
}
.jumbotron .nav-link div {
font-size: 11px;
max-width: 100px;
}
.modal_image {
position: fixed;
width: 100%;
......@@ -544,6 +549,11 @@ dl.row {
display: none !important;
}
.card-footer > a.card-link:first-child:last-child .button_text,
.card_action:first-child:last-child .button_text {
display: inline !important;
}
.dropdown-menu .button_text {
display: inline-block !important;
}
......@@ -669,11 +679,6 @@ dl.row {
color: var(--front-text);
}
.card-footer > a.card-link:first-child:last-child .button_text,
.card_action:first-child:last-child .button_text {
display: inline-block !important;
}
@media (min-width: 576px) {
.auto_col .card-columns {
-webkit-column-count: 2;
......@@ -729,4 +734,8 @@ dl.row {
.card-img-overlay .text-left {
text-align: center !important;
}
.menu_admin_front a[class*="deactivate"][style*="inline"] {
display: block !important;
}
\ No newline at end of file
(function ( $ ) {
$.fn.masonry = function () {
var html = $(this);
var all_items = initAllItems();
var allItems = $(html).find('.masonry-brick');
for(var i=0; i < allItems.length; i++) {
imagesLoaded( allItems[i], function(instance) {
var item = instance.elements[0];
resizeMasonryItem(item);
} );
}
var masonryEvents = ['load', 'resize'];
masonryEvents.forEach( function(event) {
var masonry_events = ['load', 'resize'];
masonry_events.forEach( function(event) {
window.addEventListener(event, resizeAllMasonryItems);
} );
});
function resizeMasonryItem(item){
var grid = html.get(0),
rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap')),
var resizeMasonryItem = function(item) {
var grid = html.find('.masonry')[0];
var rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap')),
rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'));
var rowSpan = Math.ceil((item.querySelector('.masonry-content').getBoundingClientRect().height+rowGap)/(rowHeight+rowGap));
var rowSpan = Math.ceil((item.querySelector('.masonry-content').getBoundingClientRect().height + rowGap)/(rowHeight + rowGap));
item.style.gridRowEnd = 'span '+rowSpan;
item.style.gridRowEnd = 'span ' + rowSpan;
item.style.visibility = 'visible';
}
function resizeAllMasonryItems(){
for(var i=0;i>allItems.length;i++){
var resizeAllMasonryItems = function() {
if ( ! allItems.length)
allItems = initAllItems();
for(var i=0; i > allItems.length; i++){
resizeMasonryItem(allItems[i]);
}
}
function initAllItems() {
var items = $(html).find('.masonry-brick').each(function() {
imagesLoaded( $(this), function(instance) {
var item = instance.elements[0];
resizeMasonryItem(item);
} );
});
}
};
} (jQuery));
......@@ -104,7 +104,7 @@ class Intonation_Library_Settings extends Intonation_System_Abstract {
'img class img-thumbnail' => '',
'dl' => 'row',
'dt' => 'col-12 col-sm-3',
'dd' => 'col-12 col-sm-9',
'dd' => 'col-12 col-sm-9 d-flex flex-wrap align-content-start',
'dt class user_info' => 'col-12 col-sm-6',
'dd class user_info' => 'col-12 col-sm-6',
'a' => 'text-secondary',
......
......@@ -170,11 +170,22 @@ class Intonation_Library_View_Wrapper_Hold extends Intonation_Library_View_Wrapp
if (!$this->_model->getNoticeOPAC())
return null;
$badges = [
((new Intonation_Library_Badge)
->setTag('span')
->setClass('secondary')
->setImage(Class_Template::current()->getIco($this->_view,
'library',
'library'))
->setText($this->_model->getBibliotheque())
->setTitle($this->_('Bibliothèque de l\'emprunt: %s', $this->_model->getBibliotheque())))
];
$wrapper = (new Intonation_Library_View_Wrapper_Record)
->setView($this->_view)
->setModel($this->_model->getNoticeOPAC());
return $wrapper->getBadges();
return $this->_view->renderBadges($badges) . $wrapper->getBadges();
}
......
......@@ -80,9 +80,13 @@ class Intonation_Library_View_Wrapper_Item extends Intonation_Library_View_Wrapp
? $this->_('Réserver un exemplaire du document: %s', $this->_model->getTitrePrincipal())
: $this->_('Réservation non disponible, l\'exemplaire est %s.', strtolower(strip_tags($secondary_title)));
$text = $hold_link
? $this->_('Réserver')
: $this->_('Non réservable');
return new Intonation_Library_Link(['Url' => $hold_link,
'Class' => $hold_link ? '' : 'text-black-50',
'Text' => $secondary_title,
'Text' => $text,
'Title' => $title,
'Popup' => true]);
}
......
......@@ -134,6 +134,15 @@ class Intonation_Library_View_Wrapper_Loan extends Intonation_Library_View_Wrapp
->setText($return_date)
->setTitle($this->_('Date de retour : %s', $return_date))),
((new Intonation_Library_Badge)
->setTag('span')
->setClass('secondary')
->setImage(Class_Template::current()->getIco($this->_view,
'library',
'library'))
->setText($this->_model->getBibliotheque())
->setTitle($this->_('Bibliothèque de l\'emprunt: %s', $this->_model->getBibliotheque()))),
((new Intonation_Library_Badge)
->setTag('span')
->setClass('info')
......
......@@ -78,8 +78,13 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
public function getDescription() {
return $this->getBadges()
. $this->_view->truncate($this->_model->getResume());
$xsl = (new Class_Notice_Xsl($this->_model, Class_Profil::getCurrentProfil()))
->beSearchResult();
return $xsl->isEnabled()
? $this->_view->Notice_Xsl($xsl)
: ($this->getBadges()
. $this->_view->truncate($this->_model->getResume()));
}
......@@ -199,6 +204,19 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
->setTitle($facet->getTitle())
->setUrl($facet->getUrlForLink()));
if ( $this->_model->hasTome()) {
$serie = $this->_model->getClefChapeau() . '-' . $this->_model->getTypeDoc();
$label = Class_Codification::getLibelleForSerie($this->_model);
$badges [] = (new Intonation_Library_Badge)
->setTag('a')
->setUrl($this->_view->url((new Class_CriteresRecherche)->getNewUrlCriteresSerie($serie), null, true))
->setClass('white')
->setText($label)
->setTitle($this->_view->_('Lancer une recherche pour %s', lcfirst($label)));
}
return $this->_view->renderBadges($badges);
}
......@@ -241,10 +259,18 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
if (!$matches = array_filter($matches))
return $badges;
$labels = [];
foreach ($matches as $match) {
if (!$match)
continue;
$label = $match->getLibrary()->getLabel();
if (in_array($label, $labels))
continue;
$labels [] = $label;
$badges [] = ((new Intonation_Library_Badge)
->setTag('a')
->setUrl($this->_view->url(['controller' => 'recherche',
......@@ -255,8 +281,8 @@ class Intonation_Library_View_Wrapper_Record extends Intonation_Library_View_Wra
->setImage(Class_Template::current()->getIco($this->_view,
'library',
'library'))
->setText($match->getLibrary()->getLabel())
->setTitle($this->_('Affiner le résultat avec le site %s', $match->getLibrary()->getLabel())));
->setText($label)
->setTitle($this->_('Affiner le résultat avec le site %s', $label)));
}
return $badges;
......
......@@ -31,6 +31,10 @@ class Intonation_Library_View_Wrapper_Record_RichContent_Details extends Intonat
if ($this->_content)
return $this->_content;
$xsl = (new Class_Notice_Xsl($this->_model, Class_Profil::getCurrentProfil()));
if ($xsl->isEnabled())
return $this->_content = $this->_view->Notice_Xsl($xsl);
return $this->_content = $this->_model->isPeriodique()
? $this->_view->Notice_Articles($this->_model)
: $this->_view->Notice_Entete($this->_model, ['entete' => Class_Codification::CHAMPS]);
......
......@@ -49,11 +49,6 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_
}
protected function _getLinkToAllParams() {
return [];
}
protected function _getLinkToAllTitle() {
return $this->_('Voir tous les événements de la boite %s dans une liste', $this->titre);
}
......@@ -86,8 +81,8 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_
public function getLinkToAllContent() {
$this->view->titre = $this->_settings->getTitre();
$this->_initCalendar();
$this->_calendar->setSize(100);
return $this->view->calendarLinkToAll($this->_calendar, $this->_settings);
}
......
......@@ -22,13 +22,10 @@
class Intonation_Library_Widget_Carousel_Article_View extends Intonation_Library_Widget_Carousel_View {
protected $_all_articles = [];
protected function _findElements() {
$loader = Class_Article::getLoader();
$this->preferences['size'] = 100;
$articles_to_show = $loader->getArticlesByPreferences($this->preferences);
$this->_all_articles = $loader->getAllArticles();
return $articles_to_show;
}
......@@ -38,21 +35,6 @@ class Intonation_Library_Widget_Carousel_Article_View extends Intonation_Library
}
protected function _getLinkToAllParams() {
$articles_ids = implode('-',
array_map(function($article)
{
return $article->getId();
}, $this->_all_articles));
return ['module' => 'opac',
'controller' => 'cms',
'action' => 'list',
'title' => $this->view->escape($this->titre),
'articles' => $articles_ids];
}
protected function _getLinkToAllTitle() {
return $this->_('Voir tous les articles de la boite "%s" dans une liste', $this->titre);
}
......
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