diff --git a/VERSIONS_WIP/dev_#18864_typo3_attribution_domain b/VERSIONS_WIP/dev_#18864_typo3_attribution_domain
new file mode 100644
index 0000000000000000000000000000000000000000..231fc908443434754125b673a74dec4a3e2369ec
--- /dev/null
+++ b/VERSIONS_WIP/dev_#18864_typo3_attribution_domain
@@ -0,0 +1,2 @@
+ - ticket : 18864
+   - L'import typo3 des TT_news ne génère plus de domaine lié à la catégorie
\ No newline at end of file
diff --git a/VERSIONS_WIP/dev_#18866_typo3_event_date b/VERSIONS_WIP/dev_#18866_typo3_event_date
new file mode 100644
index 0000000000000000000000000000000000000000..35cdb087ceeb1d0e6c37ffa6b39485901c135376
--- /dev/null
+++ b/VERSIONS_WIP/dev_#18866_typo3_event_date
@@ -0,0 +1,2 @@
+ - ticket : #18866
+   - L'import Typo3 ajout une date de début d'évènement et une date de fin d'évènement basé sur datetime lorsque l'article appartient à la catégorie "Action_culturelle" 
\ No newline at end of file
diff --git a/VERSIONS_WIP/dev_#18867_typo3_dossiers_documentaires b/VERSIONS_WIP/dev_#18867_typo3_dossiers_documentaires
new file mode 100644
index 0000000000000000000000000000000000000000..1bfe8a5581e1ddfb705a3270d3288f5b235fbaf8
--- /dev/null
+++ b/VERSIONS_WIP/dev_#18867_typo3_dossiers_documentaires
@@ -0,0 +1,5 @@
+- Import Typo3 "Dossiers Documentaires" : 
+    - les articles de présentation des dossiers doc ( tt_news=36 ) sont mis dans la catégorie  "Nos dossiers documentaires" et la date d'évenement est récupérée
+    - Réorganisation des docs : création d'une sous catégorie de la catégorie "Nos dossiers documentaires"  pour chaque page ayaint un pid=309
+    - Sauvegarde des uid typo3 pour les articles pour permettre les mises à jour de cette table
+    - Mise à jour des catégories des articles ayant un pid=309 
diff --git a/VERSIONS_WIP/dev_#18868_typo3_summary_image b/VERSIONS_WIP/dev_#18868_typo3_summary_image
new file mode 100644
index 0000000000000000000000000000000000000000..840bb0be0728d6915e864bafe6838c4bd46cff63
--- /dev/null
+++ b/VERSIONS_WIP/dev_#18868_typo3_summary_image
@@ -0,0 +1,2 @@
+ - ticket : #18868
+   - L'import typo3 ajoute l'image dans la description d'un article même si elle est vide
\ No newline at end of file
diff --git a/library/Class/Article.php b/library/Class/Article.php
index 863f78d7a78d890ac269e8186212f7bbc506bbd5..e1aef1ba4650d8d7a9fe0d946d64a233986ada3d 100644
--- a/library/Class/Article.php
+++ b/library/Class/Article.php
@@ -20,6 +20,7 @@
  */
 
 class ArticleLoader extends Storm_Model_Loader {
+
 	/** @var Zend_Db_Table_Select */
 	protected $_select;
 	protected $_sort_order;
@@ -431,7 +432,7 @@ class ArticleLoader extends Storm_Model_Loader {
 
 
 class Class_Article extends Storm_Model_Abstract {
-	use Trait_TreeViewableItem, Trait_HasManyDomaines, Trait_TimeSource, Trait_Indexable;
+	use Trait_TreeViewableItem, Trait_HasManyDomaines, Trait_TimeSource, Trait_Indexable, Trait_CustomFields;
 
 	const END_TAG='{FIN}';
 
@@ -733,12 +734,12 @@ class Class_Article extends Storm_Model_Abstract {
 	 */
 	public function _get($field) {
 		if ($this->shouldOverrideAttribute($field))
-			return parent::_get($field);
+			return $this->_getCustomField($field);
 
 		if ($this->isTraduction())
 			return $this->getArticleOriginal()->_get($field);
 
-		return parent::_get($field);
+		return $this->_getCustomField($field);
 	}
 
 	/**
@@ -748,12 +749,12 @@ class Class_Article extends Storm_Model_Abstract {
 	 */
 	public function _set($field, $value) {
 		if ($this->shouldOverrideAttribute($field))
-			return parent::_set($field, $value);
+			return $this->_setCustomField($field,$value);
 
 		if ($this->isTraduction()) {
 			return $this->getArticleOriginal()->_set($field, $value);
 		} else {
-			return parent::_set($field, $value);
+			return $this->_setCustomField($field, $value);
 		}
 	}
 
@@ -766,7 +767,7 @@ class Class_Article extends Storm_Model_Abstract {
 	public function beforeSave() {
 		$this->_updateDateMaj();
 
-		if ($this->isNew())
+		if ($this->isNew() && !$this->getDateCreation())
 			$this->setDateCreation($this->getDateMaj());
 
 		$this->unindex();
@@ -1197,6 +1198,12 @@ class Class_Article extends Storm_Model_Abstract {
 			return $matches[3] . '-' . $matches[2] . '-' . $matches[1] . $matches[4];
 		}
 
+
+		if (preg_match('/^(\d{4})-(\d{2})-(\d{2})( \d{2}:\d{2})?/', $str, $matches)) {
+			$matches[4] = isset($matches[4]) ? $matches[4] : ' 00:00';
+			return $matches[1] . '-' . $matches[2] . '-' . $matches[3] . $matches[4];
+		}
+
 		$locale = Zend_Registry::get('locale');
 		$date = new Zend_Date($str, null, $locale);
 		return $date->toString('YYYY-MM-dd HH:mm');
diff --git a/library/Class/ArticleCategorie.php b/library/Class/ArticleCategorie.php
index 736af092b8b994c4e408e78c6b90bc27c8d19d0a..cf6a97fa650fd3ca10292b42b4ac66fffcc27ae4 100644
--- a/library/Class/ArticleCategorie.php
+++ b/library/Class/ArticleCategorie.php
@@ -21,6 +21,7 @@
 
 
 class ArticleCategorieLoader extends Storm_Model_Loader {
+
 	public function getRoot() {
 		return Class_ArticleCategorie::newInstanceWithId(null,
 																										 ['sous_categories' => Class_ArticleCategorie::findTopCategories()]);
@@ -39,7 +40,7 @@ class Class_ArticleCategorie extends Storm_Model_Abstract {
 	use
 		Trait_TreeViewableCategorie,
 		Trait_TreeNode;
-
+//	use Trait_CustomFields;
 	protected
 		$_table_name = 'cms_categorie',
 		$_table_primary = 'ID_CAT',
diff --git a/library/Class/CustomField.php b/library/Class/CustomField.php
index 2b4dacbdc5390d5f47e710020711fc954ef73037..f61844747fe2f75a7c37bd658ec61924814f2c8a 100644
--- a/library/Class/CustomField.php
+++ b/library/Class/CustomField.php
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
  * along with BOKEH; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301	 USA 
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301	 USA
  */
 
 class CustomFieldsLoader extends Storm_Model_Loader {
@@ -27,9 +27,9 @@ class CustomFieldsLoader extends Storm_Model_Loader {
 		foreach($custom_fields_meta as $custom_field_meta) {
 			$custom_fields = Class_CustomField::findAllBy(['meta_id' => $custom_field_meta->getId(),
 																										 'model' => $model]);
-			if(!array_filter($custom_fields)){
+			if (!array_filter($custom_fields))
 				$availables_meta[] = $custom_field_meta;
-			}
+
 		}
 
 		return $availables_meta;
@@ -37,7 +37,7 @@ class CustomFieldsLoader extends Storm_Model_Loader {
 
 
 	public function initializePrioritiesAndSave($fields) {
-		foreach($fields as $priority => $field) 
+		foreach($fields as $priority => $field)
 			$field->setPriority($priority + 1)->save();
 	}
 }
@@ -46,8 +46,8 @@ class CustomFieldsLoader extends Storm_Model_Loader {
 
 class Class_CustomField extends Storm_Model_Abstract {
 	use Trait_TreeViewableItem;
-	
-	protected 
+
+	protected
 		$_table_name = 'custom_field',
 		$_loader_class = 'CustomFieldsLoader',
 		$_belongs_to = ['meta' => ['model' => 'Class_CustomField_Meta',
@@ -91,13 +91,13 @@ class Class_CustomField extends Storm_Model_Abstract {
 		$this->getMeta()->save();
 	}
 
-	
+
 	public function setFieldType($value) {
 		$this->getMeta()->setFieldType($value);
 		return $this;
 	}
 
-	
+
 	public function getFieldType() {
 		return $this->getMeta()->getFieldType();
 	}
@@ -108,12 +108,12 @@ class Class_CustomField extends Storm_Model_Abstract {
 		return $this;
 	}
 
-	
+
 	public function getOptionsList() {
 		return $this->getMeta()->getOptionsList();
 	}
 
-	
+
 	public function getOptionsListAsArray() {
 		return $this->getMeta()->getOptionsListAsArray();
 	}
diff --git a/library/Class/CustomField/Model.php b/library/Class/CustomField/Model.php
index eabd2e0c9407dafb7269581d3ad139a8647f1f13..bea06b412ada75a8f5ff507b90cafd71dacd619d 100644
--- a/library/Class/CustomField/Model.php
+++ b/library/Class/CustomField/Model.php
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
  * along with BOKEH; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
 
@@ -24,7 +24,7 @@ class Class_CustomField_Model {
 	use Trait_TreeViewableCategorie;
 
 	const CLASS_PREFIX = 'Class_';
-	
+
 	protected static $_models = [];
 
 	protected $_configuration;
@@ -63,11 +63,12 @@ class Class_CustomField_Model {
 	}
 
 
+
 	public function __construct($configuration) {
 		$this->_configuration = $configuration;
 	}
 
-	
+
 	public function isNew() {
 		return false;
 	}
@@ -87,7 +88,7 @@ class Class_CustomField_Model {
 		return $this->_configuration->getEditUrl();
 	}
 
-	
+
 	public function getId() {
 		return $this->_configuration->getClassName();
 	}
@@ -120,7 +121,7 @@ class Class_CustomField_Model {
 
 class Class_CustomField_NullModel extends Class_CustomField_Model {
 	public function __construct() {
-		
+
 	}
 
 
diff --git a/library/Class/Exemplaire.php b/library/Class/Exemplaire.php
index 4d6e43ad537cb036b57ee4c6ecbc9eb4f0c09274..0b3ea17c077747bb7b425a2eba4f127dd5b1169d 100644
--- a/library/Class/Exemplaire.php
+++ b/library/Class/Exemplaire.php
@@ -20,6 +20,7 @@
  */
 
 class Class_Exemplaire extends Storm_Model_Abstract {
+//	use Trait_CustomFields;
 	protected $_table_name = 'exemplaires';
 	protected $_table_primary = 'id';
 
diff --git a/library/Class/Import/Typo3.php b/library/Class/Import/Typo3.php
index 03b490b14f60b2b356b06ca57ce9b9eba904097f..e7cd665f3603924f5f755396f70ce6b2e7f07c0c 100644
--- a/library/Class/Import/Typo3.php
+++ b/library/Class/Import/Typo3.php
@@ -26,9 +26,14 @@ class Class_Import_Typo3 {
 //	const BOKEH_ATTACHMENT_URL="http://web.afi-sa.net/miop-test.net/userfiles/file/";
 	const BOKEH_FILEADMIN_URL= "http://www.mediathequeouestprovence.fr/fileadmin/";
 //	const BOKEH_FILEADMIN_URL= "http://web.afi-sa.net/miop_test.net/userfiles/image/";
+
+	const  FOREIGN_UID_DATETIME=[867,36];
+	const UID_TYPO3_CF='uid_typo3';
+
 	protected
 		$user_mapper,
-		$unknown_koha_urls = [];
+		$unknown_koha_urls = [],
+		$meta;
 
   public function __construct() {
     $this->t3db = new Typo3DB();
@@ -49,8 +54,16 @@ class Class_Import_Typo3 {
     $this->errors = [];
     $this->domaine_map = new DomaineMap();
 		$this->userMap = new UserMap();
+		$this->createCustomField();//		Class_CustomField_model::register(new Class_CustomField_modelConfiguration('
+
+
   }
 
+	public function createCustomField() {
+		return Class_Article::addCustomField(self::UID_TYPO3_CF, Class_CustomField_Meta::TEXT_INPUT);
+	}
+
+
 	public function setTypo3DB($t3db) {
 		$this->t3db=$t3db;
 		return $this;
@@ -60,6 +73,11 @@ class Class_Import_Typo3 {
   public function run($what = 'all') {
 		$_SERVER['HTTP_HOST']='localhost';
 
+		if ($what == 'update') {
+			Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Mise a jour uniquement");
+      $this->updateCategoriesForDossiersDocumentaires();
+
+		}
     if ($what == 'all' || $what == 'users') {
       Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing users");
       $this->import_user();
@@ -104,6 +122,9 @@ class Class_Import_Typo3 {
     Class_CodifThesaurus::deleteBy([]);
     Class_Sitotheque::deleteBy([]);
     Class_SitothequeCategorie::deleteBy([]);
+
+		$meta = Class_Article::getMeta('uid_typo3');
+
     $this->reset_auto_increment();
 
     $this->cal_categories_map= new CalendarCategoriesMap('Agenda', $this->domaine_map);
@@ -177,8 +198,8 @@ class Class_Import_Typo3 {
 
 
 	public function manipulate_body($body,$image='') {
-		$body = $this->addImage($image).$body;
 		$body = $this->wrapWithHtml($body);
+		$body = $this->addImage($image).$body;
 		$body = $this->translateLinksToAnchor($body);
 		$body = $this->fixImageLinks($body);
 		$body = $this->fixAttachmentsLinks($body);
@@ -295,6 +316,32 @@ class Class_Import_Typo3 {
 		return '<p>' . $content . '</p>';
 	}
 
+	public function getCatDossierDoc() {
+		return $this->createCategory("Nos dossiers documentaires");
+	}
+
+
+	public function updateCategoriesForDossiersDocumentaires() {
+		$t3_pages = $this->t3db->findAllPagesWithPid(309);
+		foreach ($t3_pages as $page) {
+			$category = $this->createCategory($page['title'],$this->getCatDossierDoc()->getId());
+
+			$contents = $this->t3db->findAllContents($page['uid']);
+			foreach ($contents as $content) {
+				$article = $this->_getArticle($content['uid']);
+				$article->setCategorie($category);
+				$article->save();
+			}
+		}
+
+	}
+
+
+	protected function _getArticle($value) {
+		return Class_Article::findFirstByCustomFieldValue(self::UID_TYPO3_CF,$value);
+	}
+
+
 
   public function importArticles() {
     $t3news = $this->t3db->findAllArticles();
@@ -316,29 +363,64 @@ class Class_Import_Typo3 {
   }
 
 
+	public function setMiopDateEvent($article,$data) {
+		if ($this->existCategoriesAsForeign($data,self::FOREIGN_UID_DATETIME)) {
+			$converted_date = $this->formatDate($data['datetime']);
+			$article->setEventsDebut($converted_date)->setEventsFin($converted_date);
+		}
+
+		$this->changeCategory($article,$data,$this->getCatDossierDoc()->getId());
+		return $article;
+	}
+
+
+	public function existCategoriesAsForeign($data,$array_catid) {
+		foreach ($this->t3db->findAllForeignUidForNewsCat($data['uid']) as $domain) {
+			if (in_array($domain['uid_foreign'],$array_catid))
+				return true;
+		}
+		return false;
+	}
+
+
+	public function changeCategory($article,$data,$id_cat) {
+		if ($this->existCategoriesAsForeign($data,[$id_cat]))
+			$article->setIdCat($this->news_categories_map->find($id_cat)->getId());
+	}
+
+
+	public function formatDate($date_str) {
+		return $date_str ? date("Y-m-d H:i", $date_str) : '';
+	}
+
+
 	public function createArticle($new,$id_cat) {
 		$date_creation = date("Y-m-d H:i:s", $new['crdate']);
-		$debut = $new['starttime'] ? date("Y-m-d", $new['starttime']) : '';
-		$fin = $new['endtime'] ? date("Y-m-d", $new['endtime']) : '';
+		$debut = $this->formatDate($new['starttime']);
+		$fin = $this->formatDate($new['endtime']);
 
 		$element = Class_Article::newInstance(['date_creation' => $date_creation,
 																					 'debut' => $debut,
 																					 'fin' => $new['hidden'] ? null : $fin,
+																					 'events_debut' => null,
+																					 'events_fin' => null,
 																					 'id_user' => $this->userMap->find($new['cruser_id']),
-																					 'description' => $new['short']? $this->manipulate_body($new['short'],$new['image']): '',
+																					 'description' => $new['short']? $this->manipulate_body($new['short'],$new['image']): $this->addImage($new['image']),
 																					 'contenu' => $new['bodytext'] ? $this->manipulate_body($new['bodytext'],$new['image']) : '&nbsp;',
 																					 'id_cat' => $id_cat,
 																					 'status' => Class_Article::STATUS_VALIDATED,
 																					 'tags' => str_replace(', ', ';', $new['tx_danpextendnews_tags']),
 																					 'titre' => $new['title']]);
+		$element = $this->setMiopDateEvent($element,$new);
 
-
+		$element->setUidTypo3($new['uid']);
 		if (!$element->save()) {
 			Class_Import_Typo3_Logs::getInstance()->incrementArticleRejected($element, [$new['uid'],
 																																									$new['title']]);
 			return $element;
 
 		}
+
 		Class_Import_Typo3_Logs::getInstance()->incrementArticlesSaved();
 		return $element;
 	}
@@ -357,7 +439,7 @@ class Class_Import_Typo3 {
       $minutes = 59;
     }
 
-    return sprintf('%s-%s-%s %s:%s:%s', $year, $month, $day, $hour, $minutes, '00');
+    return sprintf('%s/%s/%s %s:%s:%s', $year, $month, $day, $hour, $minutes, '00');
   }
 
 
@@ -374,14 +456,15 @@ class Class_Import_Typo3 {
 
 
 	public function createCalendar($new) {
-
       $date_creation = date("Y-m-d H:i:s", $new['crdate']);
-      $debut = $new['starttime'] ? date("Y-m-d", $new['starttime']) : '';
-      $fin = $new['endtime'] ? date("Y-m-d", $new['endtime']) : '';
+			$debut = $this->formatDate($new['starttime']);
+			$fin = $this->formatDate($new['endtime']);
+
       $event_debut = $this->typo_event_to_date($new['start_date'], $new['start_time']);
       $event_fin = $this->typo_event_to_date($new['end_date'], $new['end_time']);
 
-      $element = Class_Article::newInstance(['debut' => $debut,
+      $element = Class_Article::newInstance(['date_creation' => $date_creation,
+																						 'debut' => $debut,
                                              'fin' => $new['hidden'] ? null : $fin,
                                              'events_debut' => $event_debut,
                                              'events_fin' => $event_fin,
@@ -394,6 +477,8 @@ class Class_Import_Typo3 {
                                              'tags' => '',
                                              'titre' => $new['title']]);
 
+			$element->setUidTypo3($new['uid']);
+
       if (!$element->save()) {
         $this->report['calendar_errors']++;
         Class_Import_Typo3_Logs::getInstance()->addErrorRow('calendar with uid: ' . $new['uid'] . '(' . $new['title'] . ') - ' . implode(', ', $element->getErrors()));
@@ -411,6 +496,14 @@ class Class_Import_Typo3 {
 	}
 
 
+	public function createCategory($category_name,$id_cat_mere=0) {
+		if ($category=Class_ArticleCategorie::findFirstBy(['libelle' => $category_name]))
+			return $category;
+    $category=Class_ArticleCategorie::newInstance(['libelle' => $category_name,'id_cat_mere' =>$id_cat_mere]);
+		$category->save();
+    return $category;
+	}
+
   public function importArticlesPages() {
     $rows = $this->t3db->findAllContents();
 
@@ -431,9 +524,8 @@ class Class_Import_Typo3 {
 
 	public function createArticlePage($new, $pages_cat) {
 		$date_creation = date("Y-m-d H:i:s", $new['crdate']);
-		$debut = $new['starttime'] ? date("Y-m-d", $new['starttime']) : '';
-		$fin = $new['endtime'] ? date("Y-m-d", $new['endtime']) : '';
-
+		$debut = $this->formatDate($new['starttime']);
+		$fin = $this->formatDate($new['endtime']);
 
 		$element = Class_Article::newInstance(['date_creation' => $date_creation,
 																					 'debut' => $debut,
@@ -446,10 +538,13 @@ class Class_Import_Typo3 {
 																					 'tags' => '',
 																					 'titre' => $new['header']]);
 
+
 		if (!$element->save()) {
 			$this->report['pages_errors']++;
 			Class_Import_Typo3_Logs::getInstance()->addErrorRow('pages with uid: ' . $new['uid'] . ' (' . $new['title'] . ') - ' . implode(', ', $element->getErrors()));
 		}
+		$element->setUidTypo3($new['uid']);
+		$element->save();
 		return $element;
 	}
 
@@ -626,7 +721,7 @@ abstract class CategoriesMap {
 
 
 	public function setDomainsFor($model, $t3_domain_ids) {
-		$domains = [$this->domaine_map->findOrCreateDomaine($model->getCategorie())];
+		$domains = [];
 		foreach ($t3_domain_ids as $t3_domain) {
 			$category = $this->find($t3_domain['uid_foreign']);
 			$domains[] = $this->domaine_map->findOrCreateDomaine($category);
@@ -772,6 +867,12 @@ class Typo3DB {
 		return $this->pages_titles[$uid] = $row['title'];
 	}
 
+
+	public function findAllPagesWithPid($pid) {
+		return $this->t3db->fetchAll('select * from pages where pid='.$pid);
+	}
+
+
 	public function findAllUsers() {
 		return $this->t3db->fetchAll('select * from be_users where uid > 1');
 	}
@@ -805,8 +906,11 @@ class Typo3DB {
 		return $this->t3db->fetchAll("select * from tx_cal_event where deleted=0 and hidden=0 order by uid ASC");
 	}
 
-	public function findAllContents() {
-		return $this->t3db->fetchAll("select * from tt_content where deleted=0 and hidden=0 and header>'' and bodytext>'' and  (ctype='text' or ctype='textpic') order by uid ASC");
+	public function findAllContents($page_id=false) {
+		$pid_sql='';
+		if ($page_id)
+			$pid_sql='and pid='.$page_id;
+		return $this->t3db->fetchAll("select * from tt_content where deleted=0 and hidden=0 and header>'' and bodytext>'' and  (ctype='text' or ctype='textpic') ".$pid_sql." order by uid ASC");
 	}
 }
 ?>
\ No newline at end of file
diff --git a/library/Class/Sitotheque.php b/library/Class/Sitotheque.php
index 922200d3e47735a3df60f341f77934b338b32dd2..811e21f95296ac1fdcaa445284201fee26e1c8ae 100644
--- a/library/Class/Sitotheque.php
+++ b/library/Class/Sitotheque.php
@@ -20,18 +20,6 @@
  */
 require_once dirname(__FILE__)."/CompositeBuilder.php";
 
-class SitoCategorie extends Zend_Db_Table_Abstract {
-	protected static $_instance;
-	protected $_name = 'sito_categorie';
-
-	public static function getInstance() {
-		if (!isset(self::$_instance))
-			self::$_instance = new self();
-		return self::$_instance;
-	}
-}
-
-
 class Class_SitothequeModelCategorie extends ItemCategory {
 	public function getLabel(){
 		return $this->libelle;
@@ -201,26 +189,6 @@ class Class_Sitotheque extends Storm_Model_Abstract {
 	}
 
 
-	public function getAllSousCategorie($id_cat_mere = "all")
-	{
-		try{
-			if($id_cat_mere == "all") { return $fetch = SitoCategorie::getInstance()->fetchAll(); }
-			else
-				{
-					$select = SitoCategorie::getInstance()>getAdapter()->select()
-						->from('sito_categorie',array('ID_CAT'=>'ID_CAT', 'ID_CAT_MERE'=>'ID_CAT_MERE','LIBELLE'=>'LIBELLE','ID_SITE'=>'ID_SITE'))
-						->where('ID_CAT_MERE=?', $id_cat_mere);
-					$stmt = $select->query();
-					$row = $stmt->fetchAll();
-					return $row;
-				}
-		}catch (Exception $e){
-			logErrorMessage('Class: Class_Sitotheque; Function: getAllSousCategorie' . NL . $e->getMessage());
-			return $this->_dataBaseError;
-		}
-	}
-
-
 	public function validate()	{
 		$this->check($this->getTitre(), $this->_("Vous devez compléter le champ 'Titre'"));
 
diff --git a/library/Class/SitothequeCategorie.php b/library/Class/SitothequeCategorie.php
index 322cf4026bd3deb42b3503826f2dea923265a716..13b0a38141f3996d79b4871ae36931983c5a32df 100644
--- a/library/Class/SitothequeCategorie.php
+++ b/library/Class/SitothequeCategorie.php
@@ -20,7 +20,7 @@
  */
 class Class_SitothequeCategorie extends Storm_Model_Abstract {
  	use Trait_TreeViewableCategorie, Trait_Translator, Trait_TreeNode;
-
+//	use Trait_CustomFields;
 	protected $_table_name = 'sito_categorie';
 	protected $_table_primary = 'ID_CAT';
 	protected $_belongs_to = ['parent_categorie' => ['model' => 'Class_SitothequeCategorie',
diff --git a/library/Trait/CustomFields.php b/library/Trait/CustomFields.php
new file mode 100644
index 0000000000000000000000000000000000000000..fc7878db1020c3ab8445ad6c14292b30475f4505
--- /dev/null
+++ b/library/Trait/CustomFields.php
@@ -0,0 +1,210 @@
+<?php
+/**
+ * Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
+ *
+ * BOKEH is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
+ * the Free Software Foundation.
+ *
+ * There are special exceptions to the terms and conditions of the AGPL as it
+ * is applied to this software (see README file).
+ *
+ * BOKEH is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * along with BOKEH; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+
+/**
+ * To use this Trait in a model  you need to :
+ * Register you model : cf Class_CustomField_Model::register
+ * Redefine this 2 methods :
+	public function _set($field, $value) {
+    	return $this->_setCustomField($field,$value);
+	}
+
+	public function _get($field) {
+	    return  $this->_getCustomField($field);
+  }
+
+ *	WARN : this trait redefine afterSave() and beforeSave() method
+ *
+ */
+
+
+
+trait Trait_CustomFields {
+	protected $custom_fields=[],
+		$custom_fields_meta;
+
+	public static  function findMetaForLabel($label) {
+		return Class_CustomField_Meta::findFirstBy(['label' => $label]);
+	}
+
+	public static function findFirstByCustomFieldValue($custom_field_name,$custom_field_value) {
+		$meta=self::findMetaForLabel($custom_field_name);
+		$custom_fields=Class_CustomField::findAllBy(['meta_id' => $meta->getId(),
+																								 'model' => static::getModelName()]);
+
+		foreach ($custom_fields as $custom_field) {
+			$value = Class_CustomField_Value::findFirstBy(['custom_field_id' => $custom_field->getId(),
+																										 'value' => $custom_field_value]);
+			if ($value)
+				return static::getLoader()->find($value->getModelId());
+		}
+		return null;
+
+	}
+
+
+	public static function getMeta($custom_field_name) {
+		if ($meta=Class_CustomField_Meta::findFirstBy(['label' => $custom_field_name]))
+			return $meta;
+
+	}
+
+
+	public static function getAndCreateMeta($custom_field_name,$custom_field_type,$options='') {
+		if ($meta=self::getMeta($custom_field_name))
+			return $meta;
+		$meta=Class_CustomField_Meta::newInstance(
+																							[
+																							 'label' => $custom_field_name,
+																							 'field_type' => $custom_field_type,
+																							 'options_list' => $options]);
+		$meta->save();
+
+		return $meta;
+	}
+
+
+	public static function addCustomField($custom_field_name,$custom_field_type,$options='') {
+		$meta=self::getAndCreateMeta($custom_field_name,$custom_field_type,$options);
+		if ($custom_field_model=Class_CustomField::findFirstBy(['meta_id' => $meta->getId(),
+																														'model' => self::getModelName()]))
+			return $custom_field_model;
+		$custom_field_article=Class_CustomField::newInstance(['meta_id' => $meta->getId(),
+																													'priority' => 1,
+																													'model' => self::getModelName()]);
+		$custom_field_article->save();
+		return $custom_field_article;
+
+	}
+
+
+	public static function getModelName() {
+		return Class_CustomField_Model::sanitizeName(static::getLoader()->getModel());
+	}
+
+
+	public function isRegistered() {
+		return  Class_CustomField_Model::isRegistered($this->getModelName());
+	}
+
+
+	public function getAvailableMeta() {
+		$availables_meta = [];
+		$custom_fields_meta = Class_CustomField_Meta::findAll();
+
+		foreach($custom_fields_meta as $custom_field_meta) {
+			$custom_fields = Class_CustomField::findAllBy(['meta_id' => $custom_field_meta->getId(),
+																										 'model' => $this->getModelName()]);
+			if ($custom_fields)
+				$availables_meta[] = $custom_field_meta;
+
+		}
+
+		return $availables_meta;
+
+	}
+
+
+
+	public function afterSave() {
+		if (!$this->isRegistered())
+			return true;
+
+		foreach ($this->custom_fields as $field => $value) {
+
+			if (!$meta =self::getMeta($field))
+				continue;
+			$custom_field=Class_CustomField::findFirstBy(['meta_id' => $meta->getId(),
+																										'model'=> $this->getModelName()]);
+
+			if (!$cf_value = Class_CustomField_Value::findFirstBy(['model_id' => $this->getId(),
+																														 'custom_field_id'=> $custom_field->getId()]))
+				$cf_value = Class_CustomField_Value::newInstance(['model_id' => $this->getId() ,
+																													'custom_field_id' =>$custom_field->getId()]);
+
+			return 	$cf_value->setValue($value)->save();
+		}
+	}
+
+
+	public function findCustomFieldValue($custom_field_name) {
+		$meta=self::findMetaForLabel($custom_field_name);
+		$custom_field=Class_CustomField::findFirstBy(['meta_id' => $meta->getId(),
+																									'model' => $this->getModelName()]);
+
+		$values = Class_CustomField_Value::findAllBy(['custom_field_id' => $custom_field->getId(),
+																									'model_id' => $this->getId()]);
+
+		foreach ($values as $value) {
+			return $value->getValue();
+		}
+		return '';
+
+	}
+
+
+	public function getCustomFieldsAvailable() {
+		if (!$custom_field_model=Class_CustomField_Model::getModel($this->getModelName()))
+			return [];
+		return $custom_field_model->getItems();
+	}
+
+
+	public function getCustomMetaNames() {
+		if (!$this->isRegistered())
+			return [];
+		if ($this->custom_meta_names)
+			return $this->custom_meta_names;
+
+		return $this->custom_meta_name=array_map(function($meta) {return $meta->getLabel();},$this->getAvailableMeta());
+
+	}
+
+	public function _setCustomField($field,$value) {
+		if (in_array($field,$this->getCustomMetaNames()))
+			return $this->custom_fields[$field]=$value;
+		return parent::_set($field, $value);
+
+	}
+
+
+	public function _getCustomField($field) {
+		if ($this->isAttributeExists($field))
+			return parent::_get($field);
+
+		if(!$meta =self::getMeta($field))
+			return null;
+
+		if (isset($this->custom_fields[$field]))
+			return $this->custom_fields[$field];
+		$this->custom_fields[$field]=$this->findCustomFieldValue($field);
+		return $this->custom_fields[$field];
+	}
+
+
+	public function afterDelete() {
+		if (!$this->isRegistered())
+			return true;
+		Class_CustomField_Value::deleteBy(['model_id' => $this->getId()]);
+	}
+}
+?>
\ No newline at end of file
diff --git a/library/storm b/library/storm
index 25ca343bac14e3227379c588cdccedd3df5b5a31..aa890c69508b0c9f62cb2313f9ae8269890d9ce1 160000
--- a/library/storm
+++ b/library/storm
@@ -1 +1 @@
-Subproject commit 25ca343bac14e3227379c588cdccedd3df5b5a31
+Subproject commit aa890c69508b0c9f62cb2313f9ae8269890d9ce1
diff --git a/scripts/import_typo3.php b/scripts/import_typo3.php
index 13c0e102fae4c412b47f7b0f7b266e48766d25c9..442bb38a5f0ca9ea40dd17a85bfd0a7f20a2dcad 100644
--- a/scripts/import_typo3.php
+++ b/scripts/import_typo3.php
@@ -2,8 +2,8 @@
 /*
  * Launch import_typo3.php like:
  *    php import_typo3.php <arg>
- *    <arg> can be users (import users only), articles (import articles only) or all (import all)
- *
+ *    <arg> can be users (import users only), articles (import articles only), all (import all)
+ *          or update (don't destroy database)
  * Script import data in a database named miop_typo3. To change it, edit the line 109.
  */
 
@@ -12,6 +12,9 @@ require('console.php');
 $toRun = $argv[1];
 
 Class_Import_Typo3_Logs::getInstance()->activateOutput();
+Class_CustomField_Model::registerAll([
+																			new Class_CustomField_ModelConfiguration_Article()
+																			]);
 
 $migration = new Class_Import_Typo3();
 $migration->run($toRun);
diff --git a/tests/library/Class/Import/Typo3Fixture.php b/tests/library/Class/Import/Typo3Fixture.php
index cae82a1de63aa264c1799e2aa90d8d4b2c9353f8..034fa0c04c63590a75fc5dd35ee76f70cc58f34f 100644
--- a/tests/library/Class/Import/Typo3Fixture.php
+++ b/tests/library/Class/Import/Typo3Fixture.php
@@ -82,10 +82,18 @@ class MockTypo3DB {
 						['title' => 'NOS TOPS 5',
 						 'uid' => 43,
 						 'parent_category' => 0
-						]
-		];
+						],
+						['title' => 'Action Culturelle',
+						 'uid' => 867,
+						 'parent_category' => 0
+						],
+						['title' => 'Nos dossiers documentaires',
+						 'uid' => 36,
+						 'parent_category' => 0
+						]];
 	}
 
+
 	public function findAllEventCat() {
 		return [
 						['uid' => 6,
@@ -103,6 +111,7 @@ class MockTypo3DB {
 		];
 	}
 
+
 	public function findAllSites() {
 		return [
 						['crdate' => '1412781027',
@@ -199,10 +208,11 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
  La collection, dans son ensemble, s\'adresse à un large public, désireux de mieux comprendre cet &quot;art de bâtir&quot; qui l\'environne et façonne de plus en plus son rapport à l\'espace, tant public que privé.
 '],
 						[ 'uid' => 14477,
-						 'starttime' => 0,
-						 'endtime' => 0,
+						 'starttime' => 1419844200,
+						 'endtime' => 1420017000,
 						 'hidden' => 0,
-						 'crdate' => 1359562198,
+						 'datetime' =>1419933840,
+						 'crdate' => 1419933840,
 						 'cruser_id' => 22,
 						 'short' => null,
 						 'category' => 1,
@@ -216,7 +226,7 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 						 'starttime' => 0,
 						 'endtime' => 0,
 						 'hidden' => 0,
-						 'image' => '',
+						 'image' => 'onyx.png',
 						 'crdate' => 1359562208,
 						 'cruser_id' => 22,
 						 'short' => null,
@@ -229,6 +239,7 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 						 'endtime' => 0,
 						 'hidden' => 0,
 						 'crdate' => 1357562208,
+						 'datetime' => 1395409080,
 						 'cruser_id' => 22,
 						 'image' => '',
 						 'short' => null,
@@ -274,7 +285,8 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 						 'tx_danpextendnews_tags' => '',
 						 'title' => 'Deezer ?',
 						 'bodytext' => '<link http://www.deezer.com/fr/nneka.html>Nneka</link>'],
-						['uid' => 13973,
+
+						['uid' => 139735,
 						 'starttime' => 0,
 						 'endtime' => 0,
 						 'hidden' => 0,
@@ -286,11 +298,32 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 						 'tx_danpextendnews_tags' => '',
 						 'title' => 'L\'artothèque',
 						 'bodytext' => '<p style="color: rgb(0, 0, 0); font-family: Verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">L\'artothèque de la Médiathèque Intercommunale propose au public sur les sites du réseau, une collection de 1 825 œuvres d\'art contemporain constituant un large panorama de la création plastique et photographique des quarante dernières années.</p>
-<p style="color: rgb(0, 0, 0); font-family: Verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><link http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-search.pl?q=test&idx=kw&idx=kw&idx=kw&limit=mc-itemtype%3AOART&sort_by=relevance&do=Rechercher _blank external-link-new-window>Un catalogue iconographique</link>&nbsp;est spécialement dédié à cette collection; il est également consultable dans tous les pôles&nbsp;<span style="font-style: italic;">Art</span>,<span style="font-style: italic;">&nbsp;</span>Musique, Cinéma&nbsp;du réseau.<br /><br />Outre le prêt d\'œuvres d\'art, l\'artothèque organise aussi des expositions, réalise des animations, accueille des groupes, édite des catalogues..., favorisant ainsi la diffusion et la promotion de l\'art et des artistes d\'aujourd\'hui.</p>']
+<p style="color: rgb(0, 0, 0); font-family: Verdana, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><link http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-search.pl?q=test&idx=kw&idx=kw&idx=kw&limit=mc-itemtype%3AOART&sort_by=relevance&do=Rechercher _blank external-link-new-window>Un catalogue iconographique</link>&nbsp;est spécialement dédié à cette collection; il est également consultable dans tous les pôles&nbsp;<span style="font-style: italic;">Art</span>,<span style="font-style: italic;">&nbsp;</span>Musique, Cinéma&nbsp;du réseau.<br /><br />Outre le prêt d\'œuvres d\'art, l\'artothèque organise aussi des expositions, réalise des animations, accueille des groupes, édite des catalogues..., favorisant ainsi la diffusion et la promotion de l\'art et des artistes d\'aujourd\'hui.</p>'],
+
+
+						['uid' => 14418,
+						 'starttime' => 1412632800,
+						 'endtime' => 1412683132,
+						 'datetime' => 1412805600,
+						 'hidden' => 0,
+						 'crdate' => 1412683132,
+						 'cruser_id' => 22,
+						 'short' => null,
+	 					 'image' => '',
+						 'category' => 1,
+						 'tx_danpextendnews_tags' => '',
+						 'title' => 'La fete de la science',
+						 'bodytext' => 'on y découvre plein de choses']
 ];
 	}
 
 	public function findAllForeignUidForNewsCat($uid) {
+		if (in_array($uid , [14488, 14418]))
+			return [[ 'uid_foreign' => 867 ]];
+
+		if ($uid==14477)
+			return [[ 'uid_foreign' => 36 ]];
+
 		return [
 						['uid_foreign' => 81],
 						['uid_foreign' => 43],
@@ -373,10 +406,10 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 		];
 	}
 
-	public function findAllContents() {
+	public function findAllContents($page_id=false) {
 		return [
 						[
-						 'uid' => 32,
+						 'uid' => 13973,
 						 'crdate' => 1298390490,
 						 'starttime' => 1298389541,
 						 'endtime' => 0,
@@ -391,6 +424,13 @@ La collection<span style="text-decoration: none"><span style="font-style: normal
 	}
 
 
+	public function findAllPagesWithPid($pid) {
+
+		if ($pid==309){
+			return [ [ 'uid' => 13973,
+								'title' => 'BLOGS AND SITES' ]];}
+		return [];
+	}
 	public function findPageTitle($uid) {
 		if ($uid == 49)
 			return '2014';
diff --git a/tests/library/Class/Import/Typo3Test.php b/tests/library/Class/Import/Typo3Test.php
index 3de28d20fd73828d737fa74d2c14c47831a06244..f0b14d6f1eb360abdf1a594c7455366db3864315 100644
--- a/tests/library/Class/Import/Typo3Test.php
+++ b/tests/library/Class/Import/Typo3Test.php
@@ -30,7 +30,6 @@ abstract class Import_Typo3TestCase extends ModelTestCase {
 	public function setUp() {
 		parent::setUp();
 		Class_Import_Typo3_Logs::getInstance()->cleans();
-
     Class_Article::beVolatile();
     Class_Users::beVolatile();
     Class_ArticleCategorie::beVolatile();
@@ -38,15 +37,43 @@ abstract class Import_Typo3TestCase extends ModelTestCase {
     Class_CodifThesaurus::beVolatile();
     Class_Sitotheque::beVolatile();
     Class_SitothequeCategorie::beVolatile();
+
+		Class_CustomField_Model::registerAll([
+																					new Class_CustomField_ModelConfiguration_Article()
+
+																					])
+			;
+		Class_CustomField_Meta::beVolatile();
+		Class_CustomField::beVolatile();
+		Class_CustomField_Value::beVolatile();
 		$this->mock_sql = Storm_Test_ObjectWrapper::mock();
 		$this->old_sql = Zend_Registry::get('sql');
 		Zend_Registry::set('sql', $this->mock_sql);
 
 		$this->mock_sql->whenCalled('execute')
 									 ->answers(true);
+		$this->fixture('Class_CustomField_Meta',
+									 ['id' => 1,
+										'label' => 'uid_typo3',
+										'field_type' => Class_CustomField_Meta::TEXT_INPUT,
+										'options_list' => '']);
+
+
+		$this->fixture('Class_CustomField',
+									 ['id' => 1,
+										'meta_id' => 1,
+										'priority' => 1,
+										'model' => 'Article']);
+
 		$this->migration = new Class_Import_Typo3();
 		$this->migration->setTypo3DB(new MockTypo3DB());
+/*		$this->fixture('Class_CustomField_Value',
+			['id' => 25,
+			'custom_field_id' => 1,
+			'model_id' => 1,
+			'value' => 'enabled']);
 
+*/
 	}
 
 
@@ -217,7 +244,7 @@ class Import_Typo3ArticleTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function articleABordDuBateauPirateShouldBeInDomainAutres() {
-		$this->assertEquals(['Société & Civilisation', 'Divers', 'NOS TOPS 5', 'Autres'],
+		$this->assertEquals(['Divers', 'NOS TOPS 5', 'Autres'],
 												$this->bateau_pirate->getDomaineLibelles());
 	}
 
@@ -228,18 +255,18 @@ class Import_Typo3ArticleTest extends Import_Typo3TestCase {
 												$this->bateau_pirate->getCategorieLibelle());
 	}
 
- /** @test */
+	/** @test */
 	public function articleABordDuBateauPirateShouldContainsImageWithBateau() {
 		$this->assertContains('<img src="'.Class_Import_Typo3::BOKEH_IMG_URL.'pics/bateau.jpg" alt=""/>',$this->bateau_pirate->getContenu());
 	}
 
- /** @test */
+	/** @test */
 	public function articleABordDuBateauPirateShouldContainsImageWithBateauInSummary() {
 		$this->assertContains('<img src="'.Class_Import_Typo3::BOKEH_IMG_URL.'pics/bateau.jpg" alt=""/>',$this->bateau_pirate->getDescription());
 	}
 
 
- /** @test */
+	/** @test */
 	public function articleABordDuBateauPirateShouldConvertImageWithUploads() {
 		$this->assertContains('<img style="padding-right: 10px; padding-bottom: 10px; float: left;" src="'.Class_Import_Typo3::BOKEH_IMG_URL.'RTEmagicC_5_37.jpg.jpg" height="76" width="133" alt="" />',$this->bateau_pirate->getContenu());
 	}
@@ -256,12 +283,12 @@ class Import_Typo3ArticleTest extends Import_Typo3TestCase {
 	}
 
 
- /** @test */
+	/** @test */
 	public function articleABordDuBateauPirateShouldConvertFileWithAttachmentsWithHttpLink() {
 		$this->assertContains('<a href="'.Class_Import_Typo3::BOKEH_ATTACHMENT_URL.'fichiers_joints/formulaires/memento_communique_sans_danger.pdf">',$this->bateau_pirate->getContenu());
 	}
 
- /** @test */
+	/** @test */
 	public function articleABordDuBateauPirateShouldConvertUserUploadWithFileAdmin() {
 		$this->assertContains('<a href="'.Class_Import_Typo3::BOKEH_FILEADMIN_URL.'jeunesse/formulaire_inscription_atelier_internet_espace_J.pdf">',$this->bateau_pirate->getContenu());
 	}
@@ -287,6 +314,12 @@ class Import_Typo3ArticleTest extends Import_Typo3TestCase {
 	}
 
 
+	/** @test */
+	public function discoverTowerEventSummaryShouldContainsOnyxImage() {
+		$this->assertContains('<img src="http://www.mediathequeouestprovence.fr/uploads/pics/onyx.png" alt=""/>', Class_Article::findFirstBy(['titre' => 'Onyx tower event'])->getDescription());
+	}
+
+
 	/** @test */
 	public function bokehWikiContentShouldContainsAnchorWithExpectedAttributs() {
 		$this->assertEquals('<p>Welcome to <a href="http://wiki.bokeh-library-portal.org">Wiki Bokeh</a></p>', Class_Article::findFirstBy(['titre' => 'Wiki Bokeh'])->getContenu());
@@ -336,6 +369,63 @@ class Import_Typo3ArticleTest extends Import_Typo3TestCase {
 	public function lartothequeArticleShouldBeTranformed() {
 		$this->assertContains('<a href="http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-search.pl?q=test&idx=kw&idx=kw&idx=kw&limit=mc-itemtype%3AOART&sort_by=relevance&do=Rechercher">Un catalogue iconographique</a>', Class_Article::findFirstBy(['titre' => 'L\'artothèque'])->getContenu());
 	}
+
+
+  /** @test */
+	public function welcomeShouldHaveStartEventDate() {
+		$this->assertEquals('2014-03-21 14:38',Class_Article::findFirstBy(['titre' => 'Wiki Bokeh'])->getEventsDebut());
+	}
+
+  /** @test */
+	public function welcomeShouldHaveEndEventDate() {
+		$this->assertEquals('2014-03-21 14:38',Class_Article::findFirstBy(['titre' => 'Wiki Bokeh'])->getEventsFin());
+	}
+
+  /** @test */
+	public function architectureShouldHaveStartEventDate() {
+		$this->assertEquals('2014-12-30 11:04',Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getEventsDebut());
+	}
+
+  /** @test */
+	public function architectureShouldHaveEndEventDate() {
+		$this->assertEquals('2014-12-30 11:04',Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getEventsFin());
+	}
+
+
+  /** @test */
+	public function architectureShouldHaveDateCreation() {
+		$this->assertEquals('2014-12-30 11:04:00',
+												Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getDateCreation());
+	}
+
+  /** @test */
+	public function architectureShouldHaveDateDebut() {
+		$this->assertEquals('2014-12-29 10:10',
+												Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getDebut());
+	}
+
+
+  /** @test */
+	public function architectureShouldHaveDateFin() {
+		$this->assertEquals('2014-12-31 10:10',
+												Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getFin());
+	}
+
+
+
+  /** @test */
+	public function feteScienceShouldHaveDateFin() {
+		$this->assertEquals('2014-10-09 00:00',
+												Class_Article::findFirstBy(['titre' => 'La fete de la science'])->getEventsFin());
+	}
+
+
+  /** @test */
+	public function architectureCategoryShouldBeNosDossiersDocumentaires() {
+		$this->assertEquals('Nos dossiers documentaires',Class_Article::findFirstBy(['titre' => 'Architecture summary'])->getCategorie()->getLibelle());
+	}
+
+
 }
 
 
@@ -380,7 +470,7 @@ class Import_Typo3CalendarTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function decouvrirBridgeShouldBeInDomainsAtelierPont() {
-	$this->assertEquals(['Atelier', 'Pont'],
+		$this->assertEquals(['Pont'],
 												$this->event_bridge->getDomaineLibelles());
 	}
 
@@ -391,6 +481,12 @@ class Import_Typo3CalendarTest extends Import_Typo3TestCase {
 	}
 
 
+	/** @test */
+	public function discoverMuseumEventsDebutShouldBe() {
+		$this->assertEquals('2007-11-02 18:30', Class_Article::findFirstBy(['titre' => 'Discover Museum'])->getEventsDebut());
+	}
+
+
 	/** @test */
 	public function discoverSpaceContentShouldContainsExpectedTitleWithHTML() {
 		$this->assertEquals('<p>Discover Space</p>', Class_Article::findFirstBy(['titre' => 'Discover Space'])->getContenu());
@@ -445,7 +541,7 @@ class Import_Typo3SitothequeTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function museoParcShouldBeInDomainAutres() {
-		$this->assertEquals(['My category', 'Divers', 'NOS TOPS 5', 'Autres'],
+		$this->assertEquals(['Divers', 'NOS TOPS 5', 'Autres'],
 												$this->sito->getDomaineLibelles());
 	}
 
@@ -461,10 +557,67 @@ class Import_Typo3SitothequeTest extends Import_Typo3TestCase {
 		$this->assertEquals('/miop-test.net/recherche/viewnotice/clef/OUEST_CANADIEN', Class_Sitotheque::findFirstBy(['titre' => 'L\'ouest canadien'])->getUrl());
 
 	}
+
 }
 
 
 
+class Import_Typo3CustomFieldTest extends Import_Typo3TestCase {
+	public function setUp() {
+		parent::setUp();
+		$this->migration->import_categories();
+		$this->migration->importArticles();
+
+		$this->migration->importArticlesPages();
+  	Class_CustomField_Value::clearCache();
+		$this->migration->updateCategoriesForDossiersDocumentaires();
+
+
+	}
+	/** @test */
+	public function museoShouldHaveCustomField() {
+   	Class_CustomField_Value::clearCache();
+		$article=Class_Article::findFirstBy(['titre' => 'A haute voix... le roman se fait entendre...']);
+ 		$this->custom_field_values = Class_CustomField_Value::findAllByInstance($article);
+		$this->assertEquals(13973,$this->custom_field_values[0]->getValue());
+	}
+
+  /** @test */
+	public function testShouldtypo3() {
+		$article=Class_Article::findFirstBy(['titre' => 'A haute voix... le roman se fait entendre...']);
+		$article->setUidTypo3('345');
+		$article->save();
+		$this->assertFalse(isset($article->attributesToArray()['uid_typo3']));
+	}
+
+
+  /** @test */
+	public function customfieldShouldbeUnique() {
+		$custom_fields=Class_CustomField::findAllBy(['meta_id' => 1,
+																								 'model' => 'Article']);
+		foreach ($custom_fields as $custom_field) {
+			$value = Class_CustomField_Value::findFirstBy(['custom_field_id' => $custom_field->getId(),
+																										 'value' => 13973]);
+		}
+
+	}
+
+	/** @test */
+	public function updateCategoriesShouldUpdateCategorie() {
+		Class_CustomField_Value::clearCache();
+		$article=Class_Article::findFirstBy(['titre' => 'A haute voix... le roman se fait entendre...']);
+		$this->assertEquals('BLOGS AND SITES',$article->getCategorie()->getLibelle());
+	}
+
+
+	/** @test */
+	public function updateCategorieShouldUpdateParentCategorie() {
+		Class_CustomField_Value::clearCache();
+		$article=Class_Article::findFirstBy(['titre' => 'A haute voix... le roman se fait entendre...']);
+		$this->assertEquals('Nos dossiers documentaires',$article->getCategorie()->getParent()->getLibelle());
+	}
+}
+
 class Import_Typo3ContentTest extends Import_Typo3TestCase {
 	public function setUp() {
 		parent::setUp();
@@ -503,14 +656,14 @@ class Import_Typo3LogsTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function logsShouldContainsUrlKohaNotFoundForArticle23() {
-		$this->assertContains('Class_Article id:1 , typo3 uid: 32, unknown URL: http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-shelves.pl?viewshelf=1556&sortfield=title%20%3Ccid:part1.08080603.08080008@ouestprovence.fr',
+		$this->assertContains('Class_Article id:1 , typo3 uid: 13973, unknown URL: http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-shelves.pl?viewshelf=1556&sortfield=title%20%3Ccid:part1.08080603.08080008@ouestprovence.fr',
 													Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
 
 	/** @test */
 	public function logsShouldContainsUrlKohaNotFoundForArticle9() {
-		$this->assertContains('Class_Article id:9 , typo3 uid: 13973, unknown URL: http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-search.pl?q=test&idx=kw&idx=kw&idx=kw',
+		$this->assertContains('Class_Article id:9 , typo3 uid: 139735, unknown URL: http://koha.mediathequeouestprovence.fr/cgi-bin/koha/opac-search.pl?q=test&idx=kw&idx=kw&idx=kw',
 													Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
@@ -561,20 +714,20 @@ class Import_Typo3LogsTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function logsShouldContains8T3Categories() {
-		$this->assertContains("Typo3 categories found: 8", Class_Import_Typo3_Logs::getInstance()->getLogs());
+		$this->assertContains("Typo3 categories found: 10", Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
 
 	/** @test */
 	public function logsShouldContainsSavedSitoCategories() {
-		$this->assertContains("Typo3 Sito categories saved: 7", Class_Import_Typo3_Logs::getInstance()->getLogs());
+		$this->assertContains("Typo3 Sito categories saved: 9", Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
 
 	/** @test */
 	public function logsShouldContainsSavedArticleCategories() {
-		$this->assertContains("Typo3 Article categories saved: 10",
-													 Class_Import_Typo3_Logs::getInstance()->getLogs());
+		$this->assertContains("Typo3 Article categories saved: 12",
+													Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
 
@@ -592,13 +745,13 @@ class Import_Typo3LogsTest extends Import_Typo3TestCase {
 
 	/** @test */
 	public function logsShouldContainsSavedDomains() {
-		$this->assertContains("Typo3 Domains saved: 11", Class_Import_Typo3_Logs::getInstance()->getLogs());
+		$this->assertContains("Typo3 Domains saved: 13", Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}
 
 
 	/** @test */
-	public function logsShouldContains8SavedArticles() {
-		$this->assertContains("Typo3 Articles saved: 8", Class_Import_Typo3_Logs::getInstance()->getLogs());
+	public function logsShouldContains9SavedArticles() {
+		$this->assertContains("Typo3 Articles saved: 9", Class_Import_Typo3_Logs::getInstance()->getLogs());
 	}