From 81957d74fc139064f8d661e9240b4e2efa729d11 Mon Sep 17 00:00:00 2001
From: jgaimard <jgaimard@afi-sa.fr>
Date: Mon, 17 Feb 2014 15:04:19 +0100
Subject: [PATCH] =?UTF-8?q?P=C3=A9riodiques=20orphee?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 cosmogramme/php/classes/classe_notice_integration.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/cosmogramme/php/classes/classe_notice_integration.php b/cosmogramme/php/classes/classe_notice_integration.php
index c7a2b19f16d..f44221c75b0 100644
--- a/cosmogramme/php/classes/classe_notice_integration.php
+++ b/cosmogramme/php/classes/classe_notice_integration.php
@@ -166,8 +166,8 @@ class notice_integration
 		// suppression ou creation des articles si périodique
 		if($this->notice["type_doc"]==2)
 		{
-			// Periodiques Koha (1 exemplaire pour chaque numéro)
-			if($this->id_article_periodique==3 and $this->flag_koha==false)
+			// Periodiques Koha et orphee (1 exemplaire pour chaque numéro)
+			if(($this->id_article_periodique==3 or $this->id_article_periodique==4) and $this->flag_koha==false)
 			{
 				$this->flag_koha=true;
 				$ret=$this->traitePeriodiquesKoha();
@@ -386,6 +386,9 @@ class notice_integration
 		$exemplaires=$this->notice["statut_exemplaires"]["unimarc"];
 		if(!count($exemplaires)) return array();
 		$unimarc=$this->notice["unimarc"];
+		if($this->id_article_periodique==3) $champ_numero="v";
+		if($this->id_article_periodique==4) $champ_numero="u";
+		if(!$champ_numero) return array();
 		
 		foreach($exemplaires as $exemplaire)
 		{
@@ -396,7 +399,7 @@ class notice_integration
 			foreach($champs as $champ)
 			{
 				$table_champs[]=array($champ["code"],$champ["valeur"]);
-				if($champ["code"]=='v')
+				if($champ["code"]==$champ_numero)
 				{
 					$trav=explode(' ',$champ['valeur']);
 					$numero=$trav[0];
-- 
GitLab