diff --git a/VERSIONS b/VERSIONS index 5cf9e5829d066a6d656ca6eaaefc58aaa89731dc..dde67ab64a5875ef977b1a336bbe5a0b1c4b6f9b 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,10 @@ +24/06/2014 - v6.46.1 +- ticket #14515 : correction du partage des paramètres des boîtes de bannière sur une même arborescence de profils +- ticket #13914 : correction d'un bug dans l'écran des options de menu de type "Lien vers un album" qui survenait lorsqu'un album appartenait à la catégorie automatique "Albums non classés" +- Suppression de mots exclus pour améliorer la recherche sur les séries +- SIGB Pergame: correction mise à jour des abonnés en temps réel si le serveur est chargé + + 23/06/2014 - v6.46 - ticket #13657: administration des lettres d'information diff --git a/application/modules/admin/controllers/AccueilController.php b/application/modules/admin/controllers/AccueilController.php index 47c99d2c9bb5c7c29fdfa2eab969c35b9510e734..495e296107d42a85a62469f9138f8a9066838cb9 100644 --- a/application/modules/admin/controllers/AccueilController.php +++ b/application/modules/admin/controllers/AccueilController.php @@ -50,8 +50,8 @@ class Admin_AccueilController extends Zend_Controller_Action { $this->type_module = $module_config['type_module']; } + xdebug_break(); - $user = Class_Users::getIdentity(); diff --git a/application/modules/admin/controllers/AlbumController.php b/application/modules/admin/controllers/AlbumController.php index 7dc71a9a2d94343b02f98d23043207dce5e4cfcc..b05f10b1e4a2a89f35e17695c7bcf16d62bd9a05 100644 --- a/application/modules/admin/controllers/AlbumController.php +++ b/application/modules/admin/controllers/AlbumController.php @@ -34,9 +34,7 @@ class Admin_AlbumController extends ZendAfi_Controller_Action { public function indexAction() { $categories = Class_AlbumCategorie::findAllBy(['parent_id' => 0, 'order' => 'libelle']); - $categories []= Class_AlbumCategorie::newInstanceWithId(0) - ->setLibelle('Albums non classés') - ->setSousCategories([]) + $categories []= Class_AlbumCategorie::defaultCategory() ->setAlbums(Class_Album::findAllBy(['cat_id' => 0])); $this->view->categories = [['bib' => Class_Bib::getPortail(), diff --git a/application/modules/admin/controllers/MenusController.php b/application/modules/admin/controllers/MenusController.php index e57f3a07f55d4a06cc5669ad320f4beb3b50b599..cc4d326cd5126df77d0c06d3fb85da7ec55403bb 100644 --- a/application/modules/admin/controllers/MenusController.php +++ b/application/modules/admin/controllers/MenusController.php @@ -18,22 +18,16 @@ * along with AFI-OPAC 2.0; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -////////////////////////////////////////////////////////////////////////////////////////// -// OPAC3 - Propriétés des modules des menus -// -////////////////////////////////////////////////////////////////////////////////////////// -require_once('AccueilController.php'); +require_once 'AccueilController.php'; class Admin_MenusController extends Admin_AccueilController { private $id_profil; // Id_profil du menu private $id_module; // N° d'identifiant unique pour le javascript config_menus private $type_menu; // Type de menu -//------------------------------------------------------------------------------------------------------ -// Initialisation des parametres et du layout -//------------------------------------------------------------------------------------------------------ - function init() { + + public function init() { // Changer le layout $viewRenderer = $this->getHelper('ViewRenderer'); $viewRenderer->setLayoutScript('subModal.phtml'); @@ -53,7 +47,7 @@ class Admin_MenusController extends Admin_AccueilController { } - function postDispatch(){ + public function postDispatch() { $modules_menu = new Class_Systeme_ModulesMenu(); $reload = (1 === (int)$this->_getParam('styles_reload')); @@ -65,150 +59,122 @@ class Admin_MenusController extends Admin_AccueilController { $this->renderScript('accueil/'.$action.'.phtml'); } -//------------------------------------------------------------------------------------------------------ -// Fonctions sans préférences : uniquement picto et libelle -//------------------------------------------------------------------------------------------------------ - function indexAction() { - if ($this->_request->isPost()) - { - $enreg=$_POST; + + public function indexAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// Avis -//------------------------------------------------------------------------------------------------------ - function avisAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - $nb=(int)($enreg["nb"]); - if($nb < 1 or $nb > 50) $this->retourErreur("Le nombre d'avis doit être compris entre 1 et 50"); - else $this->_updateEtRetour($enreg); + + public function avisAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + $nb = (int)($enreg['nb']); + ($nb < 1 or $nb > 50) ? + $this->retourErreur("Le nombre d'avis doit être compris entre 1 et 50") : + $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// NEWS (articles cms) -//------------------------------------------------------------------------------------------------------ - function newsAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; + + public function newsAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; $enreg["nb_aff"] = (int)$enreg["nb_aff"]; $enreg["nb_analyse"] = (int)$enreg["nb_analyse"]; $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// LAST_NEWS (derniers articles) -//------------------------------------------------------------------------------------------------------ - function lastnewsAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - $nb=(int)($enreg["nb"]); - if($nb < 1 or $nb > 50) $this->retourErreur("Le nombre d'articles doit être compris entre 1 et 50"); - else $this->_updateEtRetour($enreg); + + + public function lastnewsAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + $nb = (int)($enreg["nb"]); + ($nb < 1 or $nb > 50) ? + $this->retourErreur("Le nombre d'articles doit être compris entre 1 et 50"): + $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// RSS -//------------------------------------------------------------------------------------------------------ - function rssAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - $nb=(int)($enreg["nb"]); - if($nb < 1 or $nb > 50) $this->retourErreur("Le nombre à afficher doit être compris entre 1 et 50"); - else $this->_updateEtRetour($enreg); + + public function rssAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + $nb = (int)($enreg["nb"]); + ($nb < 1 or $nb > 50) ? + $this->retourErreur("Le nombre à afficher doit être compris entre 1 et 50"): + $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// SITOTHEQUE -//------------------------------------------------------------------------------------------------------ - function sitothequeAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - $nb=(int)($enreg["nb"]); - if($nb < 1 or $nb > 50) $this->retourErreur("Le nombre à afficher doit être compris entre 1 et 50"); - else $this->_updateEtRetour($enreg); + + public function sitothequeAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + $nb = (int)($enreg["nb"]); + ($nb < 1 or $nb > 50) ? + $this->retourErreur("Le nombre à afficher doit être compris entre 1 et 50"): + $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// Lien vers une site (url libre) -//------------------------------------------------------------------------------------------------------ - function liensiteAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - if(trim($enreg["url"])> "" and substr(strtolower($enreg["url"]),0,4) != "http") $this->retourErreur("L'url saisie n'est pas correcte"); - else $this->_updateEtRetour($enreg); + + public function liensiteAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + (trim($enreg["url"])> "" and substr(strtolower($enreg["url"]),0,4) != "http") ? + $this->retourErreur("L'url saisie n'est pas correcte"): + $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// Lien vers un profil du portail -//------------------------------------------------------------------------------------------------------ - function lienprofilAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; + + public function lienprofilAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; $this->_updateEtRetour($enreg); } } -//------------------------------------------------------------------------------------------------------ -// Google map -//------------------------------------------------------------------------------------------------------ - function googlemapAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - $enreg["id_bib"]=$enreg["bib"]; + + public function googlemapAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + $enreg["id_bib"] = $enreg["bib"]; unset($enreg["bib"]); $this->_updateEtRetour($enreg); } - $bib=new Class_Bib(); - $this->view->combo_bibs=$bib->getComboBib($this->view->preferences["id_bib"],false,false); + + $bib = new Class_Bib(); + $this->view->combo_bibs = $bib->getComboBib($this->view->preferences["id_bib"],false,false); } -//------------------------------------------------------------------------------------------------------ -// Catalogue -//------------------------------------------------------------------------------------------------------ - function catalogueAction() { + + public function catalogueAction() { $selected_panier = null; if (array_key_exists('id_panier', $this->view->preferences) && array_key_exists('id_user', $this->view->preferences)) $selected_panier = Class_PanierNotice::getLoader()->findFirstBy(array( 'id_panier' => $this->view->preferences['id_panier'], 'id_user' => $this->view->preferences['id_user'])); - if ($selected_panier !== null) $this->view->preferences['id_panier'] = $selected_panier->getId(); + if ($selected_panier !== null) + $this->view->preferences['id_panier'] = $selected_panier->getId(); + + if ($this->_request->isPost()) { + $enreg = $_POST; + if(!$enreg["titre"]) + $enreg["titre"]=$enreg["libelle"]; - if ($this->_request->isPost()) - { - $enreg=$_POST; - if(!$enreg["titre"]) $enreg["titre"]=$enreg["libelle"]; if($enreg["id_panier"]) { $panier = Class_PanierNotice::getLoader()->find($enreg['id_panier']); $enreg["id_catalogue"]=0; $enreg['id_panier'] = $panier->getIdPanier(); - $enreg["id_user"] = $panier->getIdUser(); - + $enreg["id_user"] = $panier->getIdUser(); + } else { + $enreg["id_user"]=0; } - else $enreg["id_user"]=0; $this->_updateEtRetour($enreg); } @@ -216,23 +182,18 @@ class Admin_MenusController extends Admin_AccueilController { $this->view->paniers=Class_PanierNotice::getPaniersForCombo(); } -//------------------------------------------------------------------------------------------------------ -// Etagère -//------------------------------------------------------------------------------------------------------ - function etagereAction() - { - if ($this->_request->isPost()) - { - $enreg=$_POST; - if(!$enreg["titre"]) $enreg["titre"]=$enreg["libelle"]; + + public function etagereAction() { + if ($this->_request->isPost()) { + $enreg = $_POST; + if (!$enreg["titre"]) + $enreg["titre"] = $enreg["libelle"]; $this->_updateEtRetour($enreg); } } - //------------------------------------------------------------------------------------------------------ - // bibliotheque numerique - //------------------------------------------------------------------------------------------------------ - function albumAction() { + + public function albumAction() { if ($this->_request->isPost()) { $enreg=$_POST; if(!$enreg["titre"]) $enreg["titre"]=$enreg["libelle"]; @@ -246,11 +207,8 @@ class Admin_MenusController extends Admin_AccueilController { asort($this->view->albums); } -//------------------------------------------------------------------------------------------------------ -// Retour au formulaire pour erreurs -//------------------------------------------------------------------------------------------------------ - private function retourErreur($erreur) - { + + private function retourErreur($erreur) { $this->view->erreur=$erreur; $this->view->libelle=$_POST["libelle"]; $this->view->picto=$_POST["picto"]; @@ -258,20 +216,16 @@ class Admin_MenusController extends Admin_AccueilController { } -//------------------------------------------------------------------------------------------------------ -// Décompactage des proprietes si on vient la de config admin des menus -//------------------------------------------------------------------------------------------------------ protected function extractProperties() { $module = (new Class_Systeme_ModulesMenu())->getFonction($this->type_menu); return $module->extractPreferences($this->_getParam("preferences")); } -//------------------------------------------------------------------------------------------------------ -// Validation et retour config admin des menus -//------------------------------------------------------------------------------------------------------ + protected function _updateEtRetour($data) { // Filtrage des données - foreach($data as $clef => $valeur) $enreg[$clef]=addslashes($valeur); + foreach($data as $clef => $valeur) + $enreg[$clef] = addslashes($valeur); // Variables de vue $this->view->libelle = isset($enreg['libelle']) ? $enreg['libelle'] : $enreg['titre']; @@ -304,4 +258,5 @@ class Admin_MenusController extends Admin_AccueilController { ->setCfgMenuHorizontal(['menus' => $menu_horizontal->asCfgProfil()]) ->save(); } -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/cosmogramme/php/classes/classe_indexation.php b/cosmogramme/php/classes/classe_indexation.php index 4cc547265d940328a5df710c0f1df8f0ebb6a819..20b8df9e33d8e42d3590f88b8063e0277b4e5dbf 100644 --- a/cosmogramme/php/classes/classe_indexation.php +++ b/cosmogramme/php/classes/classe_indexation.php @@ -48,10 +48,8 @@ class indexation { // Lire formes rejetées $this->articles=array("L'","LE ","LA ","LES ","UN ","UNE "); - $this->inclu=array("AN","AS","OR","U2","AI","LU","XO","DO","RE","MI","FA","SI","AC","DC","XX","B","C","D","E","F","G","H","I","J","K","M","N","P","Q","R","S","T","V","W","X","Y","Z","L","YU","UT","LI","OC","PI","ZU","WU","TO","OZ","ZZ","XX"); - $this->exclu = array("LES","DES","MES","TES","ENTRE","CHEZ","SES","LEUR","MON","ENTRE","POUR","ELLE","ILS","COMME","DANS", - "EUX","CEUX","MAIS","MEME","SANS","TOME","VERS","VOUS","CECI","CES","ETC","PARCE","QUE","QUEL","QUELLE","QUELS","QUELLES", - "PAS","QUI","QUOI","VOS","AFIN","CECI","CELA","LUI","PAR","PUIS","SOI"); + $this->inclu=array("AN","AS","OR","U2","AI","LU","XO","DO","RE","MI","FA","SI","AC","DC","XX","B","C","D","E","F","G","H","I","J","K","M","P","Q","R","S","T","V","W","X","Y","Z","L","YU","UT","LI","OC","PI","ZU","WU","TO","OZ","ZZ","XX"); + $this->exclu = array("L","LE","LA","LES","UN","UNE","LES","DES","MES","TES","CES"); // Pluriels $this->pluriel=array( diff --git a/cosmogramme/php/web_services/temps_reel_pergame.php b/cosmogramme/php/web_services/temps_reel_pergame.php index 3ff399a50ca27336d4ecedb9d080ac449622a4da..f7c346af95c7de3a8ad3e5edc66cd29d562e2a72 100644 --- a/cosmogramme/php/web_services/temps_reel_pergame.php +++ b/cosmogramme/php/web_services/temps_reel_pergame.php @@ -78,7 +78,7 @@ define("ID_PROFIL_RESERVATION",103); $trace=$_REQUEST["trace"]; if($trace) trace("mode trace"); $statut=setConnect(); -if($statut == "busy") retour($statut,"Trop de connexions"); +if($statut == "busy" and $_REQUEST["cmd"]!='8') retour($statut,"Trop de connexions"); // on laisse passer les abonnés (code 8) // Controle des parametres et connexion a la base $nomBase=$_REQUEST["base"]; diff --git a/library/Class/Album.php b/library/Class/Album.php index e72f13aeb2990d366c3d6e608b3d8ab0cbad3513..43d55ed567292e012ee033e38db6639cd95da4d4 100644 --- a/library/Class/Album.php +++ b/library/Class/Album.php @@ -352,9 +352,7 @@ class Class_Album extends Storm_Model_Abstract { /** @return array */ public function getHierarchy() { - $hierarchy = []; - $this->getCategorie()->getHierarchyOn($hierarchy); return $hierarchy; } @@ -989,7 +987,13 @@ class Class_Album extends Storm_Model_Abstract { * @return string */ public function getAbsolutePath() { - return $this->getCategorie()->getAbsolutePath().'>'.$this->getTitre(); + return $this->getCategorie()->getAbsolutePath() . '>' . $this->getTitre(); + } + + + public function getCategorie() { + return ($parent = parent::getCategorie()) ? + $parent : Class_AlbumCategorie::defaultCategory(); } diff --git a/library/Class/AlbumCategorie.php b/library/Class/AlbumCategorie.php index 0e8d5455541d4a601c9315967a13f2a7432963f3..6163413898440ddfa6427bfee4b8a76dfb8eb22d 100644 --- a/library/Class/AlbumCategorie.php +++ b/library/Class/AlbumCategorie.php @@ -51,6 +51,13 @@ class AlbumCategorieLoader extends Storm_Model_Loader { asort($libelles); return $libelles; } + + + public function defaultCategory() { + return Class_AlbumCategorie::newInstanceWithId(0) + ->setLibelle('Albums non classés') + ->setSousCategories([]); + } } diff --git a/library/Class/Indexation.php b/library/Class/Indexation.php index dd2fe3c43b8cc9b69ce27b00cf8841432410e5e1..2da8d0fbb97e038d24b351e2d64190da21b44213 100644 --- a/library/Class/Indexation.php +++ b/library/Class/Indexation.php @@ -34,9 +34,8 @@ class Class_Indexation { public function __construct() { // Lire formes rejetées $this->articles=array("L'","LE ","LA ","LES ","UN ","UNE "); - $this->inclu=array("AN","AS","OR","U2","AI","LU","XO","DO","RE","MI","FA","SI","AC","DC","XX","B","C","D","E","F","G","H","I","J","K","M","N","P","Q","R","S","T","V","W","X","Y","Z","L","YU","UT","LI","OC","PI","ZU","WU","TO","OZ","ZZ","XX"); - $this->exclu = array("LES","DES","MES","TES","ENTRE","CHEZ","SES","LEUR","MON","ENTRE","POUR","ELLE","ILS","COMME","DANS","EUX","CEUX","MAIS","MEME","SANS", - "TOME","VERS","VOUS","CECI","CES","ETC","PARCE","QUE","QUEL","QUELLE","QUELS","QUELLES","PAS","QUI","QUOI","VOS","AFIN","CECI","CELA","LUI","PAR","PUIS","SOI"); + $this->inclu=array("AN","AS","OR","U2","AI","LU","XO","DO","RE","MI","FA","SI","AC","DC","XX","B","C","D","E","F","G","H","I","J","K","M","P","Q","R","S","T","V","W","X","Y","Z","L","YU","UT","LI","OC","PI","ZU","WU","TO","OZ","ZZ","XX"); + $this->exclu = array("L","LE","LA","LES","UN","UNE","LES","DES","MES","TES","CES"); // Pluriels $this->pluriel=array( diff --git a/library/Class/Profil.php b/library/Class/Profil.php index 8e926f2871aab6f9e3c5be11f8aacb98fe2e21fc..18f247c3927c988ebc855595cd6cbfad2bc68e2e 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -407,21 +407,30 @@ class Class_Profil extends Storm_Model_Abstract { } + protected function isModulePreferencesSharedBetweenProfils($module, $type_module) { + return ( + (isset($module['division']) && ($module['division'] == self::DIV_BANNIERE)) + || + (!isset($module['division']) && ($this->isTypeBoiteInBanniere($type_module))) + ); + } + + /** * @param int $id_module * @param string $type_module * @return array */ public function getOrCreateConfigAccueil($id_module, $type_module) { - if ($this->isTypeBoiteInBanniere($type_module)) - return $this->getModuleAccueilPreferencesByType($type_module); - $cfg_accueil = $this->getCfgAccueilAsArray(); $module = (array_isset($id_module, $cfg_accueil['modules'])) ? $cfg_accueil['modules'][$id_module] : ['preferences' => []]; + if ($this->isModulePreferencesSharedBetweenProfils($module, $type_module)) + return $this->getModuleAccueilPreferencesByType($type_module, self::DIV_BANNIERE); + $preferences = []; if (array_isset('preferences', $module)) $preferences = $module['preferences']; @@ -549,11 +558,12 @@ class Class_Profil extends Storm_Model_Abstract { /** * @param string $type_module + * @param int $division * @return array | null */ - public function getModuleAccueilPreferencesByType($type_module){ + public function getModuleAccueilPreferencesByType($type_module, $division = null){ if ($this->hasParentProfil() && - ($preferences = $this->getParentProfil()->getModuleAccueilPreferencesByType($type_module))) + ($preferences = $this->getParentProfil()->getModuleAccueilPreferencesByType($type_module, $division))) return $preferences; $preferences = []; @@ -561,7 +571,7 @@ class Class_Profil extends Storm_Model_Abstract { foreach($cfg_accueil['modules'] as $key_module => $module ) { foreach($module as $key => $value){ - if ($module[$key]===$type_module) { + if (($module[$key]===$type_module) && (!$division || ($module['division'] == $division))) { return $this->getModuleAccueilPreferences($key_module); } } diff --git a/library/startup.php b/library/startup.php index a8bacd4349f6d62217485467198e3222e4203ba2..d01935211beea511e97561ace15d249041572003 100644 --- a/library/startup.php +++ b/library/startup.php @@ -57,7 +57,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('VERSION_PERGAME','6.46'); - defineConstant('RELEASE_NUMBER', VERSION_PERGAME.''); + defineConstant('RELEASE_NUMBER', VERSION_PERGAME.'.1'); defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/'); diff --git a/tests/application/modules/admin/controllers/AccueilControllerTest.php b/tests/application/modules/admin/controllers/AccueilControllerTest.php index c0a876410c530bfa6ecb56d72bc4b6bc6528a8a4..af6541dbe9e00b01f3866a43c52bb412b47b6a48 100644 --- a/tests/application/modules/admin/controllers/AccueilControllerTest.php +++ b/tests/application/modules/admin/controllers/AccueilControllerTest.php @@ -846,7 +846,10 @@ class AccueilControllerConfigBoiteWithRightConfigFrontTest extends AccueilContro -class AccueilControllerRechSimpleConfigurationTest extends Admin_AbstractControllerTestCase { +abstract class AccueilControllerRechSimpleConfigurationTestCase extends Admin_AbstractControllerTestCase { + protected + $_profil_adulte; + public function setUp() { parent::setUp(); @@ -857,16 +860,80 @@ class AccueilControllerRechSimpleConfigurationTest extends Admin_AbstractControl 'boite' => 'boite_vide', 'placeholder' => 'ex: Potter']]; - $profil_adulte = Class_Profil::getCurrentProfil() + $this->_profil_adulte = Class_Profil::getCurrentProfil() ->setLibelle('Adulte') ->updateModuleConfigAccueil(2, $boite_recherche); + } +} + + + + +class AccueilControllerMultipleRechSimpleConfigurationTest extends AccueilControllerRechSimpleConfigurationTestCase { + protected + $_profil_romans; + + public function setUp() { + parent::setUp(); + + $boite_recherche_banniere = ['type_module' => 'RECH_SIMPLE', + 'division' => 4, + 'id_module' => 8, + 'preferences' => ['titre' => 'Search']]; + + $this->_profil_adulte->updateModuleConfigAccueil(8, $boite_recherche_banniere); + + + $this->_profil_romans = $this->fixture('Class_Profil', ['id' => '123']) + ->setLibelle('Romans') + ->setParentProfil(Class_Profil::getCurrentProfil()); + } + + + protected function dispatchConfigModuleProfil($id_module, $id_profil) { + $this->request_url = '/admin/accueil/rechsimple?id_module='.$id_module.'&id_profil='.$id_profil.'&type_module=RECH_SIMPLE&config=accueil'; + $this->dispatch($this->request_url, true); + $this->assertXPath('//input[@name="titre"][@value="Search"]'); + } + + + /** @test */ + public function parentProfilBoiteBanniereConfigInputTitreShouldBeSearch() { + $this->dispatchConfigModuleProfil(8, $this->_profil_adulte->getId()); + } + + + /** @test */ + public function subprofilBoiteBanniereWithConfigurationInputTitreShouldBeSearch() { + $boite_recherche_romans = ['type_module' => 'RECH_SIMPLE', + 'division' => 4, + 'id_module' => 9, + 'preferences' => ['titre' => 'Find']]; + + + $this->_profil_romans->updateModuleConfigAccueil(9, $boite_recherche_romans); + $this->dispatchConfigModuleProfil(9, 123); + } + + + /** @test */ + public function subprofilBoiteBanniereWithoutConfigurationInputTitreShouldBeSearch() { + $this->dispatchConfigModuleProfil(9, 123); + } +} + + + + +class AccueilControllerRechSimpleConfigurationTest extends AccueilControllerRechSimpleConfigurationTestCase { + public function setUp() { + parent::setUp(); Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Profil') ->whenCalled('findAllByZoneAndBib') - ->answers([$profil_adulte, + ->answers([$this->_profil_adulte, Class_Profil::newInstanceWithId(98, ['libelle' => 'Jeunesse'])]); - $this->request_url = '/admin/accueil/rechsimple?id_module=2&type_module=RECH_SIMPLE&config=accueil'; $this->dispatch($this->request_url, true); } diff --git a/tests/application/modules/admin/controllers/MenusControllerTest.php b/tests/application/modules/admin/controllers/MenusControllerTest.php index 587287db6207b71cbd787e911dfc24e4ba98cbf1..022d969cb11ad8d706bd45f868569782da2386e7 100644 --- a/tests/application/modules/admin/controllers/MenusControllerTest.php +++ b/tests/application/modules/admin/controllers/MenusControllerTest.php @@ -216,7 +216,30 @@ class Admin_MenusControllerEditMenuBibNumTest extends Admin_AbstractControllerTe } } +class Admin_MenusControllerEditMenuAlbumLinkTest extends Admin_AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $this->fixture('Class_Album', ['id' => 421, + 'cat_id' => 0, + 'titre' => 'Step accross the border']); + $this->dispatch('admin/menus/album?'. + http_build_query(array('id_profil' => '5', + 'id_bib' => 'null', + 'type_menu' => 'BIBNUM', + 'id_module' => 1, + 'libelle' => 'Lien vers un album', + 'picto' => 'book.png', + 'preferences' => 'album_id=421'))); + + } + + +/** @test */ + public function linkAlbumWithoutCategoryShouldReturnCategoryNotClassified() { + $this->assertXPathContentContains('//div', 'non classé', $this->_response->getBody()); + } +} class Admin_MenusControllerProfilJazzEditCalendrierActionTest extends Admin_MenusControllerProfilJazzTestCase {