From 4c7809a438aa322fc1051863bb5fc13dcbe360d5 Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@git-test.afi-sa.fr>
Date: Mon, 11 Feb 2013 14:41:28 +0000
Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20patch=20pour=20r=C3=A9cup?=
 =?UTF-8?q?=C3=A9rer=20les=20notices=20erron=C3=A9es=20dont=20les=20vignet?=
 =?UTF-8?q?tes=20n'existent=20pas?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitattributes                           |  1 +
 cosmogramme/php/_init.php                |  4 ++--
 cosmogramme/php/integration/facettes.php | 17 +++++++++++++++++
 cosmogramme/sql/patch/patch_147.sql      |  3 +++
 4 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 cosmogramme/sql/patch/patch_147.sql

diff --git a/.gitattributes b/.gitattributes
index d85091d3ef8..37e02777b11 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2123,6 +2123,7 @@ cosmogramme/sql/patch/patch_143.sql -text
 cosmogramme/sql/patch/patch_144.sql -text
 cosmogramme/sql/patch/patch_145.sql -text
 cosmogramme/sql/patch/patch_146.sql -text
+cosmogramme/sql/patch/patch_147.sql -text
 cosmogramme/tests/bootstrap.php -text
 cosmogramme/tests/php/classes/IndexationTest.php -text
 cosmogramme/tests/php/classes/Iso2709RecordTest.php -text
diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php
index 4696f8f246b..3727eeba4ad 100644
--- a/cosmogramme/php/_init.php
+++ b/cosmogramme/php/_init.php
@@ -1,7 +1,7 @@
 <?PHP
 // Constantes
-define("VERSION_COSMOGRAMME","6.26");
-define("PATCH_LEVEL","146");
+define("VERSION_COSMOGRAMME","6.27");
+define("PATCH_LEVEL","147");
 define("APPLI","cosmogramme");
 define("CRLF", chr(13) . chr(10));
 define("BR","<br />");
diff --git a/cosmogramme/php/integration/facettes.php b/cosmogramme/php/integration/facettes.php
index 34ca550d0ef..ce4d5629215 100644
--- a/cosmogramme/php/integration/facettes.php
+++ b/cosmogramme/php/integration/facettes.php
@@ -152,6 +152,23 @@ if ($phase == 7.1)
 			$phase_data["pointeur_notice"] = $id_notice;
 			$phase_data["nombre"]++;
 			if ($phase_data["nombre"] % 5000 == 0) { print($phase_data["nombre"] . BR); flush(); }
+
+	
+			////////////////////////////////////////    BLOC TEMPORAIRE ///////////////////////////////
+			require_once("classe_unimarc.php");
+			require_once("classe_indexation.php");
+			$unimarc = new notice_unimarc();
+			$ix = new indexation();
+            
+			$ligne=fetchEnreg("select id_notice,facettes,unimarc from notices where id_notice=$id_notice");
+			$unimarc->ouvrirNotice($ligne["unimarc"],0);
+			$notice=$unimarc->getNoticeIntegration();
+			$data["auteurs"]=$ix->getfullText($notice["auteurs"]);
+			$data["collection"]=$ix->getfullText($notice["collection"]);
+			$data["matieres"]=$ix->getfullText($notice["matieres"]);
+			$sql->update("update notices set @SET@ where id_notice=".$ligne["id_notice"],$data);
+			////////////////////////////////////////    FIN BLOC TEMPORAIRE ///////////////////////////		
+
 		}
 	}
 	setVariable('date_maj_facettes', $last_date_maj);
diff --git a/cosmogramme/sql/patch/patch_147.sql b/cosmogramme/sql/patch/patch_147.sql
new file mode 100644
index 00000000000..5350fe65683
--- /dev/null
+++ b/cosmogramme/sql/patch/patch_147.sql
@@ -0,0 +1,3 @@
+-- récupération de notices altérées
+update notices set date_maj=now(), url_vignette="", url_image="" 
+where matieres="Array" or auteurs="Array" or collection="Array";
-- 
GitLab