diff --git a/VERSIONS b/VERSIONS index fcd85e50c92e96d1d76b081931d915c15ceb801d..495cfd2e62cfd430ed7705f86c22ba2a7199df86 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,21 @@ +30/06/2020 - v8.0.68 + + - ticket #109494 : PNB Dilicom : Correction d'une erreur lors de l'export des prèts quand l'album dilicom a été supprimé + + - ticket #109428 : PNB Dilicom : Correction du calcul des prêts en cours + + - ticket #109427 : Magasin de thème : correction de la pagination/recherche dans la liste verticale à interactions + + - ticket #113717 : Magasin de thèmes / boite agenda : correction de la prise en compte des paramètres de boîte + + - ticket #113598 : Support international dans l'affichage des notices non trouvées + + - ticket #112284 : Inspector Gadget : Ajout de la visualisation des requetes transmises aux SIGB lors de la connexion de l'utilisateur. + + - ticket #113526 : SIGB Dynix : Cosmogramme : rend disponible la configuration des mails à envoyer aux différentes bibliothèques lors de la réservation d'un documente disponible + + + 25/06/2020 - v8.0.67 - suppression de l'annonce des webinaires diff --git a/application/modules/opac/controllers/AuthController.php b/application/modules/opac/controllers/AuthController.php index e9f17aaab9eed4d7da0b6145eaecf5a87851a473..c19f4034b1498ac937e12c2a71de8ec3516122a8 100644 --- a/application/modules/opac/controllers/AuthController.php +++ b/application/modules/opac/controllers/AuthController.php @@ -161,8 +161,11 @@ class AuthController extends ZendAfi_Controller_Action { public function loginAction() { + $this->view->preferences = $this->_loginPrefFromWidgetOrModule(); - $redirect = $this->_getParam('redirect', '/opac'); + $redirect = $this->_getParam('redirect', Class_Url::relative(['module' => 'opac', + 'action' => 'index', + 'controller' => 'index'])); $this->view->redirect = $redirect; $service = $this->_getParam('service',''); $this->view->service = $service; diff --git a/application/modules/opac/views/scripts/auth/boite-login.phtml b/application/modules/opac/views/scripts/auth/boite-login.phtml index 8e4cb443e628176425ef48f32860a309aca83931..d109856ab096c98bcdb83f5fa82ad8e3a7d7fa5a 100644 --- a/application/modules/opac/views/scripts/auth/boite-login.phtml +++ b/application/modules/opac/views/scripts/auth/boite-login.phtml @@ -3,11 +3,20 @@ $url_action = $this->form_action ? $this->form_action : $this->url(['controller' => 'auth', 'action' => ('boite-login'), 'id_module' => $this->id_module]); +$datas = ['redirect_url' => $this->redirect, + 'service' => $this->service, + 'id_notice' => $this->id_notice]; + + +if ($inspector_gadget = Zend_Controller_Front::getInstance() + ->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget')) + $datas = $inspector_gadget->addToParams($datas); + + + echo $this->Widget_Login( new Class_Entity(array_merge(['Preferences' => $this->preferences], ['FormOptions' => ['data' => array_merge($this->preferences, - ['redirect_url' => $this->redirect, - 'service' => $this->service, - 'id_notice' => $this->id_notice]), + $datas), 'action' => $url_action]]))); diff --git a/cosmogramme/php/fonctions/objets_saisie.php b/cosmogramme/php/fonctions/objets_saisie.php index 5a9f4724fd7ac82868347dc015036e4ac0adf69f..9f87adcdc0e7b2bd992383f1e991673510fb2d14 100644 --- a/cosmogramme/php/fonctions/objets_saisie.php +++ b/cosmogramme/php/fonctions/objets_saisie.php @@ -157,7 +157,12 @@ function getBlocsParams($id_bib, $type, $valeurs) { $champs_params[0] = ['url_serveur', 'catalogue_web', 'reserver_retrait_bib_abonne']; if ($clef == Class_IntBib::COM_DYNIX) - $champs_params[0] = ['url_serveur', 'client_id']; + $champs_params[0] = ['url_serveur', + 'client_id', + ['mails_bib' => function($id, $valeur) + { + return getTextArea($id, $valeur, 60, 20); + }]]; if ($clef == Class_IntBib::COM_Z3950) $champs_params[0] = ['url_serveur', 'login', 'password', 'nom_base']; diff --git a/library/Class/Calendar.php b/library/Class/Calendar.php index a48ebdefa674a7bcd62d7a75c9ea111c93939c3e..89401fd4f37b847711aaf8677d5b6309fa14dcc6 100644 --- a/library/Class/Calendar.php +++ b/library/Class/Calendar.php @@ -216,7 +216,7 @@ class Class_Calendar { } - protected function _getNextEvents(){ + protected function _getNextEvents($fill_with_following_months = true){ $time = $this->getTimeSource()->time(); $prefs = []; if ($this->date == strftime('%Y-%m',$time)) @@ -224,6 +224,9 @@ class Class_Calendar { $articles = $this->_loadArticles($prefs); + if (!$fill_with_following_months) + return $articles; + if (count($articles) < $this->_getSize() && $this->preferences['event_filter'] == 'none') { $next_articles = $this->_loadArticles(['event_start_after' => $this->date, @@ -271,25 +274,17 @@ class Class_Calendar { } - public function getArticles() { + public function getArticles($fill_with_following_months = true) { $articles = isset($this->day) ? $this->_loadArticles(['event_date' => $this->day]) - : $this->_getNextEvents(); - - return array_slice($articles, 0, $this->_getSize()); - } - + : $this->_getNextEvents($fill_with_following_months); - public function getArticlesInMonth() { - $articles = Class_Article::getArticlesByPreferences(['event_date'=> self::getTimeSource()->getMonth($this->month), - 'events_only' => true, - 'status' => 3]); return array_slice($articles, 0, $this->_getSize()); } - public function getNextEvents() { - $articles = $this->_getNextEvents(); + public function getNextEvents($fill_with_following_months = true) { + $articles = $this->_getNextEvents($fill_with_following_months); return array_slice($articles, 0, $this->_getSize()); } diff --git a/library/Class/Catalogue.php b/library/Class/Catalogue.php index c7d95708e6e7323cc146e2f10884d8720d5c4292..c24c70ddb03ee2cb89cbc65119ab72f82a1c44a1 100644 --- a/library/Class/Catalogue.php +++ b/library/Class/Catalogue.php @@ -143,7 +143,7 @@ class CatalogueLoader extends Storm_Model_Loader { if (!Class_NoticeDomain::getClesNoticesForDomain($catalogue->getId())) return ''; - return Class_MoteurRecherche::prepareFacetteDomainForOrConditions($catalogue->getId()); + return (new Class_MoteurRecherche())->prepareFacetteDomainForOrConditions($catalogue->getId()); } diff --git a/library/Class/Loan/Pnb.php b/library/Class/Loan/Pnb.php index ed31add32bd8cf4344791660dbf657d571b20b2d..cc0ad7ba59336882b9632c20ea0e71da53a5b014 100644 --- a/library/Class/Loan/Pnb.php +++ b/library/Class/Loan/Pnb.php @@ -152,7 +152,10 @@ class Class_Loan_Pnb extends Storm_Model_Abstract { public function getItem() { - foreach(Class_Album_Item::findAllBy(['album_id' => $this->getAlbum()->getId()]) + if (!$album = $this->getAlbum()) + return; + + foreach(Class_Album_Item::findAllBy(['album_id' => $album->getId()]) as $item) if ($item->getOrderLineId() == $this->getOrderLineId()) return $item; diff --git a/library/Class/MoteurRecherche.php b/library/Class/MoteurRecherche.php index a5424d70f7969820b03d5be531ec7ea99ef1651c..3f6eb5c6291c2fc8b450bd5186b104208afb0522 100644 --- a/library/Class/MoteurRecherche.php +++ b/library/Class/MoteurRecherche.php @@ -43,7 +43,7 @@ class Class_MoteurRecherche { public function __construct() { - $this->ix = new Class_Indexation; + $this->ix = Class_Indexation::getInstance(); $this->_type_condition = 'type=' . Class_Notice::TYPE_BIBLIOGRAPHIC; } diff --git a/library/Class/TableDescription/PNBItemsRenderer.php b/library/Class/TableDescription/PNBItemsRenderer.php index 72c48ce68b45d58c11bd03a7a3a96a78a6d7bef8..69e0e25adab68a89496f0bfc605498b16a9ded7b 100644 --- a/library/Class/TableDescription/PNBItemsRenderer.php +++ b/library/Class/TableDescription/PNBItemsRenderer.php @@ -67,7 +67,7 @@ class Class_TableDescription_PNBItemsRenderer { public function getLiveQuantity() { - return $this->getLoanCountOrLocalOngoing() + return $this->getLocalOngoingCount() . ' / ' . $this->_item->getLoanAllowedNumberOfUsers(); } diff --git a/library/Class/Url.php b/library/Class/Url.php index 6d39eb4b7f51ca5889facfbe6a78fd46645b519a..264954143c5d31a1ad74d005567c56fd3c148075 100644 --- a/library/Class/Url.php +++ b/library/Class/Url.php @@ -155,6 +155,12 @@ class Class_Url { */ public static function assemble(array $urlOptions = array(), $name = null, $reset = true, $encode = true) { $router = Zend_Controller_Front::getInstance()->getRouter(); + $inspector_gadget = Zend_Controller_Front::getInstance() + ->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget'); + + if ($inspector_gadget) + $urlOptions = $inspector_gadget->addToParams($urlOptions); + return $router->assemble($urlOptions, $name, $reset, $encode); } @@ -266,12 +272,6 @@ Bokeh Error : adminVar "NOM_DOMAINE" is empty. Bokeh in php cli mode is unable t if (is_string($url_array_or_string)) return static::_beginWithSlash($url_array_or_string); - $inspector_gadget = Zend_Controller_Front::getInstance() - ->getPlugin('ZendAfi_Controller_Plugin_InspectorGadget'); - - if ($inspector_gadget) - $url_array_or_string = $inspector_gadget->addToParams($url_array_or_string); - return static::assemble($url_array_or_string, $name, $reset, $encode); } } diff --git a/library/Class/WebService/SIGB/Abstract.php b/library/Class/WebService/SIGB/Abstract.php index f762489f3a60c92dac26a929157e79d73ab80022..0e541c7630a5a206845a60b0362b4668eae239b3 100644 --- a/library/Class/WebService/SIGB/Abstract.php +++ b/library/Class/WebService/SIGB/Abstract.php @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Abstract { protected static $service; @@ -40,5 +40,16 @@ class Class_WebService_SIGB_Abstract { public static function reset() { static::$service = null; } + + + public static function decodeMapping($str_codif) { + $codifs = []; + $lines = array_filter(explode("\n", trim($str_codif))); + foreach($lines as $line) { + $code_libelle = explode(':', $line); + $codifs[trim($code_libelle[0])] = trim($code_libelle[1]); + } + return $codifs; + } } ?> \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Dynix.php b/library/Class/WebService/SIGB/Dynix.php index dd79e7d4a4cbc5f4084410d2dd87aedde3475ab7..26de2af5e92a98bd3f47bb0753b3b71b47977871 100644 --- a/library/Class/WebService/SIGB/Dynix.php +++ b/library/Class/WebService/SIGB/Dynix.php @@ -16,11 +16,13 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Class_WebService_SIGB_Dynix extends Class_WebService_SIGB_Abstract { public static function getService($params){ - return parent::getService($params)->setClientId($params['client_id']); + return parent::getService($params) + ->setClientId($params['client_id']) + ->setMailsBib(static::decodeMapping($params['mails_bib'])); } } diff --git a/library/Class/WebService/SIGB/Dynix/Service.php b/library/Class/WebService/SIGB/Dynix/Service.php index 53d2375184581710bba0927e05dbe10fe916a053..097d92232c9fabec57357f9de33538abc63676d2 100644 --- a/library/Class/WebService/SIGB/Dynix/Service.php +++ b/library/Class/WebService/SIGB/Dynix/Service.php @@ -20,21 +20,8 @@ */ class Class_Webservice_SIGB_Dynix_Service extends Class_WebService_SIGB_AbstractRESTService { protected $_client_id; - protected $_mail_bib = [ - 'ALFAX1'=>'bibliotheque.alfortville.annexe@agglo-plainecentrale94.fr', - 'ALFMEDA'=>'malfortville@agglo-plainecentrale94.fr', - 'CRETBLE'=>'biblibleuets@agglo-plainecentrale94.fr', - 'CRETMES'=>'bibliotheque.creteil.biblimesly@agglo-plainecentrale94.fr', - 'CRETBUS'=>'bibliotheque.creteil.bibliobus@agglo-plainecentrale94.fr', - 'CRETMEC'=>'bibliotheque.creteil.meches@agglo-plainecentrale94.fr', - 'CRETDOY'=>'mediatheque.creteil.abbaye@agglo-plainecentrale94.fr', - 'ENMDAD'=>'', - 'CRETHAB'=>'medialudo.creteil@gpsea.fr', - 'CRETMAC'=>'mediabus@gpsea.fr', - 'CRETMUL'=>'', - 'CRETRES'=>'bibliotheque.creteil.servicesinternes@agglo-plainecentrale94.fr', - 'CRETVIL'=>'mediatheque.creteil.village@agglo-plainecentrale94.fr', - 'LB'=>'bibliotheque.limeilbrevannes@agglo-plainecentrale94.fr']; + protected $_mail_bib = []; + /** * @param string $server_root @@ -47,6 +34,12 @@ class Class_Webservice_SIGB_Dynix_Service extends Class_WebService_SIGB_Abstract } + public function setMailsBib($mails_bib) { + $this->_mail_bib = $mails_bib; + return $this; + } + + public function setClientId($client_id) { $this->_client_id = $client_id; return $this; diff --git a/library/Class/WebService/SIGB/Koha.php b/library/Class/WebService/SIGB/Koha.php index ec4d2f1d6cd3aa7c6ccb59a3ef5b0b4d8f906771..9f6891a1b38fb6a0bb0448bbb341c4be5930d723 100644 --- a/library/Class/WebService/SIGB/Koha.php +++ b/library/Class/WebService/SIGB/Koha.php @@ -50,8 +50,8 @@ class Class_WebService_SIGB_Koha { $service = $service_class::getService($params); $service - ->setCodificationDisponibilites(static::decodeMapping($params['Codification_disponibilites'])) - ->setWithdrawnMapping(static::decodeMapping($params['withdrawn_mapping'])) + ->setCodificationDisponibilites(Class_WebService_SIGB_Abstract::decodeMapping($params['Codification_disponibilites'])) + ->setWithdrawnMapping(Class_WebService_SIGB_Abstract::decodeMapping($params['withdrawn_mapping'])) ->setGroupedHoldsITypes(array_filter(explode("\n", $params['grouped_holds_itypes']))) ->setBundledHoldsMinimalDuration($params['bundled_holds_minimal_duration']) ->setBundledHoldsMaximalDuration($params['bundled_holds_maximal_duration']);; @@ -63,17 +63,6 @@ class Class_WebService_SIGB_Koha { } - public static function decodeMapping($str_codif) { - $codifs = []; - $lines = array_filter(explode("\n", trim($str_codif))); - foreach($lines as $line) { - $code_libelle = explode(':', $line); - $codifs[trim($code_libelle[0])] = trim($code_libelle[1]); - } - return $codifs; - } - - public static function setService($params, $service) { static::$services[static::makeKey($params)] = $service; } diff --git a/library/Class/WebService/Vignette.php b/library/Class/WebService/Vignette.php index 8fe8501fbda80030d168fedf73f94ba4b81bedd8..a465725283ddbf6419eb150673d49ba12765f439 100644 --- a/library/Class/WebService/Vignette.php +++ b/library/Class/WebService/Vignette.php @@ -93,6 +93,7 @@ class Class_WebService_Vignette extends Class_WebService_Abstract { static function renderThumbnail($id_notice,$titre,$type_doc) { + $image = static::createImage($titre, 300, 400, $type_doc); imagepng($image); } @@ -129,7 +130,9 @@ class Class_WebService_Vignette extends Class_WebService_Abstract { public static function writeText ($titre, $image_obj, $position = 0) { // Tronçonner le texte - $texte=wordwrap(utf8_decode(str_replace('<br />', ';', $titre)), 12, ';'); + + $texte=wordwrap(str_replace('<br />', ';', $titre), 12, ';'); + $texte=explode(";", $texte); // Parametres @@ -142,7 +145,7 @@ class Class_WebService_Vignette extends Class_WebService_Abstract { // Afficher foreach($texte as $ligne) { - imagettftext($image_obj, 30, 0, $pos_x, $pos_y, $couleur, PATH_FONTS . 'Vera.ttf', trim($ligne)); + imagettftext($image_obj, 30, 0, $pos_x, $pos_y, $couleur, PATH_FONTS . 'OpenSans.ttf', $ligne); $pos_y += $hauteur; } diff --git a/library/Trait/AlbumDelegator.php b/library/Trait/AlbumDelegator.php index 76f4a3d8f28259a0cd7fd0d2744272a76781be16..bccec7d059ad18f0067f1a110907f0a1d64dede2 100644 --- a/library/Trait/AlbumDelegator.php +++ b/library/Trait/AlbumDelegator.php @@ -25,7 +25,7 @@ */ trait Trait_AlbumDelegator { public function getNoticeOPACId() { - return $this->getAlbum()->getNoticeId(); + return $this->_withAlbumGet('notice_id'); } @@ -40,42 +40,44 @@ trait Trait_AlbumDelegator { public function getTitle() { - return $this->getAlbum()->getTitre(); + return $this->_withAlbumGet('titre', ''); } public function getMainAuthor() { - return $this->getAlbum()->getMainAuthorName(); + return $this->_withAlbumGet('main_author_name', ''); } public function getFirstEditor() { - return $this->getAlbum()->getFirstEditor(); + return $this->_withAlbumGet('first_editor', ''); } public function getFirstCollection() { - return $this->getAlbum()->getFirstCollection(); + return $this->_withAlbumGet('first_collection', ''); } public function getYear() { - return $this->getAlbum()->getAnnee(); + return $this->_withAlbumGet('annee', ''); } public function getFirstKind() { - return $this->getFirstLabelFromAlbumCodif('Class_CodifGenre', $this->getAlbum()->getGenre()); + return $this->getFirstLabelFromAlbumCodif('Class_CodifGenre', + $this->_withAlbumGet('genre', '')); } public function getFirstSection() { - return $this->getFirstLabelFromAlbumCodif('Class_CodifSection', $this->getAlbum()->getSections()); + return $this->getFirstLabelFromAlbumCodif('Class_CodifSection', + $this->_withAlbumGet('sections')); } public function getCategory() { - return $this->getAlbum()->getCategoryLabel(); + return $this->_withAlbumGet('category_label', ''); } @@ -85,4 +87,11 @@ trait Trait_AlbumDelegator { ? '' : $labels->first(); } + + + protected function _withAlbumGet($attribute, $default=null) { + return ($album = $this->getAlbum()) + ? $album->callGetterByAttributeName($attribute) + : $default; + } } diff --git a/library/ZendAfi/Form/Login.php b/library/ZendAfi/Form/Login.php index 45ad3acb19d143a12577fb00514d70aedbf299a6..a22d1f30baddbbb002c6aa4f982782db0beb3fe1 100644 --- a/library/ZendAfi/Form/Login.php +++ b/library/ZendAfi/Form/Login.php @@ -112,6 +112,15 @@ class ZendAfi_Form_Login extends ZendAfi_Form { array_push($group, 'redirect'); } + if (isset($this->_data['inspector_gadget'])) { + $this->addElement('hidden', + 'inspector_gadget', + ['value' => $this->_data['inspector_gadget']]); + array_push($group, 'inspector_gadget'); + + } + + if(strlen($this->_service)>1){ $this->addElement('hidden', 'service', diff --git a/library/startup.php b/library/startup.php index b29c3d6c243bbb307d38503e04a0fcd27dfb3235..9f9980f2e1b640dfd8e8e466a95fa04147db4453 100644 --- a/library/startup.php +++ b/library/startup.php @@ -81,7 +81,7 @@ class Bokeh_Engine { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','8.0'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.67'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.68'); defineConstant('BOKEH_REMOTE_FILES', 'https://git.afi-sa.net/afi/opacce/'); diff --git a/library/templates/Intonation/Library/AjaxPaginatedListHelper.php b/library/templates/Intonation/Library/AjaxPaginatedListHelper.php index c1e5214d987764f1c29c95bafdf19464a34c6d05..7addcc30dc3289b0c41807a65deeea17a231ed56 100644 --- a/library/templates/Intonation/Library/AjaxPaginatedListHelper.php +++ b/library/templates/Intonation/Library/AjaxPaginatedListHelper.php @@ -147,6 +147,7 @@ class Intonation_Library_AjaxPaginatedListHelper { { $element ->setView($this->_view) + ->setModel($element->getModel()) ->inJsSearch(); return false !== strpos(strtolower($element->getContentForJSSearch()), $term); }); diff --git a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php index dc802adcaf9a4a7e7b11ebb9e77219bbbc19acd5..993893776ff11e61df84533f26ffd8915f82b868 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Agenda/View.php @@ -35,7 +35,7 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_ protected function _findElements() { $this->_initCalendar(); - return $this->_calendar->getArticlesInMonth(); + return $this->_calendar->getArticles($fill_with_following_months = false); } diff --git a/library/templates/Intonation/View/RenderAjaxPaginatedList.php b/library/templates/Intonation/View/RenderAjaxPaginatedList.php index be7848092225aaa30e402b3f5b0433937ef41f58..f1e45a2033da3b9126b8edf40cfe8fe64cc70673 100644 --- a/library/templates/Intonation/View/RenderAjaxPaginatedList.php +++ b/library/templates/Intonation/View/RenderAjaxPaginatedList.php @@ -32,6 +32,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $callback = function($element) use ($helper) { $element->setView($this->view); + $element->setModel($element->getModel()); return call_user_func_array([$this->view, $helper->getRendering()], [$element]); }; @@ -62,7 +63,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $page_size = $helper->getPageSize(); $count_pages = ceil( $count_result / $page_size ); - + $count_pages = $count_pages < 1 ? 1 : $count_pages ; return $this->view->div([], implode([$this->view->tagAnchor(['controller' => 'index', 'action' => 'ajax-paginated-list', @@ -79,6 +80,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $this->view->tagAnchor(['controller' => 'index', 'action' => 'ajax-paginated-list', + 'id_profil' => Class_Profil::getCurrentProfil()->getId(), 'id' => $this->_id, 'page' => $current_page +1], $this->_tag('i','',['class' => 'fas fa-chevron-right m-0']), @@ -95,6 +97,7 @@ class Intonation_View_RenderAjaxPaginatedList extends ZendAfi_View_Helper_BaseHe $form ->setAction($this->view->url(['controller' => 'index', 'action' => 'ajax-paginated-list', + 'id_profil' => Class_Profil::getCurrentProfil()->getId(), 'id' => $this->_id, 'size' => $helper->getPageSize(), 'page' => 1], null, true)) diff --git a/library/translation/ca.mo b/library/translation/ca.mo index 67d3d1dd561cfaeb598dc5b208bbbf5c15dc998c..4df7c2d1945f01d5aeb7907ab1645b5a7f7d4d78 100644 Binary files a/library/translation/ca.mo and b/library/translation/ca.mo differ diff --git a/library/translation/el.mo b/library/translation/el.mo new file mode 100644 index 0000000000000000000000000000000000000000..a129551d7cd59b636e8ddacb670bed66b382571c Binary files /dev/null and b/library/translation/el.mo differ diff --git a/library/translation/en.mo b/library/translation/en.mo index 303edf0237c497a9573d6437694c30f260da563d..45df4dea33eb482083e4882833eba57a88237f38 100644 Binary files a/library/translation/en.mo and b/library/translation/en.mo differ diff --git a/library/translation/es.mo b/library/translation/es.mo index 6fe86dd02bdb9048b78bd4cd955173456cba67ac..3c2b0e56e409a1b7a7e078f0282d42148c8d9c16 100644 Binary files a/library/translation/es.mo and b/library/translation/es.mo differ diff --git a/library/translation/fr.mo b/library/translation/fr.mo index f137793c4ad3e4fb848590863b39a561fd5bfaf0..b8ec8b6623cf20122150de5ca5d035e8ba264fdb 100644 Binary files a/library/translation/fr.mo and b/library/translation/fr.mo differ diff --git a/library/translation/ro.mo b/library/translation/ro.mo index 4f591fd8aa493f59f781f1cb6943d0b1b5ac8a38..1da8d70a2e5a2b3806f14898cbe24dd8db48d66d 100644 Binary files a/library/translation/ro.mo and b/library/translation/ro.mo differ diff --git a/public/opac/fonts/OpenSans.ttf b/public/opac/fonts/OpenSans.ttf new file mode 100644 index 0000000000000000000000000000000000000000..db433349b7047f72f40072630c1bc110620bf09e Binary files /dev/null and b/public/opac/fonts/OpenSans.ttf differ diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php index a5255b0d3c107ffa26b26e7f0f77ed417e4a94be..6c65c78112e1391f10a2dff37249e931d167476c 100644 --- a/tests/application/modules/opac/controllers/AuthControllerTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerTest.php @@ -155,6 +155,15 @@ class AuthControllerAbonneSIGBLoggedTest extends PortailWithOneLoginModuleTestCa $this->assertXPathContentContains('//div[@class="barre_nav"]/span','Connexion'); } + + /** @test */ + public function pageShouldkeepInspectorGadgetInForm() { + $this->bootstrap(); + $this->dispatch('/opac/auth/login?inspector_gadget=keep',true); + $this->assertXPath('//form//input[@type="hidden"][@name="inspector_gadget"][@value="keep"]', $this->_response->getBody()); + } + + } @@ -1072,7 +1081,7 @@ class AuthControllerPostSimpleSuccessfulTest extends AuthControllerPostSimpleSuc /** @test */ public function responseShouldBeARedirectToOPAC() { - $this->assertRedirectTo('/opac'); + $this->assertRedirectTo('/'); } @@ -1334,7 +1343,7 @@ class AuthControllerPostSimpleFailureTest extends AuthControllerPostSimpleTestCa public function withAuthenticationFailureResponseShouldBeRedirect() { $this->postDispatch('/opac/auth/login', ['username' => 'foo', 'password' => 'bar']); - $this->assertRedirectTo('/opac'); + $this->assertRedirectTo('/'); } diff --git a/tests/application/modules/opac/controllers/AuthControllerWithNanookTest.php b/tests/application/modules/opac/controllers/AuthControllerWithNanookTest.php index 9f0c5e75484c426665bd7fc17d71238b82f1e8e4..780f59f15a52dff4b6267bdd7cf67c028df2a1dc 100644 --- a/tests/application/modules/opac/controllers/AuthControllerWithNanookTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerWithNanookTest.php @@ -307,6 +307,16 @@ class AuthControllerWithNanookPostLoginWithMailAndUnsecurePasswordOthersLogins /** @test */ + public function withActionLoginWithInspectorGadgetShouldDisplayButtonWebserviceCalls() { + $this->postDispatch('/opac/auth/login', ['username' => 'name@server.tld', + 'password' => '1987', + 'inspector_gadget' => 1]); + + $this->assertXPathContentContains('//button', 'Appels webservices', $this->_response->getBody()); + } + + + /** @test */ public function withActionAjaxLoginShouldForwardToSecurePassword() { $this->postDispatch('/opac/auth/ajax-login', ['username' => 'name@server.tld', 'password' => '1987']); diff --git a/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php b/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php index 9e5344d8b44ae454034d1b9e2d6b2df54753fbf3..e92cc50a89f30d8e5391d97679e76a645421e403 100644 --- a/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerWithoutPasswordTest.php @@ -104,7 +104,7 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor public function setUp() { parent::setUp(); - $this->postDispatch('/opac/auth/login', ['username' => 'foo', 'password' => 'bar']); + $this->postDispatch('/opac/auth/login', ['username' => 'foo', 'password' => 'bar' , 'inspector_gadget' => 'keep']); } @@ -124,13 +124,21 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor ->whenCalled('open_url') ->with('http://mon-koha-de-test.org?service=GetPatronInfo&patron_id=96138&show_contact=0&show_loans=1&show_holds=0') ->answers(KohaFixtures::xmlGetPatronInfoDupont()) - + ->whenCalled('getLastResponse') + ->answers( + (new Class_Entity())->setStatus('ok')->setBody(KohaFixtures::xmlAuthenticatePatronOk())) + ->whenCalled('getLastRequest') + ->answers('true') ->beStrict(); - + Class_HttpClientFactory::setInstance($this->mock()->whenCalled('getLastHttpClient')->answers($this->_mock_web_client)); $this->_service = Class_WebService_SIGB_Koha::getService($this->_params); $this->_service->setWebClient($this->_mock_web_client); } + public function tearDown() { + Class_HttpClientFactory::resetInstance(); + parent::tearDown(); + } /** @test */ public function userFooShouldBeLogged() { @@ -142,6 +150,14 @@ class AuthControllerWithoutPasswordKohaTest extends AuthControllerWithoutPasswor public function userFooPasswordShouldHaveNotBeenSet() { $this->assertEquals('', Class_Users::getIdentity()->getPassword()); } + + + /** @test */ + public function withActionLoginWithInspectorGadgetShouldKeepWebserviceCalls() { + $this->assertRedirectTo('/index/index/inspector_gadget/keep'); + $this->assertNotNull(Zend_Registry::get('session')->inspectorCalls); + } + } diff --git a/tests/library/Class/CommSigbTest.php b/tests/library/Class/CommSigbTest.php index 768d967b289ea735426d2b5641bc28f42c5fcc17..ce8baae82a2e52b9459a0c800f4e4f0587080990 100644 --- a/tests/library/Class/CommSigbTest.php +++ b/tests/library/Class/CommSigbTest.php @@ -674,7 +674,8 @@ class CommSigbDynixTest extends CommSigbTestCase { $this->bib_pc94 = Class_IntBib::newInstanceWithId(5) ->setCommParams(["url_serveur" => 'http://www.dynix.fr:8080/capcvm/', - 'client_id' => 'SymWS']) + 'client_id' => 'SymWS', + 'mails_bib' => 'ALFA:alfa@here.fr']) ->setCommSigb(11); Class_WebService_SIGB_Dynix::setService($this->createMockForService('Dynix')); @@ -683,6 +684,11 @@ class CommSigbDynixTest extends CommSigbTestCase { ->expects($this->any()) ->method('setClientId') ->will($this->returnValue($this->mock_service)); + + $this->mock_service + ->expects($this->any()) + ->method('setMailsBib') + ->will($this->returnValue($this->mock_service)); } @@ -691,7 +697,8 @@ class CommSigbDynixTest extends CommSigbTestCase { $this->assertEquals(["url_serveur" => 'http://www.dynix.fr:8080/capcvm/', "type" => Class_IntBib::COM_DYNIX, 'client_id' => 'SymWS', - 'id_bib' => 5], + 'id_bib' => 5, + 'mails_bib' => 'ALFA:alfa@here.fr'], $this->bib_pc94->getModeComm(5)); } } diff --git a/tests/library/Class/WebService/SIGB/DynixTest.php b/tests/library/Class/WebService/SIGB/DynixTest.php index 333b1eccab2b95991248c0f54f4d72a581056675..881d6393ae164281e767af3ee902e77be94dd44d 100644 --- a/tests/library/Class/WebService/SIGB/DynixTest.php +++ b/tests/library/Class/WebService/SIGB/DynixTest.php @@ -27,7 +27,8 @@ class DynixGetServiceTest extends ModelTestCase { public function setUp() { Class_WebService_SIGB_Dynix::reset(); $this->_service = Class_WebService_SIGB_Dynix::getService(['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/', - 'client_id' => 'myid']); + 'client_id' => 'myid', + 'mails_bib' => "CRETBUS:mediatheque.creteil.bibliobus@gpsea.fr\nALFMEDA:malfortville@agglo-plainecentrale94.fr"]); } @@ -58,7 +59,8 @@ abstract class DynixTestCase extends ModelTestCase { Class_WebService_SIGB_Dynix::setService(null); $this->_service = Class_WebService_SIGB_Dynix ::getService(['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/', - 'client_id' => 'SymWS']) + 'client_id' => 'SymWS', + 'mails_bib' => "CRETBUS:mediatheque.creteil.bibliobus@gpsea.fr\nALFMEDA:malfortville@agglo-plainecentrale94.fr"]) ->setWebClient($this->_mock_web_client); @@ -638,7 +640,8 @@ class DynixAuthenticateManuLarcinetTest extends DynixTestCase { ['id' => 94, 'comm_sigb' => Class_IntBib::COM_DYNIX, 'comm_params' => ['url_serveur' => 'http://www.infocom94.fr:8080/capcvm/', - 'client_id' => 'SymWS']]); + 'client_id' => 'SymWS', + 'mails_bib' => '']]); ZendAfi_Auth::getInstance()->authenticateLoginPassword('0917036', 'secret'); } diff --git a/tests/scenarios/AuthorPage/AuthorPageTest.php b/tests/scenarios/AuthorPage/AuthorPageTest.php index 473948d91bf481e2baa2c3b954ca8d459830a9d6..88729fdf764a1389fa16a0c61fa8f8f3e7d3bc63 100644 --- a/tests/scenarios/AuthorPage/AuthorPageTest.php +++ b/tests/scenarios/AuthorPage/AuthorPageTest.php @@ -234,21 +234,48 @@ class AuthorPageViewAuthorWithoutRecordTest extends AuthorPageTestCase { - -class AuthorPageViewByIdTest extends AuthorPageTestCase { +class AuthorPageViewByIdWithInspectorGadgetTest extends AuthorPageTestCase { public function setUp() { parent::setUp(); - $this->dispatch('/author/view/id/2408/inspector_gadget/1'); } + /** @test */ + public function biographyTextLesMiserablesShouldBeReplacedByLinkToRecord() { + $this->assertXPathContentContains('//div[@class="biography"]//a[contains(@href, "/recherche/viewnotice/code_rebond/A2408/inspector_gadget/1/id/9")][@title="Accéder au document: Les Misérables"]', + 'Les Misérables',$this->_response->getBody()); + } + + /** @test */ public function pageShouldContainsInspectorGadgetButton() { $this->assertXPathContentContains('//button[contains(@class,"admin-button")]', 'Auteur Bokeh'); } + /** @test */ + public function pageShouldLinkGavrocheWithCodeRebondAndFacet() { + $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/8/inspector_gadget/1/clef/GAVROCHE_HUGO/code_rebond/A2408/facette/T1")]', + $this->_response->getBody()); + } + + + /** @test */ + public function pageShouldLinkLesMiserablesWithCodeRebondAndFacet() { + $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/9/inspector_gadget/1/clef/MISERABLES_HUGO/code_rebond/A2408/facette/T1")]'); + } +} + + +class AuthorPageViewByIdTest extends AuthorPageTestCase { + public function setUp() { + parent::setUp(); + + $this->dispatch('/author/view/id/2408'); + } + + /** @test */ public function authorWikdataIdShouldBeQ8298() { $this->assertEquals('Q8298', Class_CodifAuteur::find(2408)->getWikidataId()); @@ -294,7 +321,7 @@ class AuthorPageViewByIdTest extends AuthorPageTestCase { /** @test */ public function biographyTextLesMiserablesShouldBeReplacedByLinkToRecord() { $this->assertXPathContentContains('//div[@class="biography"]//a[contains(@href, "/recherche/viewnotice/code_rebond/A2408/id/9")][@title="Accéder au document: Les Misérables"]', - 'Les Misérables'); + 'Les Misérables',$this->_response->getBody()); } @@ -411,14 +438,14 @@ class AuthorPageViewByIdTest extends AuthorPageTestCase { /** @test */ public function pageShouldLinkGavrocheWithCodeRebondAndFacet() { - $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/8/inspector_gadget/1/clef/GAVROCHE_HUGO/code_rebond/A2408/facette/T1")]', + $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/8/clef/GAVROCHE_HUGO/code_rebond/A2408/facette/T1")]', $this->_response->getBody()); } /** @test */ public function pageShouldLinkLesMiserablesWithCodeRebondAndFacet() { - $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/9/inspector_gadget/1/clef/MISERABLES_HUGO/code_rebond/A2408/facette/T1")]'); + $this->assertXPath('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/id/9/clef/MISERABLES_HUGO/code_rebond/A2408/facette/T1")]'); } diff --git a/tests/scenarios/PnbDilicom/PnbDilicomTest.php b/tests/scenarios/PnbDilicom/PnbDilicomTest.php index fad70b72fd3edabd712b3b346e9251ba529650c0..a93bb251042e13dc04fa26620b9ffe1f5c201606 100644 --- a/tests/scenarios/PnbDilicom/PnbDilicomTest.php +++ b/tests/scenarios/PnbDilicom/PnbDilicomTest.php @@ -3377,6 +3377,7 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont $this->fixture('Class_Album', ['id' => 23, + 'id_origine' => 'Dilicom-36636', 'titre' => 'Being human being', 'type_doc_id' => Class_TypeDoc::DILICOM]); @@ -3399,7 +3400,6 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont 'usage_type' => Class_Album_UsageConstraint::DEVICE_SHARE_CONSTRAINT, 'serialized_datas' => json_encode([Class_Album_UsageConstraint::QUANTITY => 6])]), - $this->fixture('Class_Album_UsageConstraint', ['id' => 3, 'usage_type' => Class_Album_UsageConstraint::AVAILABILITY_CONSTRAINT, @@ -3409,6 +3409,27 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont ] ]); + $this->fixture('Class_Loan_Pnb', + ['id' => 1, + 'record_origin_id' => 'Dilicom-36636', + 'subscriber_id' => '000005', + 'user_id' => 4077, + 'expected_return_date' => '2017-01-20 13:57:33', + 'loan_date' => '2016-12-16 13:57:33', + 'loan_link' => 'https://pnb-dilicom.centprod.com/v2//XXXXXXXX.do', + 'order_line_id' => '12385',]); + + $this->fixture('Class_Loan_Pnb', + ['id' => 2, + 'record_origin_id' => 'Dilicom-36636', + 'subscriber_id' => '000006', + 'user_id' => 4078, + 'expected_return_date' => '2017-12-13 13:57:33', + 'loan_date' => '2017-11-13 13:57:33', + 'loan_link' => 'https://pnb-dilicom.centprod.com/v2//XXXXXXXX.do', + 'order_line_id' => '12385',]); + + $this->fixture('Class_Album_Item', ['id' => 2, 'quantity' => '20', @@ -3417,11 +3438,12 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont 'usage_constraints' => [ $this->fixture('Class_Album_UsageConstraint', - ['id' => 1, + ['id' => 4, 'usage_type' => Class_Album_UsageConstraint::LOAN_CONSTRAINT, 'serialized_datas' => json_encode([Class_Album_UsageConstraint::DURATION => 20, Class_Album_UsageConstraint::QUANTITY => 20, Class_Album_UsageConstraint::MAX_NB_OF_USERS => 15])]), + $this->fixture('Class_Album_UsageConstraint', ['id' => 5, 'usage_type' => Class_Album_UsageConstraint::AVAILABILITY_CONSTRAINT, @@ -3466,20 +3488,19 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont 'usage_constraints' => [ $this->fixture('Class_Album_UsageConstraint', - ['id' => 1, + ['id' => 6, 'usage_type' => Class_Album_UsageConstraint::LOAN_CONSTRAINT, 'serialized_datas' => json_encode([Class_Album_UsageConstraint::DURATION => 359, Class_Album_UsageConstraint::QUANTITY => 999999, Class_Album_UsageConstraint::MAX_NB_OF_USERS => 1])]), $this->fixture('Class_Album_UsageConstraint', - ['id' => 2, + ['id' => 7, 'usage_type' => Class_Album_UsageConstraint::DEVICE_SHARE_CONSTRAINT, 'serialized_datas' => json_encode([Class_Album_UsageConstraint::QUANTITY => 6])]), - $this->fixture('Class_Album_UsageConstraint', - ['id' => 3, + ['id' => 8, 'usage_type' => Class_Album_UsageConstraint::AVAILABILITY_CONSTRAINT, 'serialized_datas' => json_encode([Class_Album_UsageConstraint::DURATION => 999999, Class_Album_UsageConstraint::ORDER_LINE_ID => '584837a045ce56ef0a072a8b', @@ -3488,7 +3509,7 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont ]); $this->fixture('Class_Loan_Pnb', - ['id' => 2, + ['id' => 3, 'record_origin_id' => 'Dilicom-3663608260879', 'subscriber_id' => '000005', 'user_id' => 4077, @@ -3498,7 +3519,7 @@ abstract class PnbDilicomAdminAlbumControllerTestCase extends Admin_AbstractCont 'order_line_id' => '584837a045ce56ef0a072a8b',]); $this->fixture('Class_Loan_Pnb', - ['id' => 3, + ['id' => 4, 'record_origin_id' => 'Dilicom-3663608260879', 'subscriber_id' => '000006', 'user_id' => 4078, @@ -3795,9 +3816,10 @@ class PnbDilicomAdminAlbumControllerExportCsvTest extends PnbDilicomAdminAlbumCo public function csvShouldContainsAlbumsItems() { $this->assertEquals('Titre;"Prêts / Droits";"Nombre de prêts";"Prêts simultanés / Droits";"Prêts simultanés";"Durée de prêt en jours";"Nombre de jours restant sur la licence";"Date de commande";Auteur;Éditeur;Collection;Année;Genre;Section;Catégorie "Being human being";"10 / 30";10;"2 / 15";2;45;2095;30/03/2015;;;;;;;"Albums non classés" -"Being human being";"20 / 20";20;"5 / 15";5;20;19902;29/08/2015;;;;;;;"Albums non classés" +"Being human being";"20 / 20";20;"0 / 15";5;20;19902;29/08/2015;;;;;;;"Albums non classés" "Hell is from here to eternity";"2 / ∞";2;"1 / 1";1;359;∞;30/03/2015;"Iron Maiden";EMI;"Temple Of Rock";1992;"Heavy Metal";"Espace métal";Fondu -', $this->_response->getBody()); +', + $this->_response->getBody()); } } @@ -3821,7 +3843,7 @@ class PnbDilicomAdminAlbumControllerExportLoansCsvTest extends PnbDilicomAdminAl 'gln' => '333']); $this->fixture('Class_Loan_Pnb', - ['id' => 4, + ['id' => 5, 'record_origin_id' => 'Dilicom-3663608260879', 'subscriber_id' => 9879, 'user_id' => 7, @@ -3831,7 +3853,7 @@ class PnbDilicomAdminAlbumControllerExportLoansCsvTest extends PnbDilicomAdminAl 'order_line_id' => '82377a045ce56ef0a072a8b']); $this->fixture('Class_Loan_Pnb', - ['id' => 5, + ['id' => 6, 'record_origin_id' => 'Dilicom-3663608260879', 'subscriber_id' => 9878, 'user_id' => 12321, @@ -3840,7 +3862,7 @@ class PnbDilicomAdminAlbumControllerExportLoansCsvTest extends PnbDilicomAdminAl 'loan_link' => 'https://pnb-dilicom.centprod.com/v2//XXXXXXXX.do', 'order_line_id' => '82377a045ce56ef0a072a8b']); - $this->dispatch('admin/album/dilicom-export-loans-csv', true); + $this->dispatch('admin/album/dilicom-export-loans-csv'); } @@ -3862,7 +3884,9 @@ class PnbDilicomAdminAlbumControllerExportLoansCsvTest extends PnbDilicomAdminAl /** @test */ public function csvShouldContainsAlbumsItems() { $this->assertEquals('Date;Titre;"Date de commande";Auteur;Éditeur;Collection;Année;Genre;Section;Catégorie;Bibliothèque +16/12/2016;"Being human being";30/03/2015;;;;;;;"Albums non classés"; 16/12/2016;"Hell is from here to eternity";30/03/2015;"Iron Maiden";EMI;"Temple Of Rock";1992;"Heavy Metal";"Espace métal";Fondu; +13/11/2017;"Being human being";30/03/2015;;;;;;;"Albums non classés"; 13/11/2017;"Hell is from here to eternity";30/03/2015;"Iron Maiden";EMI;"Temple Of Rock";1992;"Heavy Metal";"Espace métal";Fondu; 06/01/2020;"Hell is from here to eternity";;"Iron Maiden";EMI;"Temple Of Rock";1992;"Heavy Metal";"Espace métal";Fondu;SomewhereInCode 06/02/2020;"Hell is from here to eternity";;"Iron Maiden";EMI;"Temple Of Rock";1992;"Heavy Metal";"Espace métal";Fondu;SomewhereInCode @@ -3874,6 +3898,29 @@ class PnbDilicomAdminAlbumControllerExportLoansCsvTest extends PnbDilicomAdminAl +class PnbDilicomAdminAlbumControllerExportLoansCsvWithMissingAlbumTest + extends PnbDilicomAdminAlbumControllerTestCase { + + public function setUp() { + parent::setUp(); + + Class_Album::find(23)->delete(); + $this->dispatch('admin/album/dilicom-export-loans-csv'); + } + + + /** @test */ + public function filenameShouldBeDilicomLoansCsv() { + $this->assertContains(['name' => 'Content-Type', + 'value' => 'text/csv; name="dilicom_loans_csv.csv"', + 'replace' => true], + $this->_response->getHeaders()); + } +} + + + + class PnbDilicomAdminIndexControllerTest extends AbstractControllerTestCase { protected $_storm_default_to_volatile = true; diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index 03b779c5e569d1178612aa070576ce60ed89e864..2b14c090d57e9d7ec6e74b5ff702e100705ea6db 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -3491,6 +3491,63 @@ class TemplatesDispatchAbonneLoansTest extends TemplatesIntonationAccountTestCas } + /** @test */ + public function page2ReviewsShouldContainsSearchInputWithMd5Key() { + Storm_Cache::beVolatile(); + $this->fixture('Class_AvisNotice', + ['id' => 4, + 'id_user' => 666, + 'id_notice' => 2, + 'clef_oeuvre' => 'PSYKO', + 'note' => '4', + 'entete' => 'Le Roi', + 'avis' => 'Le Roi des cons sur son throne', + 'source_author' => null]); + + + $this->fixture('Class_AvisNotice', + ['id' => 5, + 'id_user' => 666, + 'id_notice' => 3, + 'clef_oeuvre' => 'PSYKO', + 'note' => '4', + 'entete' => 'Le Roi des cons avec sa couronne', + 'avis' => 'Le Roi des cons avec sa couronne', + 'source_author' => null]); + + $this->fixture('Class_Notice', + ['id' => 2, + 'clef_oeuvre' => 'PSYKO', + ]); + + $this->fixture('Class_Notice', + ['id' => 3, + 'clef_oeuvre' => 'PSYKOTIC', + ]); + + + $reviews = Class_AvisNotice::groupByRecords(Class_AvisNotice::findAll()); + $reviews = array_map(function($review) + { + return (new Intonation_Library_View_Wrapper_ReviewsByRecord) + ->setModel($review) + ->setView($this->view); + }, $reviews); + + $collection = new Storm_Collection($reviews); + + $helper = (new Intonation_Library_AjaxPaginatedListHelper) + ->setCollection($collection) + ->setRendering('cardifyHorizontal'); + + $id = $helper->getId(); + + $this->dispatch('/opac/index/ajax-paginated-list/id/' . $id . '/page/2/render/ajax/id_profil/72/size/1/search/roi'); + $this->assertContains('input_69219ce1da1a3a70c6511767a99d5a05', $this->_response->getBody()); + $this->assertContains('avec sa couronne', $this->_response->getBody()); + } + + /** @test */ public function loansShouldContainsDrHouse() { Storm_Cache::beVolatile(); @@ -4036,25 +4093,29 @@ class TemplatesBibControllerProActionsTest extends TemplatesIntonationTestCase { class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase { + protected $_vacances; public function setUp() { parent::setUp(); - $vacances = $this - ->fixture('Class_Article', - ['id' => 78, - 'titre' => 'Les vacances', - 'contenu' => 'À la mer']); + Class_Profil::find(72) + ->setCfgAccueil(['modules' => + ['21' => ['division' => 3, + 'type_module' => 'CALENDAR', + 'preferences' => ['id_categorie' => 22]]]]) + ->assertSave(); + + ZendAfi_View_Helper_CalendarContent::setTimeSource(new TimeSourceForTest('2020-04-12 23:34:00')); + + $this->_vacances = $this->fixture('Class_Article', + ['id' => 78, + 'titre' => 'Les vacances', + 'contenu' => 'À la mer']); $this ->onLoaderOfModel('Class_Article') - ->whenCalled('getAllArticles') - ->answers([$vacances]) - - - ->whenCalled('getArticlesByPreferences') - ->answers([$vacances]); + ->answers([$this->_vacances]); } @@ -4067,6 +4128,32 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase { /** @test */ public function boiteAgendaShouldBePresent() { + Class_Article::getLoader() + ->whenCalled('getArticlesByPreferences') + ->with(['display_order' => 'EventDebut', + 'id_categorie' => '22', + 'events_only' => true, + 'event_date' => '2020-04', + 'id_bib' => 0, + 'id_lieu' => '', + 'custom_fields' => [], + 'published' => true]) + ->answers([$this->_vacances]) + + ->whenCalled('getArticlesByPreferences') + ->with(['display_order' => 'EventDebut', + 'id_categorie' => '22', + 'events_only' => true, + 'event_date' => '2020-04', + 'id_bib' => 0, + 'id_lieu' => '', + 'custom_fields' => [], + 'published' => true, + 'event_end_after' => '2020-04-12']) + ->answers([$this->_vacances]) + + ->beStrict(); + $this->dispatch('/opac/index/index/id_profil/72'); $this->assertXPath('//div', 'À la mer'); }