diff --git a/VERSIONS b/VERSIONS index cf8064def31c75c4307d037eaec0b03081ac6717..07af71023774d5afabf6afef10dcca4e30405386 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,10 @@ +18/11/2015 - v7.3.28 + + - ticket #33136 : correction de l'écriture des images dans le dossier temp. + + - ticket #32771 : Ajout du texte "Valider" dans le bouton de validation de la modification d'un panier. + + 13/11/2015 - v7.2.27 - ticket #31988 : Correction de la css des bandeaux d'alertes pour être compatible avec le mode responsive. diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php index 03ab696c7d83992f8d97f7ee54a88bb2a130bf95..47c0fc14abcb79b518749bec3aed87ecc481eec3 100644 --- a/application/modules/opac/controllers/RechercheController.php +++ b/application/modules/opac/controllers/RechercheController.php @@ -71,12 +71,15 @@ class RechercheController extends ZendAfi_Controller_Action { unset($params['q']); } + $search_start_time = microtime(true); + $criteres_recherche = $this->newCriteresRecherches($params); if ($this->view->statut == 'guidee') $criteres_recherche->updateRubrique('guidee'); $search_result = $this->moteur->lancerRecherche($criteres_recherche); + if ('json' == $this->_getParam('format', '')) { $this->_renderJsonResult($search_result); return; @@ -89,6 +92,7 @@ class RechercheController extends ZendAfi_Controller_Action { $this->_renderHtmlResult($search_result); + $this->view->search_duration = microtime(true) - $search_start_time; } diff --git a/application/modules/opac/views/scripts/recherche/resultatRecherche.phtml b/application/modules/opac/views/scripts/recherche/resultatRecherche.phtml index 367f7be9a832765e016327a0ea5fd62d983ad6a9..3b35b8170987797d1762727c2959f5677ce341c1 100644 --- a/application/modules/opac/views/scripts/recherche/resultatRecherche.phtml +++ b/application/modules/opac/views/scripts/recherche/resultatRecherche.phtml @@ -14,8 +14,7 @@ if ($this->is_pertinence) { <div class="resultats_page"> <?php echo $this->tagTriRecherche($this->criteres_recherche); - echo $this->tagTitreEtNombreDeResultats($this->search_result->getRecordsCount(), - $this->criteres_recherche); + echo $this->tagTitreEtNombreDeResultats($this->search_result, $this->search_duration); echo $this->tagNombreDePages($this->criteres_recherche->getPage()); if ($this->search_result->getRubrics() || $this->search_result->getBreadcrumb()) { diff --git a/application/modules/telephone/views/scripts/recherche/simple.phtml b/application/modules/telephone/views/scripts/recherche/simple.phtml index 770cf4eea74530a0aba1964ddc4cfdc2990afb83..3a82ab810889bed5222c33cdb02424faf17d30f2 100644 --- a/application/modules/telephone/views/scripts/recherche/simple.phtml +++ b/application/modules/telephone/views/scripts/recherche/simple.phtml @@ -1,8 +1,7 @@ <ul data-role="listview"> <?php echo $this->toolbar("Recherche", $this->url(array(), null, true)); -echo $this->tagTitreEtNombreDeResultats($this->search_result->getRecordsCount(), - $this->criteres_recherche); +echo $this->tagTitreEtNombreDeResultats($this->search_result, $this->search_duration); echo $this->listeNotices($this->search_result->fetchRecords(), diff --git a/library/Class/AdminVar/UnleashedFacets.php b/library/Class/AdminVar/UnleashedFacets.php index 4ae7429b614038fb5bbda6c611ad09056d62cf54..4a7d46f22941d27d9e13732bfd5d97a928738a91 100644 --- a/library/Class/AdminVar/UnleashedFacets.php +++ b/library/Class/AdminVar/UnleashedFacets.php @@ -24,7 +24,7 @@ class Class_AdminVar_UnleashedFacets { protected $_facets; public function __construct() { - $facets = explode(';', Class_AdminVar::get('UNLEASHED_FACETS')); + $facets = array_filter(explode(';', Class_AdminVar::get('UNLEASHED_FACETS'))); $this->_facets = array_combine($facets, $facets); // speed optimization } @@ -32,5 +32,10 @@ class Class_AdminVar_UnleashedFacets { public function isUnleashed($code) { return isset($this->_facets[$code]); } + + + public function isEmpty() { + return empty($this->_facets); + } } ?> \ No newline at end of file diff --git a/library/Class/MoteurRecherche/Facettes.php b/library/Class/MoteurRecherche/Facettes.php index 1d71767e1a5d441503993e7a696c2ce48dae6c76..3be79667dc3f114956464253ea11250b3308f16e 100644 --- a/library/Class/MoteurRecherche/Facettes.php +++ b/library/Class/MoteurRecherche/Facettes.php @@ -84,10 +84,12 @@ class Class_MoteurRecherche_Facettes { $to_display = $this->_groupCodesFrom($rubriques); $to_display = array_combine($to_display, $to_display); //speed optimization in_array -> isset + $admin_var_unleashed = new Class_AdminVar_UnleashedFacets(); + $should_test_unleashed = !$admin_var_unleashed->isEmpty(); foreach($codes as $code => $count) { - $rubrique = Class_Notice_Facette::find($code)->getCodeRubrique(); + $rubrique = Class_Notice_Facette::extractCodeRubrique($code); if (!isset($to_display[$rubrique])) continue; @@ -96,8 +98,10 @@ class Class_MoteurRecherche_Facettes { $facets[$rubrique] = []; if ((count($facets[$rubrique]) >= $nombre) - && !$admin_var_unleashed->isUnleashed($rubrique)) + && (!$should_test_unleashed || !$admin_var_unleashed->isUnleashed($rubrique))) { + unset($to_display[$rubrique]); continue; + } $facets[$rubrique][$code] = $count; } diff --git a/library/Class/Notice.php b/library/Class/Notice.php index 811723a36738e83bbd986f337f4915b67ea98c85..e4996f0919779ff078b3818818f2d75a62f285a3 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -1046,7 +1046,7 @@ class Class_Notice extends Storm_Model_Abstract { public function getAuteursUnimarc($auteurPrincipal = false, $getFonction = false) { - $indexation = new Class_Indexation(); + $indexation = Class_Indexation::getInstance(); $auteurs = []; $zones = ['700', '710', '720', '730', '701', '702', '711', '712', '721', '722']; @@ -1183,7 +1183,7 @@ class Class_Notice extends Storm_Model_Abstract { if (!is_array($auteurs) || empty($auteurs)) return []; - $ix = new Class_Indexation(); + $ix = Class_Indexation::getInstance(); $result = []; foreach ($auteurs as $auteur) { $avec_fonction = $this->_getAuteurAvecFonction($auteur, $ix); diff --git a/library/Class/Notice/Facette.php b/library/Class/Notice/Facette.php index 67ebc4da8e66ade3da1cc95442f658ac00128eab..927134d6637d2f1b532aa6d6c19a5085ecbb2612 100644 --- a/library/Class/Notice/Facette.php +++ b/library/Class/Notice/Facette.php @@ -37,6 +37,13 @@ class Class_Notice_Facette { } + public static function extractCodeRubrique($cle) { + return (Class_CodifThesaurus::CODE_FACETTE == $cle[0]) + ? Class_CodifThesaurus::getFacetGroup($cle) + : $cle[0]; + } + + public static function find($cle) { return (isset(static::$_instances[$cle])) ? static::$_instances[$cle]: @@ -60,14 +67,7 @@ class Class_Notice_Facette { protected function getGroupCodeFromKey() { - return $this->isThesaurus() ? - Class_CodifThesaurus::getFacetGroup($this->_cle) : - $this->_cle[0]; - } - - - public function isThesaurus() { - return Class_CodifThesaurus::CODE_FACETTE == $this->_cle[0]; + return static::extractCodeRubrique($this->_cle); } diff --git a/library/Class/Notice/Thumbnail/ProviderLocal.php b/library/Class/Notice/Thumbnail/ProviderLocal.php index 1f71e799c628fb89cdbd71d97490f2de7fc87886..4d14b3f3619e07aa3adec237c7cdec50b924b9da 100644 --- a/library/Class/Notice/Thumbnail/ProviderLocal.php +++ b/library/Class/Notice/Thumbnail/ProviderLocal.php @@ -33,7 +33,12 @@ class Class_Notice_Thumbnail_ProviderLocal $filename = $this->_record->getClefAlpha().'.jpg'; $image->thumbnailImage(160, 220, true, true); - $image->writeImage($this->_getPath($filename)); + + try { + $image->writeImage($this->_getPath($filename)); + } catch (Exception $e) { + return $this; + } return $this->_setRecordUrls($this->_getUrl($filename)); } diff --git a/library/Class/Systeme/Sql.php b/library/Class/Systeme/Sql.php index 244828b9d16ed58856c34dc4e424e1b3d3f89a65..154fbd64e182a3640a0527851a79531325294dc8 100644 --- a/library/Class/Systeme/Sql.php +++ b/library/Class/Systeme/Sql.php @@ -89,7 +89,6 @@ class Class_Systeme_Sql { return $this->run( function() use ($req, $num, $filter) { $result = $this->getAdapter()->prepare($req); - $result->execute(); $data = $result->fetchAll(($num == true) ? Zend_Db::FETCH_NUM : Zend_Db::FETCH_ASSOC); diff --git a/library/ZendAfi/View/Helper/Panier/Edit.php b/library/ZendAfi/View/Helper/Panier/Edit.php index af179ed4551f99e586f5e52a2cfeb75004f3dc12..55bf9c5a02bc2b4cb9cd78881181769d5d3103cb 100644 --- a/library/ZendAfi/View/Helper/Panier/Edit.php +++ b/library/ZendAfi/View/Helper/Panier/Edit.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 ZendAfi_View_Helper_Panier_Edit extends ZendAfi_View_Helper_BaseHelper { @@ -26,27 +26,27 @@ class ZendAfi_View_Helper_Panier_Edit extends ZendAfi_View_Helper_BaseHelper { public function Panier_Edit($panier_courant, $nombre_notices) { $this->_panier_courant = $panier_courant; $this->_nb_notices = $nombre_notices; - + $html = ''; $html.= $this->_getExportAction(); $html.= $this->_getFormEdit(); - + return $html; } - - + + protected function _getExportAction() { $html=''; if($this->_nb_notices > 0) { $html.= '<div>'. '<h2>'.$this->view->_('Exporter ce panier: ').'</h2>'. - $this->view->tagAnchor($this->view->url(['action' => 'export-unimarc', + $this->view->tagAnchor($this->view->url(['action' => 'export-unimarc', 'id_panier' => $this->_panier_courant->getId()]), $this->view->_('UNIMARC'), ['title' => $this->view->_('Exporter en UNIMARC')]). ' '. - $this->view->tagAnchor($this->view->url(['action' => 'export-liste', + $this->view->tagAnchor($this->view->url(['action' => 'export-liste', 'id_panier' => $this->_panier_courant->getId()]), $this->view->_('Liste'), ['title' => $this->view->_('Exporter en liste')]). @@ -55,34 +55,34 @@ class ZendAfi_View_Helper_Panier_Edit extends ZendAfi_View_Helper_BaseHelper { return $html; } - + protected function _getFormEdit() { $domaine_select = ''; if(Class_Users::getIdentity()->canAccessBackend()) $domaine_select = $this->view->domaineSelect($this->_panier_courant); - + $form_libelle = $domaine_select ? $this->view->_('Modifier le panier') : $this->view->_('Modifier le titre du panier') ; - + $html= ''; $html.= '<div style="display:none" id="maj_titre" name="maj_titre">'. - - '<form method="post" action="'.$this->view->url(['action' => 'majtitrepanier', + + '<form method="post" action="'.$this->view->url(['action' => 'majtitrepanier', 'id_panier' => $this->_panier_courant->getId()]).'">'. $this->view->_('Nouveau titre'). - + '<input type="text" size="40" maxlength="40" id="new_libelle" name="new_libelle" value="'.htmlspecialchars($this->_panier_courant->getLibelle()).'">'. - + $domaine_select. - - '<input name="button" type="submit" class="submit" value=""/></form></div>'. + + '<input name="button" type="submit" class="submit" value="' . $this->view->_('Valider') . '"/></form></div>'. $this->_boutonToggleForm($form_libelle); - + return $html; } - + protected function _boutonToggleForm($libelle) { return $this->view->tagAnchor('maj_titre', $libelle.$this->view->tagImg(URL_ADMIN_IMG.'ico/edit.gif', @@ -90,5 +90,5 @@ class ZendAfi_View_Helper_Panier_Edit extends ZendAfi_View_Helper_BaseHelper { ['onclick' => "$(this).prev().toggle();return false;", 'title' => $this->view->_('Modifier le panier')]); } - + } \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/TagTitreEtNombreDeResultats.php b/library/ZendAfi/View/Helper/TagTitreEtNombreDeResultats.php index 65f6c34c2132976917037e56582bced5da6f2e94..de40413c7dc2c54ec6752fb0c65f3b075092e716 100644 --- a/library/ZendAfi/View/Helper/TagTitreEtNombreDeResultats.php +++ b/library/ZendAfi/View/Helper/TagTitreEtNombreDeResultats.php @@ -21,8 +21,12 @@ class ZendAfi_View_Helper_TagTitreEtNombreDeResultats extends Zend_View_Helper_HtmlElement { - public function tagTitreEtNombreDeResultats($nombre_resultats, $criteres_recherche){ + public function tagTitreEtNombreDeResultats($search_result, $search_duration){ + $criteres_recherche = $search_result->getCriteresRecherche(); $expression_recherche = $this->_getExpressionRecherche($criteres_recherche); + + $nombre_resultats = $search_result->getRecordsCount(); + $plural_expression = $this->view->_plural( $nombre_resultats, "Aucun résultat trouvé", "Il y a <span class='nombre-recherche'> %d </span> résultat", @@ -36,7 +40,7 @@ class ZendAfi_View_Helper_TagTitreEtNombreDeResultats extends Zend_View_Helper_H $html .= $this->view->tagRss($this->view->url($url_rss, null, true), $this->view->_('S\'abonner à cette recherche')); - $html.='<span>' . $plural_expression . ' ' . $expression_recherche . '</span>'; + $html.='<span>' . $plural_expression . ' ' . $expression_recherche . '</span> ('. $this->view->_('%1.2f secondes', $search_duration). ')'; return $html.='</div>'; } diff --git a/library/startup.php b/library/startup.php index 6868f7d6bf18c2457378ccbd9db9b6a2e5a3e0e3..109bb98ffccc33a4ea775fc77081754311ffa661 100644 --- a/library/startup.php +++ b/library/startup.php @@ -65,7 +65,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.3'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.27'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.28'); defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/'); diff --git a/library/storm b/library/storm index f94951c8badd39a799bafc6cdcffc5b714511b91..487264e815459eb1c3560ff6a7131bffd36b35d9 160000 --- a/library/storm +++ b/library/storm @@ -1 +1 @@ -Subproject commit f94951c8badd39a799bafc6cdcffc5b714511b91 +Subproject commit 487264e815459eb1c3560ff6a7131bffd36b35d9 diff --git a/public/opac/skins/modele/css/global.css b/public/opac/skins/modele/css/global.css index 7eef1bfca3408e6f038c494cff24ea0edc7dd891..a44a23ab05ba635e19320e41f25efeec318cb38c 100644 --- a/public/opac/skins/modele/css/global.css +++ b/public/opac/skins/modele/css/global.css @@ -168,7 +168,7 @@ a:hover {color:#D44100;} .form td.masque{text-align:right;} .form td.saisie{text-align:left;} .submit {background:transparent url(../images/bouton/btn_ok.gif) no-repeat scroll 0 0;border:0 none;cursor:pointer;height:18px;width:18px;} - +.panier_index .submit {font-size: 0px;} /* Tableau de liste */ .listeTitre{border-bottom:1px solid #CACFD5;border-top:1px solid #CACFD5;color:#666666;font-weight:bold;} .listePaire{background-color:#F4F4EF;} diff --git a/public/opac/skins/original/css/global.css b/public/opac/skins/original/css/global.css index aa519344819e10a7c193589887e1b75a91ce0d6c..62984b81b48242e5f53457c62c2075184e4e63fe 100644 --- a/public/opac/skins/original/css/global.css +++ b/public/opac/skins/original/css/global.css @@ -190,7 +190,7 @@ a:visited{color:#0058A5; text-decoration:none;} .form td.masque{text-align:right;font-size:8pt} .form td.saisie{text-align:left;font-size:8pt} .submit {background:transparent url(../images/bouton/btn_ok.gif) no-repeat scroll 0 0;border:0 none;cursor:pointer;height:18px;width:18px;} - +.panier_index .submit {font-size: 0px;} /* Tableau de liste */ .listeTitre{border-bottom:1px solid #CACFD5;border-top:1px solid #CACFD5;color:#666666;font-weight:bold;} .listePaire{background-color:#F4F4EF;} diff --git a/tests/application/modules/opac/controllers/PanierControllerTest.php b/tests/application/modules/opac/controllers/PanierControllerTest.php index cb6919d03021f5b74618fe97300a33f2c7054dbe..d6777afc4119f19faad7070cb9313b0d1b32c6c0 100644 --- a/tests/application/modules/opac/controllers/PanierControllerTest.php +++ b/tests/application/modules/opac/controllers/PanierControllerTest.php @@ -265,6 +265,11 @@ class PanierControllerIndexActionWithIdNoticeBDTest extends PanierControllerTest } + /** @test */ + public function majTitreFormSubmitValueShouldBeValider() { + $this->assertXPath('//div[@id="maj_titre"]//form//input[@type="submit"][@value="Valider"]'); + } + /** @test */ public function panierOrphelinShouldBeVisible() { diff --git a/tests/application/modules/opac/controllers/RechercheControllerTest.php b/tests/application/modules/opac/controllers/RechercheControllerTest.php index 4f400ae547a77d7e2d66917b88ef54fc5217208b..ccddbd6831f3e4014a5d95a5e2fc1d3f1ad5d31a 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerTest.php @@ -1107,10 +1107,14 @@ class RechercheControllerSimpleActionWithDefaultConfigTest extends RechercheCont Class_Profil::getCurrentProfil()->setCfgModules([]); $this->dispatch('/recherche/simple/expressionRecherche/pomme/tri/alpha_auteur',true); - } + /** @test */ + public function pageShouldContainsSearchDurationInSecondes() { + $this->assertXPathContentContains('//div', 'secondes)'); + } + /** @test */ public function pageShouldContainsLinkToAtomFormat() { diff --git a/tests/application/modules/telephone/controllers/RechercheControllerTest.php b/tests/application/modules/telephone/controllers/RechercheControllerTest.php index 2eec4626e4921b6d71c8f672a8c5159ba2f7ea03..dc0e00c1b5909637ac094568a51c20811ab30702 100644 --- a/tests/application/modules/telephone/controllers/RechercheControllerTest.php +++ b/tests/application/modules/telephone/controllers/RechercheControllerTest.php @@ -25,7 +25,7 @@ require_once 'TelephoneAbstractControllerTestCase.php'; class Telephone_RechercheControllerSimpleSeveralInexistingWordsActionTest extends TelephoneAbstractControllerTestCase { public function setUp() { parent::setUp(); - $this->dispatch('/telephone/recherche/simple/expressionRecherche/zzriuezz+greuieub+brfauiok'); + $this->dispatch('/telephone/recherche/simple/expressionRecherche/zzriuezz+greuieub+brfauiok', true); } @@ -99,6 +99,12 @@ class Telephone_RechercheControllerSimpleByPertinenceActionTest extends Telephon public function pageShouldNotDisplayAucunResultat() { $this->assertNotXPathContentContains('//span', 'Aucun résultat trouvé'); } + + + /** @test */ + public function pageShouldContainsSearchDurationInSecondes() { + $this->assertXPathContentContains('//div', 'secondes)'); + } }