diff --git a/VERSIONS b/VERSIONS
index a48c118eaa38fec388f4e377eee5a38add9dd416..d1af6de45a5720a412b642ea245eaeaac2814039 100644
--- a/VERSIONS
+++ b/VERSIONS
@@ -1,3 +1,14 @@
+15/07/2014 - v6.47.2
+- ticket #14874 : correction de cas pour lesquels les configurations de boîtes n'étaient pas chargées correctement
+- ticket #13648 : amélioration du moteur d'analyse unimarc
+
+Interface d'administration
+- ticket #15001 : mise à jour de liens suite au changement de nom de la mailing list afi-opac2 en utilisateurs-bokeh
+
+SIGB Nanook
+- ticket #14400 : suppression d'éventuels caractères invalides lors de l'appel au service ILSDI GetPatronInfo
+
+
 07/07/2014 - v6.47
 
  - Interface d'administration
diff --git a/application/modules/admin/controllers/AccueilController.php b/application/modules/admin/controllers/AccueilController.php
index 495e296107d42a85a62469f9138f8a9066838cb9..33dc445f0b9abc0c8d4b7576cef55bb3ac4d8ed8 100644
--- a/application/modules/admin/controllers/AccueilController.php
+++ b/application/modules/admin/controllers/AccueilController.php
@@ -28,7 +28,9 @@ class Admin_AccueilController extends Zend_Controller_Action {
 	private $_systemeModulesAccueil;
 
 
-	public function init() {
+	public function preDispatch() {
+		parent::preDispatch();
+
 		// Changer le layout
 		$viewRenderer = $this->getHelper('ViewRenderer');
 	 	$viewRenderer->setLayoutScript('subModal.phtml');
@@ -38,21 +40,13 @@ class Admin_AccueilController extends Zend_Controller_Action {
 		$this->id_profil = $this->_request->getParam("id_profil");
 		$this->config = $this->_request->getParam("config");
 
-
 		// On initalise les proprietes
-		if (!$this->profil = Class_Profil::getLoader()->find($this->id_profil)) {
+		if (!$this->profil = Class_Profil::find($this->id_profil)) {
 			$this->profil = Class_Profil::getCurrentProfil();
 			$this->id_profil = $this->profil->getId();
 		}
 
-		if (!$this->type_module = $this->_request->getParam("type_module")) {
-			$module_config = $this->profil->getModuleAccueilConfig($this->id_module);
-			$this->type_module = $module_config['type_module'];
-		}
-			
-		xdebug_break();
-
-
+		$this->type_module = $this->_getParam('type_module');			
 		$user = Class_Users::getIdentity();
  
 		if ((!$user->isAdminBib() && !$user->hasRightConfigFront())
@@ -61,13 +55,9 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			 return;
 		}
 
-
-
-		if ($this->config == "admin")
-			$this->preferences = $this->_extractProperties();
-		else 
-			$this->preferences = $this->profil->getOrCreateConfigAccueil($this->id_module,
-																																	 $this->type_module);
+		$this->preferences = ($this->config == 'admin') ?
+			$this->_extractProperties() : 
+			$this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module);
 
 		$boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : '';
 		$this->view->preferences = $this->preferences;
@@ -78,25 +68,23 @@ class Admin_AccueilController extends Zend_Controller_Action {
 		$this->view->id_bib = $this->profil->getIdSite();
 
 		$this->_systemeModulesAccueil = new Class_Systeme_ModulesAccueil();
-	}
 
-	public function preDispatch(){
-		Zend_Layout::startMvc(array());
+		Zend_Layout::startMvc([]);
 	}
 
 
 	public function calendrierAction()	{
-		$this->_simpleAction();
+		$this->_simpleAction('CALENDAR');
 	}
 
 
 	public function menuverticalAction()	{
-		$this->_simpleAction();
+		$this->_simpleAction('MENU_VERTICAL');
 	}
 
 
 	public function rechguideeAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('RECH_GUIDEE');
 	}
 
 
@@ -106,82 +94,85 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			->setTagName('profil_redirect')
 			->addEmptyOption();
 
-		$this->_simpleAction();
+		$this->_simpleAction('RECH_SIMPLE');
 	}
 
 
 	public function cartezonesAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('CARTE_ZONES');
 	}
 
 
 	public function sitothequeAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('SITO');
 	}
 
 
 	public function domainBrowserAction() {
-		$this->view->module_settings = $this->profil->getModuleAccueilConfig($this->id_module)['preferences'];
-		$this->_simpleAction();
+		$this->view->module_settings = $this->profil
+			->getModuleAccueilConfig($this->id_module, 'DOMAIN_BROWSER')['preferences'];
+		$this->_simpleAction('DOMAIN_BROWSER');
 	}
 
 
 	public function formationsWidgetAction() {
-		$this->view->module_settings = $this->profil->getModuleAccueilConfig($this->id_module)['preferences'];
-		$this->_simpleAction();
+		$this->view->module_settings = $this->profil
+			->getModuleAccueilConfig($this->id_module, 'FORMATIONS_WIDGET')['preferences'];
+		$this->_simpleAction('FORMATIONS_WIDGET');
 	}
 
 
 	public function newsAction() {
 		if (1 == $this->_getParam('styles_reload')) {
 			$this->view->preferences = $this->_request->getPost();
-		} else {
-			$this->_simpleAction();			
+			return;
 		}
+
+		$this->_simpleAction('NEWS');
 	}
 
 
 	public function rssAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('RSS');
 	}
 
 
 	public function langueAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('LANGUE');
 	}
 
 
 	public function loginAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('LOGIN');
 	}
 
 
 	public function compteursAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('COMPTEURS');
 	}
 
 	public function pretsAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('PRETS');
 	}
 
 	public function historiqueRecherchesAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('HISTORIQUE_RECHERCHES');
 	}
 
 	public function reservationsAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('RESERVATIONS');
 	}
 
 	public function multimediaAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('MULTIMEDIA');
 	}
 
 	public function newslettersAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('NEWSLETTERS');
 	}
 
 	public function panierAction() {
-		$this->_simpleAction();
+		$this->_simpleAction('PANIER');
 	}
 	
 
@@ -189,7 +180,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 		if (1 == $this->_getParam('styles_reload')) {
 			$this->view->preferences = $this->_request->getPost();
 		} else {
-			$this->_simpleAction();			
+			$this->_simpleAction('BIB_NUMERIQUE');
 		}
 
 		$this->view->categories = Class_AlbumCategorie::getLoader()->getCollections();
@@ -208,7 +199,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			$enreg['nombre'] = (int)$this->_getParam('nombre', 10);
 			$enreg['limite'] = (int)$this->_getParam('limite', 1000);
 			$enreg['type_tags'] = $enreg['type_tags_codes'];
-			$this->_updateEtRetour($enreg);
+			$this->_updateEtRetour($enreg, 'TAGS');
 		} else {
 			$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
 		}
@@ -227,7 +218,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 				$enreg["id_user"] = 0;
 			}
 
-			$this->_updateEtRetour($enreg);
+			$this->_updateEtRetour($enreg, 'CRITIQUES');
 		}
 
 		$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
@@ -262,7 +253,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			$enreg["nb_requete"] = $nb_requete;
 			$enreg["nb_aff"] = $nb_aff;
 
-			$this->_updateEtRetour($enreg);
+			$this->_updateEtRetour($enreg, 'CATALOGUE');
 		}
 	}
 
@@ -272,7 +263,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			if (1 == $this->_getParam('styles_reload')) {
 				$this->view->preferences = $this->_request->getPost();
 			} else {
-				$this->_updateConfig();
+				$this->_updateConfig('KIOSQUE');
 			}
 		}
 
@@ -312,19 +303,20 @@ class Admin_AccueilController extends Zend_Controller_Action {
 	}
 
 
