Koha-Contrib-Mirabel

 view release on metacpan or  search on metacpan

lib/Koha/Contrib/Mirabel.pm  view on Meta::CPAN

package Koha::Contrib::Mirabel;
$Koha::Contrib::Mirabel::VERSION = '1.0.2';
# ABSTRACT: Synchronise un catalogue Koha avec Mir@bel
use Moose;

use Modern::Perl;
use utf8;
use FindBin qw($Bin);
use List::Util qw/first/;
use YAML qw/LoadFile Dump/;
use XML::Simple;
use LWP::Simple;
use DateTime;
use C4::Biblio;
use MARC::Moose::Record;
use MARC::Moose::Field::Std;



has url => (
    is => 'rw',
    isa => 'Str',
    default => 'https://reseau-mirabel.info/site/service?',
);



has partenaire => ( is => 'rw', isa => 'Int' );



has tag => ( is => 'rw', isa => 'Str' );



has verbose => ( is => 'rw', isa => 'Bool', default => 1 );



has doit => ( is => 'rw', isa => 'Bool', default => 0 );


sub BUILD {
    my $self = shift;

    my $partenaire = C4::Context->preference('MirabelPartenaire');
    die "Il manque la préférence MirabelPartenaire" unless $partenaire;
    $self->partenaire($partenaire);

    my $tag = C4::Context->preference('MirabelTag');
    die "Il manque la préférence MirabelTag" unless $tag;
    $self->tag($tag);
}


sub get_biblio {
    my ($self, $biblionumber) = @_;

    my $record = GetMarcBiblio( { biblionumber => $biblionumber } );
    return unless $record;
    return MARC::Moose::Record::new_from($record, 'Legacy');
}


sub update {
    my ($self, $biblionumber, $services) = @_;



( run in 0.483 second using v1.01-cache-2.11-cpan-5735350b133 )