diff --git a/VERSIONS_HOTLINE/45756 b/VERSIONS_HOTLINE/45756 new file mode 100644 index 0000000000000000000000000000000000000000..6f58a2bb15bce83b3b31695c3165fbaa3135a262 --- /dev/null +++ b/VERSIONS_HOTLINE/45756 @@ -0,0 +1 @@ + - ticket #45756 : Kiosque de notices : correction de l'affichage des notices du carousel barre horizontal pleine largeur \ No newline at end of file diff --git a/VERSIONS_HOTLINE/47280 b/VERSIONS_HOTLINE/47280 new file mode 100644 index 0000000000000000000000000000000000000000..f9e73fc0a67362c851a9f68372d9151a1f240fcf --- /dev/null +++ b/VERSIONS_HOTLINE/47280 @@ -0,0 +1 @@ + - ticket #47280 : Disparition de la barre d'outils ckeditor en modification d'article pleine page \ No newline at end of file diff --git a/VERSIONS_HOTLINE/49355 b/VERSIONS_HOTLINE/49355 new file mode 100644 index 0000000000000000000000000000000000000000..34fa42213e54c593d583b0c49732bd1c2e9820f0 --- /dev/null +++ b/VERSIONS_HOTLINE/49355 @@ -0,0 +1 @@ + - ticket #49355 : Correctif sur l'ordre d'affichage de l'autocompletion \ No newline at end of file diff --git a/VERSIONS_HOTLINE/49363 b/VERSIONS_HOTLINE/49363 new file mode 100644 index 0000000000000000000000000000000000000000..2927157fcb20dcb45171c49662f5445aeb91b468 --- /dev/null +++ b/VERSIONS_HOTLINE/49363 @@ -0,0 +1 @@ + - ticket #49363 : Administration : suppression automatique des facettes obsolètes provenant des champs personnalisés \ No newline at end of file diff --git a/VERSIONS_HOTLINE/49621 b/VERSIONS_HOTLINE/49621 new file mode 100644 index 0000000000000000000000000000000000000000..b287a3ae172a4fc6e1209592c9314b894439cc70 --- /dev/null +++ b/VERSIONS_HOTLINE/49621 @@ -0,0 +1 @@ + - ticket #49621 : ajout d'un filtre anti-spam dans les formulaires intégrés dans les articles \ No newline at end of file diff --git a/VERSIONS_HOTLINE/49679 b/VERSIONS_HOTLINE/49679 new file mode 100644 index 0000000000000000000000000000000000000000..517a1f6ad16366380de0aaf0fb3f661935dea3cd --- /dev/null +++ b/VERSIONS_HOTLINE/49679 @@ -0,0 +1 @@ + - ticket #49679 : Administration : suppression des fonctions obsolètes des statistiquess des consultation de notices \ No newline at end of file diff --git a/VERSIONS_HOTLINE/50042 b/VERSIONS_HOTLINE/50042 new file mode 100644 index 0000000000000000000000000000000000000000..004363aa46953e6eb670b729573f28ce3cb8b9fa --- /dev/null +++ b/VERSIONS_HOTLINE/50042 @@ -0,0 +1 @@ + - ticket #50042 : Mise à ajour de traductions de mots espagnoles \ No newline at end of file diff --git a/VERSIONS_HOTLINE/50053 b/VERSIONS_HOTLINE/50053 new file mode 100644 index 0000000000000000000000000000000000000000..34152ef326addab43a42bda10060427d15f13c9e --- /dev/null +++ b/VERSIONS_HOTLINE/50053 @@ -0,0 +1 @@ + - ticket #50053 : Adaptation à la nouvelle API Soundcloud \ No newline at end of file diff --git a/application/modules/admin/controllers/StatController.php b/application/modules/admin/controllers/StatController.php index adb10ff08a668af036473208e938b03c4e855d98..60ac69d23645b92315408e29b8ee856a771fd40c 100644 --- a/application/modules/admin/controllers/StatController.php +++ b/application/modules/admin/controllers/StatController.php @@ -39,19 +39,6 @@ class Admin_StatController extends ZendAfi_Controller_Action { } - public function visunoticeAction() { - $this->view->titre = $this->_('Statistiques de visualisation des notices'); - $this->view->table_stat = $this->cls_stat->getRecapVisu(); - } - - - public function palmaresvisunoticeAction() { - $this->view->titre = 'Palmarès des visualisations de notices'; - $this->view->table_stat = $this->cls_stat->getPalmaresVisu($this->_getParam('type_doc')); - $this->view->type_doc = $this->_getParam('type_doc'); - } - - public function rechercheinfructueuseAction() { $this->view->titre = $this->_('Recherches infructueuses'); $page = $this->_getParam('page', 1); diff --git a/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml b/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml deleted file mode 100644 index bd2e83f4a804d77d1ab2b03d4429489fcbb68603..0000000000000000000000000000000000000000 --- a/application/modules/admin/views/scripts/stat/palmaresvisunotice.phtml +++ /dev/null @@ -1,46 +0,0 @@ -<table> - <tr> - <td style="text-align:right">Type de document : </td> - <td style="text-align:left" width="70%"> - <?php - echo $this->ComboCodification('type_doc', - $this->type_doc, - 'onchange="window.location.replace(\''.BASE_URL.'/admin/stat/palmaresvisunotice?type_doc=\' + this.value);"'); ?> - </td> - </tr> -</table> - -<br/> -<table class="stat"> - <tr> - <th class="stat" width="1%">Rang</th> - <th class="stat" width="1%"> </th> - <th class="stat" width="50%">Titre</th> - <th class="stat" width="40%">Auteur</th> - <th class="stat" width="9%">Vue</th> - </tr> -<?php -$rang = 0; -$last_nombre = 0; -if($this->table_stat) { - foreach($this->table_stat as $notice) { - // Calcul n° de rang - if($notice["nombre"] != $last_nombre) { - $last_nombre=$notice["nombre"]; - $rang++; - } - - // Html - print('<tr>'); - print('<td class="stat_nombre" style="text-align:center"><B>'.$rang.'</b></td>'); - print('<td class="stat_libelle"><img src="'.URL_ADMIN_IMG.'supports/support_'.$notice["type_doc"].'.gif" border="0"></td>'); - print('<td class="stat_libelle">'.$notice["titre"].'</td>'); - print('<td class="stat_libelle">'.$notice["auteur"].'</td>'); - print('<td class="stat_nombre">'.$notice["nombre"].' fois</td>'); - print('</tr>'); - } -} -print('</table>'); -?> - -<br> diff --git a/application/modules/admin/views/scripts/stat/visunotice.phtml b/application/modules/admin/views/scripts/stat/visunotice.phtml deleted file mode 100644 index 8eba04fa67c7c992c0863b25e75c6b8cafaa301b..0000000000000000000000000000000000000000 --- a/application/modules/admin/views/scripts/stat/visunotice.phtml +++ /dev/null @@ -1,28 +0,0 @@ -<h2 class="stat"> -<?php echo $this->periode;?>, -<?php echo number_format($this->table_stat["total"], 0, ',', ' ');?> notices ont été visualisées -</h2> - -<script> - $(function(){$('#accordion').accordion({autoHeight:false, collapsible:true});}); -</script> - -<?php if (isset($this->table_stat)) { ?> -<h3 class="stat">Détail par années</h3> -<?php -$years = []; -foreach ($this->table_stat as $label => $datas) - if (isset($datas['total'])) - $years[$label] = $datas['total']; -echo $this->blocStats('Année', $years);?> - -<h3 class="stat">Détail par mois</h3> -<div id="accordion"> -<?php foreach ($this->table_stat as $label => $datas) { -if (!isset($datas['mois'])) continue;?> -<h4><?php echo $label;?></h4> -<?php echo $this->blocStats('Mois', $datas['mois']);?> -<?php } ?> -</div> -<?php } ?> -<br> diff --git a/application/modules/opac/controllers/FormulaireController.php b/application/modules/opac/controllers/FormulaireController.php index e6ced064ebbd47db10fa1595e95b3264b12e0f7d..f51591098a2bc006fd99da3a4c74f84348fe9212 100644 --- a/application/modules/opac/controllers/FormulaireController.php +++ b/application/modules/opac/controllers/FormulaireController.php @@ -22,8 +22,14 @@ class FormulaireController extends ZendAfi_Controller_Action { public function addAction() { $article = Class_Article::find($this->_getParam('id_article')); + $post = $this->_request->getPost(); + if ($this->_getParam('emailCheck')) + return $this->_redirect('/'); + + unset($post['emailCheck']); + $formulaire = new Class_Formulaire(); - $formulaire->setData(serialize($this->_request->getPost())) + $formulaire->setData(serialize($post)) ->setUser(Class_Users::getIdentity()) ->setArticle($article) ->save(); diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php index 5842c641e270bb809fa84d2d297cc099f2cd6173..da73b10e3e7decaa8c2d4e4696527755c069b379 100644 --- a/cosmogramme/php/_init.php +++ b/cosmogramme/php/_init.php @@ -1,7 +1,7 @@ <?php error_reporting(E_ERROR | E_PARSE); -define("PATCH_LEVEL","313"); +define("PATCH_LEVEL","314"); define("APPLI","cosmogramme"); define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); diff --git a/cosmogramme/sql/patch/patch_314.php b/cosmogramme/sql/patch/patch_314.php new file mode 100644 index 0000000000000000000000000000000000000000..edc4a989ba7f18e2faf05c53651cec6be825a930 --- /dev/null +++ b/cosmogramme/sql/patch/patch_314.php @@ -0,0 +1,5 @@ +<?php +try { + (new Class_Migration_CleanCustomFieldsFacets())->run(); +} catch(Exception $e) {} +?> \ No newline at end of file diff --git a/library/Class/Article.php b/library/Class/Article.php index 3df2f6e0fe54692a09f3f42ba6abc9bf0daeae36..8b7f8cb90fae7af24658c81df6a77ebf3a948f97 100644 --- a/library/Class/Article.php +++ b/library/Class/Article.php @@ -965,17 +965,30 @@ class Class_Article extends Storm_Model_Abstract { if (preg_match('/(<form[^>]+)action='.$quote.'http/i', $contenu)) return $contenu; - if (!defined('BASE_URL')) - define('BASE_URL', ''); + $action = Class_Url::assemble(['controller' => 'formulaire', + 'action' => 'add', + 'id_article' => $this->getId()], + null, + true); $replaced_form = preg_replace(['/(<form[^>]+)action='.$quoted_value.'/i', '/(<form[^>]+)method='.$quoted_value.'/i', '/(<form *)/i'], ['$1 ', '$1 ', - '$1 action="'.BASE_URL.'/formulaire/add/id_article/'.$this->getId().'" method="POST" '], + '$1 action="'. $action .'" method="POST" '], $contenu); + + $end_form = '</form>'; + $antispam_tag = '<input data-spambots="true" name="emailCheck" type="text" />'; + + $replaced_form = str_replace($antispam_tag, '', $replaced_form); + if (false === strpos($replaced_form, 'name="emailCheck"')) + $replaced_form = preg_replace('|' . $end_form .'|i', + $antispam_tag . $end_form, + $replaced_form); + $typesubmit = 'type='.$quote.'(?:submit|button)'.$quote; $namesubmit = 'name='.$quoted_value; $otherattributes = '[^>]+'; diff --git a/library/Class/Autocomplete/IndexSearcher.php b/library/Class/Autocomplete/IndexSearcher.php index 7975f7b34cfa0371c49c328a955e3ffe4acd3ab7..0ebc8e2b59bad780b080f2b5506f611c5e2fab94 100644 --- a/library/Class/Autocomplete/IndexSearcher.php +++ b/library/Class/Autocomplete/IndexSearcher.php @@ -62,7 +62,7 @@ class Class_Autocomplete_IndexSearcher { public function buildGrepCommand($search_expression) { $terms = str_replace("'", "'\''", static::extractTerms($search_expression)); - $grep_args= ["-ri -E --no-filename '(\b|'\'')" . $terms[0] . "' " . $this->base_path . "| sort --unique"]; + $grep_args= ["-ri -E --no-filename '(\b|'\'')" . $terms[0] . "' " . $this->base_path . "| sort -Vuf"]; foreach(array_slice($terms, 1) as $term) $grep_args []= "-i -E '(\b|'\'')" . $term . "'"; diff --git a/library/Class/CodifThesaurus.php b/library/Class/CodifThesaurus.php index d3a548d21350cd9f15d0f68eb3b099418d5c1a8f..c42b55c3222769643b7ca1c529bfcc371a180259 100644 --- a/library/Class/CodifThesaurus.php +++ b/library/Class/CodifThesaurus.php @@ -92,7 +92,7 @@ class CodifThesaurusLoader extends Storm_Model_Loader { public function getOrCreateForCustomFieldMeta($meta) { return Class_CodifThesaurus::findCustomFieldsRoot() - ->getOrCreateChild($meta->getId(), $meta->getLabel()); + ->getOrCreateChild($meta->getId(), $meta->getLabel()); } @@ -203,7 +203,7 @@ class CodifThesaurusLoader extends Storm_Model_Loader { public function findNextRacineCatalogue() { $last_thesaurus = Class_CodifThesaurus::findFirstBy(['where' => 'code like "catalogue" and LENGTH(id_thesaurus) in (1,8)', - 'order' => 'id_thesaurus desc']); + 'order' => 'id_thesaurus desc']); return $last_thesaurus ? $this->incrementId($last_thesaurus->getIdThesaurus()) @@ -366,6 +366,7 @@ class Class_CodifThesaurus extends Storm_Model_Abstract { protected $_table_primary = 'id'; protected $_default_attribute_values = ['libelle_facette' => '', 'id_thesaurus' =>null, + 'id_origine' => null, 'rules' => null]; public function getListeSuggestion($recherche, $mode, $limite_resultat, $theme) { @@ -422,17 +423,17 @@ class Class_CodifThesaurus extends Storm_Model_Abstract { $code = $this->getCode(); return Class_CodifThesaurus::getLoader()->newInstance(['code' => $code, 'id_thesaurus' => Class_CodifThesaurus::getLoader()->findNextThesaurusChildId( - $code, - $this->getIdThesaurus())]); + $code, + $this->getIdThesaurus())]); } public function getOrCreateChild($id_origine, $label) { $entry = Class_CodifThesaurus::getLoader()->findFirstBy(['code' => $this->getCode(), - 'id_origine' => mb_substr($id_origine, - 0, - self::COLUMN_ORIGIN_SIZE, - 'UTF-8')]); + 'id_origine' => mb_substr($id_origine, + 0, + self::COLUMN_ORIGIN_SIZE, + 'UTF-8')]); if ($entry) return $entry; diff --git a/library/Class/Codification.php b/library/Class/Codification.php index 9134ddb829768b6d56bf8e3f1f83bf5d8e5abb96..6e4d109eee1ea2a4b47a401b4db7adda87a1623d 100644 --- a/library/Class/Codification.php +++ b/library/Class/Codification.php @@ -304,8 +304,6 @@ class Class_Codification { } - - public function cleanDeletedFacets($concat_facets) { $codes = []; $facets = $this->getCodesLibellesFacette($concat_facets); diff --git a/library/Class/CustomField/Meta.php b/library/Class/CustomField/Meta.php index bd9c3817b138270383b7a3a97ffbffb811378db4..e07aff6c1754923822616474066eb74cadcd3f44 100644 --- a/library/Class/CustomField/Meta.php +++ b/library/Class/CustomField/Meta.php @@ -46,6 +46,13 @@ class Class_CustomField_Meta extends Storm_Model_Abstract { 'options_list' => '', 'indexable' => 0]; + + public function describeAssociationsOn($associations) { + $associations + ->add(new Class_CustomField_Meta_ThesaurusAssociation('thesaurus')); + } + + public function getLibelle() { return $this->getLabel(); } @@ -73,22 +80,6 @@ class Class_CustomField_Meta extends Storm_Model_Abstract { } - public function getThesaurus() { - return Class_CodifThesaurus::findForCustomFieldMeta($this); - } - - - public function afterSave() { - $this->_instrumentThesaurus(); - } - - - public function afterDelete() { - if ($thesaurus = $this->getThesaurus()) - $thesaurus->deleteMeAndMyChildren(); - } - - public function serialize($value) { if ($this->getFieldType() == self::MULTI_CHECKBOX) return implode(';', $value); @@ -101,34 +92,55 @@ class Class_CustomField_Meta extends Storm_Model_Abstract { return explode(';', $value); return $value; } +} - protected function _instrumentThesaurus() { - $thesaurus = $this->getThesaurus(); - if ($this->_thesaurusIsMissing($thesaurus)) { - Class_CodifThesaurus::getOrCreateForCustomFieldMeta($this); +class Class_CustomField_Meta_ThesaurusAssociation extends Storm_Model_Association_Abstract { + public function canHandle($method) { + return in_array($method, ['getThesaurus']); + } + + + public function perform($model, $method, $args) { + return Class_CodifThesaurus::findForCustomFieldMeta($model); + } + + + public function save($model) { + $thesaurus = $model->getThesaurus(); + + if ($this->_thesaurusIsMissing($model)) { + Class_CodifThesaurus::getOrCreateForCustomFieldMeta($model); return; } - if ($this->_thesaurusShouldNotBeThere($thesaurus)) { + if ($this->_thesaurusShouldNotBeThere($model)) { $thesaurus->deleteMeAndMyChildren(); return; } if ($thesaurus) - $thesaurus->setLibelle($this->getLabel()) - ->setLibelleFacette($this->getLabel()) + $thesaurus->setLibelle($model->getLabel()) + ->setLibelleFacette($model->getLabel()) ->save(); } - protected function _thesaurusIsMissing($thesaurus) { - return $this->getIndexable() && !$thesaurus; + public function delete($model) { + if(!$thesaurus = $model->getThesaurus()) + return; + + $thesaurus->deleteMeAndMyChildren(); + } + + + protected function _thesaurusIsMissing($model) { + return $model->getIndexable() && !$model->getThesaurus(); } - protected function _thesaurusShouldNotBeThere($thesaurus) { - return !$this->getIndexable() && $thesaurus; + protected function _thesaurusShouldNotBeThere($model) { + return !$model->getIndexable() && $model->getThesaurus(); } } \ No newline at end of file diff --git a/library/Class/Migration/CleanCustomFieldsFacets.php b/library/Class/Migration/CleanCustomFieldsFacets.php new file mode 100644 index 0000000000000000000000000000000000000000..9db8e88f300b3f653feef5fe2781aa602cfc3d3f --- /dev/null +++ b/library/Class/Migration/CleanCustomFieldsFacets.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright (c) 2012-2014, 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_Migration_CleanCustomFieldsFacets { + + public function run() { + if(!$custom_fields_thesaurus = Class_CodifThesaurus::findCustomFieldsRoot()->getChildren()) + return; + + foreach($custom_fields_thesaurus as $thesaurus) + if(!Class_CustomField_Meta::find($thesaurus->getIdOrigine())) + $thesaurus->deleteMeAndMyChildren(); + } +} \ No newline at end of file diff --git a/library/Class/WebService/BibNumerique/SoundCloud.php b/library/Class/WebService/BibNumerique/SoundCloud.php index 34efc0b2d6e938f6f09b506abd305351a314f82a..ece61fe63fc25ec2dc584369b12a7b29a4d33891 100644 --- a/library/Class/WebService/BibNumerique/SoundCloud.php +++ b/library/Class/WebService/BibNumerique/SoundCloud.php @@ -26,14 +26,15 @@ class Class_WebService_BibNumerique_SoundCloud extends Class_WebService_BibNumer if (!preg_match('/soundcloud.com\/[^\/]+\/(.*)/', $url, $matches)) return null; - $track_id = $matches[1]; - $json = $this->_httpGetTrack($track_id, Class_AdminVar::get('SOUNDCLOUD_CLIENT_ID')); + $json = $this->_httpGetTrack($url, Class_AdminVar::get('SOUNDCLOUD_CLIENT_ID')); return (new Class_WebService_BibNumerique_SoundCloud_Track($json))->import(); } - protected function _httpGetTrack($track_id, $client_id) { - $url = 'http://api.soundcloud.com/tracks/' . $track_id . '?client_id=' . $client_id; + protected function _httpGetTrack($url, $client_id) { + $url = 'http://api.soundcloud.com/resolve/?' + . http_build_query(['url' => $url, 'client_id' => $client_id]); + return json_decode($this->httpGet($url)); } diff --git a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php index d2869a8721b1b129dfdb41f8c5d0ca8dde5dedbd..f46df85fadc1e539633b2a356cbf95e34337f5d8 100644 --- a/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php +++ b/library/ZendAfi/View/Helper/Admin/MenuGaucheAdmin.php @@ -109,9 +109,7 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdmin extends ZendAfi_View_Helper_Base return $this ->renderBloc($this->_('Statistiques'), [['piwik_stats', $this->_('Piwik'), '/admin/stat/piwik'], - ['failed_searches', $this->_('Recherches infructueuses'), '/admin/stat/rechercheinfructueuse'], - ['record_views', $this->_('Visualisations de notices'), '/admin/stat/visunotice'], - ['top_record_views', $this->_('Palmarès des visualisations'), '/admin/stat/palmaresvisunotice'] + ['failed_searches', $this->_('Recherches infructueuses'), '/admin/stat/rechercheinfructueuse'] ]); } diff --git a/library/ZendAfi/View/Helper/CkEditor.php b/library/ZendAfi/View/Helper/CkEditor.php index b835287b50000015cd065cb3d60c0b3fee7c12ea..395c7f26b28a3116d2ef0e107519ac0a384188f1 100644 --- a/library/ZendAfi/View/Helper/CkEditor.php +++ b/library/ZendAfi/View/Helper/CkEditor.php @@ -38,8 +38,9 @@ class ZendAfi_View_Helper_CkEditor extends ZendAfi_View_Helper_BaseHelper $config['filebrowserImageUploadUrl'] = CKBASEURL."filemanager/upload/php/upload.php?Type=Image&ServerPath=".USERFILESURL; $config['filebrowserFlashUploadUrl'] = CKBASEURL."filemanager/upload/php/upload.php?Type=Flash&ServerPath=".USERFILESURL; $config['imagesPath'] = URL_ADMIN_IMG."ckeditor_templates/"; - $config['templates_files'] = array(URL_ADMIN_JS."ckeditor_templates.js"); - $config['contentsCss'] = array(URL_CSS."global.css"); + $config['templates_files'] = [URL_ADMIN_JS."ckeditor_templates.js"]; + $config['contentsCss'] = [BASE_URL . '/public/opac/css/global.css', + URL_CSS . 'global.css']; $config['toolbar'] = [ ['Preview', 'Templates', 'Source','Maximize'], diff --git a/library/translation/es.po b/library/translation/es.po index 6e80dbc09680f19fdeef2e2702da0e13f03adf6d..20435ea70190bbcad0629a4d0c4b4010775fc47c 100644 --- a/library/translation/es.po +++ b/library/translation/es.po @@ -23,7 +23,7 @@ msgstr "" #: ../../application/modules/opac/controllers/AbonneController.php:264 #, php-format msgid " (%d en retard)" -msgstr " (%d de retraso)" +msgstr " (%d de retraso)" #: ../../application/modules/opac/views/scripts/recherche/resultatRecherche.phtml:7 #: ../../application/modules/opac/views/scripts/recherche/resultatRecherche.phtml:11 @@ -31,7 +31,7 @@ msgstr " (%d de retraso)" #: ../../application/modules/opac/views/scripts/recherche/resultatRecherche.phtml:16 #: ../../application/modules/opac/views/scripts/recherche/resultatRecherche.phtml:9 msgid " (recherche élargie triée par pertinence)" -msgstr " ( Búsqueda extendida ordenada por relevancia)" +msgstr " ( Búsqueda extendida ordenada por relevancia)" #: ../../library/ZendAfi/View/Helper/ListeNotices/TableauPanier.php:64 #, fuzzy @@ -54,7 +54,7 @@ msgstr "No se encontraron registros" #: ../../application/modules/admin/controllers/SitoController.php:96 #: ../../application/modules/admin/controllers/UsergroupController.php:49 msgid " Ajouter une catégorie" -msgstr " Añadir categorÃa" +msgstr " Añadir categorÃa" #: ../../application/modules/opac/views/scripts/abonne/fiche.phtml:10 #: ../../application/modules/opac/views/scripts/abonne/fiche.phtml:8 @@ -63,7 +63,7 @@ msgstr " Añadir categorÃa" #: ../../library/ZendAfi/View/Helper/Abonne/AccesFiche.php:25 #: ../../library/ZendAfi/View/Helper/Abonne/AccesFiche.php:27 msgid " Modifier ma fiche" -msgstr " Cambiar mi" +msgstr " Cambiar mi" #: ../../library/ZendAfi/Feed/SearchResultHeader.php:174 #: ../../library/ZendAfi/View/Helper/TagCriteresRecherche.php:186 @@ -84,32 +84,32 @@ msgstr "Permisos por defecto" #: ../../application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml:6 #: ../../application/modules/opac/views/scripts/panier/ajout-ajax-success.phtml:14 msgid " a bien été ajoutée au panier " -msgstr " se ha añadido a la cesta" +msgstr " se ha añadido a la cesta" #: ../../application/modules/opac/views/scripts/panier/creation-panier-success.phtml:6 msgid " a bien été créé." -msgstr " se ha creado." +msgstr " se ha creado." #: ../../application/modules/opac/controllers/PanierController.php:290 #: ../../application/modules/opac/controllers/PanierController.php:296 #: ../../application/modules/opac/controllers/PanierController.php:293 msgid " ajouté au domaine sélectionné." -msgstr " añadido a la zona seleccionada." +msgstr " añadido a la zona seleccionada." #: ../../application/modules/opac/controllers/PanierController.php:291 #: ../../application/modules/opac/controllers/PanierController.php:297 #: ../../application/modules/opac/controllers/PanierController.php:294 msgid " ajouté aux domaines sélectionnés." -msgstr " añadido a las áreas seleccionadas." +msgstr " añadido a las áreas seleccionadas." #: ../../library/ZendAfi/View/Helper/RenderSession.php:132 #: ../../library/ZendAfi/View/Helper/RenderSession.php:134 msgid " au " -msgstr " la" +msgstr " la" #: ../../application/modules/opac/views/scripts/panier/ajout-ajax.phtml:9 msgid " au panier " -msgstr " a la cesta" +msgstr " a la cesta" #: ../../library/ZendAfi/View/Helper/Redmine/Header.php:49 msgid " au travers de la bibliothèque " @@ -120,7 +120,7 @@ msgstr "en la biblioteca" #: ../../library/ZendAfi/View/Helper/Abonne/Newsletters.php:32 #: ../../library/ZendAfi/View/Helper/Abonne/Newsletters.php:48 msgid " aux lettres d'information: " -msgstr " a los boletines:" +msgstr " a los boletines:" #: ../../application/modules/opac/controllers/AuthController.php:356 #: ../../application/modules/opac/controllers/AuthController.php:370 @@ -129,7 +129,7 @@ msgstr " a los boletines:" #: ../../application/modules/opac/controllers/AuthController.php:357 #: ../../application/modules/opac/controllers/AuthController.php:371 msgid " avec l'adresse suivante: " -msgstr " con la siguiente dirección:" +msgstr " con la siguiente dirección:" #: ../../library/ZendAfi/Feed/SearchResultHeader.php:62 #: ../../library/ZendAfi/Feed/SearchResultHeader.php:53 @@ -142,7 +142,7 @@ msgstr "Empieza con" #: ../../application/modules/opac/controllers/RechercheController.php:430 #: ../../application/modules/opac/controllers/RechercheController.php:486 msgid " commence par :" -msgstr " comienza:" +msgstr " comienza:" #: ../../application/modules/opac/controllers/RechercheController.php:343 #: ../../application/modules/opac/controllers/RechercheController.php:363 @@ -150,28 +150,28 @@ msgstr " comienza:" #: ../../application/modules/opac/controllers/RechercheController.php:431 #: ../../application/modules/opac/controllers/RechercheController.php:487 msgid " contient :" -msgstr " contiene:" +msgstr " contiene:" #: ../../library/Class/Autocomplete/IndexTitle.php:32 msgid " de " -msgstr " de" +msgstr " de " #: ../../library/ZendAfi/View/Helper/TagArticleEvent.php:57 #, php-format msgid " de %s à %s" -msgstr " de %s hasta %s" +msgstr " de %s hasta %s" #: ../../library/ZendAfi/View/Helper/Abonne/Resume.php:51 #: ../../library/ZendAfi/View/Helper/Abonne/Resume.php:49 #, php-format msgid " dont %d retard" -msgstr " incluyendo %d con retraso" +msgstr " incluyendo %d con retraso" #: ../../library/ZendAfi/View/Helper/Abonne/Resume.php:52 #: ../../library/ZendAfi/View/Helper/Abonne/Resume.php:50 #, php-format msgid " dont %d retards" -msgstr " inculyendo %d con retraso" +msgstr " inculyendo %d con retraso" #: ../../application/modules/opac/controllers/RechercheController.php:342 #: ../../application/modules/opac/controllers/RechercheController.php:362 @@ -179,20 +179,20 @@ msgstr " inculyendo %d con retraso" #: ../../application/modules/opac/controllers/RechercheController.php:425 #: ../../application/modules/opac/controllers/RechercheController.php:481 msgid " et " -msgstr " y" +msgstr " y" #: ../../application/modules/opac/controllers/UploadController.php:21 #: ../../application/modules/opac/controllers/UploadController.php:24 #: ../../application/modules/opac/controllers/UploadController.php:43 #, php-format msgid " et des dimensions se rapprochant de %s x %s pixels" -msgstr " y las dimensiones que se aproximan %s x %s pÃxeles" +msgstr " y las dimensiones que se aproximan %s x %s pÃxeles" #: ../../library/ZendAfi/View/Helper/admin/ProfileSelect.php:20 #: ../../library/ZendAfi/View/Helper/Admin/ProfileSelect.php:20 #: ../../library/ZendAfi/View/Helper/Admin/ProfileSelect.php:39 msgid " et profil" -msgstr " y el perfil" +msgstr " y el perfil" #: ../../application/modules/opac/controllers/RechercheController.php:342 #: ../../application/modules/opac/controllers/RechercheController.php:362 @@ -205,7 +205,7 @@ msgstr " y el perfil" #: ../../library/ZendAfi/View/Helper/TagCriteresRecherche.php:48 #: ../../library/ZendAfi/View/Helper/TagCriteresRecherche.php:50 msgid " ou " -msgstr " o" +msgstr " o" #: ../../application/modules/opac/controllers/AbonneController.php:451 #: ../../application/modules/opac/controllers/AbonneController.php:511 @@ -217,7 +217,7 @@ msgstr " o" #: ../../application/modules/opac/controllers/AbonneController.php:510 #: ../../application/modules/opac/controllers/AbonneController.php:528 msgid " par E-Mail" -msgstr " por E-Mail" +msgstr " por E-Mail" #: ../../application/modules/opac/controllers/AbonneController.php:452 #: ../../application/modules/opac/controllers/AbonneController.php:512 @@ -229,7 +229,7 @@ msgstr " por E-Mail" #: ../../application/modules/opac/controllers/AbonneController.php:511 #: ../../application/modules/opac/controllers/AbonneController.php:529 msgid " par SMS" -msgstr " SMS" +msgstr " SMS" #: ../../application/modules/opac/controllers/AbonneController.php:450 #: ../../application/modules/opac/controllers/AbonneController.php:510 @@ -241,7 +241,7 @@ msgstr " SMS" #: ../../application/modules/opac/controllers/AbonneController.php:509 #: ../../application/modules/opac/controllers/AbonneController.php:527 msgid " par courrier postal" -msgstr " por correo" +msgstr " por correo" #: ../../library/ZendAfi/View/Helper/Abonne/LoansExtension.php:37 msgid " prolongation(s) impossible(s)." @@ -262,24 +262,24 @@ msgstr "préstamo(s) extendido(s)" #: ../../library/ZendAfi/View/Helper/TagCriteresRecherche.php:49 #: ../../library/ZendAfi/View/Helper/TagCriteresRecherche.php:51 msgid " sauf " -msgstr " excepto" +msgstr " excepto" #: ../../library/ZendAfi/View/Helper/Notice/Navigation.php:52 #: ../../library/ZendAfi/View/Helper/Notice/Navigation.php:61 msgid " sur " -msgstr " en" +msgstr " en" #: ../../library/ZendAfi/View/Helper/TagArticleEvent.php:56 #, php-format msgid " à %s" -msgstr "hasta %s" +msgstr "hasta %s" #: ../../application/modules/opac/views/scripts/abonne/fiche.phtml:28 #: ../../application/modules/opac/views/scripts/abonne/fiche.phtml:34 #: ../../library/ZendAfi/View/Helper/Abonne/Newsletters.php:32 #: ../../library/ZendAfi/View/Helper/Abonne/Newsletters.php:48 msgid " à la lettre d'information: " -msgstr " el boletÃn de noticias:" +msgstr " el boletÃn de noticias:" #: ../../library/Class/ModeleFusion.php:214 msgid "!!Erreur dans le modèle, attribut indéfini:" @@ -520,7 +520,7 @@ msgstr "%s %s" #: ../../library/ZendAfi/View/Helper/Redmine/IssueJournal.php:175 #, fuzzy, php-format msgid "%s changé de %s à %s" -msgstr " de %s hasta %s" +msgstr " de %s hasta %s" #: ../../library/ZendAfi/View/Helper/TagRss.php:24 #, php-format @@ -563,7 +563,7 @@ msgstr "Libros%s" #: ../../library/ZendAfi/View/Helper/Redmine/IssueJournal.php:174 #, fuzzy, php-format msgid "%s mis à %s" -msgstr " de %s hasta %s" +msgstr " de %s hasta %s" #: ../../library/ZendAfi/View/Helper/TagDilicomWidget.php:41 #, php-format @@ -598,7 +598,7 @@ msgstr "%s préstamo(s) a comprobar " #: ../../library/ZendAfi/View/Helper/Redmine/IssueJournal.php:74 #, fuzzy, php-format msgid "%x à %X" -msgstr "hasta %s" +msgstr "hasta %s" #: ../../application/modules/opac/views/scripts/panier/index.phtml:64 #: ../../application/modules/opac/views/scripts/panier/index.phtml:68 @@ -1234,7 +1234,7 @@ msgstr "Obtener el eBook" #: ../../application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml:17 #, fuzzy, php-format msgid "Accéder au panier %s" -msgstr " a la cesta" +msgstr " a la cesta" #: ../../library/ZendAfi/View/Helper/TagAssimil.php:34 #, php-format @@ -9684,7 +9684,7 @@ msgstr "" #: ../../application/modules/opac/views/scripts/panier/add-record-ajax-success.phtml:9 #, fuzzy, php-format msgid "Le document %s a été ajouté au panier %s" -msgstr " se ha añadido a la cesta" +msgstr " se ha añadido a la cesta" #: ../../application/modules/admin/controllers/CatalogueController.php:63 msgid "" @@ -20679,7 +20679,7 @@ msgstr "msg3" #: ../../application/modules/admin/controllers/PremierChapitreController.php:146 #, fuzzy msgid "n'a pas encore été créé" -msgstr " se ha creado." +msgstr " se ha creado." #: ../../application/modules/opac/views/scripts/bib-numerique/consult-book.phtml:6 #: ../../application/modules/opac/views/scripts/bib-numerique/loan-book.phtml:6 diff --git a/public/opac/css/global.css b/public/opac/css/global.css index e59f48990cd8a0829c4120429d66bd5276c647ed..47b89cf00cdbbba1c1f7bf419e5e4df8afbc9a38 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -3415,4 +3415,9 @@ th.actions { background-color:#eeeeee; padding:4px; margin-bottom:3px; +} + + +.cke_inner.cke_reset.cke_maximized { + position: fixed !important; } \ No newline at end of file diff --git a/public/opac/java/mycarousel_horizontal/carousel.css b/public/opac/java/mycarousel_horizontal/carousel.css index 0dfd9bbc5a9c880592291ff452a6059cb32e382e..801f2e1402607bb7987b67899f4d903ff15f5d7e 100644 --- a/public/opac/java/mycarousel_horizontal/carousel.css +++ b/public/opac/java/mycarousel_horizontal/carousel.css @@ -1,62 +1,57 @@ -div.jMyCarousel, -div.jMyCarousel ul { - height: auto !important; /* firefox compatibility */ -} - - -div.jMyCarousel ul { - width: 10000px !important; /* firefox compatibility */ -} - - -/************************* -******** Arrows ********** -**************************/ +/**********************************************/ +/* @name: style.css */ +/* @date: 19/11/07 */ +/* @desc: JMyCarousel css */ +/* @auth: kevin@enova-tech.net */ +/**********************************************/ +/** General Elements && arrows description ***/ div.jMyCarousel .prev{ - background: url('arrow_left.gif') center center no-repeat; - width:44px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_left.gif') center center no-repeat; + width:38px; + height:48px; + border:0px; + cursor:pointer; } + div.jMyCarousel .next{ - background: url('arrow_right.gif') center center no-repeat; - width:38px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_right.gif') center center no-repeat; + width:38px; + height:48px; + border:0px; + cursor:pointer; } + div.jMyCarousel .up{ - background: url('arrow_up.gif') center center no-repeat; - width:61px; - height:40px; - border:0px; - cursor:pointer; + background: url('arrow_up.gif') center center no-repeat; + width:61px; + height:40px; + border:0px; + cursor:pointer; } div.jMyCarousel .down{ - background: url('arrow_down.gif') center center no-repeat; - width:47px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_down.gif') center center no-repeat; + width:47px; + height:61px; + border:0px; + cursor:pointer; } +div.jMyCarousel{ + +} -/** carousel 1 **/ div.jMyCarousel ul li{ - border: 1px solid #B0BEC7; - margin-left:5px; - margin-bottom:3px; - line-height:0px; + margin:1px; + line-height:0px; + padding:1px; } div.jMyCarousel ul li a{ /* in case of link */ - display:block; - border:0px; + display:block; } -div.jMyCarousel ul li a img{ - display:block; - border:0px; +div.jMyCarousel ul li img{ + display:block; + border:0px; } \ No newline at end of file diff --git a/public/opac/java/mycarousel_horizontal/valeurs_properties.html b/public/opac/java/mycarousel_horizontal/valeurs_properties.html index e9cebd274a7841ff0307571a44188d9bc56adf1f..c52c12b17939d57d562c6835797cc8840134cea9 100644 --- a/public/opac/java/mycarousel_horizontal/valeurs_properties.html +++ b/public/opac/java/mycarousel_horizontal/valeurs_properties.html @@ -7,12 +7,12 @@ <tr> <td class="droite">Largeur de l'image </td> - <td class="gauche"><?php $this->view->tagSlider("op_largeur_img",$preferences["op_largeur_img"],50,200,5) ?></td> + <td class="gauche"><?php $this->view->tagSlider("op_largeur_img",$preferences["op_largeur_img"],50,1000,5) ?></td> </tr> <tr> <td class="droite">Hauteur de l'image </td> - <td class="gauche"><?php $this->view->tagSlider("op_hauteur_img",$preferences["op_hauteur_img"],50,200,5) ?></td> + <td class="gauche"><?php $this->view->tagSlider("op_hauteur_img",$preferences["op_hauteur_img"],50,1000,5) ?></td> </tr> -</table> \ No newline at end of file +</table> diff --git a/public/opac/java/mycarousel_vertical/carousel.css b/public/opac/java/mycarousel_vertical/carousel.css index 93806d969d76d258123b1e74c7f8f9a5e98205cc..801f2e1402607bb7987b67899f4d903ff15f5d7e 100644 --- a/public/opac/java/mycarousel_vertical/carousel.css +++ b/public/opac/java/mycarousel_vertical/carousel.css @@ -1,51 +1,57 @@ -/************************* -******** Arrows ********** -**************************/ +/**********************************************/ +/* @name: style.css */ +/* @date: 19/11/07 */ +/* @desc: JMyCarousel css */ +/* @auth: kevin@enova-tech.net */ +/**********************************************/ +/** General Elements && arrows description ***/ div.jMyCarousel .prev{ - background: url('arrow_left.gif') center center no-repeat; - width:44px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_left.gif') center center no-repeat; + width:38px; + height:48px; + border:0px; + cursor:pointer; } + div.jMyCarousel .next{ - background: url('arrow_right.gif') center center no-repeat; - width:38px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_right.gif') center center no-repeat; + width:38px; + height:48px; + border:0px; + cursor:pointer; } + div.jMyCarousel .up{ - background: url('arrow_up.gif') center center no-repeat; - width:61px; - height:40px; - border:0px; - cursor:pointer; + background: url('arrow_up.gif') center center no-repeat; + width:61px; + height:40px; + border:0px; + cursor:pointer; } div.jMyCarousel .down{ - background: url('arrow_down.gif') center center no-repeat; - width:47px; - height:61px; - border:0px; - cursor:pointer; + background: url('arrow_down.gif') center center no-repeat; + width:47px; + height:61px; + border:0px; + cursor:pointer; } +div.jMyCarousel{ + +} -/** carousel 1 **/ div.jMyCarousel ul li{ - border: 1px solid #B0BEC7; - margin-left:5px; - margin-bottom:3px; - line-height:0px; + margin:1px; + line-height:0px; + padding:1px; } div.jMyCarousel ul li a{ /* in case of link */ - display:block; - border:0px; + display:block; } -div.jMyCarousel ul li a img{ - display:block; - border:0px; +div.jMyCarousel ul li img{ + display:block; + border:0px; } \ No newline at end of file diff --git a/public/opac/java/mycarousel_vertical/valeurs_properties.html b/public/opac/java/mycarousel_vertical/valeurs_properties.html index 31c4bd7de92fe61854178e935a550b134075a5ca..c52c12b17939d57d562c6835797cc8840134cea9 100644 --- a/public/opac/java/mycarousel_vertical/valeurs_properties.html +++ b/public/opac/java/mycarousel_vertical/valeurs_properties.html @@ -1,23 +1,18 @@ <table cellspacing="2" width="100%"> <tr> - <td class="droite" width="160px">Vitesse de défilement </td> + <td class="droite" width="130px">Vitesse de défilement </td> <td class="gauche"><?php $this->view->tagSlider("op_speed",$preferences["op_speed"],100,1000,10) ?></td> </tr> - <tr> - <td class="droite">Nbre d'images en hauteur </td> - <td class="gauche"><?php $this->view->comboNombres("op_visible",$preferences["op_visible"],2,5,1) ?></td> - </tr> - <tr> <td class="droite">Largeur de l'image </td> - <td class="gauche"><?php $this->view->tagSlider("op_largeur_img",$preferences["op_largeur_img"],50,200,5) ?></td> + <td class="gauche"><?php $this->view->tagSlider("op_largeur_img",$preferences["op_largeur_img"],50,1000,5) ?></td> </tr> <tr> <td class="droite">Hauteur de l'image </td> - <td class="gauche"><?php $this->view->tagSlider("op_hauteur_img",$preferences["op_hauteur_img"],50,200,5) ?></td> + <td class="gauche"><?php $this->view->tagSlider("op_hauteur_img",$preferences["op_hauteur_img"],50,1000,5) ?></td> </tr> -</table> \ No newline at end of file +</table> diff --git a/tests/application/modules/admin/controllers/CustomFieldsControllerTest.php b/tests/application/modules/admin/controllers/CustomFieldsControllerTest.php index 3037737197208e2dafa62763aee8143d006814de..d8ee756c868a92fe76fac0e4a78141a94dada150 100644 --- a/tests/application/modules/admin/controllers/CustomFieldsControllerTest.php +++ b/tests/application/modules/admin/controllers/CustomFieldsControllerTest.php @@ -266,7 +266,8 @@ class CustomFieldsControllerAddIndexTest extends CustomFieldControllerTestCase { class CustomFieldsControllerPostAddActionTest extends AbstractControllerTestCase { - protected $_storm_default_to_volatile = true; + protected $_storm_default_to_volatile = true, + $thesaurus; public function setup() { parent::setup(); @@ -278,6 +279,7 @@ class CustomFieldsControllerPostAddActionTest extends AbstractControllerTestCase 'model' => 'Article']); $this->field = Class_CustomField::find(1); + $this->thesaurus = $this->field->getMeta()->getThesaurus(); } @@ -310,6 +312,32 @@ class CustomFieldsControllerPostAddActionTest extends AbstractControllerTestCase public function shouldBeIndexable() { $this->assertEquals(1, $this->field->getIndexable()); } + + + /** @test */ + public function thesaurusShouldBeCreated() { + $this->assertNotNull($this->thesaurus); + } + + + /** @test */ + public function deleteCustomFieldMetaShouldDeleteThesaurus() { + Zend_Registry::set('sql', + $this->mock() + ->whenCalled('execute') + ->with('delete from codif_thesaurus where id_thesaurus like "CFCF0001%"') + ->willDo( + function() { + Class_CodifThesaurus::findForCustomField($this->field) + ->delete(); + }) + ->beStrict()); + + $meta = $this->field->getMeta(); + $meta->delete(); + Class_CodifThesaurus::clearCache(); + $this->assertNull(Class_CodifThesaurus::find($this->thesaurus->getId())); + } } diff --git a/tests/application/modules/admin/controllers/StatControllerTest.php b/tests/application/modules/admin/controllers/StatControllerTest.php index ea127eaf38fad714a5e9dbd3c25fac36f31d46f9..f680b9f0550e9a5b708a6be2bb5dbb1162ba426b 100644 --- a/tests/application/modules/admin/controllers/StatControllerTest.php +++ b/tests/application/modules/admin/controllers/StatControllerTest.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 */ require_once 'AdminAbstractControllerTestCase.php'; @@ -31,131 +31,4 @@ class Admin_StatControllerRecherchesInfructueusesTest extends Admin_AbstractCont $this->assertXPathContentContains('//h1', 'Recherches infructueuses'); } } - - -class Admin_StatControllerVisunoticeTest extends Admin_AbstractControllerTestCase{ - public function setUp() { - parent::setUp(); - $this->sql = $this->mock() - ->whenCalled('fetchAll') - ->with('Select annee, sum(nb_visu) from stats_notices group by 1 order by annee desc', false) - ->answers([['annee' => '2000', 'sum(nb_visu)' => 6000],]) - - ->whenCalled('fetchAll') - ->with('Select annee, mois, nb_visu as cnt from stats_notices order by annee desc, mois desc', - false) - ->answers([['annee' => '2000', 'mois' => 1, 'cnt' => 42],]) - - ->whenCalled('fetchOne') - ->with('select min(annee) from stats_notices') - ->answers('2000') - - ->whenCalled('fetchOne') - ->with("select min(mois) from stats_notices where annee=2000") - ->answers('1') - - ->whenCalled('fetchOne') - ->answers('1'); - - - Zend_Registry::set('sql', $this->sql); - - $this->dispatch('/admin/stat/visunotice', true); - } - - - /** @test */ - public function titreShouldBeVisualisationNotice() { - $this->assertXPathContentContains('//h1', 'visualisation des notices'); - } - - - /** @test */ - public function shouldHaveYearDetails() { - $this->assertXPathContentContains('//h3', 'Détail par années'); - } - - - /** @test */ - public function shouldHaveYear2000Label() { - $this->assertXPathContentContains('//td', '2000'); - } - - - /** @test */ - public function shouldHaveYear2000Detail() { - $this->assertXPathContentContains('//td', '6000'); - } - - - /** @test */ - public function shouldHaveYearsGraph() { - $this->assertXPath('//img[contains(@src, "chl=2000")]'); - } - - - /** @test */ - public function shouldHaveMonthDetails() { - $this->assertXPathContentContains('//h3', 'Détail par mois'); - } - - - /** @test */ - public function shouldHaveMonth1DetailLabel() { - $this->assertXPathContentContains('//td', 'janvier'); - } - - - /** @test */ - public function shouldHaveMonth1DetailCount() { - $this->assertXPathContentContains('//td', '42'); - } - - /** @test */ - public function shouldHaveMonthsGraph() { - $this->assertXPath('//img[contains(@src, "janvier")]', - $this->_response->getBody()); - } -} - - -class Admin_StatControllerPalmaresVisunoticeTest extends Admin_AbstractControllerTestCase{ - public function setUp() { - parent::setUp(); - Storm_Test_ObjectWrapper::onLoaderOfModel('Class_TypeDoc') - ->whenCalled('findUsedTypeDocIds') - ->answers([]); - - $this->fixture('Class_Notice', ['id' => 1, - 'nb_visu' => 600, - 'titre_principal' => 'Captain Harlock']); - - $this->dispatch('/admin/stat/palmaresvisunotice', true); - } - - - /** @test */ - public function titleShouldBePalmares() { - $this->assertXPathContentContains('//h1', 'Palmarès des visualisations de notices'); - } - - - /** @test */ - public function docTypeSelectorShouldBePresent() { - $this->assertXPath('//select[@id="select_type_doc"]'); - } - - - /** @test */ - public function harlockShouldBeInPalmares() { - $this->assertXPathContentContains('//td', 'Captain Harlock'); - } - - - /** @test */ - public function harlockShouldHaveBeenViewed600Times() { - $this->assertXPathContentContains('//td', '600', $this->_response->getBody()); - } -} - ?> \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/FormulaireControllerTest.php b/tests/application/modules/opac/controllers/FormulaireControllerTest.php index b65b5f84ee547b5a62707d79c8248688d22a2500..bbc693973b9fe20c33473161a0050a2ddeb6f8b0 100644 --- a/tests/application/modules/opac/controllers/FormulaireControllerTest.php +++ b/tests/application/modules/opac/controllers/FormulaireControllerTest.php @@ -20,6 +20,10 @@ */ abstract class FormulaireControllerPostActionTestCase extends AbstractControllerTestCase { + protected + $_storm_default_to_volatile = true; + + public function setUp() { parent::setUp(); @@ -39,6 +43,9 @@ abstract class FormulaireControllerPostActionTestCase extends AbstractController } } + + + class FormulaireControllerWithEmailPostActionTest extends FormulaireControllerPostActionTestCase { protected $_user; @@ -57,15 +64,15 @@ class FormulaireControllerWithEmailPostActionTest extends FormulaireControllerPo $this->mock_transport = new MockMailTransport(); Zend_Mail::setDefaultTransport($this->mock_transport); - $this->postDispatch('/formulaire/add/id_article/45', ['nom' => 'Tinguette' , - 'prenom' => 'Quentin' ] - ,true); + 'prenom' => 'Quentin' ], + true); $this->new_formulaire = Class_Formulaire::find(2); } + /** @test */ public function postFormulaireShouldReturnEmail() { $this->assertXpathContentContains('//div','courriel',true ); @@ -74,7 +81,8 @@ class FormulaireControllerWithEmailPostActionTest extends FormulaireControllerPo /** @test */ public function mailContentShouldContainData() { - $this->assertContains('nom: Tinguette', quoted_printable_decode($this->mock_transport->getSentMails()[0]->getBodyText()->getContent())); + $this->assertContains('nom: Tinguette', + quoted_printable_decode($this->mock_transport->getSentMails()[0]->getBodyText()->getContent())); } @@ -83,18 +91,20 @@ class FormulaireControllerWithEmailPostActionTest extends FormulaireControllerPo $this->assertEquals('sender@example.com', $this->mock_transport->getSentMails()[0]->getFrom()); } + /** @test */ public function emailToShouldBeRecipient() { $this->assertEquals('recipient@example.com', $this->mock_transport->getSentMails()[0]->getRecipients()[0]); } + /** @test */ public function emailSubjectShouldBeFormSent() { $this->assertEquals('[Bokeh] Envoi d\'un formulaire', $this->mock_transport->getSentMails()[0]->getSubject()); } +} -} class FormulaireControllerPostActionTest extends FormulaireControllerPostActionTestCase { @@ -111,12 +121,14 @@ class FormulaireControllerPostActionTest extends FormulaireControllerPostActionT $this->postDispatch('/formulaire/add/id_article/45', ['nom' => 'Tinguette' , - 'prenom' => 'Quentin' ] - ,true); + 'prenom' => 'Quentin', + 'emailCheck' => ''], + true); $this->new_formulaire = Class_Formulaire::find(2); } + /** @test */ public function saveFormulaireShouldHaveNomTinguette() { $this->assertEquals('Tinguette', $this->new_formulaire->getNom()); @@ -176,22 +188,48 @@ class FormulaireControllerWithoutConnectedUserPostActionTest extends FormulaireC parent::setUp(); ZendAfi_Auth::getInstance()->clearIdentity(); - $this->postDispatch('/formulaire/add/id_article/45', ['nom' => 'Tinguette' , - 'prenom' => 'Quentin' ] - ,true); + 'prenom' => 'Quentin' ], + true); $this->new_formulaire = Class_Formulaire::find(2); - } + /** @test */ public function saveFormulaireShouldNotHaveAnyUsers() { $this->assertEmpty($this->new_formulaire->getUser()); + } +} + + + +class FormulaireControllerPostAsBotTest extends FormulaireControllerPostActionTestCase { + public function setUp() { + parent::setUp(); + + $this->postDispatch('/formulaire/add/id_article/45', + ['nom' => 'Tinguette' , + 'prenom' => 'Quentin', + 'emailCheck' => 'i am a bot'], + true); + + $this->new_formulaire = Class_Formulaire::find(2); + } + + + /** @test */ + public function formulaireShouldNotBeCreated() { + $this->assertNull($this->new_formulaire); } + + /** @test */ + public function answerShouldRedirectToRoot() { + $this->assertRedirectTo('/'); + } } ?> \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index 638873159fff4a0c7985d9b5ff0b925ed9f051c7..e816dded9512a7f9dacdb1751178b3549317f95b 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -2858,7 +2858,7 @@ class RechercheController_IndexSearcherTest extends RechercheControllerNoticeTes /** @test */ public function grepCommandForIleMaiteShouldRestrictLastResultToTen() { $this->assertEquals( - "grep -ri -E --no-filename '(\b|'\'')M[aà áâãäå][iìÃîï]t[eèéêë][eèéêë]' | sort --unique | grep -i -E '(\b|'\'')l'\''[iìÃîï]l[eèéêë]' | grep -i -E '(\b|'\'')[iìÃîï]l[eèéêë]' | grep -m 10 -i -E '(\b|'\'')d[eèéêë]'", + "grep -ri -E --no-filename '(\b|'\'')M[aà áâãäå][iìÃîï]t[eèéêë][eèéêë]' | sort -Vuf | grep -i -E '(\b|'\'')l'\''[iìÃîï]l[eèéêë]' | grep -i -E '(\b|'\'')[iìÃîï]l[eèéêë]' | grep -m 10 -i -E '(\b|'\'')d[eèéêë]'", (new Class_Autocomplete_IndexSearcher)->buildGrepCommand("l'ile dE Maitee")); } diff --git a/tests/db/UpgradeDBTest.php b/tests/db/UpgradeDBTest.php index 180c2838f5a89f680a7194a5998e790f54c16a0d..170e3d40ba436614ac360696bd9907487d19eec6 100644 --- a/tests/db/UpgradeDBTest.php +++ b/tests/db/UpgradeDBTest.php @@ -1083,8 +1083,8 @@ class UpgradeDB_311_Test extends UpgradeDBTestCase { $this->query("ALTER TABLE album MODIFY type_doc_id tinyint(4)"); $this->query('ALETR TABLE user_group_permission MODIFY id_model int(11) unsigned not null'); $this->query('alter table user_group_permission MODIFY model_class varchar(255) not null'); - } catch(Exception $e) {} - } + } catch(Exception $e) {} + } /** @test */ @@ -1150,3 +1150,21 @@ class UpgradeDB_313_Test extends UpgradeDBTestCase { $this->assertFieldType('newsletter_dispatch', 'error', 'longtext'); } } + + + + +class UpgradeDB_314_Test extends UpgradeDBTestCase { + public function prepare() { + try { + $this->query('delete from codif_thesaurus'); + $this->query('insert into codif_thesaurus set id_origine = 999999, libelle = "Expo", id_thesaurus = "CFCF0001", code = "Custom fields";'); + } catch(Exception $e) {} + } + + /** @test */ + public function thesaurusExpoShouldHaveBeenDeleted() { + $items = $this->query('select * from codif_thesaurus where libelle = "Expo"')->fetch(); + $this->assertNull($items); + } +} \ No newline at end of file diff --git a/tests/library/Class/ArticleFormulaireTest.php b/tests/library/Class/ArticleFormulaireTest.php index 90f3f26f3084d4015dac154475535d1ce2151624..41360a5c9678f0b611239b84bf8c3e0aff9b1ded 100644 --- a/tests/library/Class/ArticleFormulaireTest.php +++ b/tests/library/Class/ArticleFormulaireTest.php @@ -16,14 +16,19 @@ * * 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 ArticleFormulaireInternalTest extends Storm_Test_ModelTestCase { +class ArticleFormulaireInternalTest extends ViewHelperTestCase { + protected $_storm_default_to_volatile = true; + public function setUp() { parent::setUp(); - $this->_article = Class_Article::newInstanceWithId(2,['titre' => 'Contactez-nous !', - 'contenu' => '<FORM id="idform" action=\'form\' method="post" name="form" target="_blank"> + + $article = $this->fixture('Class_Article', + ['id' => 2, + 'titre' => 'Contactez-nous !', + 'contenu' => '<FORM id="idform" action=\'form\' method="post" name="form" target="_blank"> <p> Donnee 1 :<br /><input name="champs texte" type="text" value="champtxt" /> <input value="champ2" name=\'champs texte\' type="text"/></p> <p> </p> @@ -32,97 +37,152 @@ class ArticleFormulaireInternalTest extends Storm_Test_ModelTestCase { <input type="submit" value="send" name="send"/> </form> - POST<form method="POST"> - + POST<form method="POST" id="without_action"> + <input type="button" value="likebutton" /> + <input data-spambots="true" name="emailCheck" type="text" /> </form> - EMPTY<form> + EMPTY<form id="empty"> </form> ']); + + $this->_content = $article->getContenu(); } + /** @test */ public function formIdFormActionShouldBeFormulaireAdd() { - $this->assertContains('<FORM action="'.BASE_URL.'/formulaire/add/id_article/2" method="POST" id="idform" name="form" target="_blank', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//form[contains(@action, "/formulaire/add/id_article/2")][@id="idform"][@method="POST"]'); } /** @test */ - public function formWithMethodPostActionShouldBeFormulaireAdd() { - $this->assertContains('POST<form action="'.BASE_URL.'/formulaire/add/id_article/2" method="POST" >', - $this->_article->getContenu()); + public function eachFormShouldContainsInputEmailCheckForSpamBot() { + $this + ->assertXPathCount($this->_content, + '//form/input[@name="emailCheck"][@data-spambots="true"]', + 3); } /** @test */ - public function emptyFormActionShouldBeFormulaireAdd() { - $this->assertContains('EMPTY<form action="'.BASE_URL.'/formulaire/add/id_article/2" method="POST" >', - $this->_article->getContenu()); + public function withoutActionFormShouldHaveFormulaireAddAction() { + $this + ->assertXPath($this->_content, + '//form[contains(@action, "/formulaire/add/id_article/2")][@id="without_action"][@method="POST"]'); + } + + + /** @test */ + public function emptyFormShouldHaveFormulaireAddAction() { + $this + ->assertXPath($this->_content, + '//form[contains(@action, "/formulaire/add/id_article/2")][@id="empty"][@method="POST"]'); } - + /** @test */ public function formSubmitButtonShouldHaveNoName() { - $this->assertContains('<input value="click !" type="submit"/>', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//input[@value="click !"][@type="submit"][not(@name)]'); } /** @test */ public function formNotSubmitButtonShouldNotBeChanged() { - $this->assertContains( - '<input name="champs texte" type="text" value="champtxt" />', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//input[@name="champs texte"][@type="text"][@value="champtxt"]'); } /** @test */ public function formSubmitButtonNamedEnvoiShouldHaveNoName() { - $this->assertContains('<input value="envoi" type="submit"/>', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//input[@value="envoi"][@type="submit"][not(@name)]'); } + /** @test */ public function formSubmitButtonNamedSendShouldHaveNoName() { - $this->assertContains('<input value="send" type="submit"/>', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//input[@value="send"][@type="submit"][not(@name)]'); } /** @test */ public function formTypeButtonShouldBeTransformedToSubmit() { - $this->assertContains('<input value="likebutton" type="submit"/>', - $this->_article->getContenu()); + $this + ->assertXPath($this->_content, + '//input[@value="likebutton"][@type="submit"][not(@name)]'); + } +} + + + +class ArticleFormulaireWithLegacyEmailCheckTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; + + public function setUp() { + parent::setUp(); + $this->_article = $this->fixture('Class_Article', + ['id' => 2, + 'titre' => 'Contactez-nous !', + 'contenu' => ' + <form id="old" > + <input name="extenvoi" value="extenvoi" type="submit"/> + <input name="emailCheck" /> + </form> + ']); + } + + + /** @test */ + public function inputDataSpamBotsShouldNotBeAdded() { + $this->assertNotContains('data-spambots', $this->_article->getContenu()); } } +class ArticleFormulaireExternalTest extends ModelTestCase { + protected $_storm_default_to_volatile = true; -class ArticleFormulaireExternalTest extends Storm_Test_ModelTestCase { public function setUp() { parent::setUp(); - $this->_article = Class_Article::newInstanceWithId(2,['titre' => 'Contactez-nous !', - 'contenu' => ' + + $this->_article = $this->fixture('Class_Article', + ['id' => 2, + 'titre' => 'Contactez-nous !', + 'contenu' => ' <form id="extern" action="http://monserveur/post" > <input name="extenvoi" value="extenvoi" type="submit"/> </form> ']); } - + /** @test */ public function formWithExternalUrlShouldNotChange() { - $this->assertContains('<form id="extern" action="http://monserveur/post" >', + $this->assertContains('<form id="extern" action="http://monserveur/post" >', $this->_article->getContenu()); } + /** @test */ public function formSubmitWithExternalUrlShouldNotChange() { $this->assertContains(' <input name="extenvoi" value="extenvoi" type="submit"/>', $this->_article->getContenu()); } -} + /** @test */ + public function inputEmailCheckShouldNotBePresent() { + $this->assertNotContains('emailCheck', $this->_article->getContenu()); + } +} diff --git a/tests/library/Class/Migration/CleanCustomFieldsFacetsTest.php b/tests/library/Class/Migration/CleanCustomFieldsFacetsTest.php new file mode 100644 index 0000000000000000000000000000000000000000..17548076be623fd11ff69a34ce5dc02c5fd77903 --- /dev/null +++ b/tests/library/Class/Migration/CleanCustomFieldsFacetsTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright (c) 2012-2016, 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_Migration_CleanCustomFieldsFacetsTest extends ModelTestCase { + protected $_storm_default_to_volatile = true, + $_response = false; + + + public function setUp() { + parent::setUp(); + + $this->_response = false; + + $thesaurus = $this->fixture('Class_CodifThesaurus', + ['id' => 3, + 'id_origine' => 45, + 'code' => 'Custom fields', + 'libelle' => 'Custom public', + 'id_thesaurus' => 'CFCF0001']); + + $sql = $this->mock() + ->whenCalled('execute') + ->with('delete from codif_thesaurus where id_thesaurus like "CFCF0001%"') + ->willDo(function() + { + Class_CodifThesaurus::find(3)->delete(); + }); + + Zend_Registry::set('sql', $sql); + + $this->onLoaderOfModel('Class_CodifThesaurus') + ->whenCalled('findChildrenOf') + ->answers([$thesaurus]); + } + + + /** @test */ + public function customPublicShouldHaveBeenDeleted() { + (new Class_Migration_CleanCustomFieldsFacets())->run(); + $this->assertNull(Class_CodifThesaurus::find(3)); + } + + + /** @test */ + public function customPublicShouldNotHaveBeenDeleted() { + $this->fixture('Class_CustomField_Meta', + ['id' => 45, + 'indexable' => 1]); + + (new Class_Migration_CleanCustomFieldsFacets())->run(); + $this->assertNotNull(Class_CodifThesaurus::find(3)); + } +} \ No newline at end of file diff --git a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php index 1711b85c946ffe95724f72f84d0e24e156c50b2a..8f46e649c2b0585d9529e21f011b3ec49e53ad25 100644 --- a/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php +++ b/tests/library/ZendAfi/View/Helper/Admin/MenuGaucheAdminTest.php @@ -228,8 +228,6 @@ Trait MenuGaucheAdminRolesDefinition { 'profil/genres', 'index/update-skin', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'zone', 'bib', 'users', @@ -282,8 +280,6 @@ Trait MenuGaucheAdminRolesDefinition { 'profil/genres', 'index/update-skin', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'zone', 'bib', 'users', @@ -309,8 +305,6 @@ Trait MenuGaucheAdminRolesDefinition { 'modo/membreview', 'newsletter', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', ] ], [ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB, @@ -335,8 +329,6 @@ Trait MenuGaucheAdminRolesDefinition { 'print/index', 'profil/genres', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', 'bib', 'users', 'usergroup' @@ -350,8 +342,6 @@ Trait MenuGaucheAdminRolesDefinition { 'modo/membreview', 'newsletter', 'stat/rechercheinfructueuse', - 'stat/visunotice', - 'stat/palmaresvisunotice', ] ] ]; } diff --git a/tests/scenarios/SoundCloud/SoundCloudTest.php b/tests/scenarios/SoundCloud/SoundCloudTest.php index 1eb7f2cf4f332af9cede1f83559c2cabf2311cd4..a5f578082db7f802b3477df0a6825412467d10e4 100644 --- a/tests/scenarios/SoundCloud/SoundCloudTest.php +++ b/tests/scenarios/SoundCloud/SoundCloudTest.php @@ -20,16 +20,19 @@ */ class SoundCloudFixtures { + public static function prepare() { Class_AdminVar::newInstanceWithId('SOUNDCLOUD_CLIENT_ID', ['valeur' => '5f3790669220322f2c3033980ae074b7']); - $mock_http = Storm_Test_ObjectWrapper::mock(); - $mock_http->whenCalled('open_url') - ->with('http://api.soundcloud.com/tracks/the-mihalis-experience-rosetta-the-giant-golem-cc-by-nc-nd?client_id=5f3790669220322f2c3033980ae074b7') - ->answers(file_get_contents(__DIR__.'/giant_golem.json')) - ->whenCalled('open_url') - ->answers(''); + $mock_http = Storm_Test_ObjectWrapper::mock() + ->whenCalled('open_url') + ->with('http://api.soundcloud.com/resolve/?' + . http_build_query(['url' => 'https://soundcloud.com/ziklibrenbib/the-mihalis-experience-rosetta-the-giant-golem-cc-by-nc-nd', + 'client_id' => '5f3790669220322f2c3033980ae074b7'])) + ->answers(file_get_contents(__DIR__.'/giant_golem.json')) + ->whenCalled('open_url') + ->answers(''); Class_WebService_BibNumerique_SoundCloud::setDefaultHttpClient($mock_http); }