From 93bfecfd66bb36e60f36579fc4eb4c506222f231 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 29 Jul 2024 12:53:40 +0000 Subject: [PATCH] Prepend only string content before first occurrence of ';' --- Koha/Plugin/Com/PTFSEurope/HLISD.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/Plugin/Com/PTFSEurope/HLISD.pm b/Koha/Plugin/Com/PTFSEurope/HLISD.pm index 4f84c6a..41f6bd1 100644 --- a/Koha/Plugin/Com/PTFSEurope/HLISD.pm +++ b/Koha/Plugin/Com/PTFSEurope/HLISD.pm @@ -168,6 +168,9 @@ sub harvest_libraries { } ); + my $prepend = $library->{attributes}->{'document-supply'}; + $prepend = substr( $prepend, 0, index( $prepend, ';' ) ) if ( index( $prepend, ';' ) != -1 ); + if($koha_library){ $self->debug_msg( sprintf( @@ -182,7 +185,7 @@ sub harvest_libraries { my $library = Koha::Library->new( { branchcode => $library->{id}, - branchname => $library->{attributes}->{'document-supply'} + branchname => $prepend . ' - ' . $library->{attributes}->{ $self->get_HLISD_library_field('branchname') }, branchaddress1 => $library->{attributes}->{$self->get_HLISD_library_field('branchaddress1')}, branchzip => $library->{attributes}->{$self->get_HLISD_library_field('branchzip')},