-	protected function _updateConfig() {
+	protected function _updateConfig($type) {
 			$enreg = $this->_request->getPost();
 			$this->_unsetStyleReload($enreg);
 			$this->_setTypeDAnalyse($enreg);
 			$this->_setPanierOrDomaine($enreg);
-			$this->_updateEtRetour($enreg);
+			$this->_updateEtRetour($enreg, $type);
 	}
 
 
 	public function kiosqueChangeSelectionAction() {
 		$this->getHelper('ViewRenderer')->setNoRender();
 
-		$module_config = $this->profil->getModuleAccueilConfig($this->id_module);
+		$module_config = $this->profil
+			->getModuleAccueilConfig($this->id_module, 'KIOSQUE');
 		$selected_elementId = explode('-', $this->_request->getPost('domaine_panier'));
 		
 		if($selected_elementId[0] == 'p') {
@@ -354,7 +346,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 			foreach (array('gauche', 'droite') as $colonne)
 				$this->_conteneur2colonnes_createModules($enreg, $colonne);
 
-			$this->_updateEtRetour($enreg);
+			$this->_updateEtRetour($enreg, 'CONTENEUR_DEUX_COLONNES');
 			return;
 		}
 
@@ -367,10 +359,11 @@ class Admin_AccueilController extends Zend_Controller_Action {
 	}
 
 
-	private function _simpleAction() {
+	private function _simpleAction($type) {
 		// pour combo des annexes
-		$this->view->ya_annexes=fetchAll("select count(*) from codif_annexe where invisible=0 order by libelle");
-		if ($this->_request->isPost()) $this->_updateEtRetour($this->_request->getPost());
+		$this->view->ya_annexes = fetchAll("select count(*) from codif_annexe where invisible=0 order by libelle");
+		if ($this->_request->isPost()) 
+			$this->_updateEtRetour($this->_request->getPost(), $type);
 	}
 
 
@@ -410,8 +403,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 	/**
 	 * @param array $data
 	 */
-	protected function _updateEtRetour($data) {
-		
+	protected function _updateEtRetour($data, $type) {
 		$enreg = [];
 
 		foreach ($data as $clef => $valeur)
@@ -420,13 +412,13 @@ class Admin_AccueilController extends Zend_Controller_Action {
 		if ($this->config == "admin") {
 			$this->view->id_module = $this->id_module;
 			$this->view->properties = $this->_compactProperties($enreg);
-		}else {
-			$module_config = $this->profil->getModuleAccueilConfig($this->id_module);
+		} else {
+			$module_config = $this->profil->getModuleAccueilConfig($this->id_module, $type);
 			$module_config['preferences'] = $enreg;
+
 			$this->profil
 				->updateModuleConfigAccueil($this->id_module, $module_config)
 				->save();
-
 			$this->view->reload = 'SITE';
 		}
 
@@ -475,7 +467,7 @@ class Admin_AccueilController extends Zend_Controller_Action {
 
 		$enreg[$id_key] = $id_module; // L'id module n'est pas dans le post.
 
-		if ($this->profil->getModuleAccueilConfig($id_module) == null)
+		if ($this->profil->getModuleAccueilConfig($id_module, $type_module) == null)
 			$id_module = null;
 
 		// Si le module existe et du même type, pas besoin de le créer
@@ -493,8 +485,8 @@ class Admin_AccueilController extends Zend_Controller_Action {
 		$preferences = $modules_accueil->getValeursParDefaut($type_module);
 
 		$preferences['conteneur_deux_colonnes_id'] = $this->id_module;
-		$config = array("preferences" => $preferences,
-										"type_module" => $type_module);
+		$config = ["preferences" => $preferences,
+							 "type_module" => $type_module];
 
 		$this->profil->updateModuleConfigAccueil($id_module, $config);
 	}
diff --git a/application/modules/admin/controllers/CatalogueController.php b/application/modules/admin/controllers/CatalogueController.php
index 0b886e1cd5ff61aad012661674756c39d03d0f72..33d8f3fb6756641281563947ea90fc8af61dd324 100644
--- a/application/modules/admin/controllers/CatalogueController.php
+++ b/application/modules/admin/controllers/CatalogueController.php
@@ -107,7 +107,7 @@ class Admin_CatalogueController extends ZendAfi_Controller_Action {
 
 	protected function updateConfigKiosque($id_module, $catalogue){
 		$profil = Class_Profil::getCurrentProfil();
-		$module_config = $profil->getModuleAccueilConfig($id_module);
+		$module_config = $profil->getModuleAccueilConfig($id_module, 'KIOSQUE');
 		$module_config['preferences']['id_catalogue'] = $catalogue->getId();
 		$profil->updateModuleConfigAccueil($id_module, $module_config);
 		$profil->save();
diff --git a/application/modules/admin/controllers/CmsController.php b/application/modules/admin/controllers/CmsController.php
index 973c8e28b282f60d4981b19f63459f3dfe57821b..9005ce4fd49ee122e84b60a5d5127f195e389627 100644
--- a/application/modules/admin/controllers/CmsController.php
+++ b/application/modules/admin/controllers/CmsController.php
@@ -210,7 +210,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
  
 	protected function updateConfigBoiteNews($id_module, $article){
 		$profil = Class_Profil::getCurrentProfil();
-		$module_config = $profil->getModuleAccueilConfig($id_module);
+		$module_config = $profil->getModuleAccueilConfig($id_module, 'NEWS');
 		$id_items= array_filter(explode('-',$module_config['preferences']['id_items']));
 		array_unshift($id_items,$article->getId());
 		$module_config['preferences']['id_items'] = implode('-',$id_items);
@@ -225,7 +225,6 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
 			$this->_redirect('admin/cms');
 			return;
 		}
-		xdebug_break();
 	 	$this->_article_old_status = $article->getStatus();
 		if (null === ($article->getCategorie()->getBib()))
 			$article->getCategorie()->setBib($this->_bib);
diff --git a/application/modules/admin/controllers/MenusController.php b/application/modules/admin/controllers/MenusController.php
index cc4d326cd5126df77d0c06d3fb85da7ec55403bb..627e49ef25881889766487af97af08a8b039aa9e 100644
--- a/application/modules/admin/controllers/MenusController.php
+++ b/application/modules/admin/controllers/MenusController.php
@@ -27,7 +27,8 @@ class Admin_MenusController extends Admin_AccueilController {
 	private $type_menu;							// Type de menu
 
 
-	public function init()	{
+	public function preDispatch()	{
+		parent::preDispatch();
 		// Changer le layout
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->setLayoutScript('subModal.phtml');
@@ -222,7 +223,7 @@ class Admin_MenusController extends Admin_AccueilController {
 	}
 	
 
-	protected function _updateEtRetour($data) {
+	protected function _updateEtRetour($data, $type=null) {
 		// Filtrage des données
 		foreach($data as $clef => $valeur) 
 			$enreg[$clef] = addslashes($valeur);
diff --git a/application/modules/admin/controllers/ModulesController.php b/application/modules/admin/controllers/ModulesController.php
index 81a22dcebe213cf4c8b47be0f0ab4cc90631efa7..f1bb4fb8ca708c16d7b96b741960acdd336ea913 100644
--- a/application/modules/admin/controllers/ModulesController.php
+++ b/application/modules/admin/controllers/ModulesController.php
@@ -298,7 +298,9 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
 	public function kiosqueChangeDataAction() {
 		$this->id_module = $this->_getParam('id_module');
 			
-		$module_config = $this->profil->getModuleAccueilConfig($this->_getParam('id_module'));
+		$module_config = $this->profil
+			->getModuleAccueilConfig($this->_getParam('id_module'), 'KIOSQUE');
+
 		$this->view->id_panier = $module_config['preferences']['id_panier'];
 		$this->view->id_catalogue = $module_config['preferences']['id_catalogue'];
 		$this->view->titre = $this->view->_('Sélectionnez un panier ou un domaine');
@@ -307,16 +309,16 @@ class Admin_ModulesController extends ZendAfi_Controller_Action {
 			return;
 
 		$enreg = $this->_request->getPost();
-		$this->updateCfg($enreg);
+		$this->updateCfg($enreg, 'KIOSQUE');
 		$this->_request->setParam('render','');
 
 		$this->_redirect($this->_getReferer());
 	}
 
 
-	protected function updateCfg($data) {
+	protected function updateCfg($data, $type) {
 		$enreg = [];
-		$module_config = $this->profil->getModuleAccueilConfig($this->id_module);
+		$module_config = $this->profil->getModuleAccueilConfig($this->id_module, $type);
 		foreach ($data as $clef => $valeur) {
 			$enreg[$clef] = addslashes($valeur);
 			$module_config['preferences'][$clef]=addslashes($valeur);
diff --git a/application/modules/admin/controllers/ProfilController.php b/application/modules/admin/controllers/ProfilController.php
index 1e77be238caa84ab14e3f6015cc221ae4af6fe03..3a58354b80eef28730b7c6aecfdfa7a283033107 100644
--- a/application/modules/admin/controllers/ProfilController.php
+++ b/application/modules/admin/controllers/ProfilController.php
@@ -341,17 +341,19 @@ class Admin_ProfilController extends ZendAfi_Controller_Action {
 					$enreg["modules"][$id_module]['preferences'] = $class_module->getValeursParDefaut($type_module);
 				}
 
-				/* Permet de ne pas perdre la configuration des modules contenus
-				 * dans une boîte 2 colonnes */
+				/* 
+					 Permet de ne pas perdre la configuration des modules contenus
+					 dans une boîte 2 colonnes 
+				*/
 				if ($module_config['type_module'] == "CONTENEUR_DEUX_COLONNES") {
 					if (array_key_exists('col_gauche_module_id', $module_config['preferences']) and
 						  $id_col_gauche = $module_config['preferences']['col_gauche_module_id'])
-						$enreg["modules"][$id_col_gauche] = $profil->getModuleAccueilConfig($id_col_gauche);
+						$enreg["modules"][$id_col_gauche] = $profil->getLocalModuleAccueilConfig($id_col_gauche);
 
 
 					if (array_key_exists('col_droite_module_id', $module_config['preferences']) and
 							$id_col_droite = $module_config['preferences']['col_droite_module_id'])
-						$enreg["modules"][$id_col_droite] = $profil->getModuleAccueilConfig($id_col_droite);
+						$enreg["modules"][$id_col_droite] = $profil->getLocalModuleAccueilConfig($id_col_droite);
 				}
 			}
 
diff --git a/application/modules/admin/views/scripts/accueil/calendrier.phtml b/application/modules/admin/views/scripts/accueil/calendrier.phtml
index 4b28083a03804a6449245c77b32d94bd63aa70ff..a19d4d0c4c16b4175542e093616dc0aab6798d9c 100644
--- a/application/modules/admin/views/scripts/accueil/calendrier.phtml
+++ b/application/modules/admin/views/scripts/accueil/calendrier.phtml
@@ -77,13 +77,25 @@
 																			'diaporama_navigation' => $this->_('Diaporama avec navigation'),
 									                    'none' => $this->_('Ne pas afficher')]);
 							echo (new ZendAfi_View_Helper_Admin_PropertiesReader())
-																										 ->setView($this)
-																										 ->propertiesReader($this->preferences['mode-affichage'],
-																																				$this->preferences);
+												->setView($this)
+												->propertiesReader($this->preferences['mode-affichage'],
+																					 $this->preferences);
 						  ?>
 					  </td>
-						</tr>
-						<tr>
+					</tr>
+
+					<tr>
+	          <td class="droite"><?php echo $this->_('Filtre sur les évènements'); ?></td>
+	          <td class="gauche">
+	            <?php echo $this->formSelect('event_filter', 
+	                                         $this->preferences['event_filter'], 
+	                                         '', 
+	                                         ['none' => $this->_('aucun'),
+																						'month' => $this->_('par mois')]); ?>
+	          </td>
+	        </tr>
+
+					<tr>
 						<td class="droite">Mode d'affichage des titres</td>
 						<td class="gauche">
 						  <?php 
@@ -148,16 +160,16 @@
 
 	      <div id='table_selection'>
 	        <?php	
-	        echo $this->treeSelect(
-	          '',
-	          $this->preferences["id_categorie"],
-	          true,
-	          $this->url(array('module' => 'admin',
-	                           'controller' => 'bib',
-	                           'action' => 'articles',
-	                           'id_bib' => $this->id_bib,
-	                           'categories_only' => 1)),
-	          "form");
+							 echo $this->treeSelect(
+								 '',
+								 $this->preferences["id_categorie"],
+								 true,
+								 $this->url(array('module' => 'admin',
+																	'controller' => 'bib',
+																	'action' => 'articles',
+																	'id_bib' => $this->id_bib,
+																	'categories_only' => 1)),
+								 "form");
 	        ?>
 	      </div>
 
diff --git a/application/modules/admin/views/scripts/index/index.phtml b/application/modules/admin/views/scripts/index/index.phtml
index 93636f038fd1a788789cc41364d81042d419be5d..1438bd1e6a98d7d86055a22683bc9c29b0a0aaf5 100644
--- a/application/modules/admin/views/scripts/index/index.phtml
+++ b/application/modules/admin/views/scripts/index/index.phtml
@@ -1,92 +1,92 @@
-<h2><?php echo $this->traduire('Version');?>&nbsp;:
-	<a href='http://git.afi-sa.fr/afi/opacce/blob/master/VERSIONS'><?php echo RELEASE_NUMBER ?></a>
-</h2>
-
-
-<h2><?php echo $this->traduire('Paramètres du site');?>&nbsp;:</h2>
-<?php 
-$profil = Class_Profil::getCurrentProfil();
-$lien_edit_site = $lien = '';
-if ($this->user->isAdmin()) {
-	$lien = sprintf('<a href="admin?setsiteok=%s" style="margin-left:30px">&raquo;&nbsp;%s&nbsp;&laquo;</a>',
-									$this->href_site, $this->lien_site);
-	$lien_edit_site = sprintf('<a href="%s" style="margin-left:30px" >&raquo;&nbsp;Paramétrer&nbsp;&laquo;</a>',
-														$this->url(array('controller' => 'profil', 
-																						 'action' => 'accueil', 
-																						 'id_profil' => $profil->getId())));
-}
-
-echo $this->ligneInfos("Etat du site", $this->etat_site . $lien) 
-  . $this->ligneInfos("Profil", $profil->getLibelle() . $lien_edit_site) 
-  . $this->ligneInfos("Thème", $profil->getSkin())
-  . $this->ligneInfos("Avis Babelio", $this->status_babelio);
-
-if ($this->show_babelio_info) { ?>
-  <div class='ligne_info'>Le service <a href='http://www.babelio.com/'>Babelio</a> est gratuit pour une durée de 
-90 jours à compter de l'ouverture du portail. Veuillez contacter AFI pour souscrire à un abonnement.</div>
-<?php } ?>
-
-<h2><?php echo $this->traduire('Accès');?>&nbsp;:</h2>
-<?php
-$acl = new ZendAfi_Acl_AdminControllerRoles();
-echo $this->ligneInfos($this->traduire("Utilisateur"), $this->user->getLogin());
-echo $this->ligneInfos("Pseudo", $this->user->getNomAff());
-echo $this->ligneInfos("Rôle", $acl->getLibelleRole($this->user->getRoleLevel()));
-$bib = $this->user->getBib();
-$bib = (!$bib) ? 'Portail' : $bib->getLibelle();
-echo $this->ligneInfos("Bibliothèque", $bib);
-?>
-
-<h2><?php echo $this->traduire('Données en attente de modération');?>&nbsp;:
-<a class="rss" href="<?php 
-echo $this->url(array('module' => 'opac',
-                      'controller' => 'rss',
-                      'action' => 'moderations'));
-?>"><img src="<?php echo URL_ADMIN_IMG;?>/rss.gif" alt="RSS"/></a>
-</h2>
-<?php 
-$moderer = new Class_Moderer();
-$modstats = $moderer->getModerationStats();
-foreach ($modstats as $stat) {
-	$nombre = ($stat['count']) ? $stat['count'] : 'aucun';
-	echo $this->ligneInfos(sprintf('<a href="%s" style="font-size:10pt">%s</a>',
-                                 $stat['url'], $stat['label']), 
-                         $nombre);
-}
-?>
-
-<h2>Un problème ? Contactez le support AFI:</h2>
-<?php echo $this->ligneInfos('Par courriel (de préférence)',  '<a href="mailto:hotline@afi-sa.fr">hotline@afi-sa.fr</a>') ?>
-<?php echo $this->ligneInfos('Par téléphone',  '01.60.17.12.34 en semaine, 01.60.37.01.34 le samedi') ?>
-
-<h2>Participez à la communauté !</h2>
-<div class='ligne_info'><a onclick="window.open(this.href); return false" href="https://groups.google.com/group/afi-opac2">Google group afi-opac2</a></div>
-<div class='ligne_info'><a onclick="window.open(this.href); return false" href="http://bibliopedia.fr/index.php/AFI-OPAC2.0_-_Trucs_et_astuces">Wiki sur Bibliopedia</a></div>
-	
-<h2>Forum AFI-OPAC2.0:</h2>
-<iframe id="forum_embed"
- src="javascript:void(0)"
- scrolling="no"
- frameborder="0"
- width="700"
- height="700">
-</iframe>
-
-<script type="text/javascript">
- document.getElementById("forum_embed").src =
-  "https://groups.google.com/forum/embed/?place=forum/afi-opac2" +
-  "&showsearch=true&hl=fr&hideforumtitle=true&showpopout=true";
-</script>
-
-
-<script>
-(function() {
-	 function supportsCanvas() {
-		 return !!document.createElement('canvas').getContext;
-	 }
-
-	 if (!supportsCanvas())
-	   showNotification({message: 'Votre navigateur ne permet pas d\'utiliser pleinement l\'interface d\'administration. Pour un fonctionnement optimal, nous recommandons d\'utiliser une version récente de Firefox, Chrome, Safari ou Internet Explorer',
-											 type: 'error'});
-})();
-</script>
+<h2><?php echo $this->traduire('Version');?>&nbsp;:
+	<a href='http://git.afi-sa.fr/afi/opacce/blob/master/VERSIONS'><?php echo RELEASE_NUMBER ?></a>
+</h2>
+
+
+<h2><?php echo $this->traduire('Paramètres du site');?>&nbsp;:</h2>
+<?php 
+$profil = Class_Profil::getCurrentProfil();
+$lien_edit_site = $lien = '';
+if ($this->user->isAdmin()) {
+	$lien = sprintf('<a href="admin?setsiteok=%s" style="margin-left:30px">&raquo;&nbsp;%s&nbsp;&laquo;</a>',
+									$this->href_site, $this->lien_site);
+	$lien_edit_site = sprintf('<a href="%s" style="margin-left:30px" >&raquo;&nbsp;Paramétrer&nbsp;&laquo;</a>',
+														$this->url(array('controller' => 'profil', 
+																						 'action' => 'accueil', 
+																						 'id_profil' => $profil->getId())));
+}
+
+echo $this->ligneInfos("Etat du site", $this->etat_site . $lien) 
+  . $this->ligneInfos("Profil", $profil->getLibelle() . $lien_edit_site) 
+  . $this->ligneInfos("Thème", $profil->getSkin())
+  . $this->ligneInfos("Avis Babelio", $this->status_babelio);
+
+if ($this->show_babelio_info) { ?>
+  <div class='ligne_info'>Le service <a href='http://www.babelio.com/'>Babelio</a> est gratuit pour une durée de 
+90 jours à compter de l'ouverture du portail. Veuillez contacter AFI pour souscrire à un abonnement.</div>
+<?php } ?>
+
+<h2><?php echo $this->traduire('Accès');?>&nbsp;:</h2>
+<?php
+$acl = new ZendAfi_Acl_AdminControllerRoles();
+echo $this->ligneInfos($this->traduire("Utilisateur"), $this->user->getLogin());
+echo $this->ligneInfos("Pseudo", $this->user->getNomAff());
+echo $this->ligneInfos("Rôle", $acl->getLibelleRole($this->user->getRoleLevel()));
+$bib = $this->user->getBib();
+$bib = (!$bib) ? 'Portail' : $bib->getLibelle();
+echo $this->ligneInfos("Bibliothèque", $bib);
+?>
+
+<h2><?php echo $this->traduire('Données en attente de modération');?>&nbsp;:
+<a class="rss" href="<?php 
+echo $this->url(array('module' => 'opac',
+                      'controller' => 'rss',
+                      'action' => 'moderations'));
+?>"><img src="<?php echo URL_ADMIN_IMG;?>/rss.gif" alt="RSS"/></a>
+</h2>
+<?php 
+$moderer = new Class_Moderer();
+$modstats = $moderer->getModerationStats();
+foreach ($modstats as $stat) {
+	$nombre = ($stat['count']) ? $stat['count'] : 'aucun';
+	echo $this->ligneInfos(sprintf('<a href="%s" style="font-size:10pt">%s</a>',
+                                 $stat['url'], $stat['label']), 
+                         $nombre);
+}
+?>
+
+<h2>Un problème ? Contactez le support AFI:</h2>
+<?php echo $this->ligneInfos('Par courriel (de préférence)',  '<a href="mailto:hotline@afi-sa.fr">hotline@afi-sa.fr</a>') ?>
+<?php echo $this->ligneInfos('Par téléphone',  '01.60.17.12.34 en semaine, 01.60.37.01.34 le samedi') ?>
+
+<h2>Participez à la communauté !</h2>
+<div class='ligne_info'><a onclick="window.open(this.href); return false" href="https://groups.google.com/group/utilisateurs-bokeh">Google group Bokeh</a></div>
+<div class='ligne_info'><a onclick="window.open(this.href); return false" href="http://bibliopedia.fr/index.php/AFI-OPAC2.0_-_Trucs_et_astuces">Wiki sur Bibliopedia</a></div>
+	
+<h2>Forum Bokeh :</h2>
+<iframe id="forum_embed"
+ src="javascript:void(0)"
+ scrolling="no"
+ frameborder="0"
+ width="700"
+ height="700">
+</iframe>
+
+<script type="text/javascript">
+ document.getElementById("forum_embed").src =
+  "https://groups.google.com/forum/embed/?place=forum/utilisateurs-bokeh" +
+  "&showsearch=true&hl=fr&hideforumtitle=true&showpopout=true";
+</script>
+
+
+<script>
+(function() {
+	 function supportsCanvas() {
+		 return !!document.createElement('canvas').getContext;
+	 }
+
+	 if (!supportsCanvas())
+	   showNotification({message: 'Votre navigateur ne permet pas d\'utiliser pleinement l\'interface d\'administration. Pour un fonctionnement optimal, nous recommandons d\'utiliser une version récente de Firefox, Chrome, Safari ou Internet Explorer',
+											 type: 'error'});
+})();
+</script>
diff --git a/application/modules/opac/controllers/AuthController.php b/application/modules/opac/controllers/AuthController.php
index e233ecef37f0a530598de46bc8efce18d2e8da50..07d7c39eb193fe07099a00666dc9358321d3b77a 100644
--- a/application/modules/opac/controllers/AuthController.php
+++ b/application/modules/opac/controllers/AuthController.php
@@ -113,14 +113,14 @@ class AuthController extends ZendAfi_Controller_Action {
 
 
 	public function popupLoginAction() {
-		$page_settings = Class_Profil::getCurrentProfil()->getCfgModulesPreferences('auth','login');
-		$widget_settings = Class_Profil::getCurrentProfil()->getModuleAccueilPreferencesByType('LOGIN');
-		$this->view->preferences = 
-			$widget_settings 
-			? $widget_settings 
-			:( $page_settings 
-				 ? $page_settings 
-				 : []);
+		$page_settings = Class_Profil::getCurrentProfil()
+			->getCfgModulesPreferences('auth','login');
+		$widget_settings = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferencesByType('LOGIN');
+
+		$this->view->preferences = $widget_settings ? 
+			$widget_settings :
+			($page_settings ? $page_settings : []);
 
 		$this->view->redirect = $this->_getParam('redirect');
 
@@ -130,7 +130,9 @@ class AuthController extends ZendAfi_Controller_Action {
 
 
 	public function boiteLoginAction() {
-		$this->view->preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferencesByType('LOGIN');	
+		$this->view->preferences = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferencesByType('LOGIN');
+
 		$strategy = Auth_Strategy_Abstract::strategyForController($this);
 		$strategy->setDefaultUrl($this->_request->getServer('HTTP_REFERER'));
 		$strategy->processLogin();
diff --git a/application/modules/opac/controllers/BlogController.php b/application/modules/opac/controllers/BlogController.php
index 7861a738c497f841e7fcb9b21626521b5631bb6c..9dd3c45048b1e3ba3005afb063263bb8b8dafcce 100644
--- a/application/modules/opac/controllers/BlogController.php
+++ b/application/modules/opac/controllers/BlogController.php
@@ -96,14 +96,12 @@ class BlogController extends ZendAfi_Controller_Action {
 		$this->renderScript('blog/viewcritiques.phtml');
 	}
 
-	/* Affiche les critiques à partir des préférences d'un module
-		 Appelé lorsqu'on clique sur le titre du module critiques.
-		 Paramètre: id_module
-	 */
-	function viewcritiquesAction() {
-		$id_module = (int)$this->_request->getParam('id_module');
-		$preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module);
-		$avis = Class_AvisNotice::getLoader()->getAvisFromPreferences($preferences);
+
+	public function viewcritiquesAction() {
+		$id_module = (int)$this->_getParam('id_module');
+		$preferences = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences($id_module, 'CRITIQUES');
+		$avis = Class_AvisNotice::getAvisFromPreferences($preferences);
 		
 		$this->view->nb_aff = 50;
 		$this->view->liste_avis = $avis;
diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php
index 33d67029bd34144bf64cf742448a15d46f906ddf..bf5a2c66de3bf77bcea67500ae022d842efdef07 100644
--- a/application/modules/opac/controllers/CmsController.php
+++ b/application/modules/opac/controllers/CmsController.php
@@ -41,9 +41,10 @@ class CmsController extends Zend_Controller_Action {
 	public function articleviewbydateAction() {
 		$id_profil = (int)$this->_getParam('id_profil');
 		$id_module = (int)$this->_getParam('id_module');
-		if (!$profil = Class_Profil::getLoader()->find($id_profil))
+		if (!$profil = Class_Profil::find($id_profil))
 			$profil = Class_Profil::getCurrentProfil();
-		$preferences	= $profil->getModuleAccueilPreferences($id_module);
+
+		$preferences	= $profil->getModuleAccueilPreferences($id_module, 'NEWS');
 		$preferences['event_date']		= $this->_getParam('d');
 		$preferences['id_bib']				= $this->_getParam('b');
 		$preferences['events_only']		= true;
@@ -60,9 +61,9 @@ class CmsController extends Zend_Controller_Action {
 		if($preferences['display_mode']!='Title')
 			$this->_viewArticlesByPreferences($preferences);
 
-		$articles = Class_Article::getLoader()->getArticlesByPreferences($preferences);
-		$articles = Class_Article::getLoader()->filterByLocaleAndWorkflow($articles);
-		$articles	= Class_Article::getLoader()->groupByBibId($articles);
+		$articles = Class_Article::getArticlesByPreferences($preferences);
+		$articles = Class_Article::filterByLocaleAndWorkflow($articles);
+		$articles	= Class_Article::groupByBibId($articles);
 
 		if ((count($articles) == 1) && isset($articles[0]))
 			$libelle_bibs = [0 => ''];
@@ -81,8 +82,8 @@ class CmsController extends Zend_Controller_Action {
 		$id_profil = (int)$this->_getParam('id_profil');
 		$id_module = (int)$this->_getParam('id_module');
 
-		$profil				= Class_Profil::getLoader()->find($id_profil);
-		$preferences	= $profil->getModuleAccueilPreferences($id_module);
+		$profil				= Class_Profil::find($id_profil);
+		$preferences	= $profil->getModuleAccueilPreferences($id_module, 'NEWS');
 
 		if (
 			array_key_exists('id_categorie', $preferences)
@@ -99,16 +100,16 @@ class CmsController extends Zend_Controller_Action {
 		$preferences['events_only'] = true;
 		$preferences['published'] = false;
 
-		$articles = Class_Article::getLoader()->getArticlesByPreferences($preferences);
-		$articles = Class_Article::getLoader()->filterByLocaleAndWorkflow($articles);
+		$articles = Class_Article::getArticlesByPreferences($preferences);
+		$articles = Class_Article::filterByLocaleAndWorkflow($articles);
 
-		$data_rss = array(
+		$data_rss = [
 			'title' 	=> $preferences['titre'],
 			'link'  	=> $profil->urlForModule('cms', 'articleviewbydate', $id_module),
 			'charset'	  => 'utf-8',
 			'description' => 'Agenda: ' . $preferences['titre'],
 			'lastUpdate'  => time()
-		);
+		];
 
 		$this->_renderRSS($articles, $data_rss);
 
@@ -182,38 +183,34 @@ class CmsController extends Zend_Controller_Action {
 		$id_profil = (int)$this->_getParam('id_profil');
 		$id_module = (int)$this->_getParam('id_module');
 
-		$articles = array();
+		$articles = [];
 
-		$data_rss = array(
+		$data_rss = [
 				'title' 	=> 'Flux indisponible',
 				'link'  	=> $this->_request->getScheme() . '://'
 												. $this->_request->getServer('HTTP_HOST'),
 				'charset'	  => 'utf-8',
 				'description' => '',
 				'lastUpdate'  => time()
-		);
+		];
 
-		if (null != ($profil = Class_Profil::getLoader()->find($id_profil))) {
-			$preferences = $profil->getModuleAccueilPreferences($id_module);
+		if (null != ($profil = Class_Profil::find($id_profil))) {
+			$preferences = $profil->getModuleAccueilPreferences($id_module, 'NEWS');
 
 			$data_rss = array_merge(
 					$data_rss,
-					array(
+					[
 						'title' 	=> $preferences['titre'],
 						'link'  	=> $profil->urlForModule('cms', 'viewselection', $id_module),
 						'description' => 'Articles: '.$preferences['titre']
-					)
+					]
 			);
 
-			$articles = Class_Article::getLoader()
-										->getArticlesByPreferences($preferences);
-
-			$articles = Class_Article::getLoader()->filterByLocaleAndWorkflow($articles);
-
+			$articles = Class_Article::getArticlesByPreferences($preferences);
+			$articles = Class_Article::filterByLocaleAndWorkflow($articles);
 		}
 
 		$this->_renderRSS($articles, $data_rss);
-
 	}
 
 
@@ -230,11 +227,13 @@ class CmsController extends Zend_Controller_Action {
 	 */
 	public function articleviewselectionAction() {
 		$preferences = $this->_modulesPreferences(
-																				(int)$this->_getParam('id_module'),
-																				(int)$this->_getParam('id_profil'),
-																				$this->_getParam('id_menu'));
+			(int)$this->_getParam('id_module'),
+			(int)$this->_getParam('id_profil'),
+			$this->_getParam('id_menu'));
+
 		$preferences['nb_aff'] = 30;
-		if (!array_isset('display_order', $preferences) || ('Random' == $preferences['display_order']))
+		if (!array_isset('display_order', $preferences) 
+				|| ('Random' == $preferences['display_order']))
 			$preferences['display_order'] = 'DateCreationDesc';
 		$this->_viewArticlesByPreferences($preferences);
 	}
@@ -333,13 +332,13 @@ class CmsController extends Zend_Controller_Action {
 	 */
 	private function _modulesPreferences($id_module, $id_profil = null, $id_menu = null) {
 		$profil = ($id_profil)
-								? Class_Profil::getLoader()->find($id_profil)
+								? Class_Profil::find($id_profil)
 								: Class_Profil::getCurrentProfil();
 
 		if ($id_menu === 'H')
 			return $profil->getMenuHorizontal()->getMenuPrefencesByIdModule($id_module);
 
-		return $profil->getModuleAccueilPreferences($id_module);
+		return $profil->getModuleAccueilPreferences($id_module, 'NEWS');
 	}
 
 	 /**
diff --git a/application/modules/opac/controllers/DomainsController.php b/application/modules/opac/controllers/DomainsController.php
index 65b152c5c16e9c9d1f67d5a328ecdedb59c62bae..99fa2cb1b6864d3e5179457482bedcce954f6f1d 100644
--- a/application/modules/opac/controllers/DomainsController.php
+++ b/application/modules/opac/controllers/DomainsController.php
@@ -26,9 +26,8 @@ class DomainsController extends ZendAfi_Controller_Action {
 			return;
 		}
 
-
 		$id_module = $this->_getParam('id_module');
-		if (!$catalog->hasSousDomaines()){
+		if (!$catalog->hasSousDomaines()) {
 			$this->_redirect($this->view->url(array_filter(['controller' => 'recherche',
 																											'action' => 'simple',
 																											'id_catalogue' => $catalog->getId(),
@@ -37,7 +36,9 @@ class DomainsController extends ZendAfi_Controller_Action {
 			return;
 		}
 
-		$this->view->module_preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module);
+		$this->view->module_preferences = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences($id_module, 'DOMAIN_BROWSER');
+
 		$this->view->current_domain = $catalog;
 		$this->view->id_module = $id_module;
 		$this->view->current_breadcrumb = $this->_getParam('parents');
diff --git a/application/modules/opac/controllers/IndexController.php b/application/modules/opac/controllers/IndexController.php
index 4eb5668ec0a778e9836149bd82a58bfaa914ce05..82697e2ff41dde127425c3b6e61e4cb9867dc2ff 100644
--- a/application/modules/opac/controllers/IndexController.php
+++ b/application/modules/opac/controllers/IndexController.php
@@ -20,7 +20,7 @@
  */
 
 class IndexController extends Zend_Controller_Action {
-	function indexAction()	{
+	public function indexAction()	{
 		// Mettre le layout
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->setLayoutScript('portail.phtml');
@@ -31,19 +31,18 @@ class IndexController extends Zend_Controller_Action {
 	}
 
 
-	function embedmoduleAction() {
+	public function embedmoduleAction() {
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->setLayoutScript('iframe.phtml');
 
 		$id_module = $this->_getParam('id_module');
-		$id_profil = $this->_getParam('id_profil');
-		$profil = Class_Profil::getCurrentProfil();
-		$this->view->module = $profil->getModuleAccueilConfig($id_module);
+		$this->view->module = Class_Profil::getCurrentProfil()
+			->getLocalModuleAccueilConfig($id_module);
 		$this->view->id_module = $id_module;
 	}
 
 
-	function sitedownAction()	{
+	public function sitedownAction()	{
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->setLayoutScript('sansMenuGauche.phtml');
 	}
diff --git a/application/modules/opac/controllers/JavaController.php b/application/modules/opac/controllers/JavaController.php
index 5ac3818502a84dd6f3aff58404a6f9f149dc0dcf..1170d4747a7ab84e44647dc846ddfd4e1c8a2b94 100644
--- a/application/modules/opac/controllers/JavaController.php
+++ b/application/modules/opac/controllers/JavaController.php
@@ -18,16 +18,9 @@
  * 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 - Objets java
-/////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
 class JavaController extends Zend_Controller_Action {
-
-//-------------------------------------------------------------------------------
-// Met le layout
-//-------------------------------------------------------------------------------
-	function init()	{
+	public function init() {
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->setLayoutScript('iframe.phtml');
 	}
@@ -38,25 +31,18 @@ class JavaController extends Zend_Controller_Action {
 	}
 
 
-//-------------------------------------------------------------------------------
-// Menu images avec panneaux horizontaux
-//-------------------------------------------------------------------------------
-	function menuimageAction()
-	{
+	public function menuimageAction() {
 		// rien ici -> tout est fait par le view-helper
 	}
 
-//-------------------------------------------------------------------------------
-// Kiosque de notices
-//-------------------------------------------------------------------------------
-	function kiosqueAction()	{
-		// Preferences du module
-		$id_module=$this->_getParam("id_module");
 
-		$preferences = array_merge(Class_Systeme_ModulesAccueil::getInstance()->getValeursParDefaut('KIOSQUE'),
-															 $this->view->profil->getModuleAccueilPreferences($id_module));
+	public function kiosqueAction()	{
+		$id_module = $this->_getParam('id_module');
+		$preferences = array_merge(
+			Class_Systeme_ModulesAccueil::getInstance()->getValeursParDefaut('KIOSQUE'),
+			$this->view->profil->getModuleAccueilPreferences($id_module, 'KIOSQUE'));
 
-		$this->view->preferences=$preferences;
+		$this->view->preferences = $preferences;
 		$this->view->base_url = $this->view->url(array_merge($this->_request->getParams(),
 																												 ['controller' => 'recherche',
 																													'action' => 'viewnotice',
@@ -65,17 +51,17 @@ class JavaController extends Zend_Controller_Action {
 																						 true);
 		
 		// Lire les notices
-		$catalogue=new Class_Catalogue();
-		$this->view->notices=$catalogue->getNoticesByPreferences($preferences,"url");
+		$catalogue = new Class_Catalogue();
+		$this->view->notices = $catalogue->getNoticesByPreferences($preferences,"url");
 
 		// Redirection vers la bonne vue
-		$vue = '/java/'.$this->_getParam('vue', 'diaporama').'.phtml';
+		$vue = '/java/' . $this->_getParam('vue', 'diaporama').'.phtml';
 		$viewRenderer = $this->getHelper('ViewRenderer');
 		$viewRenderer->renderScript($vue);
 	}
 
 
-	function kiosquedescAction() {
+	public function kiosquedescAction() {
 		$this->getHelper('ViewRenderer')->setNoRender();
 		echo $this->view->_('Kiosque de notices');
 	}
diff --git a/application/modules/opac/controllers/RechercheController.php b/application/modules/opac/controllers/RechercheController.php
index 0797d21e9f95d59748b419ac81e9487722c5aeee..e188aa9711b79faaad7e5c800ac15d99883126a1 100644
--- a/application/modules/opac/controllers/RechercheController.php
+++ b/application/modules/opac/controllers/RechercheController.php
@@ -104,7 +104,7 @@ class RechercheController extends ZendAfi_Controller_Action {
 
 	protected function showDomainBreadcrumbOnDomainBrowsing() {
 		$id_module = $this->_getParam('id_module');
-		if ( ($config = Class_Profil::getCurrentProfil()->getModuleAccueilConfig($id_module))
+		if (($config = Class_Profil::getCurrentProfil()->getLocalModuleAccueilConfig($id_module))
 				 && ($config['type_module'] == 'DOMAIN_BROWSER')) {
 			$this->view->show_domain_browser = true;
 			$this->view->domain_id_module = $id_module;
diff --git a/application/modules/opac/controllers/RssController.php b/application/modules/opac/controllers/RssController.php
index d374d0b5fcce1ac814a9e763363819aea57a1e09..c88470bb410481a0d604ada04431c401f2f8c58f 100644
--- a/application/modules/opac/controllers/RssController.php
+++ b/application/modules/opac/controllers/RssController.php
@@ -95,13 +95,12 @@ class RssController extends Zend_Controller_Action
 	}
 
 
-	/*
+	/**
 	 * Affiche la sélection des RSS d'un module / boîte donné
 	 */
-	function viewselectionAction() {
-		$id_module = $this->_request->getParam('id');
-		$preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module);
-
+	public function viewselectionAction() {
+		$preferences = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences($this->_getParam('id'), 'RSS');
 
 		$rssClass = new Class_Rss();
 		$feeds = $rssClass->getFluxFromIdsAndCategories(explode('-', $preferences['id_items']),
@@ -110,31 +109,28 @@ class RssController extends Zend_Controller_Action
 	}
 
 
-	//---------------------------------------------------------------------------
-	// Affichage des dernier RSS
-	//---------------------------------------------------------------------------
-	function viewrecentAction()
-	{
+	public function viewrecentAction() {
 		$this->view->title = $this->view->_("Derniers Fils RSS");
-		$nb_aff = (int)$this->_request->getParam('nb');
-		$rssClass = new Class_Rss();
-
+		$nb_aff = (int)$this->_getParam('nb');
 		if(!$nb_aff) $nb_aff=200;
-		$liste_rss = $rssClass->getLastRss($nb_aff);
-		$this->_renderRSS($liste_rss);
+		$rssClass = new Class_Rss();
+		$this->_renderRSS($rssClass->getLastRss($nb_aff));
 	}
 
+
 	public function viewRawRssAction () {
-		$rssId = (int)$this->_request->getParam('id_rss', 0);
-		$profil = Class_Profil::getLoader()->find((int)$this->_request->getParam('id_profil', 1));
-		$preferences = $profil->getModuleAccueilPreferences((int)$this->_request->getParam('id_module'));
+		$rssId = (int)$this->_getParam('id_rss', 0);
+		$profil = Class_Profil::find((int)$this->_getParam('id_profil', 1));
+
+		$preferences = $profil
+			->getModuleAccueilPreferences((int)$this->_getParam('id_module'), 'RSS');
 
 		try {
-			$rss = Class_Rss::getLoader()->find($rssId);
+			$rss = Class_Rss::find($rssId);
 			$this->view->feed_items = array_slice($rss->getFeedItems(), 0, $preferences['nb_aff']);
 		} catch (Exception $e) {
 			$this->view->invalidRss = true;
-			$this->view->feed_items = array();
+			$this->view->feed_items = [];
 		}
 
 		$this->_helper->getHelper('viewRenderer')->setLayoutScript('empty.phtml');
@@ -256,19 +252,12 @@ class RssController extends Zend_Controller_Action
 	}
 
 
-	//---------------------------------------------------------------------------
-	// Flux RSS des dernieres critiques
-	//---------------------------------------------------------------------------
-	function critiquesAction() {
-		$id_profil = $this->_request->getParam('id_profil');
-
-		$profil = Class_Profil::getLoader()->find($id_profil);
-
-		$id_module = $this->_request->getParam('id_module');
-
-		$preferences = $profil->getModuleAccueilPreferences($id_module);
-
-		$liste_avis = Class_AvisNotice::getLoader()->getAvisFromPreferences($preferences);
+	public function critiquesAction() {
+		$id_profil = $this->_getParam('id_profil');
+		$profil = Class_Profil::find($id_profil);
+		$id_module = $this->_getParam('id_module');
+		$preferences = $profil->getModuleAccueilPreferences($id_module, 'CRITIQUES');
+		$liste_avis = Class_AvisNotice::getAvisFromPreferences($preferences);
 
 		//on ne prends que les 20 derniers avis
 		$liste_avis = array_slice($liste_avis, 0, 20);
@@ -276,7 +265,7 @@ class RssController extends Zend_Controller_Action
 		$data_rss["titre"] = $preferences['titre'];
 		$data_rss["description"] = $this->view->_("Critiques de la sélection: %s", $preferences['titre']);
 		$data_rss["lien"] = urlencode(urlencode($profil->urlForModule('blog', 'viewcritiques', $id_module)));
-		$data_rss["items"] = array();
+		$data_rss["items"] = [];
 		
 		$avis_helper = $this->view->getHelper('Avis');
 		foreach($liste_avis as $avis) {
@@ -349,18 +338,14 @@ class RssController extends Zend_Controller_Action
 	}
 
 
-
-	/*
-	 * Flux RSS pour la boîte kiosque
-	 */
-	function kiosqueAction() {
-		$id_profil = (int)$this->_request->getParam('id_profil');
-		$id_module = (int)$this->_request->getParam('id_module');
-		if (!$profil = Class_Profil::getLoader()->find($id_profil)) {
+	public function kiosqueAction() {
+		$id_profil = (int)$this->_getParam('id_profil');
+		$id_module = (int)$this->_getParam('id_module');
+		if (!$profil = Class_Profil::find($id_profil)) {
 			$notices = [];
 			$titre = 'Non trouvé';
 		} else {
-			$preferences = $profil->getModuleAccueilPreferences($id_module);
+			$preferences = $profil->getModuleAccueilPreferences($id_module, 'KIOSQUE');
 			$catalogue=new Class_Catalogue();
 			$preferences["aleatoire"] = 0; // les dernières seulement
 			$notices = $catalogue->getNoticesByPreferences($preferences,"url");
diff --git a/application/modules/opac/controllers/SitoController.php b/application/modules/opac/controllers/SitoController.php
index a95154d8b8e02485289b9b213e95dae848c77daf..967e0fef0a79df938380bb7ed9214edb347cc5f8 100644
--- a/application/modules/opac/controllers/SitoController.php
+++ b/application/modules/opac/controllers/SitoController.php
@@ -47,9 +47,8 @@ class SitoController extends Zend_Controller_Action {
 
 	}
 
-    // Lire les sito les plus recentes
-	function viewrecentAction()
-	{
+
+	public function viewrecentAction() {
 		$class_sito = new Class_Sitotheque();
 		$nb_sito = (int)$this->_request->getParam('nb');
 
@@ -62,14 +61,15 @@ class SitoController extends Zend_Controller_Action {
 	}
 
 
-	function viewselectionAction()	{
-		$id_module = $this->_request->getParam('id_module');
+	public function viewselectionAction()	{
+		$id_module = $this->_getParam('id_module');
 
-		$preferences = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module);
+		$preferences = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences($id_module, 'SITO');
 		
 		$sites = Class_Sitotheque::getSitesFromIdsAndCategories(
-			explode('-',$preferences['id_items']),
-			explode('-',$preferences['id_categorie']));
+			explode('-', $preferences['id_items']),
+			explode('-', $preferences['id_categorie']));
 		$this->view->sites = $sites;
 		$this->view->title = $this->view->_("Sélection de sites");
 	}
diff --git a/application/modules/opac/views/scripts/java/jcarousel.phtml b/application/modules/opac/views/scripts/java/jcarousel.phtml
index ca0b063a8a9f075d3def2e92da6f21196ab3bf0c..0b707cd3fe22581fb634146515b4919aac24e7f9 100644
--- a/application/modules/opac/views/scripts/java/jcarousel.phtml
+++ b/application/modules/opac/views/scripts/java/jcarousel.phtml
@@ -1,73 +1,66 @@
-<link rel="stylesheet" type="text/css" href="<?php echo URL_JAVA ?>jcarousel/jcarousel.css">
-<link rel="stylesheet" type="text/css" href="<?php echo URL_JAVA ?>jcarousel/tango/skin.css">
-<style>
-	.jcarousel-skin-tango .jcarousel-container-horizontal
-	{
-    width: 85%;
-		height:<?php echo $this->preferences["op_hauteur_img"]?>px;
-    padding: 5px 35px 0px 30px;
-	}
-	.jcarousel-skin-tango .jcarousel-item
-	{
-    width:<?php echo $this->preferences["op_largeur_img"]?>px;
-    height: <?php echo $this->preferences["op_hauteur_img"]+5 ?>px;
-		margin-left:3px;
-	}
-</style>
-
-<script src="<?php echo JQUERY ?>" type="text/javascript"> </script>
-<script type="text/javascript" src="<?php echo URL_JAVA ?>jcarousel/jcarousel.pack.js"></script>
-<script type="text/javascript">
-
-function mycarousel_initCallback(carousel)
-{
-    // Disable autoscrolling if the user clicks the prev or next button.
-    carousel.buttonNext.bind('click', function() {
-        carousel.startAuto(0);
-    });
-
-    carousel.buttonPrev.bind('click', function() {
-        carousel.startAuto(0);
-    });
-
-    // Pause autoscrolling if the user moves with the cursor over the clip.
-    carousel.clip.hover(function() {
-        carousel.stopAuto();
-    }, function() {
-        carousel.startAuto();
-    });
-};
-
-jQuery(document).ready(function() {
-    jQuery('#mycarousel').jcarousel({
-        auto: <?php echo $this->preferences["op_auto"]?>,
-        wrap: 'last',
-				scroll: <?php echo $this->preferences["op_scroll"]?>,
-        initCallback: mycarousel_initCallback
-    });
-});
-</script>
-
-<center>
-
-
-<?php
-if(!$this->notices) echo '<p style="margin-left:10px;color:red;font-size:10pt">Aucun document n\'a été trouvé.</p>';
-else
-{
-	echo '<ul id="mycarousel" class="jcarousel-skin-tango">';
-	foreach($this->notices as $notice)
-	{
-		echo '<li>';
-		echo '<a href="'.$this->base_url.'/id/'.$notice["id_notice"].'" target="_parent">';
-		echo '<img src="'.$notice["vignette"].'" title="'.$notice["titre"].'" width="'.$this->preferences["op_largeur_img"].'" height="'.$this->preferences["op_hauteur_img"].'" style="border:1px solid #B0BEC7"';
-		echo '</a>';
-		echo '</li>';
-	}
-	echo '</ul>';
-}
-?>
-
-</center>
-
-
+<?php
+Class_ScriptLoader::getInstance()
+->loadJQuery()
+->addOPACPluginStyleSheets(['jcarousel/jcarousel', 'jcarousel/tango/skin'])
+->addOPACPluginScript('jcarousel/jcarousel.pack')
+->addInlineStyle('
+	.jcarousel-skin-tango .jcarousel-container-horizontal {
+		width: 85%;
+		height:' . $this->preferences['op_hauteur_img'] . 'px;
+		padding: 5px 35px 0px 30px;
+	}
+	.jcarousel-skin-tango .jcarousel-item {
+		width:' . $this->preferences["op_largeur_img"] . 'px;
+		height:' . ($this->preferences["op_hauteur_img"]+5) . 'px;
+		margin-left:3px;
+	}
+')
+->addInlineScript('
+function mycarousel_initCallback(carousel) {
+		// Disable autoscrolling if the user clicks the prev or next button.
+		carousel.buttonNext.bind(\'click\', function() {
+				carousel.startAuto(0);
+		});
+
+		carousel.buttonPrev.bind(\'click\', function() {
+				carousel.startAuto(0);
+		});
+
+		// Pause autoscrolling if the user moves with the cursor over the clip.
+		carousel.clip.hover(function() {
+				carousel.stopAuto();
+		}, function() {
+				carousel.startAuto();
+		});
+};
+')
+->addJQueryReady('
+	jQuery(\'#mycarousel\').jcarousel({
+		auto:' . $this->preferences["op_auto"] . ',
+		wrap:\'last\',
+		scroll:' . $this->preferences["op_scroll"] . ',
+		initCallback: mycarousel_initCallback
+	});
+');
+
+?>
+
+<center>
+<?php if(!$this->notices) { ?>
+	<p style="margin-left:10px;color:red;font-size:10pt">Aucun document n'a été trouvé.</p>
+<?php }	else { ?>
+<ul id="mycarousel" class="jcarousel-skin-tango">
+	<?php foreach($this->notices as $notice) { ?>
+		<li>
+			<a href="<?php echo $this->base_url.'/id/'.$notice["id_notice"];?>" target="_parent">
+				<img src="<?php echo $notice["vignette"];?>" 
+						 title="<?php echo $notice["titre"];?>" 
+						 width="<?php echo $this->preferences["op_largeur_img"];?>" 
+						 height="<?php echo $this->preferences["op_hauteur_img"];?>" 
+						 style="border:1px solid #B0BEC7" />
+			</a>
+		</li>
+	<?php } ?>
+	</ul>
+<?php } ?>
+</center>
diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php
index 928e4436fc4ccb9443f506750da55848fe724fb5..3124a73eab364b47f9aaacede2143f7eed726ec5 100644
--- a/cosmogramme/php/_init.php
+++ b/cosmogramme/php/_init.php
@@ -54,7 +54,6 @@ require_once($basePath.'/../storm_init.php');
 
 require_once("classe_sql.php");
 require_once("fonctions/sql.php");
-xdebug_break();
 // Lire la config
 chdir($cosmo_path->getBasePath());
 $cfg=lireConfig($cfgfile);
diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php
index 4d9dd6027ebb686eb90975826c3f00b7bab898a5..767907ee4d93d777fdf2d75b3d209a9f0324edcd 100644
--- a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php
+++ b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php
@@ -823,7 +823,7 @@ class NoticeIntegrationBearsBeerMicrobibTest extends NoticeIntegrationTestCase {
 
 	/** @test */
 	public function titlesContainsBEAR() {
-		$this->assertEquals('BEARS BEAR BEER BE FORMULE FORMUL N00  1',
+		$this->assertEquals('BEARS BEAR BEER BE FORMULE FORMUL 1',
 												$this->notice_integration->noticeToDBEnreg($this->notice_data)['titres']);
 	}
 
@@ -1237,4 +1237,88 @@ class NoticeIntegrationKohaPeriodiqueTest extends NoticeIntegrationTestCase {
 			$this->getFieldsFromMarcDump($field, $dump)[$index]);
 	}
 }
+
+
+
+class NoticeIntegrationBiblioArcheoAnimauxTest extends NoticeIntegrationTestCase {
+	public function setUp() {
+		parent::setUp();
+		$this->loadNotice('unimarc_archeo_animaux');
+		$this->notice_sgbd->ouvrirNotice($this->notice_integration->noticeToDBEnreg($this->notice_data)['unimarc'], 0);
+	}
+
+
+	/** @test */
+	public function field200AShouldBeAsExpected() {
+		$this->assertEquals('ArchÂeo animaux',$this->notice_sgbd->get_subfield('200', 'a')[0]);
+	}
+
+	
+	/** @test */
+	public function field200EShouldBeAsExpected() {
+		$this->assertEquals("l'incroyable histoire de l'archÂeologie des animaux",$this->notice_sgbd->get_subfield('200', 'e')[0]);
+	}
+
+
+
+	/** @test */
+	public function field200FShouldBeLamysHachem() {
+		$this->assertEquals('Lamys Hachem',$this->notice_sgbd->get_subfield('200', 'f')[0]);
+	}
+
+	
+	/** @test */
+	public function field200GShouldBeLamysHachem() {
+		$this->assertEquals("ill. d'HÂelÁene Georges",$this->notice_sgbd->get_subfield('200', 'g')[0]);
+	}	
+
+	
+	/** @test */
+	public function firstField210AShouldBeAsExpected() {
+		$this->assertEquals('Arles',$this->notice_sgbd->get_subfield('210', 'a')[0]);
+	}
+
+
+	/** @test */
+	public function secondField210AShouldBeAsExpected() {
+		$this->assertEquals('[Paris]',$this->notice_sgbd->get_subfield('210', 'a')[1]);
+	}
+
+
+	/** @test */
+	public function field210CShouldBeAsExpected() {
+		$this->assertEquals('Actes Sud junior',$this->notice_sgbd->get_subfield('210', 'c')[0]);
+	}
+
+	
+	/** @test */
+	public function field210DShouldBeAsExpected() {
+		$this->assertEquals('2013',$this->notice_sgbd->get_subfield('210', 'd')[0]);
+	}
+
+
+	/** @test */
+	public function field215AShouldBeAsExpected() {
+		$this->assertEquals('1 vol. (84 p.)',$this->notice_sgbd->get_subfield('215', 'a')[0]);
+	}
+
+
+	/** @test */
+	public function field215CShouldBeAsExpected() {
+		$this->assertEquals('ill. en coul., couv. ill. en coul.',$this->notice_sgbd->get_subfield('215', 'c')[0]);
+	}
+	
+
+	/** @test */
+	public function field215DShouldReturn28Cm() {
+		$this->assertEquals('28 cm',$this->notice_sgbd->get_subfield('215', 'd')[0]);
+	}
+
+
+	/** @test */
+	public function unimarc330ShoulBeAsExpected() {
+		$this->assertEquals('Documentaire d’une trÁes grande qualitÂe qui permet d’apprendre ce qu’est l’archÂeozoologie (l’archÂeologie appliquÂee aux dÂecouvertes animales) et de dÂecouvrir les mÂethodes et techniques utilisÂees par les professionnels. Un livre enrichissant, Áa conseiller aux enfants comme aux adultes, pour en savoir plus sur les diffÂerents rÃoles des animaux auprÁes des hommes au fil des Âepoques et l’Âevolution des modes de vie, et dÂecouvrir les divers aspects du mÂetier passionnant d’archÂeozoologue. A noter : ce livre a remportÂe le prix « Le GoÃut des sciences 2013 », (catÂegorie « La science expliquÂee aux jeunes »).', $this->notice_sgbd->get_subfield('330', 'a')[0]);
+	}
+}
+
 ?>
\ No newline at end of file
diff --git a/cosmogramme/tests/php/classes/unimarc_archeo_animaux.txt b/cosmogramme/tests/php/classes/unimarc_archeo_animaux.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f9bf63fe2c5f4edcb0ddea553a0a99951764a818
--- /dev/null
+++ b/cosmogramme/tests/php/classes/unimarc_archeo_animaux.txt
@@ -0,0 +1 @@
+01739nam0 2200301   450 0010008000000100035000080730018000431000041000611010008001021020007001101050018001171060006001352000112001412100050002532150062003033300627003656060062009926060064010546060072011186760014011907000032012047020047012368010048012838010028013319030006013599970043013659980029014080641294  a978-2-330-01982-2bbr.d19 EUR 0a9782330019822  a20130718d2013    a  h0frey50      ba0 afre  aFR  ay   z   000aa  ar1 aArchÂeo animauxel'incroyable histoire de l'archÂeologie des animauxfLamys Hachemgill. d'HÂelÁene Georges  aArlescActes Sud juniora[Paris]cINRAPd2013  a1 vol. (84 p.)cill. en coul., couv. ill. en coul.d28 cm  aDocumentaire d’une trÁes grande qualitÂe qui permet d’apprendre ce qu’est l’archÂeozoologie (l’archÂeologie appliquÂee aux dÂecouvertes animales) et de dÂecouvrir les mÂethodes et techniques utilisÂees par les professionnels. Un livre enrichissant, Áa conseiller aux enfants comme aux adultes, pour en savoir plus sur les diffÂerents rÃoles des animaux auprÁes des hommes au fil des Âepoques et l’Âevolution des modes de vie, et dÂecouvrir les divers aspects du mÂetier passionnant d’archÂeozoologue. A noter : ce livre a remportÂe le prix « Le GoÃut des sciences 2013 », (catÂegorie « La science expliquÂee aux jeunes »).| 30008353aArchÂeologie30000042xOuvrages pour la jeunesse| 30002372aPalÂeozoologie30000042xOuvrages pour la jeunesse| 30016306aRelations homme-animal30000042xOuvrages pour la jeunesse  a930.1v22 |30641296aHachembLamys4070 |30578922aGeorgesbHÂelÁenef1978-....4440 0aFRbFR-751131015c20130718gAFNOR2intermrc 2aFRbBDP Yonnec20131205  ac  30641438a16431334112cYdJg930.1tLIV  30641360tLIVwYcYdJa1
diff --git a/library/Class/Calendar.php b/library/Class/Calendar.php
index a29ff5d628bf5e612dc9b3346f16f4a88877d34b..10d99a7f05e78c1f0966c97956b94e1baeccd7e0 100644
--- a/library/Class/Calendar.php
+++ b/library/Class/Calendar.php
@@ -109,7 +109,7 @@ class Class_Calendar {
 		/*if ($this->param["ALEATOIRE"] == 1)
 			shuffle($articles);*/
 
-		if (count($articles) < $this->param['NB_NEWS']) {
+		if (count($articles) < $this->param['NB_NEWS'] && $this->param['EVENT_FILTER']=='none') {
 			$next_articles = $this->_loadArticles(['event_start_after' => $this->param["DATE"],
 																						 'event_date' => '',
 																						 'event_end_after' => '',
diff --git a/library/Class/NoticeUnimarc.php b/library/Class/NoticeUnimarc.php
index 92819b7dc950e1e91137e9d914d8358bff639298..c6610903ca1305d6d10fb3a8e446cc4dc6989d7f 100644
--- a/library/Class/NoticeUnimarc.php
+++ b/library/Class/NoticeUnimarc.php
@@ -131,6 +131,7 @@ class Class_NoticeUnimarc {
 
 		$inner_data_label = $args[0];
 		$subfields = array_slice($args, 1);
+
 		$subfields_count = count($subfields);
 		$get_method = $subfields_count == 0 ? '_getSubfieldContent' : ($subfields_count == 1 ? '_getOneSubfieldContent' : '_getSeveralSubfieldContent');
 
@@ -150,11 +151,10 @@ class Class_NoticeUnimarc {
 
 
 	protected function _getOneSubfieldContent($content, &$subfields, &$result) {
-			$mask = $this->_getPatternForSubfield($subfields[0]);
-			while (preg_match($mask, $content, $regs)) {
-				$result[] = $regs[1];
-				$content = preg_replace($mask, '', $content);
-			}
+		$mask = $this->_getPatternForSubfield($subfields[0]);
+		preg_match_all($mask, $content, $matches);
+		foreach($matches[1] as $match)	
+			$result[] = $match;
 	}
 
 
diff --git a/library/Class/NoticeUnimarc/Writer.php b/library/Class/NoticeUnimarc/Writer.php
index ec4e54d51fd9feb95069e88f042e5cf7d188f304..8c55ed296393a7daa81ad3393c48ac9cb9ff7a6a 100644
--- a/library/Class/NoticeUnimarc/Writer.php
+++ b/library/Class/NoticeUnimarc/Writer.php
@@ -78,21 +78,20 @@ class Class_NoticeUnimarc_Writer extends Class_NoticeUnimarc {
 		// récupération du répertoire
 		$m = 3 + $this->inner_guide['dm1'] + $this->inner_guide['dm2'];
 		$this->directory = substr($this->full_record,	self::LABEL_LENGTH,	$this->inner_guide['ba'] - 25);
-
 		$tmp_dir = array_filter(explode('|', chunk_split($this->directory, $m, '|')));
 		$dm1 = $this->inner_guide['dm1'];
 		$dm2 = $this->inner_guide['dm2'];
 		$adress_length = 3 + $dm1;
 
-		$has_data = substr($this->full_record,
-											 $ba,
-											 strlen($this->full_record) - $ba);
+		$record = explode("\x1e", $this->full_record);
+		$label_and_dir = array_shift($record);
 
-		if ($has_data) {
+		if (count($record)) {
 			foreach ($tmp_dir as $i => $dir) {
 				$label = substr($dir, 0, 3);
 				$length = (int)substr($dir, 3, $dm1);
 				$adress = (int)substr($dir, $adress_length, $dm2);
+
 				$this->inner_directory[$i] = ['label' => $label,
 																			'length' => $length,
 																			'adress' => $adress];
@@ -100,9 +99,7 @@ class Class_NoticeUnimarc_Writer extends Class_NoticeUnimarc {
 				if (!isset($this->inner_data[$label]))
 					$this->inner_data[$label] = [];
 
-				$this->inner_data[$label][] = substr($this->full_record,
-																						 $ba + $adress,
-																						 $length);
+				$this->inner_data[$label][] = $record[$i] . "\x1e";						
 			}
 		} else {
 			$this->inner_data = array();
diff --git a/library/Class/Profil.php b/library/Class/Profil.php
index 1cd309dca953daa750e5f36e524bc7030dd859b0..326a837e9dc2be9955a9718fc3968a69fe7284f9 100644
--- a/library/Class/Profil.php
+++ b/library/Class/Profil.php
@@ -505,14 +505,14 @@ class Class_Profil extends Storm_Model_Abstract {
 	 * @param int $start_id
 	 * @return int
 	 */
-	public function createNewModuleAccueilId($start_id = 1){
+	public function createNewModuleAccueilId($start_id=1) {
 		$new_id = $start_id;
-		while ($this->getModuleAccueilConfig($new_id) != null) $new_id++;
+		while (isset($this->getLocalModuleAccueilConfig($new_id)['preferences']['id_module'])) 
+			$new_id++;
 
 		// réserve l'id pour ne pas redonner 2 fois le même
 		$cfg_accueil = $this->getCfgAccueilAsArray();
-		$cfg_accueil['modules'][$new_id] = array('preferences' => array(
-																							 'id_module' => $new_id));
+		$cfg_accueil['modules'][$new_id] = ['preferences' => ['id_module' => $new_id]];
 		$this->setCfgAccueil($cfg_accueil);
 
 		return $new_id;
@@ -523,47 +523,49 @@ class Class_Profil extends Storm_Model_Abstract {
 	 * @param int $id_module
 	 * @return array | null
 	 */
-	public function getModuleAccueilConfig($id_module) {
-		if ($this->hasParentProfil()) {
-			$parent_config = $this->getParentProfil()->getModuleAccueilConfig($id_module);
-			if (isset($parent_config['division'])
-					&& (self::DIV_BANNIERE == $parent_config['division']))
-				return $parent_config;
-		}
+	public function getModuleAccueilConfig($id_module, $type_module) {
+		$cfg_accueil = $this->getCfgAccueilAsArray();
+
+		$module = (array_isset($id_module, $cfg_accueil['modules'])) ?
+			$cfg_accueil['modules'][$id_module] : 
+			['type_module' => $type_module,
+			 'preferences' => []];
+
+		if ($this->isModulePreferencesSharedBetweenProfils($module, $type_module))
+			return $this->getModuleAccueilConfigByType($type_module, self::DIV_BANNIERE);
 
+		return $this->getLocalModuleAccueilConfig($id_module);
+	}
+
+
+	/** @return array */
+	public function getLocalModuleAccueilConfig($id_module) {
 		$cfg_accueil = $this->getCfgAccueilAsArray();
 		$modules_config = $cfg_accueil['modules'];
 
-		if (array_key_exists($id_module, $modules_config)) {
-			if (!is_array($modules_config[$id_module]))
-				$modules_config[$id_module] = [];
+		$module = ['type_module' => null, 'preferences' => []];
+		if (!array_key_exists($id_module, $modules_config))
+			return [];
 
-			$module = array_merge(['type_module' => null,
-														 'preferences' => []],
-														$modules_config[$id_module]);
+		if (!is_array($modules_config[$id_module]))
+			$modules_config[$id_module] = [];
 
-			$default_prefs = Class_Systeme_ModulesAccueil::getInstance()
-				->getValeursParDefaut($module['type_module']);
-			$default_prefs = array_merge($default_prefs,['id_module' => $id_module]);
+		$module = array_merge($module, $modules_config[$id_module]);
 
-			$module['preferences'] = (!array_isset('preferences', $module)) ?
-				$default_prefs : array_merge($default_prefs, $module['preferences']);
-		
-			return $module;
-		}
+		$default_prefs = Class_Systeme_ModulesAccueil::getInstance()
+			->getValeursParDefaut($module['type_module']);
+		$default_prefs = array_merge($default_prefs, ['id_module' => $id_module]);
 
-		return [];
+		$module['preferences'] = (!array_isset('preferences', $module)) ?
+			$default_prefs : array_merge($default_prefs, $module['preferences']);
+		
+		return $module;
 	}
 
 
-	/**
-	 * @param string $type_module
-	 * @param int $division
-	 * @return array | null
-	 */
-	public function getModuleAccueilPreferencesByType($type_module, $division = null){
+	public function getModuleAccueilConfigByType($type_module, $division=null) {
 		if ($this->hasParentProfil() && 
-		  ($preferences = $this->getParentProfil()->getModuleAccueilPreferencesByType($type_module, $division)))
+		  ($preferences = $this->getParentProfil()->getModuleAccueilConfigByType($type_module, $division)))
 			return $preferences;
 		
 		$preferences = [];
@@ -571,21 +573,35 @@ 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) && (!$division  || ($module['division'] == $division))) {
-					return $this->getModuleAccueilPreferences($key_module);
+				if (($module[$key]===$type_module) 
+					&& (!$division  || ($module['division'] == $division))) {
+					return $this->getLocalModuleAccueilConfig($key_module, $type_module);
 				}
 			}
 		}
+
 		return [];
 	}
 
 
+	/**
+	 * @param string $type_module
+	 * @param int $division
+	 * @return array | null
+	 */
+	public function getModuleAccueilPreferencesByType($type_module, $division = null) {
+		$config = $this->getModuleAccueilConfigByType($type_module, $division);
+		return (array_key_exists('preferences', $config)) ?
+			$config['preferences'] : [];
+	}
+
+
 	/**
 	 * @param int $id_module
 	 * @return array
 	 */
-	public function getModuleAccueilPreferences($id_module){
-		$config = $this->getModuleAccueilConfig($id_module);
+	public function getModuleAccueilPreferences($id_module, $type_module){
+		$config = $this->getModuleAccueilConfig($id_module, $type_module);
 		if ($config)
 			return $config['preferences'];
 		return array();
diff --git a/library/Class/Rss.php b/library/Class/Rss.php
index 3944a632fba0ac102c37f12c812f20ba811ae235..1323a53ada487232c3588ed099f0de88a32f4190 100644
--- a/library/Class/Rss.php
+++ b/library/Class/Rss.php
@@ -575,7 +575,6 @@ class Class_Rss extends Storm_Model_Abstract {
 	{
 		$niveau=0; $id=0;
 		$html= '<ul class="treeMenu">';
-		xdebug_break();
 		if(count($this->arbre_array) > 0){
 			foreach($this->arbre_array as $menu)
 				{
diff --git a/library/Class/ScriptLoader.php b/library/Class/ScriptLoader.php
index dae2ab2840bc3ad0fc1a1823df36affb70bfc6b3..64a371a7dc4145dcb1af0bf2936574e4949bf44f 100644
--- a/library/Class/ScriptLoader.php
+++ b/library/Class/ScriptLoader.php
@@ -441,6 +441,28 @@ class Class_ScriptLoader {
 	}
 	
 
+	/** 
+	 * @param $file string
+	 * @param $additional_attributes array
+	 * @return Class_ScriptLoader 
+	 */
+	public function addOPACPluginStyleSheet($file, $additional_attributes=null) {
+		return $this->addStyleSheet(BASE_URL . '/public/opac/java/' . $file, 
+																$additional_attributes);
+	}
+
+
+	/**
+	 * @param $file array
+	 * @param $additional_attributes array
+	 * @return Class_ScriptLoader
+	 */
+	public function addOPACPluginStyleSheets($files, $additional_attributes=null) {
+		foreach($files as $file) 
+			$this->addOPACPluginStyleSheet($file, $additional_attributes);
+		return $this;
+	}
+
 
 	/**
 	 * @return ScriptLoader
diff --git a/library/Class/Systeme/ModulesAccueil/Calendrier.php b/library/Class/Systeme/ModulesAccueil/Calendrier.php
index fd157fd9f3a60841366b327b6d8e383c1044091f..663f03505b6ec186e01bfff4c72c429ec9955c88 100644
--- a/library/Class/Systeme/ModulesAccueil/Calendrier.php
+++ b/library/Class/Systeme/ModulesAccueil/Calendrier.php
@@ -38,7 +38,7 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue
 	protected $_isPhone = true;
 
 	/** @var array */
-	protected $_defaultValues = array(
+	protected $_defaultValues = [
 		'titre' => 'Calendrier des animations',	 // Titre de la boite
 		'id_categorie' => '',										// Catégories d'articles à afficher. ex: 2-3-4
 		'display_cat_select' => false,					 // Afficher le sélecteur de catégories
@@ -51,8 +51,9 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue
 		'display_mode' => 'Title', // Mode d'affichage Title, Summary, FullArticle,
 		'nb_events' => '3', // Nombre de rendez-vous à afficher
 		'display_calendar' => '1', // Mode d'affichage du calendrier: 0 (caché) / 1 (calendrier) / 2 (frise chrono)
-		'mode-affichage' => 'simple' // mode d'affichage des prochains événements dans la boite: none (aucun) / simple (titre + catégorie ou bib) / article (résumé article)
-	);
+		'mode-affichage' => 'simple', // mode d'affichage des prochains événements dans la boite: none (aucun) / simple (titre + catégorie ou bib) / article (résumé article)
+		'event_filter' => 'none' // filtre les articles par mois à l'affichage
+	];
 
 
 	/** @return array */
diff --git a/library/Class/Systeme/ModulesAccueil/Kiosque.php b/library/Class/Systeme/ModulesAccueil/Kiosque.php
index 98fb0bb44ad004df0dae28f8802dcc80d6ee1420..45c3559cad2016214d11ed398abb95e497065435 100644
--- a/library/Class/Systeme/ModulesAccueil/Kiosque.php
+++ b/library/Class/Systeme/ModulesAccueil/Kiosque.php
@@ -49,6 +49,8 @@ class Class_Systeme_ModulesAccueil_Kiosque extends Class_Systeme_ModulesAccueil_
 		'op_hauteur_img' => 0, // hauteur des vignettes
 		'op_transition' => '', //type de transition pour le diaporama
 		'op_largeur_img' => 0, //largeur des vignettes 
+		'op_auto' => 0, // Animation (0 = aucune)
+		'op_scroll' => 1, // Défilement (1 = image par image)
 		'rss_avis' => 1,    // afficher les RSS
 		'id_catalogue' => 0,
 		'id_panier' => 0
diff --git a/library/Class/WebService/XMLParser.php b/library/Class/WebService/XMLParser.php
index 19b6c3b529c19640431e38a5abdc278fa7b69501..4a2566f8db38d9587c7a217308d574b1828a3d1d 100644
--- a/library/Class/WebService/XMLParser.php
+++ b/library/Class/WebService/XMLParser.php
@@ -34,18 +34,58 @@ class Class_WebService_XMLParser {
 		return new static();
 	}
 
+	/**
+	 * @param string $xml
+	 * @return string
+	 */
+	protected function stripInvalidXml($xml) {
+		if (empty($xml)) {
+			return '';
+		}
+
+		$ret = "";
+		$length = strlen($xml);
+		for ($i=0; $i < $length; $i++) {
+			$current = ord($xml{$i});
+			// http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
+			if (($current == 0x9) ||
+			($current == 0xA) ||
+			($current == 0xD) ||
+			(($current >= 0x20) && ($current <= 0xD7FF)) ||
+			(($current >= 0xE000) && ($current <= 0xFFFD)) ||
+			(($current >= 0x10000) && ($current <= 0x10FFFF)))
+				{
+					$ret .= chr($current);
+				} else {
+				$ret .= " ";
+			}
+		}
+		return $ret;
+	}
 
 	/**
 	 * @param string $xml
 	 * @return Class_WebService_XMLParser
 	 */
 	public function parse($xml) {
-		$this->_parsed_xml = $xml ;
+		$xml = preg_replace_callback("/(&#[0-9]+;)/", function($m) {
+			return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES");
+		}, $xml);
+		$xml = $this->stripInvalidXml($xml);
+		$this->_parsed_xml = $xml;
 		$this->_parents = array() ;
 		$parser = $this->_createParser() ;
-		xml_parse($parser, $xml) ;
-//		echo xml_error_string(xml_get_error_code($parser));
-		// echo xml_get_current_line_number($parser);
+		$ok = xml_parse($parser, $xml) ;
+		if (!$ok) {
+			$error_code = xml_get_error_code($parser);
+			$error_string = xml_error_string($error_code);
+			$line = xml_get_current_line_number($parser);
+			$column = xml_get_current_column_number($parser);
+			$byte = xml_get_current_byte_index($parser);
+			$error_msg = "XML parser error: $error_string"
+				. " at line $line column $column byte $byte (code: $error_code)";
+			error_log($error_msg);
+		}
 		xml_parser_free($parser) ;
 		return $this ;
 	}
@@ -109,7 +149,7 @@ class Class_WebService_XMLParser {
 	public function endElement($parser, $tag) {
 		$method_name = 'end'.$this->tagWithoutNamespace($tag);
 
-		if (method_exists($this->_element_handler, $method_name))  {
+		if (method_exists($this->_element_handler, $method_name))	 {
 			$this->_element_handler->$method_name($this->_current_data);
 		}
 		array_pop($this->_parents) ;
@@ -144,4 +184,4 @@ class Class_WebService_XMLParser {
 	}
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/library/ZendAfi/View/Helper/Accueil/Base.php b/library/ZendAfi/View/Helper/Accueil/Base.php
index 3794d354c3f5627a0ff408e3d60838bd0360d21b..ea87bd314056ad73c036c9842c257b09a8cff644 100644
--- a/library/ZendAfi/View/Helper/Accueil/Base.php
+++ b/library/ZendAfi/View/Helper/Accueil/Base.php
@@ -289,12 +289,13 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
 	}
 
 
-	/*
+	/**
 	 * Renvoie l'instance ZendAfi_View_Helper_* selon le type du module dont l'id
 	 * est donnée
 	 */
 	public static function getModuleHelper($id_module, $view) {
-		$module_params = Class_Profil::getCurrentProfil()->getModuleAccueilConfig($id_module);
+		$module_params = Class_Profil::getCurrentProfil()
+			->getLocalModuleAccueilConfig($id_module);
 		return self::getModuleHelperFromParams($id_module, $module_params, $view);
 	}
 
diff --git a/library/ZendAfi/View/Helper/Accueil/Calendar.php b/library/ZendAfi/View/Helper/Accueil/Calendar.php
index a77d1228a5d81a732be13af65f5ba8d3904f09aa..0433fa8f48774ebf4649175952b2f45edbbbd107 100644
--- a/library/ZendAfi/View/Helper/Accueil/Calendar.php
+++ b/library/ZendAfi/View/Helper/Accueil/Calendar.php
@@ -56,9 +56,10 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_B
 			$this->rss_interne = $this->_getRSSurl('cms', 'calendarrss');
 		
 
-		$param = array();
-		if (array_isset('display_date', $this->preferences))
-					$param['DATE'] = $this->preferences['display_date'];
+		$param = [];
+		
+
+		$param['DATE'] = array_isset('display_date', $this->preferences) ? $this->preferences['display_date'] : '';
 		$param['URL']='';
 		$param['ID_BIB']=Class_Profil::getCurrentProfil()->getIdSite();
 		$param['NB_NEWS']=(int)$this->preferences['nb_events'];
@@ -70,6 +71,8 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_B
 		$param['ALEATOIRE'] = 1;
 		$param['MODE_AFFICHAGE'] = array_key_exists('mode-affichage', $this->preferences) ? $this->preferences['mode-affichage'] : 'simple';
 		$param['DISPLAY_CALENDAR'] = $this->preferences['display_calendar'];
+		$param['EVENT_FILTER'] = array_isset('event_filter', $this->preferences) ? $this->preferences['event_filter'] : '';
+		;
 	
 		$this->contenu = $this->view->calendarContent($param);
 
diff --git a/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php b/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php
index 9565167c3cc1b98f0677dd1f0ebbaf43588aa9ff..0d31aac9e6821fad21258998fc32457b1e38ef82 100644
--- a/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php
+++ b/library/ZendAfi/View/Helper/Accueil/ConteneurDeuxColonnes.php
@@ -70,13 +70,10 @@ class ZendAfi_View_Helper_Accueil_ConteneurDeuxColonnes extends ZendAfi_View_Hel
 		$modules_accueil = new Class_Systeme_ModulesAccueil();
 		$preferences = $modules_accueil->getValeursParDefaut($type_module);
 
-		$config = array("preferences" => $preferences,
-										"type_module" => $type_module);
+		$config = ["preferences" => $preferences,
+							 "type_module" => $type_module];
 
-		
-
-
-		$my_config = $profil->getModuleAccueilConfig($this->id_module);
+		$my_config = $profil->getModuleAccueilConfig($this->id_module, $type_module);
 		$my_config["preferences"][$id_key] = $id_module;
 
 		$profil
diff --git a/library/ZendAfi/View/Helper/NuageTags.php b/library/ZendAfi/View/Helper/NuageTags.php
index 9d2f158214846f051ccd3ed22a9588ab1f8f4a71..69ec88c427600414b7e14b55b6a5825180cff414 100644
--- a/library/ZendAfi/View/Helper/NuageTags.php
+++ b/library/ZendAfi/View/Helper/NuageTags.php
@@ -66,57 +66,48 @@ class ZendAfi_View_Helper_NuageTags extends ZendAfi_View_Helper_BaseHelper {
 		return $html;
 	}
 
-	//------------------------------------------------------------------------------------------------------
-	// Calcul des tranches selon methode parametree
-	//------------------------------------------------------------------------------------------------------
-	private function calcultranches($tableau,$methode=3)
-	{
+
+	private function calcultranches($tableau,$methode=3) {
 		$tranches = [];
 		// Nouveau mode
-		if($methode == 3)
-			{
-				$distinct = array();
-				// determiner le nombre de valeurs distinctes
-				foreach ($tableau as $index => $value)
-					$distinct[$value['nombre']] = $value['nombre'];
+		if ($methode == 3) {
+			$distinct = array();
+			// determiner le nombre de valeurs distinctes
+			foreach ($tableau as $index => $value)
+				$distinct[$value['nombre']] = $value['nombre'];
 
-				// Si plus de 10 tranches on fusionne les tranches de plus faible ecart
-				if(count($distinct) > 10)
-					{
-						while( count($distinct) > 10)
-							{
-								// Recherche du plus petit ecart
-								$ecart_min=100000;
-								$sauve_index_nombre=0;
-								foreach($distinct as $key => $index_nombre)
-									{
-										$ecart= abs($index_nombre-$key);
-										if($ecart <= $ecart_min) 
-											{
-												$ecart_min=$ecart;
-												$ecart_index_suppr=$sauve_index_nombre;
-												$ecart_index_ref=$key;
-											}
-										$sauve_index_nombre=$key;
-									}
-								// Fusionner les tranches qui ont l'ecart mini
-								if (array_key_exists($ecart_index_suppr, $distinct))
-									$distinct[$ecart_index_ref]=$distinct[$ecart_index_suppr];
-								else
-									$distinct[$ecart_index_ref] = 0;
-								unset($distinct[$ecart_index_suppr]);
-							}
+			// Si plus de 10 tranches on fusionne les tranches de plus faible ecart
+			if(count($distinct) > 10) {
+				while( count($distinct) > 10) {
+					// Recherche du plus petit ecart
+					$ecart_min=100000;
+					$sauve_index_nombre=0;
+					foreach($distinct as $key => $index_nombre) {
+						$ecart= abs($index_nombre-$key);
+						if($ecart <= $ecart_min) {
+							$ecart_min=$ecart;
+							$ecart_index_suppr=$sauve_index_nombre;
+							$ecart_index_ref=$key;
+						}
+						$sauve_index_nombre=$key;
 					}
-				
-				// Constitution des tranches
-				$index=10;
-				foreach($distinct as $tranche => $valeur) 
-					{
-						$index--;
-						if($valeur >  0)$tranches[]=$valeur;
-					}		
-				return $tranches;
+					// Fusionner les tranches qui ont l'ecart mini
+					if (array_key_exists($ecart_index_suppr, $distinct))
+						$distinct[$ecart_index_ref]=$distinct[$ecart_index_suppr];
+					else
+						$distinct[$ecart_index_ref] = 0;
+					unset($distinct[$ecart_index_suppr]);
+				}
 			}
+				
+			// Constitution des tranches
+			$index=10;
+			foreach($distinct as $tranche => $valeur) {
+				$index--;
+				if($valeur >  0)$tranches[]=$valeur;
+			}		
+			return $tranches;
+		}
 
 		// Min et max
 		$nb_elements = count($tableau);
diff --git a/library/startup.php b/library/startup.php
index 94833eb4ef9d4d9e270dd88257a0e9d0f55bd5b8..41b4854a700802e929a3435013d982a446857323 100644
--- a/library/startup.php
+++ b/library/startup.php
@@ -57,7 +57,7 @@ function defineConstant($name, $value) {
 
 function setupConstants() {
 	defineConstant('VERSION_PERGAME','6.47');
-	defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '');
+	defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '.2');
 
 	defineConstant('ROOT_PATH',  realpath(dirname(__FILE__).'/..').'/');
 
diff --git a/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php b/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php
index 2c17e682c1019f48bf511e61a740ae554fde9caa..a96104c6dbc040602b002a7346c951c8c6fec974 100644
--- a/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php
+++ b/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php
@@ -40,13 +40,20 @@ class Admin_AccueilControllerCalendarTestWithDefaultDiaporamaNavigation extends
 																												'display_mode' => 'Summary',
 																												'display_order' => 'EventDebut',
 																												'display_cat_select' => '',
-																												'id_categorie' => ''
+																			'id_categorie' => '',
+																			'event_filter' => 'none'
 																				]])
 			->beCurrentProfil();
 
 		$this->dispatch('admin/accueil/calendrier?config=accueil&id_profil=1&id_module=1&type_module=CALENDRIER', true);
 	}
 
+	
+	/** @test */
+	public function settingsEventFilterToDisplayShouldBePresent() {
+		$this->assertXPath('//td[contains(text(),"Filtre")]/following-sibling::td/select[@name="event_filter"]/option[@value="none"][@selected="selected"]', $this->_response->getBody());
+	}
+
 
 	/** @test */
 	public function selectDisplayModeShouldBeDisplay() {
diff --git a/tests/application/modules/admin/controllers/AccueilControllerFormationsTest.php b/tests/application/modules/admin/controllers/AccueilControllerFormationsTest.php
index 0f0273eb6904f164abc59144f2f281f5844c7f48..75327f51686632372266bab342097db1f0a9e99a 100644
--- a/tests/application/modules/admin/controllers/AccueilControllerFormationsTest.php
+++ b/tests/application/modules/admin/controllers/AccueilControllerFormationsTest.php
@@ -78,9 +78,10 @@ class Admin_AccueilControllerFormationsPostTest extends Admin_AbstractController
 			
 	/** @test */
 	public function formations1And2ShouldHaveBeenSaved() {
-		$this->assertEquals('1;2', 
-												Class_Profil::getCurrentProfil()
-												->getModuleAccueilConfig(1)['preferences']['selected_formations']);
+		$this->assertEquals(
+			'1;2', 
+			Class_Profil::getCurrentProfil()
+			->getModuleAccueilConfig(1, 'FORMATIONS_WIDGET')['preferences']['selected_formations']);
 	}
 }
 ?>
\ No newline at end of file
diff --git a/tests/application/modules/admin/controllers/AccueilControllerTest.php b/tests/application/modules/admin/controllers/AccueilControllerTest.php
index af6541dbe9e00b01f3866a43c52bb412b47b6a48..4fba35e68953f0bb6deb590acd13f4c29b0bc4b2 100644
--- a/tests/application/modules/admin/controllers/AccueilControllerTest.php
+++ b/tests/application/modules/admin/controllers/AccueilControllerTest.php
@@ -92,35 +92,39 @@ class AccueilControllerBoite2ColPostTest extends AccueilControllerBoite2ColTestC
 
 	/** @test */
 	public function moduleKiosqueShouldHaveBeenCreated() {
-		$this->assertEquals('KIOSQUE', $this->_getModuleTypeOf(1000));
+		$this->assertEquals('KIOSQUE', $this->_getModuleTypeOf(1000, 'KIOSQUE'));
 	}
 
 
 	/** @test */
 	public function moduleKiosqueShouldHaveBeenAddedToBox() {
-		$this->assertEquals(1000, $this->_getModulePrefOf(3, 'col_gauche_module_id'));
+		$this->assertEquals(
+			1000, $this->_getModulePrefOf(3, 'col_gauche_module_id', 'CONTENEUR_DEUX_COLONNES'));
 	}
 
 
 	/** @test */
 	public function moduleTagsShouldHaveBeenCreated() {
-		$this->assertEquals('TAGS', $this->_getModuleTypeOf(1001));
+		$this->assertEquals('TAGS', $this->_getModuleTypeOf(1001, 'TAGS'));
 	}
 
 
 	/** @test */
 	public function moduleTagsShouldHaveBeenAddedToBox() {
-		$this->assertEquals(1001, $this->_getModulePrefOf(3, 'col_droite_module_id'));
+		$this->assertEquals(
+			1001, $this->_getModulePrefOf(3, 'col_droite_module_id', 'CONTENEUR_DEUX_COLONNES'));
 	}
 
 
-	protected function _getModuleTypeOf($id_module) {
-		return $this->profil_biologie->getModuleAccueilConfig($id_module)['type_module'];
+	protected function _getModuleTypeOf($id_module, $type) {
+		return $this->profil_biologie
+			->getModuleAccueilConfig($id_module, $type)['type_module'];
 	}
 
 
-	protected function _getModulePrefOf($id_module, $pref) {
-		return $this->profil_biologie->getModuleAccueilConfig($id_module)['preferences'][$pref];
+	protected function _getModulePrefOf($id_module, $pref, $type) {
+		return $this->profil_biologie
+			->getModuleAccueilConfig($id_module, $type)['preferences'][$pref];
 	}
 }
 
@@ -584,7 +588,8 @@ class AccueilControllerConfigBoiteLoginPostTest extends AccueilControllerConfigB
 												 'profil_redirect' => 678,
 												 'profil_logout_redirect' => 345]);
 
-		$this->_prefs = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences(32);
+		$this->_prefs = Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences(32, 'LOGIN');
 	}
 
 
@@ -662,7 +667,7 @@ extends AccueilControllerWithParentProfileConfigBoiteLoginTestCase {
 
 		$this->_prefs = Class_Profil::getCurrentProfil()
 			->getParentProfil()
-			->getModuleAccueilPreferences(32);
+			->getModuleAccueilPreferences(32, 'LOGIN');
 	}
 
 
@@ -706,7 +711,7 @@ class AccueilControllerPostConfigBoiteKiosqueProfilLognesTestCase extends Admin_
 
 	/** @test */
 	public function titleShouldBeTitreDuKiosque() {
-		$this->assertEquals('titre du /kiosque', Class_Profil::getCurrentProfil()->getModuleAccueilConfig(32)['preferences']['titre']);
+		$this->assertEquals('titre du /kiosque', Class_Profil::getCurrentProfil()->getModuleAccueilConfig(32, 'KIOSQUE')['preferences']['titre']);
 	}
 }
 
@@ -1066,7 +1071,8 @@ class AccueilControllerWidgetDomainPostConfigurationTest extends Admin_AbstractC
 
 		$this->postDispatch('/admin/accueil/domain-browser?config=accueil&id_profil=2&id_module=5&type_module=DOMAIN_BROWSER', 
 			$this->pref_list);
-		$this->pref=Class_Profil::getCurrentProfil()->getModuleAccueilConfig(5)['preferences'];
+		$this->pref = Class_Profil::getCurrentProfil()
+			->getModuleAccueilConfig(5, 'DOMAIN_BROWSER')['preferences'];
 
 	}
 
diff --git a/tests/application/modules/admin/controllers/CatalogueControllerTest.php b/tests/application/modules/admin/controllers/CatalogueControllerTest.php
index 552b332ca821f845408b8fa874bc225314dc2905..3dab132da37064174f3e1f3ccf2b16647b427207 100644
--- a/tests/application/modules/admin/controllers/CatalogueControllerTest.php
+++ b/tests/application/modules/admin/controllers/CatalogueControllerTest.php
@@ -1026,9 +1026,10 @@ class CatalogueControllerAddCatalogueToAdultesPostTest extends AdminCatalogueCon
 
 	/** @test **/
 	public function boiteKiosqueShouldBeUpdatedToNewCatalogue78() {
-		$this->assertEquals( 78, 
-												 Class_Profil::getCurrentProfil()
-												 ->getModuleAccueilPreferences(10)['id_catalogue']);
+		$this->assertEquals(
+			78, 
+			Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences(10, 'KIOSQUE')['id_catalogue']);
 	}
 }
 
diff --git a/tests/application/modules/admin/controllers/CmsControllerTest.php b/tests/application/modules/admin/controllers/CmsControllerTest.php
index 548f18a740b119aa4220660069cc9feeb1fb5018..b2a73c7e34834c869a03efac2b97c96d4f94b85d 100644
--- a/tests/application/modules/admin/controllers/CmsControllerTest.php
+++ b/tests/application/modules/admin/controllers/CmsControllerTest.php
@@ -2129,7 +2129,10 @@ class CmsControllerNewsAddToCatALaUneInNewsModuleActionTest extends CmsControlle
 
 	/** @test **/
 	public function boiteNewsShouldDisplayArticleConcert() {
-		$this->assertEquals( 4, Class_Profil::getCurrentProfil()->getModuleAccueilPreferences(10)['id_items']);
+		$this->assertEquals(
+			4, 
+			Class_Profil::getCurrentProfil()
+			->getModuleAccueilPreferences(10, 'NEWS')['id_items']);
 	}
 
 
diff --git a/tests/application/modules/admin/controllers/IndexControllerTest.php b/tests/application/modules/admin/controllers/IndexControllerTest.php
index 0195250b1726b2f56c29386c46754ea50e7225f0..6785e26082f45702c475f624d07cd74cc9680d93 100644
--- a/tests/application/modules/admin/controllers/IndexControllerTest.php
+++ b/tests/application/modules/admin/controllers/IndexControllerTest.php
@@ -20,6 +20,29 @@
  */
 require_once 'AdminAbstractControllerTestCase.php';
 
+
+class IndexControllerIndexTest extends Admin_AbstractControllerTestCase {
+	public function setUp() {
+		parent::setUp();
+		$this->dispatch('/admin/index/index', true);
+	}
+
+
+	/** @test */
+	public function linkToGoogleGroupShouldBePresent() {
+		$this->assertXPathContentContains(
+			'//a[contains(@href, "utilisateurs-bokeh")]', 'Google group Bokeh');
+	}
+
+
+	/** @test */
+	public function embedForumShouldBePresent() {
+		$this->assertXPathContentContains('//script', 'embed/?place=forum/utilisateurs-bokeh');
+	}
+}
+
+
+
 class IndexControllerHeartBeatTest extends Admin_AbstractControllerTestCase {
 	/** @test */
 	public function adminPageShouldContainsHeartbeatScript() {
diff --git a/tests/application/modules/admin/controllers/ModulesControllerTest.php b/tests/application/modules/admin/controllers/ModulesControllerTest.php
index 81e24a318f1710e529458e1abfbdc6215b76126b..e76dca9dc6157b32d55a5894ba9ebe10bccd2f09 100644
--- a/tests/application/modules/admin/controllers/ModulesControllerTest.php
+++ b/tests/application/modules/admin/controllers/ModulesControllerTest.php
@@ -481,7 +481,8 @@ class ModulesControllerChangeKiosqueSelectionPostSaveIdPanierTest extends Admin_
 		$this->postDispatch('/admin/modules/kiosque-change-data/id_module/3', 
 												['id_panier'=> 5,
 												 'id_catalogue' => 0]);
-		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')->getModuleAccueilPreferences(3);
+		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')
+			->getModuleAccueilPreferences(3, 'KIOSQUE');
 	}
 
 
@@ -545,7 +546,8 @@ class ModulesControllerChangeKiosqueSelectionPostSaveIdCatalogueTest extends Mod
 		$this->postDispatch('/admin/modules/kiosque-change-data/id_module/3', 
 												['id_catalogue' => 5,
 												 'id_panier' => 0]);
-		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')->getModuleAccueilPreferences(3);
+		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')
+			->getModuleAccueilPreferences(3, 'KIOSQUE');
 	}
 
 
@@ -572,7 +574,8 @@ class ModulesControllerChangeKiosqueSelectionPostSaveNullPanierTest extends Modu
 		$this->postDispatch('/admin/modules/kiosque-change-data/id_module/3', 
 												['id_panier' => 0,
 												 'id_catalogue' => 0]);
-		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')->getModuleAccueilPreferences(3);
+		$this->saved_preferences = Class_Profil::getFirstAttributeForLastCallOn('save')
+			->getModuleAccueilPreferences(3, 'KIOSQUE');
 	}
 
 
diff --git a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php
index 6d1e1c35f44206b0b164e29c687de0c9d3035c5e..54950a8f3f5cae6e7a2e1c2c7182cc3dbdbf6e84 100644
--- a/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php
+++ b/tests/application/modules/admin/controllers/ProfilControllerPageAccueilTest.php
@@ -64,7 +64,6 @@ abstract class Admin_ProfilControllerPageAccueilJeunesseTestCase extends Admin_A
 																						'type_module' => 'MULTIMEDIA',
 																						'preferences' => []],
 
-
 																	 '13' => ['division' => 1,
 																						'type_module' => 'HISTORIQUE_RECHERCHES',
 																						'preferences' => []],
@@ -76,6 +75,7 @@ abstract class Admin_ProfilControllerPageAccueilJeunesseTestCase extends Admin_A
 																	 '666' => ['division' => 1,
 																						 'type_module' => 'WRONG',
 																						 'preferences' => []],
+
 																	 '789' => ['division' => 1,
 																						 'type_module' => 'LOGIN',
 																						 'preferences' => ['titre'=>'Connection']]]];
@@ -245,7 +245,7 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll
 	 * @test 
 	 */
 	public function shouldPutDefaultNewsPrefereces($profil_jeunesse) {
-		$news = $profil_jeunesse->getModuleAccueilConfig(2);
+		$news = $profil_jeunesse->getModuleAccueilConfig(2, 'NEWS');
 		$this->assertEquals(1, $news['division']);
 		$this->assertEquals('NEWS', $news['type_module']);
 		$this->assertEquals('Articles', $news['preferences']['titre']);
@@ -257,7 +257,7 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll
 	 * @test 
 	 */
 	public function shouldKeepKiosquePrefereces($profil_jeunesse) {
-		$kiosque = $profil_jeunesse->getModuleAccueilConfig(3);
+		$kiosque = $profil_jeunesse->getModuleAccueilConfig(3, 'KIOSQUE');
 		$this->assertEquals(12, $kiosque['preferences']['nb_notices']);
 		$this->assertEquals(36, $kiosque['preferences']['nb_analyse']);
 
@@ -271,7 +271,7 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll
 	 * @test 
 	 */
 	public function shouldKeepRechSimpleInBanniere($profil_jeunesse) {
-		$rech = $profil_jeunesse->getModuleAccueilConfig(1);
+		$rech = $profil_jeunesse->getModuleAccueilConfig(1, 'RECH_SIMPLE');
 		$this->assertEquals(4, $rech['division']);
 	}
 
@@ -298,7 +298,7 @@ class Admin_ProfilControllerPageAccueilJeunesseTest extends Admin_ProfilControll
 	 * @test 
 	 */
 	public function boiteDeuxColonnesShouldGetIdFourAndDefaultValues($profil_jeunesse) {
-		$b2cols = $profil_jeunesse->getModuleAccueilConfig(4);
+		$b2cols = $profil_jeunesse->getModuleAccueilConfig(4, 'CONTENEUR_DEUX_COLONNES');
 		$this->assertEquals(2, $b2cols['division']);
 		$this->assertEquals('CONTENEUR_DEUX_COLONNES', $b2cols['type_module']);
 		$this->assertEquals('NEWS', $b2cols['preferences']['col_gauche_type']);
@@ -546,16 +546,18 @@ class Admin_ProfilControllerPageAccueilJeunesseConfigNewslettersTest extends Adm
 
 
 class Admin_ProfilControllerPageAccueilJeunesseConfigEmptyNewsletterTest extends Admin_ProfilControllerPageAccueilJeunesseTestCase {
-
 	public function setup() {
 		parent::setup();
-		$this->dispatch('admin/accueil/newsletters?config=admin&id_profil=7&type_module=NEWSLETTERS&id_module=11',true);
+		$this->dispatch('admin/accueil/newsletters?config=admin&id_profil=7&type_module=NEWSLETTERS&id_module=10', true);
 
 	}
 
+
 	/** @test */
 	public function titreInputShouldHaveValueMesNewsletters() {
-		$this->assertXPath('//input[@name="titre"][@value="Lettres d\'informations"]',$this->_response->getBody());
+		$this->assertXPath(
+			'//input[@name="titre"][@value="Lettres d\'informations"]',
+			$this->_response->getBody());
 	}
 }
 
@@ -593,13 +595,12 @@ class Admin_ProfilControllerPageAccueilJeunesseConfigMultimediaTest extends Admi
 
 
 class Admin_ProfilControllerPageAccueilJeunesseConfigEmptyMultimediaTest extends Admin_ProfilControllerPageAccueilJeunesseTestCase {
-
 	public function setup() {
 		parent::setup();
-		$this->dispatch('admin/accueil/multimedia?config=admin&id_profil=7&type_module=MULTIMEDIA&id_module=11',true);
-
+		$this->dispatch('admin/accueil/multimedia?config=admin&id_profil=7&type_module=MULTIMEDIA&id_module=12', true);
 	}
 
+
 	/** @test */
 	public function titreInputShouldHaveValuePostesMultimedia() {
 		$this->assertXPath('//input[@name="titre"][@value="Postes multimédia"]');
@@ -686,11 +687,13 @@ class Admin_ProfilControllerPageAccueilJeunesseConfigPanierTest extends Admin_Pr
 		$this->dispatch('admin/accueil/panier?config=admin&id_profil=7&type_module=PANIER&id_module=81&proprietes=boite=/titre=Panier/',true);
 	}
 
+
 	/** @test */
 	public function actionShouldBePanier() {
 		$this->assertAction('panier');
 	}
 
+
 	/** @test */
 	public function titleShouldBeProprieteDuModulePanier() {
 		$this->assertXPathContentContains('//h1','Propriétés du module Panier');
@@ -707,22 +710,22 @@ class Admin_ProfilControllerPageAccueilJeunesseConfigPanierTest extends Admin_Pr
 	public function titreInputShouldHaveValuePanier() {
 		$this->assertXPath('//input[@name="titre"][@value="Panier"]');
 	}
-
 }
 
 
 
 class Admin_ProfilControllerPageAccueilJeunesseConfigEmptyPanierTest extends Admin_ProfilControllerPageAccueilJeunesseTestCase {
-
 	public function setup() {
 		parent::setup();
-		$this->dispatch('admin/accueil/panier?config=admin&id_profil=7&type_module=PANIER&id_module=81',true);
-
+		$this->dispatch('admin/accueil/panier?config=admin&id_profil=7&type_module=PANIER&id_module=81', true);
 	}
 
+
 	/** @test */
-	public function titreInputShouldHaveValueMesReservations() {
-		$this->assertXPath('//input[@name="titre"][@value="Panier"]');
+	public function titreInputShouldHaveValuePanier() {
+		$this->assertXPath(
+			'//input[@name="titre"][@value="Panier"]', 
+			$this->_response->getBody());
 	}
 }
 
diff --git a/tests/application/modules/opac/controllers/PanierControllerTest.php b/tests/application/modules/opac/controllers/PanierControllerTest.php
index 48e2d85a5cc7a8ed708602f490a8b4e069e0a25a..3fb709afb6f9eea1bd0a0f2f15be001bf8b2e080 100644
--- a/tests/application/modules/opac/controllers/PanierControllerTest.php
+++ b/tests/application/modules/opac/controllers/PanierControllerTest.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
+ * Copyright (c) 2012, Agence Franテδァaise Informatique (AFI). All rights reserved.
  *
  * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
@@ -61,53 +61,58 @@ abstract class PanierControllerTestCase extends AbstractControllerTestCase {
 		Class_PanierNotice::beVolatile();
 		Class_PanierNoticeCatalogue::beVolatile();
 
-		$this->manon = Class_Users::newInstanceWithId(23, ['pseudo' => 'ManonL', 
-																											 'nom' => 'Afond',
-																											 'login' => 'man',
-																											 'password' => '123']);
+		$this->manon = $this->fixture('Class_Users', [
+			'id' => 23,
+			'pseudo' => 'ManonL', 
+			'nom' => 'Afond',
+			'login' => 'man',
+			'password' => '123']);
 
-		$this->manon->save();
 		ZendAfi_Auth::getInstance()->logUser($this->manon);
-		$group = Class_UserGroup::newInstanceWithId(280)
-			->setLibelle('Referent')
-			->setUsers([$this->manon])
-			->setRights([]);
-		$group->save();
-
-		$this->panier_bd = Class_PanierNotice::newInstanceWithId(2,
-																														 ['id_panier' => 1,
-																															'libelle' => 'Mes BD',
-																															'date_maj' => '10/02/2011',
-																															'notices' => 'COMBAT ORDINAIRE;BLACKSAD',
-																															'user' => $this->manon]);
-		$this->panier_bd->save();
-
-		$this->panier_orphelin = Class_PanierNotice::newInstanceWithId(9995,
-																																	 ['libelle' => 'Orphelin',
-																																		'date_maj' => '25/05/2010',
-																																		'user' => null]);
-																																		
-		$this->panier_orphelin->save();
-
-		$this->panier_romans = Class_PanierNotice::newInstanceWithId(15,
-																																 ['id_panier' => 2,
-																																	'libelle' => 'Mes Romans',
-																																	'date_maj' => '25/05/2010',
-																																	'notices' => 'MONTESPAN',
-																																	'user' => $this->manon]);
-		$this->panier_romans->save();
-		$montespan = Class_Notice::newInstanceWithId(4,
-																								 ['titre_principal' => 'Le Montespan',
-																									'auteur_principal' => 'Jean Teulé',
-																									'clef_alpha' => 'MONTESPAN',
-																									'unimarc' => '00445nam0 2200181   450 0010008000000100028000081000041000361010008000771020007000851050018000922000032001102100026001422150038001687000022002068010022002289020007002509030006002570507356  a978-2-260-01723-3d22 ?  a20080612d||||    uuuy0frey0103    ba| afre  aFR  ay|||||||000|y1 aMontespan (Le)fJean Teulé  aPariscJulliardd2008  a333 p.cjaq. ill. en coul.d21 cm 1aTeulébJean4070 0aFRbBMVc20080612  arh  aG']);
-
-		$combat_ordinaire = Class_Notice::newInstanceWithId(10,
-																												['titre_principal' => 'Le combat ordinaire',
-																												 'clef_alpha' => 'COMBAT ORDINAIRE']);
+		$group = $this->fixture('Class_UserGroup', [
+			'id' => 280,
+			'libelle' => 'Referent',
+			'users' => [$this->manon],
+			'rights' => []]);
+
+		$this->panier_bd = $this->fixture('Class_PanierNotice', [
+			'id' => 2,
+			'id_panier' => 1,
+			'libelle' => 'Mes BD',
+			'date_maj' => '10/02/2011',
+			'notices' => 'COMBAT ORDINAIRE;BLACKSAD',
+			'user' => $this->manon]);
+
+		$this->panier_orphelin = $this->fixture('Class_PanierNotice', [
+			'id' => 9995,
+			'libelle' => 'Orphelin',
+			'date_maj' => '25/05/2010',
+			'user' => null]);
+
+		$this->panier_romans = $this->fixture('Class_PanierNotice', [
+			'id' => 15,
+			'id_panier' => 2,
+			'libelle' => 'Mes Romans',
+			'date_maj' => '25/05/2010',
+			'notices' => 'MONTESPAN',
+			'user' => $this->manon]);
+
+		$montespan = $this->fixture('Class_Notice', [
+			'id' => 4,
+			'titre_principal' => 'Le Montespan',
+			'auteur_principal' => 'Jean Teulテδゥ',
+			'clef_alpha' => 'MONTESPAN',
+			'unimarc' => '00445nam0 2200181   450 0010008000000100028000081000041000361010008000771020007000851050018000922000032001102100026001422150038001687000022002068010022002289020007002509030006002570507356  a978-2-260-01723-3d22 ?  a20080612d||||    uuuy0frey0103    ba| afre  aFR  ay|||||||000|y1 aMontespan (Le)fJean Teulテδゥ  aPariscJulliardd2008  a333 p.cjaq. ill. en coul.d21 cm 1aTeulテδゥbJean4070 0aFRbBMVc20080612  arh  aG']);
+
+		$combat_ordinaire = $this->fixture('Class_Notice', [
+			'id' => 10,
+			'titre_principal' => 'Le combat ordinaire',
+			'clef_alpha' => 'COMBAT ORDINAIRE']);
 			
-		$blacksad = Class_Notice::newInstanceWithId(12, ['titre_principal' => 'Blacksad',
-																										 'clef_alpha' => 'BLACKSAD']);
+		$blacksad = $this->fixture('Class_Notice', [
+			'id' => 12, 
+			'titre_principal' => 'Blacksad',
+			'clef_alpha' => 'BLACKSAD']);
 
 		Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Notice')
 			->whenCalled('findAllBy')
@@ -115,8 +120,6 @@ abstract class PanierControllerTestCase extends AbstractControllerTestCase {
 							'order' => 'FIELD(clef_alpha, "MONTESPAN")'])
 			->answers([$montespan]);
 
-
-
 		$this->panier_loader = Storm_Test_ObjectWrapper::onLoaderOfModel('Class_PanierNotice')
 			->whenCalled('save')->answers(true)
 			->whenCalled('delete')->answers(true)
@@ -127,9 +130,6 @@ abstract class PanierControllerTestCase extends AbstractControllerTestCase {
 			->with(['role' => 'user', 'model' => $this->manon])
 			->answers([$this->panier_bd, $this->panier_romans]);
 
-
-		
-
 		$panier_domaine_histoire = Class_PanierNoticeCatalogue::newInstanceWithId(71);
 		$panier_domaine_histoire
 			->setPanierNotice(Class_PanierNotice::newInstanceWithId(38, 
@@ -738,18 +738,17 @@ class PanierControllerModifierCataloguePanierWithoutDomainesTest extends PanierC
 
 
 class PanierControllerExportUnimarcTest extends PanierControllerTestCase {
-
 	public function setUp() {
 		parent::setUp();
-
 		$this->dispatch('/panier/export-unimarc/id_panier/15', true);
 	}
 
 
 	/** @test */
 	public function bodyShouldReturnUnimarcISO2709() {
-		$this->assertEquals('00445nam0 22001811  450 0010008000000100028000081000041000361010008000771020007000851050018000922000032001102100026001422150038001687000022002068010022002289020007002509030006002570507356  a978-2-260-01723-3d22 ?  a20080612d||||    uuuy0frey0103    ba| afre  aFR  ay|||||||000|y1 aMontespan (Le)fJean TeulÄA©  aPariscJulliardd2008  a333 p.cjaq. ill. en coul.d21 cm 1aTeulÄA©bJean4070 0aFRbBMVc20080612  arh  ',
-												$this->_response->getBody());
+		$this->assertSame(
+			'00457nam0 22001811  450 0010008000000100028000081000041000361010008000771020007000851050018000922000038001102100026001482150038001747000028002128010022002409020007002629030006002690507356  a978-2-260-01723-3d22 ?  a20080612d||||    uuuy0frey0103    ba| afre  aFR  ay|||||||000|y1 aMontespan (Le)fJean Teulテδゥ  aPariscJulliardd2008  a333 p.cjaq. ill. en coul.d21 cm 1aTeulテδゥbJean4070 0aFRbBMVc20080612  arh  aG',
+			$this->_response->getBody());
 	}
 
 
@@ -778,7 +777,7 @@ class PanierControllerExportListeTest extends PanierControllerTestCase {
 
 	/** @test */
 	public function bodyShouldReturnListe() {
-		$this->assertContains('Montespan (Le)	Jean Teulé	Julliard', 
+		$this->assertContains('Montespan (Le)	Jean Teulテδゥ	Julliard', 
 													$this->_response->getBody());
 	}
 
@@ -1179,7 +1178,7 @@ class PanierControllerAjouterNoticeDansBoitePanierTest extends AbstractControlle
 
 		$notice = Class_Notice::newInstanceWithId(4,
 																		['titre_principal' => 'Le Montespan',
-																		 'auteur_principal' => 'Jean Teulé',
+																		 'auteur_principal' => 'Jean Teulテゥ',
 																		 'clef_alpha' => 'MONTESPAN']);
 																	
 		$notice->save();
@@ -1453,7 +1452,7 @@ class PanierControllerCreerPanierAjaxPostActionTest extends AbstractControllerTe
 
 		Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Catalogue')
 			->whenCalled('findAllBy')
-			->answers([Class_Catalogue::newInstanceWithId(45, ['libelle' => 'Nouveautés']),
+			->answers([Class_Catalogue::newInstanceWithId(45, ['libelle' => 'Nouveautテゥs']),
 								 Class_Catalogue::newInstanceWithId(56, ['libelle' => 'Musique']),
 								 Class_Catalogue::newInstanceWithId(78, ['libelle' => 'Loisirs'])]);
 
diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
index ad2c7df23a38633a7abc823af8db4c32cd4a876c..9bc019b9e42927da738c18c0de0b794df3f85174 100644
--- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
+++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php
@@ -1075,7 +1075,9 @@ class ProfilOptionsControllerProfilJeunesseViewPageJeuxTest extends ProfilOption
 
 	/** @test */
 	public function boiteKiosqueTitleShouldLinkToMenuCatalogue() {
-		$this->assertXPath("//div[@class='boite kiosque']//div//a[contains(@href, 'recherche/simple/titre/Kiosque/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/rss_avis/1/id_catalogue/0/id_panier/0/boite/boite_de_la_division_gauche')]");
+		$this->assertXPath(
+			"//div[@class='boite kiosque']//div//a[contains(@href, 'recherche/simple/titre/Kiosque/style_liste/cube/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/90/op_transition//op_largeur_img/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0/boite/boite_de_la_division_gauche')]", 
+			$this->_response->getBody());
 	}
 
 
@@ -1915,4 +1917,131 @@ class ProfilOptionsControllerWithMenuVerticalWidgetAndNewHtmlTest extends Abstra
 	}
 
 }
+
+
+
+class ProfilOptionsControllerProfilBoiteCalendarWithFilterTestCase extends AbstractControllerTestCase {
+	public function setUp() {
+		parent::setUp();
+				Class_Article::beVolatile();
+		
+		$article_mars = $this->fixture('Class_Article',
+		['id' => 1,
+		'titre' => 'News from Mars',
+		'contenu' => 'Hey! Hello from Mars.',
+		'event_date' => '01/03/2050']);
+
+		$article_october = $this->fixture('Class_Article',
+		['id' => 2,
+		'titre' => 'News from October',
+		'contenu' => 'In october ... ',
+		'event_date' => '01/10/2050']);
+
+		
+		ZendAfi_View_Helper_CalendarContent::setTimeSource(new TimeSourceForTest('2050-03-01 14:14:14'));
+		
+		Class_AdminVar::beVolatile();
+		
+		Storm_Test_ObjectWrapper::onloaderOfModel('Class_Article')
+			->whenCalled('getArticlesByPreferences')
+			->with(['display_order' => 'EventDebut',
+			'id_categorie' => '',
+			'events_only' => true,
+			'event_date' => '2050-03',
+			'id_bib' => 0,
+			'published' => true,
+			'event_end_after' => '2050-03-01'])
+			->answers([$article_mars])
+->whenCalled('getArticlesByPreferences')
+			->with(['display_order' => 'EventDebut',
+			'id_categorie' => '',
+			'events_only' => true,
+			'event_date' => '2050-03',
+			'id_bib' => 0,
+			'published' => true])
+			->answers([$article_mars])
+
+->whenCalled('getArticlesByPreferences')
+			->with(['display_order' => 'EventDebut',
+			'id_categorie' => '',
+			'events_only' => true,
+			'event_date' => '',
+			'id_bib' => 0,
+			'published' => true,
+			'event_start_after' => '2050-03',
+			'event_end_after' => '',
+			'limit' => 3])
+			->answers([$article_october])
+			->beStrict();
+	}
+}
+
+
+
+class ProfilOptionsControllerProfilBoiteCalendarWithFilterOnMonthsTest extends ProfilOptionsControllerProfilBoiteCalendarWithFilterTestCase {
+
+	public function setup() {
+		parent::setup();
+
+		$cfg_accueil = ['modules' => ['45' => ['division' => '1',
+				'type_module' => 'CALENDAR',
+				'preferences' => ['display_calendar' => '0',
+				'mode-affichage' => 'wall',
+				'event_filter' => 'month']]]];
+
+		$this->profil_with_calendar = Class_Profil::getCurrentProfil()
+			->setBrowser('opac')
+			->setTitreSite('Test Calendar')
+			->setLibelle('Profil Portail')
+			->setCfgAccueil($cfg_accueil);
+		
+		$this->dispatch('/opac');
+	}
+
+
+	/** @test */
+	public function boiteCalendarShouldBeDisplay() {
+		$this->assertXPath('//div[contains(@class,"calendar")]');
+	}
+
+
+	/** @test **/
+	public function articleFromOctoberShouldNotBePresent() {
+		$this->assertNotXPath('//article//header//a[contains(text(), "News from October")]');
+	}
+}
+
+
+
+class ProfilOptionsControllerProfilBoiteCalendarWithNoFilterTest extends ProfilOptionsControllerProfilBoiteCalendarWithFilterTestCase {
+
+	public function setup() {
+		parent::setup();
+
+		$cfg_accueil = ['modules' => ['45' => ['division' => '1',
+				'type_module' => 'CALENDAR',
+				'preferences' => ['display_calendar' => '0',
+				'mode-affichage' => 'wall',
+				'event_filter' => 'none']]]];
+
+		$this->profil_with_calendar = Class_Profil::getCurrentProfil()
+			->setBrowser('opac')
+			->setTitreSite('Test Calendar')
+			->setLibelle('Profil Portail')
+			->setCfgAccueil($cfg_accueil);
+		
+		$this->dispatch('/opac');
+	}
+	
+	/** @test **/
+	public function boiteCalendarShouldBeDisplay() {
+		$this->assertXPath('//div[contains(@class,"calendar")]');
+	}
+
+
+	/** @test **/
+	public function articleFromOctoberShouldBePresent() {
+		$this->assertXPath('//article//header//a[contains(text(), "News from October")]');
+	}
+}
 ?>
\ No newline at end of file
diff --git a/tests/library/Class/ProfilTest.php b/tests/library/Class/ProfilTest.php
index 120ffb72230ac5af5f37cc016b75e2ab23ed41d8..f6af4b716cef76f039969bc3d93feb580129636e 100644
--- a/tests/library/Class/ProfilTest.php
+++ b/tests/library/Class/ProfilTest.php
@@ -24,6 +24,7 @@ class ProfilVideTest extends ModelTestCase {
 		$this->profil_vide = new Class_Profil();
 	}
 
+
 	/** @test */
 	public function cfgAccueilShouldReturnArrayWithModules() {
 		$this->assertEquals(['page_css' => null,
@@ -32,26 +33,33 @@ class ProfilVideTest extends ModelTestCase {
 												$this->profil_vide->getCfgAccueilAsArray());
 	}
 
+
 	/** @test */
 	public function shouldBeValid() {
 		$this->assertTrue($this->profil_vide->isValid());
 	}
 
+
 	/** @test */
 	public function getBibLibelleShouldReturnEmptyString() {
 		$this->assertEquals('', $this->profil_vide->getBibLibelle());
 	}
 
+
 	/** @test */
 	public function getModuleAccueilPreferencesShouldReturnEmptyArray() {
-		$this->assertEquals(array(), $this->profil_vide->getModuleAccueilPreferences(1));
+		$this->assertEquals([], $this->profil_vide->getModuleAccueilPreferences(1, ''));
 	}
 
+
 	/** @test */
 	public function profilZonesTitreShouldReturn200_E_H_I() {
-		$this->assertEquals(['200$e', '200$h', '200$i'], Class_Profil::getCurrentProfil()->getZonesTitre());
+		$this->assertEquals(
+			['200$e', '200$h', '200$i'], 
+			Class_Profil::getCurrentProfil()->getZonesTitre());
 	}
 
+
 	/** @test **/
 	public function profilVidePathShouldBeSlahProfil() {
 		$this->assertEquals('/** nouveau profil **', $this->profil_vide->getPath());
@@ -1253,7 +1261,7 @@ extends Storm_Test_ModelTestCase {
 
 		$this->prepareProfile();
 
-		$config = $this->_profil->getModuleAccueilConfig(1);
+		$config = $this->_profil->getModuleAccueilConfig(1, 'LOGIN');
 		$config['preferences']['profil_redirect'] = 123;
 
 		$this->_profil->updateModuleConfigAccueil(1, $config);
@@ -1263,8 +1271,9 @@ extends Storm_Test_ModelTestCase {
 	protected function prepareProfile() {}
 
 
-	protected function getPreferenceOfModule($profil, $id_module, $preference) {
-		return $profil->getModuleAccueilConfig($id_module)['preferences'][$preference];
+	protected function getPreferenceOfModule($profil, $id_module, $type, $preference) {
+		return $profil
+			->getModuleAccueilConfig($id_module, $type)['preferences'][$preference];
 	}
 }
 
@@ -1275,9 +1284,9 @@ class ProfilUpdateConfigAccueilOnModuleInBannerTest
 extends ProfilUpdateConfigAccueilOnModuleInBannerTestCase {
 	/** @test */
 	public function profilRedirectShouldBeUpdated() {
-		$this->assertEquals(123, 
-												$this->getPreferenceOfModule($this->_profil, 
-																										 1, 'profil_redirect'));
+		$this->assertEquals(
+			123, 
+			$this->getPreferenceOfModule($this->_profil, 1, 'LOGIN', 'profil_redirect'));
 	}
 }
 
@@ -1293,9 +1302,9 @@ extends ProfilUpdateConfigAccueilOnModuleInBannerTestCase {
 
 	/** @test */
 	public function profilRedirectShouldBeUpdatedInParent() {
-		$this->assertEquals(123, 
-												$this->getPreferenceOfModule($this->_profil->getParentProfil(), 
-																										 1, 'profil_redirect'));
+		$this->assertEquals(
+			123, 
+			$this->getPreferenceOfModule($this->_profil->getParentProfil(), 1, 'LOGIN', 'profil_redirect'));
 	}
 }
 
@@ -1312,7 +1321,7 @@ class ProfilGetModuleAccueilConfigTest extends Storm_Test_ModelTestCase {
 		$this->_profil = $this->fixture('Class_Profil', ['id' => 2,
 																										 'parent_profil' => $this->_parent]);
 
-		$this->_module_config = $this->_profil->getModuleAccueilConfig(1);
+		$this->_module_config = $this->_profil->getModuleAccueilConfig(1, 'LOGIN');
 	}
 
 
diff --git a/tests/library/Class/WebService/SIGB/GetPatronInfoFrancoisMorel.xml b/tests/library/Class/WebService/SIGB/GetPatronInfoFrancoisMorel.xml
new file mode 100644
index 0000000000000000000000000000000000000000..60de13e6f1ce0501bcf21835191117cec8577a17
--- /dev/null
+++ b/tests/library/Class/WebService/SIGB/GetPatronInfoFrancoisMorel.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GetPatronInfo><patronId>5352</patronId><barcode>7942236</barcode><lastName>MOREL</lastName><firstName>François</firstName><displayOrder>1</displayOrder><birthDate>1970-01-01</birthDate><phoneNumber>XX XX XX XX XX</phoneNumber><town>Amityville</town><zipcode>0666</zipcode><address>12&#29;6 Elm Street
+</address><endDate>2015-03-19</endDate><mail></mail><loans><loan><bibId>186567</bibId><itemId>72958</itemId><title>Le garçon qui voulait devenir un être humain</title><author>Jorn Riel</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-06-25</loanDate><dueDate>2014-07-25</dueDate></loan><loan><bibId>186564</bibId><itemId>72955</itemId><title>Le garçon qui voulait devenir un être humain</title><author>Jorn Riel</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-06-25</loanDate><dueDate>2014-07-25</dueDate></loan><loan><bibId>279034</bibId><itemId>111089</itemId><title>La vieille qui voulait tuer le bon Dieu</title><author>Nadine Monfils</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-07-04</loanDate><dueDate>2014-08-03</dueDate></loan><loan><bibId>273559</bibId><itemId>111718</itemId><title>Un fleuve de fumée</title><author>Amitav Ghosh</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-07-04</loanDate><dueDate>2014-08-03</dueDate></loan><loan><bibId>198354</bibId><itemId>83017</itemId><title>Demoiselles des Lumières</title><author>Jean Diwo</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-07-04</loanDate><dueDate>2014-08-03</dueDate></loan><loan><bibId>230310</bibId><itemId>91620</itemId><title>Le naufrage</title><author>Eric Roussel</author><locationLabel>Médiathèque </locationLabel><loanDate>2014-07-04</loanDate><dueDate>2014-08-03</dueDate></loan></loans><holds><hold><bibId>280792</bibId><itemId>112771</itemId><title>Le livre du roi</title><author>Arnaldur Indriòason</author><locationLabel>Médiathèque </locationLabel><priority>1</priority><available>0</available><availabilityDate>11/08/2014</availabilityDate></hold><hold><bibId>152968</bibId><itemId>42029</itemId><title>L'énigme de Ravejouls</title><author>Alain Gandy</author><locationLabel>Médiathèque </locationLabel><priority>1</priority><available>0</available><availabilityDate>24/07/2014</availabilityDate></hold></holds><suggests/></GetPatronInfo>
diff --git a/tests/library/Class/WebService/SIGB/NanookFixtures.php b/tests/library/Class/WebService/SIGB/NanookFixtures.php
index b6f09761ee47c18b7faa12c1a755ac3b5df465bb..f08f043607ccc3a4ca968f693aba4ad2ff40d42e 100644
--- a/tests/library/Class/WebService/SIGB/NanookFixtures.php
+++ b/tests/library/Class/WebService/SIGB/NanookFixtures.php
@@ -335,6 +335,17 @@ class NanookFixtures {
 </GetPatronInfo>';
 	}
 
+	public static function xmlAuthenticatePatronFrancoisMorel() {
+		return '<?xml version="1.0" encoding="utf-8"?>
+<AuthenticatePatron>
+  <patronId>5352</patronId>
+</AuthenticatePatron>';
+	}
+
+  public static function xmlGetPatronInfoFrancoisMorel() {
+    return file_get_contents(dirname(__FILE__) . '/GetPatronInfoFrancoisMorel.xml');
+  }
+
 
 
 	/** @return string */
@@ -392,4 +403,4 @@ class NanookFixtures {
   <patronId>555</patronId>
 </AuthenticatePatron>';
 	}
-}
\ No newline at end of file
+}
diff --git a/tests/library/Class/WebService/SIGB/NanookTest.php b/tests/library/Class/WebService/SIGB/NanookTest.php
index f47c22127d4beaed610f984a6c4c1d6d57010278..718ac43426d7d9e9473a94ddbf10dd35c060003a 100644
--- a/tests/library/Class/WebService/SIGB/NanookTest.php
+++ b/tests/library/Class/WebService/SIGB/NanookTest.php
@@ -674,6 +674,40 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase {
 	}
 }
 
+class NanookGetEmprunteurFrancoisMorelTest extends NanookTestCase {
+	/** @var Class_WebService_SIGB_Emprunteur */
+	protected $_emprunteur;
+
+
+	public function setUp() {
+		parent::setUp();
+
+		$this->_mock_web_client
+			->whenCalled('open_url')
+			->with('http://localhost:8080/afi_Nanook/ilsdi/service/AuthenticatePatron/username/7942236/password/1900')
+			->answers(NanookFixtures::xmlAuthenticatePatronFrancoisMorel())
+
+			->whenCalled('open_url')
+			->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/5352')
+			->answers(NanookFixtures::xmlGetPatronInfoFrancoisMorel());
+
+		$this->_user = Class_Users::newInstance(['id_sigb' => 5352,
+																								 'login' => 7942236,
+																								 'password' => 1900]);
+		$this->_emprunteur = $this->_service->getEmprunteur($this->_user);
+		$this->_emprunteur->updateUser($this->_user);
+
+		Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire')
+			->whenCalled('findFirstBy')
+			->answers(null);
+	}
+
+  /** @test */
+  public function getEmpruntsShouldReturnsAllLoans() {
+    $loans = $this->_emprunteur->getEmprunts();
+    $this->assertEquals(6, count($loans));
+  }
+}
 
 
 
@@ -1011,4 +1045,4 @@ class NanookSaveEmprunteurUpdatePatronErrorTest extends NanookTestCase {
 	
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php
index 86a87019940e6a5b8c2ae2dd801a44a44d5f7feb..c1bce55ee9ce84502bbc07cc68810cbf53418d0f 100644
--- a/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php
+++ b/tests/library/ZendAfi/View/Helper/Accueil/KiosqueTest.php
@@ -489,8 +489,9 @@ class ZendAfi_View_Helper_Accueil_KiosqueTitle extends ViewHelperTestCase {
 
 	/** @test */
 	public function titleShouldContainEncodedSlashesInUrl() {
-		$this->assertContains('/recherche/simple/titre/Title+with+%2F+slash/style_liste/mur/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/0/op_transition//op_largeur_img/0/rss_avis/1/id_catalogue/0/id_panier/0">Title with / slash</a>',
-													$this->_helper->getTitre());
+		$this->assertContains(
+			'/recherche/simple/titre/Title+with+%2F+slash/style_liste/mur/nb_notices/20/only_img/1/aleatoire/1/tri/date_creation+desc/nb_analyse/50/op_hauteur_img/0/op_transition//op_largeur_img/0/op_auto/0/op_scroll/1/rss_avis/1/id_catalogue/0/id_panier/0">Title with / slash</a>',
+			$this->_helper->getTitre());
 	}
 
 }