diff --git a/C4/Context.pm b/C4/Context.pm index 926ae9fed4..a79ad40977 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -583,17 +583,19 @@ sub _new_Zconn { $syntax = 'xml'; $elementSetName = 'marcxml'; - my $host = _common_config( $server, 'listen' )->{content}; + my $host = _common_config( $server, 'listen' ); + $host = $host->{content}; my $serverinfo = _common_config( $server, 'serverinfo' ); my $user = $serverinfo->{user}; my $password = $serverinfo->{password}; eval { # set options my $o = ZOOM::Options->new(); - $o->option( user => $user ) if $user && $password; - $o->option( password => $password ) if $user && $password; - $o->option( async => 1 ) if $async; - $o->option( cqlfile => _common_config( $server, 'server' )->{cql2rpn} ); + $o->option( user => $user ) if $user && $password; + $o->option( password => $password ) if $user && $password; + $o->option( async => 1 ) if $async; + my $server_conf = _common_config( $server, 'server' ); + $o->option( cqlfile => $server_conf->{cql2rpn} ); $o->option( cclfile => $serverinfo->{ccl2rpn} ); $o->option( preferredRecordSyntax => $syntax ); $o->option( elementSetName => $elementSetName ) if $elementSetName; diff --git a/C4/Record.pm b/C4/Record.pm index febb1228ae..43f354d111 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -931,6 +931,7 @@ sub marc2cites { if ( $marcflavour eq "UNIMARC" ) { %publication = ( title => $record->subfield( "200", "a" ) || "", + subtitle => $record->subfield( "200", "e" ) || "", place => $record->subfield( "210", "a" ) || "", publisher => $record->subfield( "210", "c" ) || "", date => $record->subfield( "210", "d" ) || $record->subfield( "210", "h" ) || "" @@ -938,6 +939,7 @@ sub marc2cites { } else { %publication = ( title => $record->subfield( "245", "a" ) || "", + subtitle => $record->subfield( "245", "b" ) || "", place => $record->subfield( "264", "a" ) || $record->subfield( "260", "a" ) || "", publisher => $record->subfield( "264", "b" ) || $record->subfield( "260", "b" ) || "", date => $record->subfield( "264", "c" ) @@ -978,13 +980,16 @@ sub marc2cites { if ( $publication{date} ) { $cites{'Harvard'} .= ' (' . $publication{'date'} . '). '; $cites{'Chicago'} .= ' ' . $publication{'date'} . '. '; - $cites{'MLA'} .= ' ' . $publication{'title'} . '. '; - $cites{'APA'} .= ' (' . $publication{'date'} . '). '; + $cites{'MLA'} .= + ' ' . $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. '; + $cites{'APA'} .= ' (' . $publication{'date'} . '). '; } - $cites{'Harvard'} .= $publication{'title'} . '. '; - $cites{'Chicago'} .= $publication{'title'} . '. '; - $cites{'MLA'} .= $publication{'place'} . ': '; - $cites{'APA'} .= $publication{'title'} . '. '; + $cites{'Harvard'} .= + $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. '; + $cites{'Chicago'} .= + $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. '; + $cites{'MLA'} .= $publication{'place'} . ': '; + $cites{'APA'} .= $publication{'title'} . ( $publication{'subtitle'} ? ': ' . $publication{'subtitle'} : '' ) . '. '; $cites{'Harvard'} .= $publication{'place'} . ': '; $cites{'Chicago'} .= $publication{'place'} . ': '; $cites{'MLA'} .= $publication{'publisher'} . '. '; diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index b10ff76fd0..cc71b3926a 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -342,9 +342,10 @@ sub days_between { my $end_dt = shift; # Change time zone for date math and swap if needed - $start_dt = $start_dt->clone->set_time_zone('floating'); - $end_dt = $end_dt->clone->set_time_zone('floating'); + $start_dt = $start_dt->clone->set_time_zone('floating')->truncate( to => 'day' ); + $end_dt = $end_dt->clone->set_time_zone('floating')->truncate( to => 'day' ); if ( $start_dt->compare($end_dt) > 0 ) { + ( $start_dt, $end_dt ) = ( $end_dt, $start_dt ); } @@ -448,6 +449,20 @@ Koha::Calendar - Object containing a branches calendar =head1 METHODS +=head2 _init + + $calendar->_init(); + +Populates the object with repeatable closed days (weekly and day/month) for the +branch. Called automatically by C. + +=head2 _holidays + + my $holidays = $calendar->_holidays(); + +Returns a hashref of special (one-off) holidays for the branch, keyed by +C date strings. Results are cached. + =head2 new : Create a calendar object my $calendar = Koha::Calendar->new( branchcode => 'MAIN' ); diff --git a/Koha/Hold.pm b/Koha/Hold.pm index 2f8135f9c0..a69524dd59 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -785,7 +785,7 @@ sub cancel { type => 'RESERVE_EXPIRED', item_id => $self->itemnumber } - ) if $charge; + ) if $charge && $charge > 0; } C4::Log::logaction( 'HOLDS', 'CANCEL', $self->reserve_id, $self, undef, $original ) diff --git a/Koha/Item.pm b/Koha/Item.pm index 648268a327..ffae9c8c73 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -2067,7 +2067,9 @@ Returns the effective bookability of the current item, be that item or itemtype sub effective_bookable { my ($self) = @_; - return $self->bookable // $self->itemtype->bookable; + return $self->bookable if defined $self->bookable; + return $self->itemtype->bookable if $self->itemtype; + return 0; } =head3 orders diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index 42d5701ae7..da17e7f169 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -377,9 +377,6 @@ LINE: while ( my $borrowerline = <$handle> ) { $patron_attributes = $patron->extended_attributes->merge_and_replace_with($patron_attributes); } - - # We do not want to filter by branch, maybe we should? - Koha::Patrons->find($borrowernumber)->extended_attributes->delete; $patron->extended_attributes($patron_attributes); } $overwritten++; diff --git a/Koha/Report.pm b/Koha/Report.pm index e2f6163e88..c41feff26c 100644 --- a/Koha/Report.pm +++ b/Koha/Report.pm @@ -29,8 +29,8 @@ use base qw(Koha::Object); # TODO Koha::Report->store should check this before saving use constant FORBIDDEN_COLUMN_MATCHES => qw(password token uuid secret); -use constant WHITELISTED_COLUMN_NAMES => - qw(password_expiration_date password_expiry_days reset_password change_password min_password_length require_strong_password password_expiration_date); +use constant ALLOWLISTED_COLUMN_NAMES => + qw(password_expiration_date password_expiry_days reset_password change_password min_password_length require_strong_password password_expiration_date force_password_reset_when_set_by_staff); =head1 NAME @@ -99,8 +99,8 @@ sub check_columns { @columns = grep { /$regex/i } @columns; } - # Check for whitelisted variants - $regex = '(^' . ( join '|', WHITELISTED_COLUMN_NAMES ) . ')$'; # should be full match + # Check for allowlisted variants + $regex = '(^' . ( join '|', ALLOWLISTED_COLUMN_NAMES ) . ')$'; # should be full match @columns = grep { !/$regex/i } @columns; return @columns; } diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index 29ca1b4803..4f33b84887 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -100,7 +100,7 @@ sub store { # can be undef for branch=any suggestions my $library = $result->library; if ( $library && $library->inbound_email_address ) { - $toaddress = $library->inbound_email_address; + $toaddress = $library->inbound_email_address; } } elsif ( $emailpurchasesuggestions eq "KohaAdminEmailAddress" ) { $toaddress = C4::Context->preference('ReplytoDefault') diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index 658af3ed1e..c8718ecb0f 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -37,7 +37,7 @@ my $builder = sub { function Click$function_name(event) { defaultvalue=document.getElementById(event.data.id).value; - newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); + newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=\"+ event.data.id +\"&result=\"+encodeURIComponent(defaultvalue),\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); } diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 9810e3c42c..418b57c591 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -98,13 +98,7 @@ my $include_aqorders_qty_join = my $nfl_comparison = $include_ordered ? '<=' : '='; my $sus_comparison = $include_suspended ? '<=' : '<'; -my $strsth = "SELECT reservedate, - reserves.borrowernumber as borrowernumber, - reserves.biblionumber, - reserves.branchcode as branch, - items.holdingbranch, - items.itemcallnumber, - items.itemnumber, +my $strsth = "SELECT reserves.biblionumber, GROUP_CONCAT(DISTINCT items.itemcallnumber ORDER BY items.itemnumber SEPARATOR '|') as listcall, GROUP_CONCAT(DISTINCT homebranch @@ -117,8 +111,6 @@ my $strsth = "SELECT reservedate, ORDER BY items.itemnumber SEPARATOR '|') as l_itype, GROUP_CONCAT(DISTINCT items.ccode ORDER BY items.ccode SEPARATOR '|') as l_ccode, - - reserves.found, biblio.title, biblio.subtitle, biblio.medium, @@ -142,7 +134,10 @@ if ( C4::Context->preference('IndependentBranches') ) { push @query_params, C4::Context->userenv->{'branch'}; } -$strsth .= " GROUP BY reserves.biblionumber ORDER BY reservecount DESC"; +$strsth .= " GROUP BY reserves.biblionumber, biblio.title, biblio.subtitle, + biblio.medium, biblio.part_number, biblio.part_name, biblio.author + ORDER BY reservecount DESC +"; $template->param( sql => $strsth ); my $sth = $dbh->prepare($strsth); @@ -156,22 +151,15 @@ while ( my $data = $sth->fetchrow_hashref ) { push( @reservedata, { - reservedate => $data->{reservedate}, - priority => $data->{priority}, - name => $data->{borrower}, title => $data->{title}, subtitle => $data->{subtitle}, medium => $data->{medium}, part_number => $data->{part_number}, part_name => $data->{part_name}, author => $data->{author}, - itemnum => $data->{itemnumber}, biblionumber => $data->{biblionumber}, - holdingbranch => $data->{holdingbranch}, homebranch_list => [ split( '\|', $data->{homebranch_list} ) ], holdingbranch_list => [ split( '\|', $data->{holdingbranch_list} ) ], - branch => $data->{branch}, - itemcallnumber => $data->{itemcallnumber}, location => [ split( '\|', $data->{l_location} ) ], itype => [ split( '\|', $data->{l_itype} ) ], ccode => [ split( '\|', $data->{l_ccode} ) ], diff --git a/cpanfile b/cpanfile index 84d6e4ede0..31775489d4 100644 --- a/cpanfile +++ b/cpanfile @@ -72,7 +72,7 @@ requires 'Locale::Messages', '1.20'; requires 'Locale::PO', '0.24'; requires 'Log::Log4perl', '1.29'; requires 'MARC::Charset', '0.98'; -requires 'MARC::File::XML', 'v1.0.1'; +requires 'MARC::File::XML', 'v1.0.5'; requires 'MARC::Lint', 'v1.52'; requires 'MARC::Record', 'v2.0.6'; requires 'MARC::Record::MiJ', '0.04'; diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 6eeb1fe2a9..06c7cfa232 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -896,6 +896,8 @@ fi if [ "$op" = create ] || [ "$op" = populate ] || [ "$op" = use ] then + username="$name-koha" + # Reconfigure Apache. if ! { a2ensite "$name" > /dev/null 2>&1 || diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc index f1b8078e7e..189a737e67 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc @@ -78,7 +78,7 @@ [% ELSE %] - + [% END %] [% END %] [% END # /tab_panels %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index f760ebc811..d34f74d6ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -271,7 +271,7 @@
  • Place hold
  • Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_html => 1 %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc index 7161ca7a3b..dbf7017349 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -47,7 +47,7 @@ [%- SET display_patron_name = 0 -%] [%- END -%] [%- END -%] -[%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] +[%- IF !no_html AND (display_patron_name OR display_cardnumber) -%] [%- IF link_to == 'circulation_reserves' -%] [%- PROCESS display_patron_name -%] [%- ELSIF link_to == 'circulation_recalls' -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 05384025ba..e91800e837 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -444,6 +444,10 @@ $("#library_limitation")[0].style.minWidth = "450px"; $("#library_limitation").select2(); } + + $("#remoteImage").on("mousedown", function () { + $("#remote_image_check").prop("checked", true); + }); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 0f7915e365..868aa82c5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -572,6 +572,10 @@ $("#library_limitation")[0].style.minWidth = "450px"; $("#library_limitation").select2(); } + + $("#remoteImage").on("mousedown", function () { + $("#remote_image_check").prop("checked", true); + }); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt index 551b893c51..c37114a93a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt @@ -327,7 +327,7 @@

    Required match checks

    [% IF ( edit_matching_rule ) %] - [% SET p_style = matchpoints ? 'display:none;' : 'display:block;' %] + [% SET p_style = matchchecks ? 'display:none;' : 'display:block;' %]

    New match check

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 9c62cae068..53fe8f0755 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -105,7 +105,7 @@ Cataloging: choices: 1: specific item 0: bibliographic record - - as the authoritative item type (for determining circulation and fine rules, for displaying an item type icon on either opac detail or results page, etc). + - as the authoritative item type (for determining circulation and fine rules, for displaying an item type icon on either OPAC detail or results page, etc). - - Map the MARC subfields - pref: itemcallnumber @@ -284,7 +284,7 @@ Cataloging: - pref: OpacSuppressionByIPRange class: short - (Leave blank if not used. Define a range like 192.168..) - -
    Redirect the opac detail page for suppressed records to + -
    Redirect the OPAC detail page for suppressed records to - pref: OpacSuppressionRedirect choices: 1: "an explanatory page ('This record is blocked')." diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index 1f088136f4..06033a818a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -103,7 +103,7 @@ Enhanced content: - - Access Novelist Select using user profile - pref: NovelistSelectProfile - - on the opac + - on the OPAC - - Access Novelist Select using user profile - pref: NovelistSelectStaffProfile diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt index 1ddf1ca63d..1d499cfcd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt @@ -72,7 +72,7 @@ Merge reference
    1. [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 42f5bdc693..6ac6764963 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -165,9 +165,9 @@