diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 00f481cf96..d847fe8f61 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -62,6 +62,7 @@ BEGIN { TransformMarcToKoha TransformHtmlToMarc TransformHtmlToXml + prepare_host_field ); # Internal functions @@ -2997,6 +2998,141 @@ sub ModBiblioMarc { return $biblionumber; } +=head2 prepare_host_field + +$marcfield = prepare_host_field( $hostbiblioitem, $marcflavour ); +Generate the host item entry for an analytic child entry + +=cut + +sub prepare_host_field { + my ( $hostbiblio, $marcflavour ) = @_; + $marcflavour ||= C4::Context->preference('marcflavour'); + + my $biblio = Koha::Biblios->find($hostbiblio); + my $host = $biblio->metadata->record; + + # unfortunately as_string does not 'do the right thing' + # if field returns undef + my %sfd; + my $field; + my $host_field; + if ( $marcflavour eq 'MARC21' ) { + if ( $field = $host->field('100') || $host->field('110') || $host->field('11') ) { + my $s = $field->as_string('ab'); + if ($s) { + $sfd{a} = $s; + } + } + if ( $field = $host->field('245') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{t} = $s; + } + } + if ( $field = $host->field('260') ) { + my $s = $field->as_string('abc'); + if ($s) { + $sfd{d} = $s; + } + } + if ( $field = $host->field('240') ) { + my $s = $field->as_string(); + if ($s) { + $sfd{b} = $s; + } + } + if ( $field = $host->field('022') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + if ( $field = $host->field('020') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{z} = $s; + } + } + if ( $field = $host->field('001') ) { + $sfd{w} = $field->data(),; + } + $host_field = MARC::Field->new( 773, '0', ' ', %sfd ); + return $host_field; + } elsif ( $marcflavour eq 'UNIMARC' ) { + + #author + if ( $field = $host->field('700') || $host->field('710') || $host->field('720') ) { + my $s = $field->as_string('ab'); + if ($s) { + $sfd{a} = $s; + } + } + + #title + if ( $field = $host->field('200') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{t} = $s; + } + } + + #place of publicaton + if ( $field = $host->field('210') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{c} = $s; + } + } + + #date of publication + if ( $field = $host->field('210') ) { + my $s = $field->as_string('d'); + if ($s) { + $sfd{d} = $s; + } + } + + #edition statement + if ( $field = $host->field('205') ) { + my $s = $field->as_string(); + if ($s) { + $sfd{e} = $s; + } + } + + #URL + if ( $field = $host->field('856') ) { + my $s = $field->as_string('u'); + if ($s) { + $sfd{u} = $s; + } + } + + #ISSN + if ( $field = $host->field('011') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } + } + + #ISBN + if ( $field = $host->field('010') ) { + my $s = $field->as_string('a'); + if ($s) { + $sfd{y} = $s; + } + } + if ( $field = $host->field('001') ) { + $sfd{0} = $field->data(),; + } + $host_field = MARC::Field->new( 461, '0', ' ', %sfd ); + return $host_field; + } + return; +} + =head2 UpdateTotalIssues UpdateTotalIssues($biblionumber, $increase, [$value]) @@ -3046,7 +3182,7 @@ sub UpdateTotalIssues { if ( defined $value ) { $totalissues = $value; } else { - $totalissues = $current_issues + $increase; + $totalissues = $biblioitem->totalissues + $increase; } return 0 if $current_issues == $totalissues; # No need to update if no changes diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f9cf48a605..bf93c32a59 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -4442,7 +4442,7 @@ sub ProcessOfflineOperation { if ( $operation->{action} eq 'return' ) { $report = ProcessOfflineReturn($operation); } elsif ( $operation->{action} eq 'issue' ) { - ($report) = ProcessOfflineIssue($operation); + $report = ProcessOfflineIssue($operation); } elsif ( $operation->{action} eq 'payment' ) { $report = ProcessOfflinePayment($operation); } @@ -4513,15 +4513,15 @@ sub ProcessOfflineIssue { $operation->{timestamp}, ); } - my $checkout = AddIssue( + AddIssue( $patron, - $operation->{barcode}, - $operation->{due_date}, + $operation->{'barcode'}, + undef, undef, $operation->{timestamp}, undef, ); - return ( "Success.", $checkout ); + return "Success."; } else { return "Borrower not found."; } diff --git a/C4/ClassSplitRoutine/LCC.pm b/C4/ClassSplitRoutine/LCC.pm index a2ee632960..12901ba3e3 100644 --- a/C4/ClassSplitRoutine/LCC.pm +++ b/C4/ClassSplitRoutine/LCC.pm @@ -46,7 +46,7 @@ sub split_callnumber { # lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996'; my @lines = Library::CallNumber::LC->new($cn_item)->components(); unless ( scalar @lines && defined $lines[0] ) { - Koha::Logger->get->debug( sprintf( 'regexp failed to match string: %s', $cn_item // q{} ) ); + Koha::Logger->get->debug( sprintf( 'regexp failed to match string: %s', $cn_item ) ); @lines = $cn_item; # if no match, just use the whole string. } my $LastPiece = pop @lines; diff --git a/C4/Koha.pm b/C4/Koha.pm index bee096db9f..13e7a5da7d 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -513,7 +513,7 @@ sub GetAuthorisedValues { my $opac = shift ? 1 : 0; # normalise to be safe # Is this cached already? - my $branch_limit = C4::Context::mybranch(); + my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; my $cache_key = "AuthorisedValues-$category-$opac-$branch_limit"; my $cache = Koha::Caches->get_instance(); my $result = $cache->get_from_cache($cache_key); diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm index dd289083ee..842cfb051a 100644 --- a/C4/Labels/Label.pm +++ b/C4/Labels/Label.pm @@ -385,12 +385,8 @@ sub draw_label_text { my $font = $self->{'font'}; my $item = _get_label_item( $self->{'item_number'} ); my $label_fields = _get_text_fields( $self->{'format_string'} ); - my $biblio = Koha::Biblios->find( $item->{'biblionumber'} ); - my $record; - - if ( defined $biblio ) { - $record = $biblio->metadata->record; - } + my $biblio = Koha::Biblios->find( $item->{biblionumber} ); + my $record = $biblio->metadata->record; # FIXME - returns all items, so you can't get data from an embedded holdings field. # TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum). diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index 4909400493..247ba86ca3 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -156,15 +156,13 @@ sub do_checkout { if ($no_block_due_date) { $overridden_duedate = $no_block_due_date; - my ( $msg, $checkout ) = ProcessOfflineIssue( + ProcessOfflineIssue( { cardnumber => $patron->cardnumber, barcode => $barcode, - due_date => $no_block_due_date, - timestamp => dt_from_string, + timestamp => $no_block_due_date, } ); - $self->{due} = $self->duedatefromissue( $checkout, $itemnumber ); } else { # can issue diff --git a/C4/Search.pm b/C4/Search.pm index bf0a485286..08903e7fc5 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -40,8 +40,6 @@ use URI::Escape; use Business::ISBN; use MARC::Record; use MARC::Field; -use POSIX qw(setlocale LC_COLLATE); -use Unicode::Collate::Locale; our ( @ISA, @EXPORT_OK ); @@ -293,40 +291,6 @@ See verbose embedded documentation. =cut -=head2 _sort_facets_zebra - - my $sorted_facets = _sort_facets_zebra($facets, $locale); - -Sorts facets using a configurable locale for Zebra search engine. - -=cut - -sub _sort_facets_zebra { - my ( $facets, $locale ) = @_; - - if ( !$locale ) { - - # Get locale from system preference, falling back to system LC_COLLATE - $locale = C4::Context->preference('FacetSortingLocale') || 'default'; - if ( $locale eq 'default' || !$locale ) { - - #NOTE: When setlocale is run with only the 1st parameter, it is a "get" not a "set" function. - $locale = setlocale(LC_COLLATE) || 'default'; - } - } - - my $collator = Unicode::Collate::Locale->new( locale => $locale ); - if ( $collator && $facets ) { - my @sorted_facets = sort { $collator->cmp( $a->{facet_label_value}, $b->{facet_label_value} ) } @{$facets}; - if (@sorted_facets) { - return \@sorted_facets; - } - } - - #NOTE: If there was a problem, at least return the not sorted facets - return $facets; -} - sub getRecords { my ( $koha_query, $simple_query, $sort_by_ref, $servers_ref, @@ -590,10 +554,8 @@ sub getRecords { if (@facets_loop) { foreach my $f (@facets_loop) { if ( C4::Context->preference('FacetOrder') eq 'Alphabetical' ) { - my $sorted_facets = _sort_facets_zebra( $f->{facets} ); - if ($sorted_facets) { - $f->{facets} = $sorted_facets; - } + $f->{facets} = + [ sort { uc( $a->{facet_label_value} ) cmp uc( $b->{facet_label_value} ) } @{ $f->{facets} } ]; } } } diff --git a/Koha.pm b/Koha.pm index db34a6358d..f10b89be43 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "25.06.00.004"; +$VERSION = "25.06.00.003"; sub version { return $VERSION; diff --git a/Koha/Acquisition/Order/Claims.pm b/Koha/Acquisition/Order/Claims.pm index 7cee67ff75..eef991990e 100644 --- a/Koha/Acquisition/Order/Claims.pm +++ b/Koha/Acquisition/Order/Claims.pm @@ -25,7 +25,7 @@ use base qw(Koha::Objects); =head1 NAME -Koha::Acquisition::Order::Claims - Koha Claims Object set class +Koha::Cities - Koha Claim Object set class =head1 API diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 4c88bcd8a5..0df2b489a7 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1921,195 +1921,164 @@ sub generate_marc_host_field { my $marcflavour = C4::Context->preference('marcflavour'); my $marc_host = $self->metadata->record; - - my @sfd; + my %sfd; my $host_field; my $link_field; if ( $marcflavour eq 'MARC21' ) { - # Attempt to clone the main entry (100, 110, or 111) - my $main_entry = $marc_host->field('100') || $marc_host->field('110') || $marc_host->field('111'); - $main_entry = $main_entry ? $main_entry->clone : undef; - - # Clean unwanted subfields based on tag type - if ($main_entry) { - if ( $main_entry->tag eq '111' ) { - $main_entry->delete_subfield( code => qr/[94j]/ ); - } else { - $main_entry->delete_subfield( code => qr/[94e]/ ); - } - } - - # Construct subfield 7 from leader and main entry tag - my $s7 = "nn" . substr( $marc_host->leader, 6, 2 ); - if ($main_entry) { - my $c1 = 'n'; - if ( $main_entry->tag =~ /^1[01]/ ) { - $c1 = $main_entry->indicator('1'); - $c1 = $main_entry->tag eq '100' ? 1 : 2 unless $c1 =~ /\d/; - } - my $c0 = - ( $main_entry->tag eq '100' ) ? 'p' - : ( $main_entry->tag eq '110' ) ? 'c' - : ( $main_entry->tag eq '111' ) ? 'm' - : 'u'; - substr( $s7, 0, 2, $c0 . $c1 ); - } - push @sfd, ( '7' => $s7 ); - - # Subfield a - cleaned main entry string - if ($main_entry) { - my $a = $main_entry->as_string; - $a =~ s/\.$// unless $a =~ /\b[a-z]{1,2}\.$/i; - push @sfd, ( 'a' => $a ); - } - - # Subfield t - title from 245, cleaned - if ( my $f245 = $marc_host->field('245') ) { - my $f245c = $f245->clone; - $f245c->delete_subfield( code => 'c' ); - my $t = $f245c->as_string; - $t =~ s/[\s\/\\.]+$//; - my $nonfiling = $f245c->indicator('2') // 0; - $nonfiling = 0 unless $nonfiling =~ /^\d+$/; - $t = ucfirst substr( $t, $nonfiling ); - push @sfd, ( 't' => $t ); - } - - # Subfield b - edition from 250 - if ( my $f250 = $marc_host->field('250') ) { - my $b = $f250->as_string; - $b =~ s/\.$//; - if ($b) { - push @sfd, ( 'b' => $b ); + # Author + if ( $host_field = $marc_host->field('100') || $marc_host->field('110') || $marc_host->field('111') ) { + my $s = $host_field->as_string('ab'); + if ($s) { + $sfd{a} = $s; } } - # Subfield s - uniform title from 240 - if ( my $f240 = $marc_host->field('240') ) { - my $s = $f240->as_string('a'); + # Edition + if ( $host_field = $marc_host->field('250') ) { + my $s = $host_field->as_string('ab'); if ($s) { - push @sfd, ( 's' => $s ); + $sfd{b} = $s; } } - # Subfield d - publication info from 264/260 - my $d; + # Publication my @publication_fields = $marc_host->field('264'); @publication_fields = $marc_host->field('260') unless (@publication_fields); my $index = 0; - for my $publication_field (@publication_fields) { + for my $host_field (@publication_fields) { # Use first entry unless we find a preferred indicator1 = 3 if ( $index == 0 ) { - my $s = $publication_field->as_string('abc'); - $s =~ s/\.$//; + my $s = $host_field->as_string('abc'); if ($s) { - $d = $s; + $sfd{d} = $s; } $index++; } - if ( $publication_field->indicator(1) && ( $publication_field->indicator(1) eq '3' ) ) { - my $s = $publication_field->as_string('abc'); - $s =~ s/\.$//; + if ( $host_field->indicator(1) && ( $host_field->indicator(1) eq '3' ) ) { + my $s = $host_field->as_string('abc'); if ($s) { - $d = $s; + $sfd{d} = $s; } last; } } - push @sfd, ( d => $d ) if $d; - - # Subfield k - host info from 800-830 fields - for my $f ( $marc_host->field('8[013][01]') ) { - my $k = $f->as_string('abcdnjltnp'); - $k .= ', ISSN ' . $f->subfield('x') if $f->subfield('x'); - $k .= ' ; ' . $f->subfield('v') if $f->subfield('v'); - push @sfd, ( 'k' => $k ); + + # Uniform title + if ( $host_field = $marc_host->field('240') ) { + my $s = $host_field->as_string('a'); + if ($s) { + $sfd{s} = $s; + } } - # Subfield x - ISSN from 022 - for my $f ( $marc_host->field('022') ) { - push @sfd, ( 'x' => $f->subfield('a') ) if $f->subfield('a'); + # Title + if ( $host_field = $marc_host->field('245') ) { + my $s = $host_field->as_string('abnp'); + if ($s) { + $sfd{t} = $s; + } } - # Subfield z - ISBN from 020 - for my $f ( $marc_host->field('020') ) { - push @sfd, ( 'z' => $f->subfield('a') ) if $f->subfield('a'); + # ISSN + if ( $host_field = $marc_host->field('022') ) { + my $s = $host_field->as_string('a'); + if ($s) { + $sfd{x} = $s; + } } - # Subfield w - control number (001 and optionally 003) - if ( C4::Context->preference('UseControlNumber') ) { - if ( my $f001 = $marc_host->field('001') ) { - my $w = $f001->data; - if ( my $f003 = $marc_host->field('003') ) { - $w = '(' . $f003->data . ')' . $w; - } - push @sfd, ( 'w' => $w ); + # ISBN + if ( $host_field = $marc_host->field('020') ) { + my $s = $host_field->as_string('a'); + if ($s) { + $sfd{z} = $s; } } + if ( C4::Context->preference('UseControlNumber') ) { - # Construct 773 link field - $link_field = MARC::Field->new( 773, '0', ' ', @sfd ); + # Control number + if ( $host_field = $marc_host->field('001') ) { + $sfd{w} = $host_field->data(); + } + # Control number identifier + if ( $host_field = $marc_host->field('003') ) { + $sfd{w} = '(' . $host_field->data() . ')' . $sfd{w}; + } + } + $link_field = MARC::Field->new( 773, '0', ' ', %sfd ); } elsif ( $marcflavour eq 'UNIMARC' ) { - # Author (700/710/720) + # Author if ( $host_field = $marc_host->field('700') || $marc_host->field('710') || $marc_host->field('720') ) { my $s = $host_field->as_string('ab'); - push @sfd, ( 'a' => $s ) if $s; - } - - # Title (200) - if ( $host_field = $marc_host->field('200') ) { - my $s = $host_field->as_string('a'); - push @sfd, ( 't' => $s ) if $s; + if ($s) { + $sfd{a} = $s; + } } - # Place of publication (210$a) + # Place of publication if ( $host_field = $marc_host->field('210') ) { my $s = $host_field->as_string('a'); - push @sfd, ( 'c' => $s ) if $s; + if ($s) { + $sfd{c} = $s; + } } - # Date of publication (210$d) + # Date of publication if ( $host_field = $marc_host->field('210') ) { my $s = $host_field->as_string('d'); - push @sfd, ( 'd' => $s ) if $s; + if ($s) { + $sfd{d} = $s; + } } - # Edition statement (205) + # Edition statement if ( $host_field = $marc_host->field('205') ) { - my $s = $host_field->as_string; - push @sfd, ( 'e' => $s ) if $s; + my $s = $host_field->as_string(); + if ($s) { + $sfd{e} = $s; + } } - # URL (856$u) + # Title + if ( $host_field = $marc_host->field('200') ) { + my $s = $host_field->as_string('a'); + if ($s) { + $sfd{t} = $s; + } + } + + #URL if ( $host_field = $marc_host->field('856') ) { my $s = $host_field->as_string('u'); - push @sfd, ( u => $s ) if ($s); + if ($s) { + $sfd{u} = $s; + } } - # ISSN (011$a) + # ISSN if ( $host_field = $marc_host->field('011') ) { my $s = $host_field->as_string('a'); - push @sfd, ( x => $s ) if ($s); + if ($s) { + $sfd{x} = $s; + } } - # ISBN (010$a) + # ISBN if ( $host_field = $marc_host->field('010') ) { my $s = $host_field->as_string('a'); - push @sfd, ( y => $s ) if ($s); + if ($s) { + $sfd{y} = $s; + } } - - # Control number (001) if ( $host_field = $marc_host->field('001') ) { - push @sfd, ( 0 => $host_field->data() ); + $sfd{0} = $host_field->data(); } - - # Construct 461 link field - $link_field = MARC::Field->new( 461, '0', ' ', @sfd ); + $link_field = MARC::Field->new( 461, '0', ' ', %sfd ); } return $link_field; diff --git a/Koha/Course.pm b/Koha/Course.pm index e4b800f043..6b67a2b592 100644 --- a/Koha/Course.pm +++ b/Koha/Course.pm @@ -2,18 +2,18 @@ package Koha::Course; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Instructor.pm b/Koha/Course/Instructor.pm index da9864fe17..4b6f8a262d 100644 --- a/Koha/Course/Instructor.pm +++ b/Koha/Course/Instructor.pm @@ -2,18 +2,18 @@ package Koha::Course::Instructor; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Instructors.pm b/Koha/Course/Instructors.pm index 95e13bb9c3..82a0191b34 100644 --- a/Koha/Course/Instructors.pm +++ b/Koha/Course/Instructors.pm @@ -2,18 +2,18 @@ package Koha::Course::Instructors; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Item.pm b/Koha/Course/Item.pm index 6d6f3b626a..d13be0ba55 100644 --- a/Koha/Course/Item.pm +++ b/Koha/Course/Item.pm @@ -2,18 +2,18 @@ package Koha::Course::Item; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Items.pm b/Koha/Course/Items.pm index b6feda4f77..f563998515 100644 --- a/Koha/Course/Items.pm +++ b/Koha/Course/Items.pm @@ -2,18 +2,18 @@ package Koha::Course::Items; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Reserve.pm b/Koha/Course/Reserve.pm index 0fb1906c9b..6493ba90a3 100644 --- a/Koha/Course/Reserve.pm +++ b/Koha/Course/Reserve.pm @@ -2,18 +2,18 @@ package Koha::Course::Reserve; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Course/Reserves.pm b/Koha/Course/Reserves.pm index 5bd38a2fe7..b824a78da2 100644 --- a/Koha/Course/Reserves.pm +++ b/Koha/Course/Reserves.pm @@ -2,18 +2,18 @@ package Koha::Course::Reserves; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Courses.pm b/Koha/Courses.pm index 7604deab0b..6a3f396daa 100644 --- a/Koha/Courses.pm +++ b/Koha/Courses.pm @@ -2,18 +2,18 @@ package Koha::Courses; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/CoverImages.pm b/Koha/CoverImages.pm index 26e9fc5e5e..774d36ada8 100644 --- a/Koha/CoverImages.pm +++ b/Koha/CoverImages.pm @@ -25,7 +25,7 @@ use base qw(Koha::Objects); =head1 NAME -Koha::CoverImages - Koha CoverImage Object set class +Koha::Cities - Koha CoverImage Object set class =head1 API diff --git a/Koha/Devel/Files.pm b/Koha/Devel/Files.pm deleted file mode 100644 index df1bba620b..0000000000 --- a/Koha/Devel/Files.pm +++ /dev/null @@ -1,192 +0,0 @@ -package Koha::Devel::Files; - -use Modern::Perl; -our ( @ISA, @EXPORT_OK ); - -=head1 NAME - -Koha::Devel::Files - A utility module for managing and filtering file lists in the Koha codebase - -=head1 SYNOPSIS - - use Koha::Devel::Files; - - my $file_manager = Koha::Devel::Files->new({ context => 'tidy' }); - - my @perl_files = $file_manager->ls_perl_files($git_range); - my @js_files = $file_manager->ls_js_files(); - my @tt_files = $file_manager->ls_tt_files(); - - my $filetype = $file_manager->get_filetype($filename); - -=head1 DESCRIPTION - -Koha::Devel::Files is a utility module designed to assist in managing and filtering lists of files in the Koha codebase. It provides methods to list Perl, JavaScript, and Template Toolkit files, with options to exclude specific files based on a given context. - -=head1 EXCEPTIONS - -The module defines a set of exceptions for different file types and contexts. These exceptions are used to exclude specific files or directories from the file listings. - -=cut - -my $exceptions = { - pl => { - tidy => [ - qw( - Koha/Schema/Result - Koha/Schema.pm - ) - ], - valid => [ - qw( - Koha/Account/Credit.pm - Koha/Account/Debit.pm - Koha/Old/Hold.pm - misc/translator/TmplTokenizer.pm - ) - ], - codespell => [ - qw( - installer/data/mysql/updatedatabase.pl - installer/data/mysql/update22to30.pl - installer/data/mysql/db_revs/241200035.pl - misc/cronjobs/build_browser_and_cloud.pl - ) - ], - }, - js => { - tidy => [ - qw( - koha-tmpl/intranet-tmpl/lib - koha-tmpl/intranet-tmpl/js/Gettext.js - koha-tmpl/opac-tmpl/lib - Koha/ILL/Backend/ - ) - ], - codespell => [ - qw( - koha-tmpl/intranet-tmpl/lib - koha-tmpl/intranet-tmpl/js/Gettext.js - koha-tmpl/opac-tmpl/lib - koha-tmpl/opac-tmpl/bootstrap/js/Gettext.js - ) - ], - }, - tt => { - tidy => [ - qw( - Koha/ILL/Backend/ - *doc-head-open.inc - misc/cronjobs/rss - ) - ], - codespell => [], - }, -}; - -=head1 METHODS - -=cut - -=head2 new - - my $file_manager = Koha::Devel::Files->new({ context => 'tidy' }); - -Creates a new instance of Koha::Devel::Files. The constructor accepts a hash reference with a 'context' key, which specifies the context for file exclusions. - -=cut - -sub new { - my ( $class, $args ) = @_; - my $self = { context => $args->{context} }; - bless $self, $class; - return $self; -} - -=head2 build_git_exclude - - my $exclude_pattern = $file_manager->build_git_exclude($filetype); - -Builds a Git exclude pattern for a given file type based on the context provided during object creation. - -=cut - -sub build_git_exclude { - my ( $self, $filetype ) = @_; - return $self->{context} && exists $exceptions->{$filetype}->{ $self->{context} } - ? join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype}->{ $self->{context} } } ) ) - : q{}; -} - -=head2 ls_perl_files - - my @perl_files = $file_manager->ls_perl_files($git_range); - -Lists Perl files (with extensions .pl, .PL, .pm, .t) that have been modified within a specified Git range. If no range is provided, it lists all Perl files, excluding those specified in the exceptions. - -=cut - -sub ls_perl_files { - my ($self) = @_; - my $cmd = sprintf q{git ls-files '*.pl' '*.PL' '*.pm' '*.t' svc opac/svc debian/build-git-snapshot %s}, - $self->build_git_exclude('pl'); - my @files = qx{$cmd}; - chomp for @files; - return @files; -} - -=head2 ls_js_files - - my @js_files = $file_manager->ls_js_files(); - -Lists JavaScript and TypeScript files (with extensions .js, .ts, .vue) in the repository, excluding those specified in the exceptions. - -=cut - -sub ls_js_files { - my ($self) = @_; - my $cmd = sprintf q{git ls-files '*.js' '*.ts' '*.vue' %s}, $self->build_git_exclude('js'); - my @files = qx{$cmd}; - chomp for @files; - return @files; -} - -=head2 ls_tt_files - - my @tt_files = $file_manager->ls_tt_files(); - -Lists Template Toolkit files (with extensions .tt, .inc) in the repository, excluding those specified in the exceptions. - -=cut - -sub ls_tt_files { - my ($self) = @_; - my $cmd = sprintf q{git ls-files '*.tt' '*.inc' %s}, $self->build_git_exclude('tt'); - my @files = qx{$cmd}; - chomp for @files; - return @files; -} - -=head2 get_filetype - - my $filetype = $file_manager->get_filetype($filename); - -Determines the file type of a given file based on its extension or path. Returns 'pl' for Perl files, 'js' for JavaScript/TypeScript files, and 'tt' for Template Toolkit files. Dies with an error message if the file type cannot be determined. - -=cut - -sub get_filetype { - my ( $self, $file ) = @_; - return 'pl' if $file =~ m{^svc} || $file =~ m{^opac/svc}; - return 'pl' if $file =~ m{\.pl$} || $file =~ m{\.pm} || $file =~ m{\.t$}; - return 'pl' if $file =~ m{\.PL$}; - return 'pl' if $file =~ m{debian/build-git-snapshot}; - - return 'js' if $file =~ m{\.js$} || $file =~ m{\.ts$} || $file =~ m{\.vue$}; - - return 'tt' if $file =~ m{\.inc$} || $file =~ m{\.tt$}; - - die sprintf 'Cannot guess filetype for %s', $file; -} - -1; diff --git a/Koha/Encryption.pm b/Koha/Encryption.pm index 4cecb6e282..b18f75a9d4 100644 --- a/Koha/Encryption.pm +++ b/Koha/Encryption.pm @@ -61,9 +61,8 @@ sub new { ); } return $class->SUPER::new( - -key => $encryption_key, - -cipher => 'Cipher::AES', - -nodeprecate => 1, + -key => $encryption_key, + -cipher => 'Cipher::AES' ); } diff --git a/Koha/Exceptions/MarcOverlayRule.pm b/Koha/Exceptions/MarcOverlayRule.pm index 2cedb3526a..d2e44970af 100644 --- a/Koha/Exceptions/MarcOverlayRule.pm +++ b/Koha/Exceptions/MarcOverlayRule.pm @@ -2,18 +2,18 @@ package Koha::Exceptions::MarcOverlayRule; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/Filter/MARC/TrimFields.pm b/Koha/Filter/MARC/TrimFields.pm index 00244cab29..99a5f0dfa3 100644 --- a/Koha/Filter/MARC/TrimFields.pm +++ b/Koha/Filter/MARC/TrimFields.pm @@ -60,15 +60,9 @@ sub filter { my $value = $subfield->[1]; $value =~ s/[\n\r]+/ /g; $value =~ s/^\s+|\s+$//g; - $field->add_subfields( $key => $value ) - if $value ne q{} - ; # add subfield to the end of the subfield list, but only if there is still a non empty value there - $field->delete_subfield( pos => 0 ); # delete the subfield at the top of the subfield list + $field->add_subfields( $key => $value ); # add subfield to the end of the subfield list + $field->delete_subfield( pos => 0 ); # delete the subfield at the top of the subfield list } - - # if it happed that all existing subfields had whitespaces only, - # the field would be empty now and should be removed from the record - $record->delete_fields($field) unless scalar( $field->subfields ); } } return $record; diff --git a/Koha/I18N.pm b/Koha/I18N.pm index 3fbbabe685..c957e9df40 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -53,51 +53,8 @@ our @EXPORT = qw( N__np ); -our @EXPORT_OK = qw( - available_locales -); - our $textdomain = 'Koha'; -=head1 NAME - -Koha::I18N - Internationalization functions for Koha - -=head1 SYNOPSIS - - use Koha::I18N; - - # Basic translation functions - my $translated = __('Hello world'); - my $with_vars = __x('Hello {name}', name => 'World'); - my $plural = __n('one item', '{count} items', $count, count => $count); - - # Context-aware translations - my $context = __p('menu', 'File'); - - # Get available system locales (explicitly imported) - use Koha::I18N qw(available_locales); - my $locales = available_locales(); - -=head1 DESCRIPTION - -This module provides internationalization (i18n) functions for Koha using the -GNU gettext system. It handles locale setup, message translation, and provides -utility functions for working with system locales. - -The module automatically initializes the locale environment and provides a set -of translation functions that support variable substitution, plural forms, and -contextual translations. - -=head1 FUNCTIONS - -=head2 init - -Initializes the internationalization system by setting up locale environment -variables and configuring gettext. This is called automatically when needed. - -=cut - sub init { my $cache = Koha::Cache::Memory::Lite->get_instance(); my $cache_key = 'i18n:initialized'; @@ -135,14 +92,6 @@ sub init { } } -=head2 __ - - my $translated = __('Text to translate'); - -Basic translation function. Returns the translated text for the given message ID. - -=cut - sub __ { my ($msgid) = @_; @@ -151,15 +100,6 @@ sub __ { return _gettext( \&gettext, [$msgid] ); } -=head2 __x - - my $translated = __x('Hello {name}', name => 'World'); - -Translation with variable substitution. Variables in {brackets} are replaced -with the corresponding values from the provided hash. - -=cut - sub __x { my ( $msgid, %vars ) = @_; @@ -168,14 +108,6 @@ sub __x { return _gettext( \&gettext, [$msgid], %vars ); } -=head2 __n - - my $translated = __n('one item', '{count} items', $count); - -Plural-aware translation. Returns singular or plural form based on the count. - -=cut - sub __n { my ( $msgid, $msgid_plural, $count ) = @_; @@ -185,14 +117,6 @@ sub __n { return _gettext( \&ngettext, [ $msgid, $msgid_plural, $count ] ); } -=head2 __nx - - my $translated = __nx('one item', '{count} items', $count, count => $count); - -Plural-aware translation with variable substitution. - -=cut - sub __nx { my ( $msgid, $msgid_plural, $count, %vars ) = @_; @@ -202,25 +126,10 @@ sub __nx { return _gettext( \&ngettext, [ $msgid, $msgid_plural, $count ], %vars ); } -=head2 __xn - -Alias for __nx. - -=cut - sub __xn { return __nx(@_); } -=head2 __p - - my $translated = __p('context', 'Text to translate'); - -Context-aware translation. Allows the same text to be translated differently -based on context (e.g., 'File' in a menu vs 'File' as a document type). - -=cut - sub __p { my ( $msgctxt, $msgid ) = @_; @@ -230,14 +139,6 @@ sub __p { return _gettext( \&pgettext, [ $msgctxt, $msgid ] ); } -=head2 __px - - my $translated = __px('context', 'Hello {name}', name => 'World'); - -Context-aware translation with variable substitution. - -=cut - sub __px { my ( $msgctxt, $msgid, %vars ) = @_; @@ -247,14 +148,6 @@ sub __px { return _gettext( \&pgettext, [ $msgctxt, $msgid ], %vars ); } -=head2 __np - - my $translated = __np('context', 'one item', '{count} items', $count); - -Context-aware plural translation. - -=cut - sub __np { my ( $msgctxt, $msgid, $msgid_plural, $count ) = @_; @@ -265,14 +158,6 @@ sub __np { return _gettext( \&npgettext, [ $msgctxt, $msgid, $msgid_plural, $count ] ); } -=head2 __npx - - my $translated = __npx('context', 'one item', '{count} items', $count, count => $count); - -Context-aware plural translation with variable substitution. - -=cut - sub __npx { my ( $msgctxt, $msgid, $msgid_plural, $count, %vars ) = @_; @@ -283,51 +168,18 @@ sub __npx { return _gettext( \&npgettext, [ $msgctxt, $msgid, $msgid_plural, $count ], %vars ); } -=head2 N__ - - my $msgid = N__('Text for later translation'); - -No-operation translation marker. Returns the original text unchanged but marks -it for extraction by translation tools. - -=cut - sub N__ { return $_[0]; } -=head2 N__n - - my $msgid = N__n('singular', 'plural'); - -No-operation plural translation marker. - -=cut - sub N__n { return $_[0]; } -=head2 N__p - - my $msgid = N__p('context', 'Text for later translation'); - -No-operation context translation marker. - -=cut - sub N__p { return $_[1]; } -=head2 N__np - - my $msgid = N__np('context', 'singular', 'plural'); - -No-operation context plural translation marker. - -=cut - sub N__np { return $_[1]; } @@ -372,118 +224,4 @@ sub _expand { return $text; } -=head2 available_locales - - my $locales = Koha::I18N::available_locales(); - -Returns an arrayref of available system locales for use in system preferences. - -Each locale is a hashref with: - - C: The locale identifier (e.g., 'en_US.utf8', 'default') - - C: Human-readable description (e.g., 'English (United States) - en_US.utf8') - -Always includes 'default' as the first option. Additional locales are detected -from the system using C and filtered for UTF-8 locales. - -=cut - -sub available_locales { - my @available_locales = (); - - # Always include default option - push @available_locales, { - value => 'default', - text => 'Default Unicode collation' - }; - - # Get system locales using the same approach as init() - my @system_locales = grep { chomp; not( /^C/ || $_ eq 'POSIX' ) } qx/locale -a/; - - my @filtered_locales = (); - for my $locale (@system_locales) { - - # Filter for useful locales (UTF-8 ones and common patterns) - if ( $locale =~ /^[a-z]{2}_[A-Z]{2}\.utf8?$/i || $locale =~ /^[a-z]{2}_[A-Z]{2}$/i ) { - - # Create friendly display names - my $display_name = $locale; - if ( $locale =~ /^([a-z]{2})_([A-Z]{2})/ ) { - my %lang_names = ( - 'en' => 'English', - 'fr' => 'French', - 'de' => 'German', - 'es' => 'Spanish', - 'it' => 'Italian', - 'pt' => 'Portuguese', - 'nl' => 'Dutch', - 'pl' => 'Polish', - 'fi' => 'Finnish', - 'sv' => 'Swedish', - 'da' => 'Danish', - 'no' => 'Norwegian', - 'ru' => 'Russian', - 'ja' => 'Japanese', - 'zh' => 'Chinese', - 'ar' => 'Arabic', - 'hi' => 'Hindi' - ); - my %country_names = ( - 'US' => 'United States', - 'GB' => 'United Kingdom', - 'FR' => 'France', - 'DE' => 'Germany', - 'ES' => 'Spain', - 'IT' => 'Italy', - 'PT' => 'Portugal', - 'BR' => 'Brazil', - 'NL' => 'Netherlands', - 'PL' => 'Poland', - 'FI' => 'Finland', - 'SE' => 'Sweden', - 'DK' => 'Denmark', - 'NO' => 'Norway', - 'RU' => 'Russia', - 'JP' => 'Japan', - 'CN' => 'China', - 'TW' => 'Taiwan', - 'SA' => 'Saudi Arabia', - 'IN' => 'India' - ); - my $lang = $lang_names{$1} || uc($1); - my $country = $country_names{$2} || $2; - $display_name = "$lang ($country) - $locale"; - } - push @filtered_locales, { - value => $locale, - text => $display_name - }; - } - } - - # Sort locales by display name and add to available list - @filtered_locales = sort { $a->{text} cmp $b->{text} } @filtered_locales; - push @available_locales, @filtered_locales; - - return \@available_locales; -} - -=head1 AUTHOR - -Koha Development Team - -=head1 COPYRIGHT - -Copyright 2012-2014 BibLibre - -=head1 LICENSE - -This file is part of Koha. - -Koha is free software; you can redistribute it and/or modify it under the -terms of the GNU General Public License as published by the Free Software -Foundation; either version 3 of the License, or (at your option) any later -version. - -=cut - 1; diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 4c8453d4dd..9b151e3924 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1776,8 +1776,6 @@ sub send_patron_notice { ); my @transports = keys %{ $borrower_preferences->{transports} }; - return { result => { fail => [ 'email', 'sms' ], success => [] } } unless @transports; - # Notice should come from the library where the request was placed, # not the patrons home library my $branch = Koha::Libraries->find( $self->branchcode ); diff --git a/Koha/Import/OAI/Authorities.pm b/Koha/Import/OAI/Authorities.pm index 9b78afefb4..cdff207854 100644 --- a/Koha/Import/OAI/Authorities.pm +++ b/Koha/Import/OAI/Authorities.pm @@ -13,7 +13,6 @@ package Koha::Import::OAI::Authorities; # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . use Modern::Perl; diff --git a/Koha/Import/OAI/Authority.pm b/Koha/Import/OAI/Authority.pm index 965851d39c..f4e3a0d31f 100644 --- a/Koha/Import/OAI/Authority.pm +++ b/Koha/Import/OAI/Authority.pm @@ -13,7 +13,6 @@ package Koha::Import::OAI::Authority; # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . use Modern::Perl; diff --git a/Koha/Import/OAI/Biblio.pm b/Koha/Import/OAI/Biblio.pm index 3478a348eb..42ad046e72 100644 --- a/Koha/Import/OAI/Biblio.pm +++ b/Koha/Import/OAI/Biblio.pm @@ -13,7 +13,6 @@ package Koha::Import::OAI::Biblio; # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . use Modern::Perl; diff --git a/Koha/Import/OAI/Biblios.pm b/Koha/Import/OAI/Biblios.pm index 4a7a04cf79..59ceba9cd3 100644 --- a/Koha/Import/OAI/Biblios.pm +++ b/Koha/Import/OAI/Biblios.pm @@ -13,7 +13,6 @@ package Koha::Import::OAI::Biblios; # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . use Modern::Perl; diff --git a/Koha/Installer.pm b/Koha/Installer.pm index 48a50df2b6..235eac3247 100644 --- a/Koha/Installer.pm +++ b/Koha/Installer.pm @@ -29,7 +29,7 @@ sub needs_update { my $koha_version = Koha->version; my $code_version = TransformToNum($koha_version); - if ( $db_version && $db_version == $code_version ) { + if ( $db_version == $code_version ) { $needs_update = 0; } diff --git a/Koha/Manual.pm b/Koha/Manual.pm index fe5cc2c5b3..e811c64867 100644 --- a/Koha/Manual.pm +++ b/Koha/Manual.pm @@ -117,6 +117,7 @@ our $mapping = { 'admin/preferences#logs' => '/logspreferences.html', 'admin/preferences#opac' => '/opacpreferences.html', 'admin/preferences#patrons' => '/patronspreferences.html', + 'admin/preferences#reports' => '/reportspreferences.html', 'admin/preferences#searching' => '/searchingpreferences.html', 'admin/preferences#serials' => '/serialspreferences.html', 'admin/preferences#staff_interface' => '/staffclientpreferences.html', diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 203fa212c3..14d5838e6b 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -388,7 +388,7 @@ sub store { if ( C4::Context->preference('ChildNeedsGuarantor') and ( $self->is_child or $self->category->can_be_guarantee ) - and ( !defined $self->contactname || $self->contactname eq "" ) + and $self->contactname eq "" and !@$guarantors ) { Koha::Exceptions::Patron::Relationship::NoGuarantor->throw(); @@ -2677,8 +2677,6 @@ sub _anonymize_column { $val = $nullable ? undef : 0; } elsif ( $type =~ /date|time/ ) { $val = $nullable ? undef : dt_from_string; - } elsif ( $type eq 'enum' ) { - $val = $nullable ? undef : $col_info->{default_value}; } $self->$col($val); } diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index f36495d76a..23b6f57803 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -267,10 +267,7 @@ LINE: while ( my $borrowerline = <$handle> ) { # Remove warning for int datatype that cannot be null # Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018 - for my $field ( - qw( privacy privacy_guarantor_fines privacy_guarantor_checkouts anonymized login_attempts checkprevcheckout autorenew_checkouts ) - ) - { + for my $field (qw( privacy privacy_guarantor_fines privacy_guarantor_checkouts anonymized login_attempts )) { delete $borrower{$field} if exists $borrower{$field} and $borrower{$field} eq ""; } @@ -307,8 +304,7 @@ LINE: while ( my $borrowerline = <$handle> ) { next if $col eq 'password' && !$overwrite_passwords; next if $col eq 'dateexpiry' && $update_dateexpiry; - $borrower{$col} = $member->{$col} - if $col eq 'dateexpiry' && ( !$csvkeycol{$col} || !$columns[ $csvkeycol{$col} ] ); + $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ]; unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) { $borrower{$col} = $member->{$col} if ( $member->{$col} ); diff --git a/Koha/REST/V1/CirculationRules.pm b/Koha/REST/V1/CirculationRules.pm index 81bd51fc81..74c54b813d 100644 --- a/Koha/REST/V1/CirculationRules.pm +++ b/Koha/REST/V1/CirculationRules.pm @@ -2,18 +2,18 @@ package Koha::REST::V1::CirculationRules; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; diff --git a/Koha/REST/V1/Suggestions.pm b/Koha/REST/V1/Suggestions.pm index 442a36a8ec..9c3a0a0d50 100644 --- a/Koha/REST/V1/Suggestions.pm +++ b/Koha/REST/V1/Suggestions.pm @@ -2,18 +2,17 @@ package Koha::REST::V1::Suggestions; # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. # -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# along with Koha; if not, see . use Modern::Perl; diff --git a/Koha/Report.pm b/Koha/Report.pm index 54511cdc4c..8c292a16a8 100644 --- a/Koha/Report.pm +++ b/Koha/Report.pm @@ -20,9 +20,13 @@ use Modern::Perl; use Koha::Database; use Koha::Reports; +use Koha::Object; +use Koha::Object::Limit::Library; + +use base qw(Koha::Object Koha::Object::Limit::Library); + #use Koha::DateUtils qw( dt_from_string output_pref ); -use base qw(Koha::Object); # # FIXME We could only return an error code instead of the arrayref # Only 1 error is returned @@ -268,4 +272,18 @@ sub _type { return 'SavedSql'; } +=head3 _library_limits + +Configurable library limits + +=cut + +sub _library_limits { + return { + class => "ReportsBranch", + id => "report_id", + library => "branchcode", + }; +} + 1; diff --git a/Koha/Reports.pm b/Koha/Reports.pm index 7d99232b9b..387c72abb1 100644 --- a/Koha/Reports.pm +++ b/Koha/Reports.pm @@ -21,7 +21,7 @@ use Koha::Database; use Koha::Report; -use base qw(Koha::Objects); +use base qw(Koha::Objects Koha::Objects::Limit::Library); =head1 NAME @@ -33,6 +33,33 @@ Koha::Reports - Koha Report Object set class =cut +=head3 search_with_localization + +my $itemtypes = Koha::ItemTypes->search_with_localization + +=cut + +sub search_with_localization { + my ( $self, $params, $attributes ) = @_; + + my $language = C4::Languages::getlanguage(); + $Koha::Schema::Result::Itemtype::LANGUAGE = $language; + $attributes->{order_by} = 'translated_description' unless exists $attributes->{order_by}; + $attributes->{join} = 'localization'; + $attributes->{'+select'} = [ + { + coalesce => [qw( localization.translation me.description )], + -as => 'translated_description' + } + ]; + if ( defined $params->{branchcode} ) { + my $branchcode = delete $params->{branchcode}; + $self->search_with_library_limits( $params, $attributes, $branchcode ); + } else { + $self->SUPER::search( $params, $attributes ); + } +} + =head3 _type Returns name of corresponding DBIC resultset diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 1e1fa11cd4..2e1a5e9d51 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -582,10 +582,10 @@ controls if relatives can see this patron's checkouts =head2 checkprevcheckout - data_type: 'enum' + data_type: 'varchar' default_value: 'inherit' - extra: {list => ["yes","no","inherit"]} is_nullable: 0 + size: 7 produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. @@ -832,10 +832,10 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "checkprevcheckout", { - data_type => "enum", + data_type => "varchar", default_value => "inherit", - extra => { list => ["yes", "no", "inherit"] }, is_nullable => 0, + size => 7, }, "updated_on", { @@ -2197,8 +2197,8 @@ Composing rels: L -> permission __PACKAGE__->many_to_many("permissions", "user_permissions", "permission"); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-10 07:11:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XFOe2X4k2DUziaNS5pWd/Q +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-04-28 16:41:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:J1oaW0hFRihEJZ6U+XSwag __PACKAGE__->belongs_to( "library", diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm index 9cb9622295..62c6e3fb4d 100644 --- a/Koha/Schema/Result/Category.pm +++ b/Koha/Schema/Result/Category.pm @@ -136,10 +136,10 @@ Default privacy setting for this patron category =head2 checkprevcheckout - data_type: 'enum' + data_type: 'varchar' default_value: 'inherit' - extra: {list => ["yes","no","inherit"]} is_nullable: 0 + size: 7 produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'. @@ -274,10 +274,10 @@ __PACKAGE__->add_columns( }, "checkprevcheckout", { - data_type => "enum", + data_type => "varchar", default_value => "inherit", - extra => { list => ["yes", "no", "inherit"] }, is_nullable => 0, + size => 7, }, "can_place_ill_in_opac", { data_type => "tinyint", default_value => 1, is_nullable => 0 }, @@ -410,8 +410,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-10 07:11:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ADt+iDjteg9Jb81L2FMIvg +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-12-03 15:46:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jiQq3bW+ZfdYpUpfZq1Rzw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm index 5d0f10facb..b2decd87d2 100644 --- a/Koha/Schema/Result/Deletedborrower.pm +++ b/Koha/Schema/Result/Deletedborrower.pm @@ -579,10 +579,10 @@ controls if relatives can see this patron's checkouts =head2 checkprevcheckout - data_type: 'enum' + data_type: 'varchar' default_value: 'inherit' - extra: {list => ["yes","no","inherit"]} is_nullable: 0 + size: 7 produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. @@ -817,10 +817,10 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "checkprevcheckout", { - data_type => "enum", + data_type => "varchar", default_value => "inherit", - extra => { list => ["yes", "no", "inherit"] }, is_nullable => 0, + size => 7, }, "updated_on", { @@ -857,8 +857,8 @@ __PACKAGE__->add_columns( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-10 07:11:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vAkNNQagJcYfZ0/6mDOw8g +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-04-28 16:41:47 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5QA+/eORyEKhkG++0f3Hvw __PACKAGE__->add_columns( '+anonymized' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/ReportsBranch.pm b/Koha/Schema/Result/ReportsBranch.pm new file mode 100644 index 0000000000..970c25eabc --- /dev/null +++ b/Koha/Schema/Result/ReportsBranch.pm @@ -0,0 +1,85 @@ +use utf8; + +package Koha::Schema::Result::ReportsBranch; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ReportsBranch + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("reports_branches"); + +=head1 ACCESSORS + +=head2 report_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=cut + +__PACKAGE__->add_columns( + "report_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, +); + +=head1 RELATIONS + +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + +=head2 report + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "report", + "Koha::Schema::Result::SavedSql", + { id => "report_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-06 17:02:11 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SJqUxMgLJHAjbX3GJlpB+A + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/SavedSql.pm b/Koha/Schema/Result/SavedSql.pm index 6f75ae3b31..4f063e8d67 100644 --- a/Koha/Schema/Result/SavedSql.pm +++ b/Koha/Schema/Result/SavedSql.pm @@ -185,6 +185,221 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); +=head1 RELATIONS + +=head2 reports_branches + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "reports_branches", + "Koha::Schema::Result::ReportsBranch", + { "foreign.report_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-06 17:02:11 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qFqDaOxgdm2I12cJEiCieg +# These lines were loaded from '/kohadevbox/koha/Koha/Schema/Result/SavedSql.pm' found in @INC. +# They are now part of the custom portion of this file +# for you to hand-edit. If you do not either delete +# this section or remove that file from @INC, this section +# will be repeated redundantly when you re-create this +# file again via Loader! See skip_load_external to disable +# this feature. + +use utf8; +package Koha::Schema::Result::SavedSql; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::SavedSql + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("saved_sql"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +unique id and primary key assigned by Koha + +=head2 borrowernumber + + data_type: 'integer' + is_nullable: 1 + +the staff member who created this report (borrowers.borrowernumber) + +=head2 date_created + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +the date this report was created + +=head2 last_modified + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +the date this report was last edited + +=head2 savedsql + + data_type: 'mediumtext' + is_nullable: 1 + +the SQL for this report + +=head2 last_run + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 report_name + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +the name of this report + +=head2 type + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +always 1 for tabular + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +the notes or description given to this report + +=head2 cache_expiry + + data_type: 'integer' + default_value: 300 + is_nullable: 0 + +=head2 public + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 report_area + + data_type: 'varchar' + is_nullable: 1 + size: 6 + +=head2 report_group + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 report_subgroup + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 mana_id + + data_type: 'integer' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { data_type => "integer", is_nullable => 1 }, + "date_created", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "last_modified", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "savedsql", + { data_type => "mediumtext", is_nullable => 1 }, + "last_run", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "report_name", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "type", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, + "cache_expiry", + { data_type => "integer", default_value => 300, is_nullable => 0 }, + "public", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "report_area", + { data_type => "varchar", is_nullable => 1, size => 6 }, + "report_group", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "report_subgroup", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "mana_id", + { data_type => "integer", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:198dNG9DGQzop+s5IHy7sw @@ -214,3 +429,8 @@ sub koha_objects_class { } 1; +# End of lines loaded from '/kohadevbox/koha/Koha/Schema/Result/SavedSql.pm' + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; \ No newline at end of file diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index e81d1df84e..c88345bb58 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -54,9 +54,6 @@ use MARC::File::XML; use MIME::Base64 qw( decode_base64 ); use JSON; -use POSIX qw(setlocale LC_COLLATE); -use Unicode::Collate::Locale; - Koha::SearchEngine::Elasticsearch::Search->mk_accessors(qw( store )); =head2 search @@ -456,42 +453,6 @@ sub max_result_window { return $max_result_window; } -=head2 _sort_facets - - my $facets = _sort_facets($facets); - -Sorts facets using a locale. - -=cut - -sub _sort_facets { - my ( $self, $args ) = @_; - my $facets = $args->{facets}; - my $locale = $args->{locale}; - - if ( !$locale ) { - - # Get locale from system preference, falling back to system LC_COLLATE - $locale = C4::Context->preference('FacetSortingLocale') || 'default'; - if ( $locale eq 'default' || !$locale ) { - - #NOTE: When setlocale is run with only the 1st parameter, it is a "get" not a "set" function. - $locale = setlocale(LC_COLLATE) || 'default'; - } - } - - my $collator = Unicode::Collate::Locale->new( locale => $locale ); - if ( $collator && $facets ) { - my @sorted_facets = sort { $collator->cmp( $a->{facet_label_value}, $b->{facet_label_value} ) } @{$facets}; - if (@sorted_facets) { - return \@sorted_facets; - } - } - - #NOTE: If there was a problem, at least return the not sorted facets - return $facets; -} - =head2 _convert_facets my $koha_facets = _convert_facets($es_facets); @@ -565,16 +526,14 @@ sub _convert_facets { facet_count => $c, facet_link_value => $t, facet_title_value => $t, - facet_label_value => $label || q{}, # TODO either truncate this, - # or make the template do it like it should anyway + facet_label_value => $label, # TODO either truncate this, + # or make the template do it like it should anyway type_link_value => $type, }; } if ( C4::Context->preference('FacetOrder') eq 'Alphabetical' ) { - my $sorted_facets = $self->_sort_facets( { facets => $facet->{facets} } ); - if ($sorted_facets) { - $facet->{facets} = $sorted_facets; - } + @{ $facet->{facets} } = + sort { $a->{facet_label_value} cmp $b->{facet_label_value} } @{ $facet->{facets} }; } push @facets, $facet if exists $facet->{facets}; } diff --git a/acqui/basket.pl b/acqui/basket.pl index 57621b4e7a..791acd3250 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -613,20 +613,16 @@ sub edi_close_and_order { } exit; } else { - - my $ean_description = $query->param('ean_description'); - my $ean_branch = $query->param('ean_branch'); - $template->param( edi_confirm => 1, booksellerid => $booksellerid, basketno => $basket->{basketno}, basketname => $basket->{basketname}, basketgroupname => $basket->{basketname}, - ean => $ean ? $ean : '', - ean_description => $ean_description ? $ean_description : '', - ean_branch => $ean_branch ? $ean_branch : '', ); + if ($ean) { + $template->param( ean => $ean ); + } } return; diff --git a/admin/preferences.pl b/admin/preferences.pl index bf67c87e74..34ddca9497 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -122,18 +122,6 @@ sub _get_chunk { } $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme ); $chunk->{'type'} = 'languages'; - } elsif ( $options{'type'} && $options{'type'} eq 'locale-list' ) { - - # Dynamic locale detection for facet sorting using Koha::I18N - require Koha::I18N; - my $locales = Koha::I18N::available_locales(); - foreach my $locale (@$locales) { - if ( $locale->{value} && $value && $locale->{value} eq $value ) { - $locale->{selected} = 1; - } - } - $chunk->{'CHOICES'} = $locales; - $chunk->{'type'} = 'select'; } elsif ( $options{'choices'} ) { my $add_blank; if ( $options{'choices'} && ref( $options{'choices'} ) eq '' ) { diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml index f43c8ef1a8..fd1bbd11c9 100644 --- a/api/v1/swagger/definitions/item.yaml +++ b/api/v1/swagger/definitions/item.yaml @@ -12,7 +12,6 @@ properties: - string - "null" description: The item's barcode - maxLength: 20 acquisition_date: type: - string @@ -37,7 +36,6 @@ properties: - string - "null" description: Internal library id for the library the item belongs to - maxLength: 10 purchase_price: type: - number @@ -105,13 +103,11 @@ properties: - string - "null" description: Call number for this item - maxLength: 255 coded_location_qualifier: type: - string - "null" description: Coded location qualifier - maxLength: 10 checkouts_count: type: - integer @@ -152,7 +148,6 @@ properties: - string - "null" description: Library that is currently in possession item - maxLength: 10 timestamp: type: string format: date-time @@ -169,7 +164,6 @@ properties: description: Linked to the CART and PROC temporary locations feature, stores the permanent shelving location - maxLength: 80 checked_out_date: type: - string @@ -183,19 +177,16 @@ properties: - string - "null" description: Classification source used on this item - maxLength: 10 call_number_sort: type: - string - "null" description: "?" - maxLength: 255 collection_code: type: - string - "null" description: Authorized value for the collection code associated with this item - maxLength: 80 materials_notes: type: - string @@ -216,7 +207,6 @@ properties: - string - "null" description: Itemtype defining the type for this item - maxLength: 10 effective_item_type_id: type: - string @@ -237,19 +227,16 @@ properties: - string - "null" description: Copy number - maxLength: 32 inventory_number: type: - string - "null" description: Inventory number - maxLength: 80 new_status: type: - string - "null" description: "'new' value, whatever free-text information." - maxLength: 32 exclude_from_local_holds_priority: type: boolean description: Exclude this item from local holds priority. diff --git a/api/v1/swagger/definitions/library.yaml b/api/v1/swagger/definitions/library.yaml index c4debe94b5..0fc7967358 100644 --- a/api/v1/swagger/definitions/library.yaml +++ b/api/v1/swagger/definitions/library.yaml @@ -29,7 +29,6 @@ properties: - string - "null" description: the postal code of the library - maxLength: 25 city: type: - string @@ -85,7 +84,6 @@ properties: - string - "null" description: the IP address for your library or branch - maxLength: 15 notes: type: - string @@ -103,7 +101,6 @@ properties: description: MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode - maxLength: 16 pickup_location: type: boolean description: If the library can act as a pickup location diff --git a/api/v1/swagger/definitions/patron.yaml b/api/v1/swagger/definitions/patron.yaml index 0895ffdbe8..4b61ae2d46 100644 --- a/api/v1/swagger/definitions/patron.yaml +++ b/api/v1/swagger/definitions/patron.yaml @@ -178,11 +178,9 @@ properties: library_id: type: string description: Internal identifier for the patron's home library - maxLength: 10 category_id: type: string description: Internal identifier for the patron's category - maxLength: 10 date_enrolled: type: - string @@ -229,13 +227,11 @@ properties: - string - "null" description: used for children to include the relationship to their guarantor - maxLength: 100 gender: type: - string - "null" description: patron's gender - maxLength: 1 userid: type: - string @@ -251,19 +247,16 @@ properties: - string - "null" description: a note related to patron's alternate address - maxLength: 255 statistics_1: type: - string - "null" description: a field that can be used for any information unique to the library - maxLength: 80 statistics_2: type: - string - "null" description: a field that can be used for any information unique to the library - maxLength: 80 autorenew_checkouts: type: boolean description: indicate whether auto-renewal is allowed for patron @@ -318,7 +311,6 @@ properties: - "null" description: the mobile phone number where the patron would like to receive notices (if SMS turned on) - maxLength: 50 sms_provider_id: type: - integer @@ -335,10 +327,6 @@ properties: description: controls if relatives can see this patron's fines check_previous_checkout: type: string - enum: - - yes - - no - - inherit description: produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit' diff --git a/api/v1/swagger/definitions/patron_category.yaml b/api/v1/swagger/definitions/patron_category.yaml index da548a6980..7f2d4a3288 100644 --- a/api/v1/swagger/definitions/patron_category.yaml +++ b/api/v1/swagger/definitions/patron_category.yaml @@ -4,7 +4,6 @@ properties: patron_category_id: type: string description: Internal patron category identifier - maxLength: 10 name: type: - string @@ -57,11 +56,9 @@ properties: category_type: type: string description: Type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) - maxLength: 1 block_expired_patron_opac_actions: type: string description: Specific actions expired patrons of this category are blocked from performing. OPAC actions blocked based on the patron category take priority over this preference - maxLength: 128 default_privacy: type: string enum: @@ -71,10 +68,6 @@ properties: description: Default privacy setting for this patron category check_prev_checkout: type: string - enum: - - yes - - no - - inherit description: Produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.' can_place_ill_in_opac: type: boolean diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 51fbb1a31d..58f555d6de 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -33,6 +33,7 @@ use C4::Biblio qw( GetMarcStructure GetUsedMarcStructure ModBiblio + prepare_host_field PrepHostMarcField TransformHtmlToMarc ApplyMarcOverlayRules @@ -644,10 +645,8 @@ if ($hostbiblionumber) { if ($parentbiblio) { my $marcflavour = C4::Context->preference('marcflavour'); $record = MARC::Record->new(); - $record->leader(' naa a22 i 4500'); SetMarcUnicodeFlag( $record, $marcflavour ); - my $parent = Koha::Biblios->find($parentbiblio); - my $hostfield = $parent->generate_marc_host_field; + my $hostfield = prepare_host_field( $parentbiblio, $marcflavour ); if ($hostfield) { $record->append_fields($hostfield); } diff --git a/cpanfile b/cpanfile index 84d6e4ede0..c0fc0ef00b 100644 --- a/cpanfile +++ b/cpanfile @@ -107,7 +107,6 @@ requires 'Storable', '2.20'; requires 'String::Random', '0.22'; requires 'Template', '>= 2.27, != 3.008'; requires 'Template::Plugin::HtmlToText', '0.03'; -requires 'Template::Plugin::JSON', '0.08', requires 'Template::Plugin::JSON::Escape', '0.02'; requires 'Term::ANSIColor', '1.1'; requires 'Test', '1.25'; diff --git a/cypress.config.ts b/cypress.config.ts index e67eb344f3..e90da4e019 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -15,5 +15,13 @@ export default defineConfig({ baseUrl: "http://localhost:8081", specPattern: "t/cypress/integration/**/*.*", supportFile: "t/cypress/support/e2e.js", + env: { + db: { + host: "db", + user: "koha_kohadev", + password: "password", + database: "koha_kohadev", + }, + }, }, }); diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot index a426507fef..dd473325b7 100755 --- a/debian/build-git-snapshot +++ b/debian/build-git-snapshot @@ -24,45 +24,46 @@ use Modern::Perl; use Getopt::Long qw(:config no_ignore_case); -use POSIX qw/strftime/; +use POSIX qw/strftime/; my $basetgz; my $buildresult; -my $distribution = 'testing'; -my $git_checks = 'all'; -my $version = '16.06~git'; -my $auto_version = 1; -my $auto_changelog = 1; +my $distribution='testing'; +my $git_checks='all'; +my $version='16.06~git'; +my $auto_version=1; +my $auto_changelog=1; my $need_help; my $incr; -my $urgency = 'medium'; +my $urgency='medium'; my $debug; my $release_str; GetOptions( - 'basetgz|b=s' => \$basetgz, - 'buildresult|r=s' => \$buildresult, - 'distribution|D=s' => \$distribution, - 'git-checks|g=s' => \$git_checks, - 'version|v=s' => \$version, - 'incr|i=s' => \$incr, - 'urgency|u=s' => \$urgency, - 'autoversion!' => \$auto_version, - 'autochangelog!' => \$auto_changelog, - 'help|h' => \$need_help, - 'debug|d' => \$debug, + 'basetgz|b=s' => \$basetgz, + 'buildresult|r=s' => \$buildresult, + 'distribution|D=s' => \$distribution, + 'git-checks|g=s' => \$git_checks, + 'version|v=s' => \$version, + 'incr|i=s' => \$incr, + 'urgency|u=s' => \$urgency, + 'autoversion!' => \$auto_version, + 'autochangelog!' => \$auto_changelog, + 'help|h' => \$need_help, + 'debug|d' => \$debug, ); help_and_exit() if $need_help; + sub sys_command_output { my ($command) = @_; print "$command\n" if $debug; my $command_output; - open( $command_output, "-|", "$command " ) - or die qq{Cannot execute "$command": $!"}; + open($command_output, "-|", "$command ") + or die qq{Cannot execute "$command": $!"}; return map { chomp; $_ } <$command_output>; } @@ -77,17 +78,17 @@ sub everything_is_committed { my $filter; for ($git_checks) { $_ eq "none" - and return 1; + and return 1; $_ eq "modified" - and $filter = "no", - last; + and $filter = "no", + last; $_ eq "all" - and $filter = "normal", - last; + and $filter = "normal", + last; - help_and_exit("$0: --git-checks/-g must be one of 'all', 'modified', or 'none'"); + help_and_exit("$0: --git-checks/-g must be one of 'all', 'modified', or 'none'"); } my $has_changes = grep /^xxx/, sys_command_output("git status --porcelain -u${filter}"); @@ -95,13 +96,13 @@ sub everything_is_committed { } sub help_and_exit { - my $msg = shift; - if ($msg) { - print "$msg\n\n"; + my $msg = shift; + if ($msg) { + print "$msg\n\n"; } print < "../koha_$newversion.orig.tar.gz"}); + sys_command_output( qq{git archive --format=tar --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.orig.tar.gz"} ); - my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : ""; - my $pdebuildbasetgz = $basetgz ? "-- --use-network yes --basetgz /var/cache/pbuilder/" . $basetgz . ".tgz" : ""; - sys_command_output_screen("pdebuild --debbuildopts -sa $pdebuildbasetgz $pdebuildopts"); + my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : ""; + my $pdebuildbasetgz = $basetgz ? "-- --use-network yes --basetgz /var/cache/pbuilder/" . $basetgz . ".tgz" : ""; + sys_command_output_screen( "pdebuild --debbuildopts -sa $pdebuildbasetgz $pdebuildopts" ); } -everything_is_committed() or die "cannot build: uncommitted changes"; +everything_is_committed() or die "cannot build: uncommited changes"; -my $newversion = - $auto_version - ? sprintf( '%s%s.%s', $version, strftime( "+%Y%m%d%H%M%S", localtime ), latest_sha1() ) - : $version; +my $newversion = $auto_version + ? sprintf ('%s%s.%s', $version, strftime("+%Y%m%d%H%M%S", localtime), latest_sha1()) + : $version; -adjust_debian_changelog($newversion) if $auto_changelog; -build_package($newversion); +adjust_debian_changelog( $newversion ) if $auto_changelog; +build_package( $newversion ); reset_debian_changelog(); diff --git a/debian/control b/debian/control index 1e13743535..9ff48a08aa 100644 --- a/debian/control +++ b/debian/control @@ -137,7 +137,6 @@ Build-Depends: libalgorithm-checkdigits-perl, libtemplate-plugin-gettext-perl, libtemplate-plugin-htmltotext-perl, libtemplate-plugin-json-escape-perl, - libtemplate-plugin-json-perl, libtemplate-plugin-stash-perl, libtest-deep-perl, libtest-exception-perl, @@ -371,7 +370,6 @@ Depends: libalgorithm-checkdigits-perl, libpdf-table-perl, libplack-middleware-logwarn-perl, libplack-middleware-reverseproxy-perl, - libpod-coverage-perl, libreadonly-perl, libscalar-list-utils-perl, libschedule-at-perl, @@ -388,7 +386,6 @@ Depends: libalgorithm-checkdigits-perl, libtemplate-plugin-gettext-perl, libtemplate-plugin-htmltotext-perl, libtemplate-plugin-json-escape-perl, - libtemplate-plugin-json-perl, libtemplate-plugin-stash-perl, libtest-deep-perl, libtest-exception-perl, diff --git a/debian/templates/zebra-authorities-dom-site.cfg.in b/debian/templates/zebra-authorities-dom-site.cfg.in index 01d446b8d6..be2e0c3ae6 100644 --- a/debian/templates/zebra-authorities-dom-site.cfg.in +++ b/debian/templates/zebra-authorities-dom-site.cfg.in @@ -8,7 +8,7 @@ profilePath:/etc/koha/sites/__KOHASITE__:/etc/koha/zebradb/authorities/etc:/etc/ encoding: UTF-8 # modulePath - where to look for loadable zebra modules -modulePath: /usr/lib64/idzebra-2.0/modules:/usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules +modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules # Files that describe the attribute sets supported. attset: bib1.att diff --git a/debian/templates/zebra-biblios-dom-site.cfg.in b/debian/templates/zebra-biblios-dom-site.cfg.in index 29bf9a8473..7b5e52c153 100644 --- a/debian/templates/zebra-biblios-dom-site.cfg.in +++ b/debian/templates/zebra-biblios-dom-site.cfg.in @@ -5,7 +5,7 @@ # Where are the config files located? profilePath:/etc/koha/sites/__KOHASITE__:/etc/koha/zebradb/biblios/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:/etc/koha/zebradb/lang_defs/__ZEBRA_LANGUAGE__:/etc/koha/zebradb/xsl # modulePath - where to look for loadable zebra modules -modulePath: /usr/lib64/idzebra-2.0/modules:/usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules +modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules encoding: UTF-8 # Files that describe the attribute sets supported. diff --git a/etc/zebradb/zebra-authorities-dom.cfg b/etc/zebradb/zebra-authorities-dom.cfg index f1b5a6a9e1..f3b267b4fe 100644 --- a/etc/zebradb/zebra-authorities-dom.cfg +++ b/etc/zebradb/zebra-authorities-dom.cfg @@ -8,7 +8,7 @@ profilePath:__ZEBRA_CONF_DIR__/authorities/etc:__ZEBRA_CONF_DIR__/etc:__ZEBRA_CO encoding: UTF-8 # modulePath - where to look for loadable zebra modules -modulePath: /usr/lib64/idzebra-2.0/modules:/usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules +modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib64/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules/ # Files that describe the attribute sets supported. attset: bib1.att diff --git a/etc/zebradb/zebra-biblios-dom.cfg b/etc/zebradb/zebra-biblios-dom.cfg index 494666e82c..76ed216990 100644 --- a/etc/zebradb/zebra-biblios-dom.cfg +++ b/etc/zebradb/zebra-biblios-dom.cfg @@ -5,7 +5,7 @@ # Where are the config files located? profilePath:__ZEBRA_CONF_DIR__/biblios/etc:__ZEBRA_CONF_DIR__/etc:__ZEBRA_CONF_DIR__/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:__ZEBRA_CONF_DIR__/lang_defs/__ZEBRA_LANGUAGE__:__ZEBRA_CONF_DIR__/xsl # modulePath - where to look for loadable zebra modules -modulePath: /usr/lib64/idzebra-2.0/modules:/usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules +modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib64/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules/ encoding: UTF-8 # Files that describe the attribute sets supported. diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index 8bb8c255c6..0db9c09b1e 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -117,7 +117,7 @@ if ($backends_available) { $template->param( notices => $notices, request => $request, - ( $params->{tran_fail} ? ( tran_fail => $params->{tran_fail} ) : () ), + ( $params->{tran_error} ? ( tran_error => $params->{tran_error} ) : () ), ( $params->{tran_success} ? ( tran_success => $params->{tran_success} ) : () ), ); @@ -478,7 +478,7 @@ if ($backends_available) { $append .= '&tran_success=' . join( ',', @{ $ret->{result}->{success} } ); } if ( $ret->{result} && scalar @{ $ret->{result}->{fail} } > 0 ) { - $append .= '&tran_fail=' . join( ',', @{ $ret->{result}->{fail} } ); + $append .= '&tran_fail=' . join( ',', @{ $ret->{result}->{fail} } . join(',') ); } # Redirect to view the whole request diff --git a/installer/data/mysql/db_revs/250600003.pl b/installer/data/mysql/db_revs/250600003.pl deleted file mode 100755 index 951097d56d..0000000000 --- a/installer/data/mysql/db_revs/250600003.pl +++ /dev/null @@ -1,32 +0,0 @@ -use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_success say_info); - -return { - bug_number => "40337", - description => "Define checkprevcheckout as ENUM", - up => sub { - my ($args) = @_; - my ( $dbh, $out ) = @$args{qw(dbh out)}; - - $dbh->do( - q{ - ALTER TABLE borrowers - MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' - } - ); - - $dbh->do( - q{ - ALTER TABLE categories - MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.' - } - ); - - $dbh->do( - q{ - ALTER TABLE deletedborrowers - MODIFY COLUMN `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.' - } - ); - }, -}; diff --git a/installer/data/mysql/db_revs/250600004.pl b/installer/data/mysql/db_revs/250600004.pl deleted file mode 100755 index 7f871c7388..0000000000 --- a/installer/data/mysql/db_revs/250600004.pl +++ /dev/null @@ -1,22 +0,0 @@ -use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_success say_info); - -return { - bug_number => "36947", - description => "Add FacetSortingLocale system preference for locale-based facet sorting", - up => sub { - my ($args) = @_; - my ( $dbh, $out ) = @$args{qw(dbh out)}; - - $dbh->do( - q{ - INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) - VALUES ('FacetSortingLocale','default','', - 'Choose the locale for sorting facet names when FacetOrder is set to Alphabetical. This enables proper Unicode-aware sorting of accented characters and locale-specific alphabetical ordering.', - 'Choice') - } - ); - - say_success( $out, "Added new system preference 'FacetSortingLocale'" ); - }, -}; diff --git a/installer/data/mysql/en/optional/sample_news.yml b/installer/data/mysql/en/optional/sample_news.yml index 39432d9d7d..988d927005 100644 --- a/installer/data/mysql/en/optional/sample_news.yml +++ b/installer/data/mysql/en/optional/sample_news.yml @@ -80,12 +80,12 @@ tables: content: - "Now that you've installed Koha, what's next? Here are some suggestions:" - "" - "" lang: "default" diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 11018d4f7b..179cc2fef6 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1598,7 +1598,7 @@ CREATE TABLE `borrowers` ( `privacy` int(11) NOT NULL DEFAULT 1 COMMENT 'patron/borrower''s privacy settings related to their checkout history', `privacy_guarantor_fines` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'controls if relatives can see this patron''s fines', `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'controls if relatives can see this patron''s checkouts', - `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.', + `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.', `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'time of last change could be useful for synchronization with external systems (among others)', `lastseen` datetime DEFAULT NULL COMMENT 'last time a patron has been seen (connected at the OPAC or staff interface)', `lang` varchar(25) NOT NULL DEFAULT 'default' COMMENT 'lang to use to send notices to this patron', @@ -1808,7 +1808,7 @@ CREATE TABLE `categories` ( `category_type` varchar(1) NOT NULL DEFAULT 'A' COMMENT 'type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)', `BlockExpiredPatronOpacActions` varchar(128) NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed', `default_privacy` enum('default','never','forever') NOT NULL DEFAULT 'default' COMMENT 'Default privacy setting for this patron category', - `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.', + `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.', `can_place_ill_in_opac` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'can this patron category place interlibrary loan requests', `can_be_guarantee` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'if patrons of this category can be guarantees', `reset_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can do the password reset flow,', @@ -2760,7 +2760,7 @@ CREATE TABLE `deletedborrowers` ( `privacy` int(11) NOT NULL DEFAULT 1 COMMENT 'patron/borrower''s privacy settings related to their checkout history KEY `borrowernumber` (`borrowernumber`),', `privacy_guarantor_fines` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'controls if relatives can see this patron''s fines', `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'controls if relatives can see this patron''s checkouts', - `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.', + `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.', `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'time of last change could be useful for synchronization with external systems (among others)', `lastseen` datetime DEFAULT NULL COMMENT 'last time a patron has been seen (connected at the OPAC or staff interface)', `lang` varchar(25) NOT NULL DEFAULT 'default' COMMENT 'lang to use to send notices to this patron', @@ -5772,6 +5772,19 @@ CREATE TABLE `saved_reports` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `reports_branches`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `reports_branches` ( + `report_id` int(11) NOT NULL, + `branchcode` varchar(10) NOT NULL, + KEY `report_id` (`report_id`), + KEY `branchcode` (`branchcode`), + CONSTRAINT `reports_branches_ibfk_1` FOREIGN KEY (`report_id`) REFERENCES `saved_sql` (`id`) ON DELETE CASCADE, + CONSTRAINT `reports_branches_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `saved_sql` -- diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index f2b6d940cc..f9f419c39d 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -278,7 +278,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'), ('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'), ('FacetOrder','Alphabetical','Alphabetical|Usage','Specify the order of facets within each category','Choice'), -('FacetSortingLocale','default','','Choose the locale for sorting facet names when FacetOrder is set to Alphabetical. This enables proper Unicode-aware sorting of accented characters and locale-specific alphabetical ordering.','Choice'), ('FailedLoginAttempts','','','Number of login attempts before lockout the patron account','Integer'), ('FallbackToSMSIfNoEmail', 0, 'Enable|Disable', 'Send messages by SMS if no patron email is defined', 'YesNo'), ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is charged','YesNo'), @@ -507,7 +506,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'), ('OPACFinesTab','1','','If OFF the patron fines tab in the OPAC is disabled.','YesNo'), ('OPACFRBRizeEditions','0','','If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), -('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See https://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'), +('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See http://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'), ('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by comma, that can see items otherwise hidden by OpacHiddenItems','Textarea'), ('OpacHiddenItemsHidesRecord','1','','Hide biblio record when all its items are hidden because of OpacHiddenItems','YesNo'), ('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index adbd5e4c50..b234d7cfad 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -29455,6 +29455,22 @@ if ( CheckVersion($DBversion) ) { NewVersion( $DBversion, 28108, "Add new systempreference OpacHiddenItemsHidesRecord" ); } +$DBversion = '25.06.00.003'; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do( + "CREATE TABLE `reports_branches` ( + `report_id` int(11) NOT NULL, + `branchcode` varchar(10) NOT NULL, + KEY `report_id` (`report_id`), + KEY `branchcode` (`branchcode`), + CONSTRAINT `reports_branches_ibfk_1` FOREIGN KEY (`report_id`) REFERENCES `saved_sql` (`id`) ON DELETE CASCADE, + CONSTRAINT `reports_branches_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;" + ); + print "Upgrade to $DBversion done (reports_branches added)\n"; + SetVersion($DBversion); +} + $DBversion = '21.05.00.000'; if ( CheckVersion($DBversion) ) { NewVersion( $DBversion, "", "Koha 21.05.00 release" ); diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index ae6c2b9739..5798abfd15 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2192,16 +2192,6 @@ li { td { &.actions { white-space: nowrap; - - a, - button { - display: inline-block; - margin-left: .3rem; - - &:first-child { - margin-left: 0; - } - } } &.bookcoverimg { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc index 59e416f7b8..4461581ba1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/guided-reports-view.inc @@ -10,12 +10,12 @@
Useful resources
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 16ed39f758..15e1f17ce5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -104,16 +104,14 @@ [% SET is_superlibrarian = CAN_user_superlibrarian ? 'is_superlibrarian' : '' %] - [% logged_in_user.userid | html %] - [% logged_in_user.categorycode | html %] + [% logged_in_user.userid | html %] + [% logged_in_user.categorycode | html %] [% IF ( StaffLoginRestrictLibraryByIP ) %] [% Branches.GetLoggedInBranchname | html %] [% ELSE %] - [% Branches.GetLoggedInBranchname | html %] - [% Branches.GetLoggedInBranchcode | html %] + [% Branches.GetLoggedInBranchname | html %] + [% Branches.GetLoggedInBranchcode | html %] [% END %] [% IF Koha.Preference('UseCirculationDesks') && Desks.ListForLibrary.count %] @@ -122,16 +120,16 @@ [% IF ( Desks.GetLoggedInDeskName == '' ) %] NO DESK SET [% ELSE %] - [% Desks.GetLoggedInDeskName | html %] - [% Desks.GetLoggedInDeskId | html %] + [% Desks.GetLoggedInDeskName | html %] + [% Desks.GetLoggedInDeskId | html %] [% END %] [% END %] [% IF Koha.Preference('UseCashRegisters') && !(Registers.session_register_name == '') %] | - [% Registers.session_register_name | html %] - [% Registers.session_register_id | html %] + [% Registers.session_register_name | html %] + [% Registers.session_register_id | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc index 3e0bb172e0..7f29640ceb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc @@ -29,18 +29,10 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ patron.city |html ~%] - [%~ IF ( patron.state ) %] - [%~ IF ( patron.city ) ~%] - , - [% END ~%] - [% patron.state |html ~%] - [%~ END ~%] - [%~ IF ( patron.zipcode ) %][%~ " " _ patron.zipcode |html ~%][% END %] - [%~ IF ( patron.country ) %] - [% line_break | $raw %] - [% patron.country |html ~%] - [%~ END ~%] + [%~ patron.city |html ~%][%~ IF ( patron.state ) %][%~ IF ( patron.city ) ~%],[% END ~%][% patron.state |html ~%][%~ END ~%] + [%~ IF ( patron.zipcode ) %][%~ " " _ patron.zipcode |html ~%][% END %][%~ IF ( patron.country ) %][%~ IF ( patron.zipcode || patron.state || patron.city ) ~%] + , + [% END ~%][% patron.country |html ~%][%~ END ~%]
  • [%~ END ~%] [%~ END ~%] @@ -52,15 +44,11 @@ [%~ IF patron.streettype ~%] [%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%] [%~ END ~%] -
  • - [%~ patron.address | html ~%] - [%~ IF roadtype_desc %] - [% roadtype_desc | html ~%] - [%~ END ~%] - [%~ IF patron.streetnumber %] +
  • [%~ patron.address | html ~%][%~ IF roadtype_desc %][% roadtype_desc | html ~%][%~ END ~%][%~ IF patron.streetnumber %] [% patron.streetnumber | html ~%] - [%~ END ~%] -
  • + [%~ END ~%] [%~ END ~%] [%~ IF ( patron.address2 ) ~%]
  • [%~ patron.address2 | html ~%]
  • @@ -68,11 +56,7 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ IF ( patron.zipcode ) ~%] - [%~ patron.zipcode | html %] - [% END ~%] - [%~ patron.city | html ~%] - [%~ IF ( patron.state ) ~%] + [%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %][% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%] [% line_break | $raw %][%~ patron.state | html ~%] [%~ END ~%] [%~ IF ( patron.country ) ~%][% line_break | $raw %][%~ patron.country | html ~%][%~ END ~%] @@ -87,13 +71,9 @@ [%~ IF patron.streettype ~%] [%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%] [%~ END ~%] -
  • - [%~ IF patron.streetnumber ~%] - [%~ patron.streetnumber | html %] - [% END ~%] - [%~ IF roadtype_desc ~%] - [%~ roadtype_desc | html %] - [% END ~%] +
  • [%~ IF patron.streetnumber ~%][%~ patron.streetnumber | html %][% END ~%] + [%~ IF roadtype_desc ~%][%~ roadtype_desc | html %][% END ~%] [%~ patron.address | html ~%]
  • [%~ END ~%] @@ -103,11 +83,7 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ IF ( patron.zipcode ) ~%] - [%~ patron.zipcode | html %] - [% END ~%] - [%~ patron.city | html ~%] - [%~ IF ( patron.state ) ~%] + [%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %][% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%] [% line_break | $raw %][%~ patron.state | html ~%] [%~ END ~%] [%~ IF ( patron.country ) ~%][% line_break | $raw %][%~ patron.country | html ~%][%~ END ~%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc index 937e174112..2b17d1f079 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc @@ -165,6 +165,17 @@
  • [% END %] + [% IF ( reports ) %] +
  • + Reports + [% PROCESS subtabs %] +
  • + [% ELSE %] +
  • + Reports +
  • + [% END %] + [% IF ( searching ) %]
  • Searching diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc index 29a626aa1d..28cd71f6b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -6,7 +6,7 @@ - [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_batch_extend_due_dates || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) || CAN_user_tools_rotating_collections ) %] + [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) || CAN_user_tools_rotating_collections ) %]
    Patrons and circulation
    [% IF ( Koha.Preference('Mana') == 2 ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index fe5eb4de85..1ad0ab6fef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -136,17 +136,19 @@ [% IF closed %] Actions