Skip to content
Snippets Groups Projects
Commit 3bd73e0b authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#24999_gestion_des_isbn_a_l_import_cosmogramme' into 'hotline-master'

Hotline#24999 gestion des isbn a l import cosmogramme

See merge request !1108
parents c1c8531f 50629e43
Branches
Tags
2 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1120Master
- ticket #24999 :
- L'isbn est désormais conservé pour les type de documents spécifique au SIGB qui sont rattachés à la famille pergame "livre".
- En présence d'isbn répétés, Bokeh indexe le dernier isbn le plus long
\ No newline at end of file
This diff is collapsed.
......@@ -16,21 +16,101 @@
*
* 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
*/
require_once('classe_notice_integration.php');
require_once('classe_notice_marc21.php');
require_once 'classe_notice_integration.php';
require_once 'classe_notice_marc21.php';
require_once 'classe_unimarc.php';
require_once 'ModelTestCase.php';
class NoticeUnimarcTest extends ModelTestCase {
public function setUp() {
parent::setUp();
}
require_once 'NoticeIntegrationTest.php';
/** @test */
public function decoupeBlocThesaurusShouldReturn() {
$unimarc = new Class_NoticeUnimarc();
$this->assertEquals([[ 'code' => 'a', 'valeur' => 'GDOC005'],['code' => '2' , 'valeur' => 'genreelectre']],$unimarc->decoupe_bloc_champ_thesaurus(' aGDOC0052genreelectre'));
}
class NoticeUnimarcThesaurusFieldTest extends ModelTestCase {
/** @test */
public function decoupeBlocThesaurusShouldReturn() {
$unimarc = new Class_NoticeUnimarc();
$this->assertEquals([['code' => 'a', 'valeur' => 'GDOC005'],
['code' => '2' , 'valeur' => 'genreelectre']],
$unimarc->decoupe_bloc_champ_thesaurus(' aGDOC0052genreelectre'));
}
}
?>
\ No newline at end of file
/** @see http://forge.afi-sa.fr/issues/24999 */
class NoticeUnimarcMultipleIsbnTest extends NoticeIntegrationTestCase {
public function getProfilDonnees() {
$type_doc = [['code' => '0', 'label' => '', 'zone_995' => '' ],
['code' => '1', 'label' => 'am;na', 'zone_995' => 'LIVR' ],
['code' => '2', 'label' => 'as', 'zone_995' => 'PERI'],
['code' => '3', 'label' => 'i;j', 'zone_995' => 'DISQ'],
['code' => '4', 'label' => 'g', 'zone_995' => 'DVDR'],
['code' => '5', 'label' => 'l;m', 'zone_995' => 'CDR'],
['code' => '6', 'label' => '', 'zone_995' => '' ],
['code' => '7', 'label' => '', 'zone_995' => '' ],
['code' => '8', 'label' => '', 'zone_995' => ''],
['code' => '9', 'label' => '', 'zone_995' => ''],
['code' => '10', 'label' => ' ', 'zone_995' => 'WEB'],
['code' => '11', 'label' => '', 'zone_995' => 'ADLN'],
['code' => '12', 'label' => '', 'zone_995' => 'APER'],
['code' => '13', 'label' => 'km', 'zone_995' => 'BD'],
['code' => '14', 'label' => '', 'zone_995' => 'CART'],
['code' => '15', 'label' => '', 'zone_995' => ''],
['code' => '31', 'label' => '', 'zone_995' => 'RG']];
return $this->fixture('Class_IntProfilDonnees',
['id' => '408',
'libelle' => 'Unimarc Koha',
'accents' => Class_IntProfilDonnees::ENCODING_UTF8,
'rejet_periodiques' => 0,
'id_article_periodique' => Class_IntProfilDonnees::SERIAL_FORMAT_NONE,
'type_fichier' => Class_IntProfilDonnees::FT_RECORDS,
'format' => Class_IntProfilDonnees::FORMAT_UNIMARC,
'attributs' => [
['type_doc' => $type_doc,
Class_IntProfilDonnees::FIELD_ITEM_BARCODE => 'f',
Class_IntProfilDonnees::FIELD_ITEM_COTE => 'k',
Class_IntProfilDonnees::FIELD_ITEM_TYPE_DOC => 'r',
Class_IntProfilDonnees::FIELD_ITEM_GENRE => 'l',
Class_IntProfilDonnees::FIELD_ITEM_SECTION => 'q',
Class_IntProfilDonnees::FIELD_ITEM_EMPLACEMENT => 'c',
Class_IntProfilDonnees::FIELD_ITEM_ANNEXE => 'b'
],
['zone' => '099',
'champ' => 'n',
'format' => Class_IntProfilDonnees::NOVELTY_DATE_FORMAT_VALUES,
'jours' => '15',
'valeurs' => '1']
]])
->getRawAttributes();
}
public function setUp() {
parent::setUp();
$this->fixture('Class_CosmoVar',
['id' => 'types_docs',
'liste' => "0:non identifié\r\n1:livres\r\n2:périodiques\r\n3:disques\r\n4:DVD\r\n5:cédéroms\r\n8:articles cms\r\n9:fils rss\r\n10:sites internet\r\n100:Livre Numérique\r\n101:Diaporamas\r\n102:Type doc\r\n103:OAI\r\n104:Type doc\r\n105:Formation Vodéclic\r\n106:Livres Numériques\r\n107:Vidéos à la demande\r\n108:Tout apprendre\r\n109:Enregistrement audio\r\n110:Numérique Premium"]);
$codif_type_doc = $this->fixture('Class_CodifTypeDoc',
['id' => 31,
'label' => 'Romans gros caractères',
'famille_id' => Class_CodifTypeDoc::LIVRE]);
$this->fixture('Class_TypeDoc',
['id' => 31,
'label' => 'Romans gros caractères',
'codif_type_doc' => $codif_type_doc]);
$this->loadNotice('unimarc_multi_isbn');
}
/** @test */
public function withTwoIsbnsShouldKeepIsbn13() {
$this->assertEquals('978-2-8401-1742-1', Class_Notice::find(1)->getIsbn());
}
}
\ No newline at end of file
01129 2200253 4500001000700000010001500007010002300022090001900045091001900064101001700083102000700100105001800107106000600125100004000131200004500171205002900216210003000245215003900275225001300314700038700327801002900714099000700743995012500750154967 a2840117428 a9782840117421bbr. 9154967a154967 a2b20130526c0 a fre aFR ay z 000aa ad a20130525 frey50 1 aDans les bois éternelsbRGfFred Vargas aÉd. en gros caractères aVersaillescFeryaned2006 a535 p.ccouv. ill. en coul.d25 cm1 aPolicier 3120583593http://catalogue.bnf.fr/ark:/12148/cb12058359w3http://catalogue.bnf.fr/ark:/12148/cb12058359w3http://catalogue.bnf.fr/ark:/12148/cb12058359w3http://catalogue.bnf.fr/ark:/12148/cb12058359w3http://catalogue.bnf.fr/ark:/12148/cb12058359w3http://catalogue.bnf.fr/ark:/12148/cb12058359w95089953http://catalogue.bnf.fr/ark:/12148/cb12058359waVargasbFredf1957-....4070 0aFRbBNFc20060928gAFNOR1 tRG 00204062007-02-239242690aGRAbGRAcLLf31301010030778kRGP VARGm2015-07-11n2015-08-01o0rRGv25.00eL7lLL14qNL4
\ No newline at end of file
......@@ -22,27 +22,27 @@
class Class_CodifTypeDoc extends Storm_Model_Abstract {
use Trait_Translator;
protected $_table_name = 'codif_type_doc';
protected $_table_primary = 'type_doc_id';
protected $_default_attribute_values = ['bibliotheques' => '',
'annexes' => '',
'sections' => ''];
const INCONNU = 0;
const LIVRE = 1;
const PERIODIQUE = 2;
const SONORE = 3;
const VIDEO = 4;
const LOGICIEL = 5;
const CODE_FACETTE = 'T';
protected static $_libelles = [
self::INCONNU => 'Non identifié',
self::LIVRE => 'Livre',
self::PERIODIQUE => 'Périodique' ,
self::SONORE => 'Sonore',
self::VIDEO => 'Vidéo',
self::LOGICIEL => 'Logiciel',
];
protected $_table_name = 'codif_type_doc';
protected $_table_primary = 'type_doc_id';
protected $_default_attribute_values = ['bibliotheques' => '',
'annexes' => '',
'sections' => ''];
protected static $_libelles = [self::INCONNU => 'Non identifié',
self::LIVRE => 'Livre',
self::PERIODIQUE => 'Périodique' ,
self::SONORE => 'Sonore',
self::VIDEO => 'Vidéo',
self::LOGICIEL => 'Logiciel'];
public function getLibelle() {
......@@ -52,8 +52,9 @@ class Class_CodifTypeDoc extends Storm_Model_Abstract {
public function setFamilleId($id) {
if (!isset(static::$_libelles[$id]))
$id=0;
return parent::_set('famille_id',$id);
$id = 0;
return parent::_set('famille_id', $id);
}
......@@ -68,9 +69,13 @@ class Class_CodifTypeDoc extends Storm_Model_Abstract {
public function isSonore() {
return $this->getFamilleId() == static::SONORE;
return static::SONORE == $this->getFamilleId();
}
public function isBook() {
return static::LIVRE == $this->getFamilleId();
}
}
?>
\ No newline at end of file
......@@ -376,6 +376,11 @@ class Class_TypeDoc extends Storm_Model_Abstract {
}
public function isBook() {
return $this->getCodifTypeDoc()->isBook();
}
public function isUserFriendly() {
return $this->getFamilleId() > Class_CodifTypeDoc::INCONNU;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment