Merge remote-tracking branch 'upstream/24.05.x' into HEAD

This commit is contained in:
Alex Buckley 2025-03-24 17:11:13 +13:00
commit 39be4f7911
20 changed files with 313 additions and 267 deletions

View File

@ -1634,7 +1634,7 @@ sub check_api_auth {
-secure => ( C4::Context->https_enabled() ? 1 : 0 ),
-sameSite => 'Lax'
);
return ( $return, $cookie, $session ); # return == 'ok' here
return ( $return, $cookie, $session->id ); # return == 'ok' here
} else {

View File

@ -151,22 +151,6 @@ sub authorities {
return $results;
}
=head2 preferred_authorities
my $preferred_authorities = $heading->preferred_authorities;
Return a list of authority records for headings
that are a preferred form of the heading.
=cut
sub preferred_authorities {
my $self = shift;
my $skipmetadata = shift || undef;
my ( $results, $total ) = _search( 'see-from', $skipmetadata );
return $results;
}
=head2 valid_heading_subfield
if (C4::Heading::valid_heading_subfield('100', 'e', '')) ...

View File

@ -2113,6 +2113,8 @@ sub RevertWaitingStatus {
}
)->next;
my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef;
## Increment the priority of all other non-waiting
## reserves for this bib record
my $holds = Koha::Holds->search({ biblionumber => $hold->biblionumber, priority => { '>' => 0 } })
@ -2129,7 +2131,7 @@ sub RevertWaitingStatus {
}
)->store( { hold_reverted => 1 } );
logaction( 'HOLDS', 'MODIFY', $hold->id, $hold )
logaction( 'HOLDS', 'MODIFY', $hold->id, $hold, undef, $original )
if C4::Context->preference('HoldsLog');
_FixPriority( { biblionumber => $hold->biblionumber } );

View File

@ -132,12 +132,36 @@ sub checkout {
# BEGIN TRANSACTION
$circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) );
$circ->item( $item = C4::SIP::ILS::Item->new($item_id) );
if ($fee_ack) {
$circ->fee_ack($fee_ack);
}
if ( !$patron ) {
$circ->screen_msg("Invalid Patron");
}
elsif ( !$item ) {
$circ->screen_msg("Invalid Item");
}
elsif ( $no_block_due_date ) {
# A no block due date means we need check this item out to the patron
# regardless if fines, restrictions or any other things that would
# typically prevent a patron from checking out.
# A no block transaction is used for send offline ( store and forward )
# transaction to Koha. The patron already has possession of the item
# so it should be checked out to the patron no matter what.
$circ->do_checkout( $account, $no_block_due_date );
$item->{borrowernumber} = $patron_id;
$item->{due_date} = $circ->{due};
push( @{ $patron->{items} }, { barcode => $item_id } );
$circ->desensitize( !$item->magnetic_media );
siplog(
"LOG_DEBUG", "ILS::Checkout: patron %s has checked out %s via a no block checkout",
$patron_id, join( ', ', map { $_->{barcode} } @{ $patron->{items} } )
);
}
elsif ( !$patron->charge_ok ) {
if ($patron->debarred) {
$circ->screen_msg("Patron debarred");
@ -169,7 +193,9 @@ sub checkout {
$circ->screen_msg("Item type cannot be checked out at this checkout location");
}
else {
$circ->do_checkout($account, $no_block_due_date);
# No block checkouts were handled earlier so there is no need
# to bass the no block due date here.
$circ->do_checkout($account);
if ( $circ->ok ) {
# If the item is already associated with this patron, then

View File

@ -126,7 +126,7 @@ sub to_api_mapping {
seriestitle => 'series_title',
copyrightdate => 'copyright_date',
datecreated => 'creation_date',
deleted_on => 'timestamp',
timestamp => 'deleted_on',
};
}

View File

@ -351,193 +351,194 @@ if (@$barcodes && $op eq 'cud-checkout') {
}
};
my $blocker = $invalidduedate ? 1 : 0;
my $blocker = $invalidduedate ? 1 : 0;
$template_params->{alert} = $alerts;
$template_params->{messages} = $messages;
$template_params->{alert} = $alerts;
$template_params->{messages} = $messages;
my $item = Koha::Items->find({ barcode => $barcode });
my $item = Koha::Items->find({ barcode => $barcode });
my $biblio;
if ( $item ) {
$biblio = $item->biblio;
}
if ( $issuingimpossible->{'STATS'} ) {
my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) =
AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 );
$template->param(
STATS => 1,
CHECKEDIN => $stats_return,
MESSAGES => $stats_messages,
ITEM => $stats_iteminformation,
BORROWER => $stats_borrower,
);
#increment items.localuse
my $localuse_count = $item->localuse;
$localuse_count++;
$item->localuse($localuse_count)->store;
}
# Fix for bug 7494: optional checkout-time fallback search for a book
if ( $issuingimpossible->{'UNKNOWN_BARCODE'}
&& C4::Context->preference("itemBarcodeFallbackSearch")
&& not $batch
)
{
$template_params->{FALLBACK} = 1;
my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX});
my $query = "kw=" . $barcode;
my ( $searcherror, $results, $total_hits ) = $searcher->simple_search_compat($query, 0, 10);
# if multiple hits, offer options to librarian
if ( $total_hits > 0 ) {
my @barcodes;
foreach my $hit ( @{$results} ) {
my $chosen = # Maybe easier to retrieve the itemnumber from $hit?
TransformMarcToKoha({ record => C4::Search::new_record_from_zebra('biblioserver',$hit) });
# offer all barcodes individually
if ( $chosen->{barcode} ) {
push @barcodes, sort split(/\s*\|\s*/, $chosen->{barcode});
}
}
my $items = Koha::Items->search({ barcode => {-in => \@barcodes}});
$template_params->{options} = $items;
my $biblio;
if ( $item ) {
$biblio = $item->biblio;
}
}
# Only some errors will block when performing forced onsite checkout,
# for other cases all errors will block
my @blocking_error_codes =
( $onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce") )
? qw( UNKNOWN_BARCODE NO_OPEN_DAYS )
: ( keys %$issuingimpossible );
if ( $issuingimpossible->{'STATS'} ) {
my ( $stats_return, $stats_messages, $stats_iteminformation, $stats_borrower ) =
AddReturn( $item->barcode, C4::Context->userenv->{'branch'}, undef, undef, 1 );
if ( $issuingimpossible->{BOOKED_TO_ANOTHER} ) {
$template_params->{BOOKED_TO_ANOTHER} = $issuingimpossible->{BOOKED_TO_ANOTHER};
$template_params->{IMPOSSIBLE} = 1;
$blocker = 1;
}
$template->param(
STATS => 1,
CHECKEDIN => $stats_return,
MESSAGES => $stats_messages,
ITEM => $stats_iteminformation,
BORROWER => $stats_borrower,
);
foreach my $code ( @blocking_error_codes ) {
if ($issuingimpossible->{$code}) {
$template_params->{$code} = $issuingimpossible->{$code};
$template_params->{IMPOSSIBLE} = 1;
$blocker = 1;
#increment items.localuse
my $localuse_count = $item->localuse;
$localuse_count++;
$item->localuse($localuse_count)->store;
}
}
delete $needsconfirmation->{'DEBT'} if ($debt_confirmed);
# Fix for bug 7494: optional checkout-time fallback search for a book
if ( $item && C4::Context->preference('ClaimReturnedLostValue') ) {
my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout');
if ( $issuingimpossible->{'UNKNOWN_BARCODE'}
&& C4::Context->preference("itemBarcodeFallbackSearch")
&& not $batch
)
{
$template_params->{FALLBACK} = 1;
my $claims = Koha::Checkouts::ReturnClaims->search(
{
itemnumber => $item->id,
}
);
if ( $claims->count ) {
if ($autoClaimReturnCheckout) {
my $claim = $claims->next;
my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX});
my $query = "kw=" . $barcode;
my ( $searcherror, $results, $total_hits ) = $searcher->simple_search_compat($query, 0, 10);
my $patron_id = $logged_in_user->borrowernumber;
my $resolution = $autoClaimReturnCheckout;
# if multiple hits, offer options to librarian
if ( $total_hits > 0 ) {
my @barcodes;
foreach my $hit ( @{$results} ) {
my $chosen = # Maybe easier to retrieve the itemnumber from $hit?
TransformMarcToKoha({ record => C4::Search::new_record_from_zebra('biblioserver',$hit) });
$claim->resolve(
{
resolution => $resolution,
resolved_by => $patron_id,
# offer all barcodes individually
if ( $chosen->{barcode} ) {
push @barcodes, sort split(/\s*\|\s*/, $chosen->{barcode});
}
);
$template_params->{CLAIM_RESOLUTION} = $claim;
}
}
}
if( $item and ( !$blocker or $force_allow_issue ) ){
my $confirm_required = 0;
unless($issueconfirmed){
# Get the item title for more information
my $materials = $item->materials;
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.materials', authorised_value => $materials });
$materials = $descriptions->{lib} // $materials;
$template_params->{ADDITIONAL_MATERIALS} = $materials;
$template_params->{itemhomebranch} = $item->homebranch;
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
foreach my $needsconfirmation_key ( keys %$needsconfirmation ) {
$template_params->{$needsconfirmation_key} = $needsconfirmation->{$needsconfirmation_key};
$template_params->{getTitleMessageIteminfo} = $biblio->title;
$template_params->{getBarcodeMessageIteminfo} = $item->barcode;
$template_params->{NEEDSCONFIRMATION} = 1;
$confirm_required = 1;
if ( $needsconfirmation_key eq 'BOOKED_TO_ANOTHER' ) {
my $reduceddue =
dt_from_string( $$needsconfirmation{$needsconfirmation_key}->start_date )->subtract( days => 1 );
$template_params->{reduceddue} = $reduceddue;
}
my $items = Koha::Items->search({ barcode => {-in => \@barcodes}});
$template_params->{options} = $items;
}
}
unless ($confirm_required) {
my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
my $recall = Koha::Recalls->find(
{
biblio_id => $item->biblionumber,
item_id => [ undef, $item->itemnumber ],
status => [ 'requested', 'waiting' ],
completed => 0,
patron_id => $patron->borrowernumber,
}
);
$recall_id = ( $recall and $recall->id ) ? $recall->id : undef;
}
# If booked (alerts or confirmation) update datedue to end of booking
if ( my $booked = $needsconfirmation->{BOOKED_EARLY} // $alerts->{BOOKED} ) {
$datedue = $booked->end_date;
# Only some errors will block when performing forced onsite checkout,
# for other cases all errors will block
my @blocking_error_codes =
( $onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce") )
? qw( UNKNOWN_BARCODE NO_OPEN_DAYS )
: ( keys %$issuingimpossible );
if ( $issuingimpossible->{BOOKED_TO_ANOTHER} ) {
$template_params->{BOOKED_TO_ANOTHER} = $issuingimpossible->{BOOKED_TO_ANOTHER};
$template_params->{IMPOSSIBLE} = 1;
$blocker = 1;
}
foreach my $code ( @blocking_error_codes ) {
if ($issuingimpossible->{$code}) {
$template_params->{$code} = $issuingimpossible->{$code};
$template_params->{IMPOSSIBLE} = 1;
$blocker = 1;
}
my $issue = AddIssue(
$patron, $barcode, $datedue,
$cancelreserve,
undef, undef,
}
delete $needsconfirmation->{'DEBT'} if ($debt_confirmed);
if ( $item && C4::Context->preference('ClaimReturnedLostValue') ) {
my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout');
my $claims = Koha::Checkouts::ReturnClaims->search(
{
onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'),
switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
recall_id => $recall_id,
itemnumber => $item->id,
resolution => undef,
}
);
$template_params->{issue} = $issue;
$session->clear('auto_renew');
$inprocess = 1;
if ( $claims->count ) {
if ($autoClaimReturnCheckout) {
my $claim = $claims->next;
my $patron_id = $logged_in_user->borrowernumber;
my $resolution = $autoClaimReturnCheckout;
$claim->resolve(
{
resolution => $resolution,
resolved_by => $patron_id,
}
);
$template_params->{CLAIM_RESOLUTION} = $claim;
}
}
}
}
if ($needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} or $needsconfirmation->{PROCESSING}){
$template->param(
reserveborrowernumber => $needsconfirmation->{'resborrowernumber'},
reserve_id => $needsconfirmation->{reserve_id},
);
}
if( $item and ( !$blocker or $force_allow_issue ) ){
my $confirm_required = 0;
unless($issueconfirmed){
# Get the item title for more information
my $materials = $item->materials;
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.materials', authorised_value => $materials });
$materials = $descriptions->{lib} // $materials;
$template_params->{ADDITIONAL_MATERIALS} = $materials;
$template_params->{itemhomebranch} = $item->homebranch;
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
foreach my $needsconfirmation_key ( keys %$needsconfirmation ) {
$template_params->{$needsconfirmation_key} = $needsconfirmation->{$needsconfirmation_key};
$template_params->{getTitleMessageIteminfo} = $biblio->title;
$template_params->{getBarcodeMessageIteminfo} = $item->barcode;
$template_params->{NEEDSCONFIRMATION} = 1;
$confirm_required = 1;
if ( $needsconfirmation_key eq 'BOOKED_TO_ANOTHER' ) {
my $reduceddue =
dt_from_string( $$needsconfirmation{$needsconfirmation_key}->start_date )->subtract( days => 1 );
$template_params->{reduceddue} = $reduceddue;
}
}
}
unless ($confirm_required) {
my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
my $recall = Koha::Recalls->find(
{
biblio_id => $item->biblionumber,
item_id => [ undef, $item->itemnumber ],
status => [ 'requested', 'waiting' ],
completed => 0,
patron_id => $patron->borrowernumber,
}
);
$recall_id = ( $recall and $recall->id ) ? $recall->id : undef;
}
# If booked (alerts or confirmation) update datedue to end of booking
if ( my $booked = $needsconfirmation->{BOOKED_EARLY} // $alerts->{BOOKED} ) {
$datedue = $booked->end_date;
}
my $issue = AddIssue(
$patron, $barcode, $datedue,
$cancelreserve,
undef, undef,
{
onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'),
switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall,
recall_id => $recall_id,
}
);
$template_params->{issue} = $issue;
$session->clear('auto_renew');
$inprocess = 1;
}
}
if ($needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} or $needsconfirmation->{PROCESSING}){
$template->param(
reserveborrowernumber => $needsconfirmation->{'resborrowernumber'},
reserve_id => $needsconfirmation->{reserve_id},
);
}
# FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
$patron = Koha::Patrons->find( $borrowernumber );
$template_params->{issuecount} = $patron->checkouts->count;
# FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
$patron = Koha::Patrons->find( $borrowernumber );
$template_params->{issuecount} = $patron->checkouts->count;
if ( $item ) {
$template_params->{item} = $item;
$template_params->{biblio} = $biblio;
$template_params->{itembiblionumber} = $biblio->biblionumber;
}
push @$checkout_infos, $template_params;
if ( $item ) {
$template_params->{item} = $item;
$template_params->{biblio} = $biblio;
$template_params->{itembiblionumber} = $biblio->biblionumber;
}
push @$checkout_infos, $template_params;
}
unless ( $batch ) {
$template->param( %{$checkout_infos->[0]} );

View File

@ -13,7 +13,6 @@ requires 'CGI::Carp', '1.29';
requires 'CGI::Compile', '>= 0.17, != 0.24';
requires 'CGI::Emulate::PSGI', '0.20';
requires 'CGI::Session', '4.2';
requires 'CPAN::Meta', '2.150006';
requires 'Cache::Memcached', '1.30';
requires 'Cache::Memcached::Fast::Safe', '0.06';
requires 'Class::Accessor', '0.3';

3
debian/list-deps vendored
View File

@ -27,10 +27,7 @@ use C4::Installer::PerlModules;
# apt-file can find, e.g. in the Koha repo rather than the regular
# debian one.
my %overrides = (
'LWP::Protocol::https' => 'liblwp-protocol-https-perl | libwww-perl (<<6.02), libio-socket-ssl-perl',
'HTTP::OAI' => 'libhttp-oai-perl (>= 3.2) | libhttp-oai-3.27-perl, libhttp-oai-perl (<< 4.0) | libhttp-oai-3.27-perl',
'IO::Socket::IP' => 'perl-modules (>= 5.20.0) | libio-socket-ip-perl',
'CPAN::Meta' => 'libcpan-meta-perl (>= 2.150010) | perl-modules-5.28 | perl-modules-5.30 | perl-modules (>= 5.20.2)',
'CGI::Compile' => 'libcgi-compile-perl (>= 0.25) | libcgi-compile-perl (<< 0.24)',
'DBD::SQLite' => 'libdbd-sqlite3-perl',
'Starman' => 'starman',

View File

@ -22,7 +22,7 @@ description:
tables:
- restriction_types:
translatable: []
translatable: [ display_text ]
multiline: []
rows:
- code: "MANUAL"

View File

@ -2948,7 +2948,7 @@ tables:
liblibrarian: "Originating Source"
libopac: "Originating Source"
repeatable: 1
mandatory: 1
mandatory: 0
authorised_value:
frameworkcode: ""
@ -3783,7 +3783,7 @@ tables:
liblibrarian: "Country Code"
libopac: "Country Code"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 0
authorised_value: COUNTRY
@ -3837,7 +3837,7 @@ tables:
liblibrarian: "Country Code"
libopac: "Country Code"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 0
authorised_value: COUNTRY
@ -4035,7 +4035,7 @@ tables:
liblibrarian: "Number of work"
libopac: "Number of work"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 0
authorised_value:
@ -4053,7 +4053,7 @@ tables:
liblibrarian: "Number of movement"
libopac: "Number of movement"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 0
authorised_value:
@ -4071,7 +4071,7 @@ tables:
liblibrarian: "Number of incipit"
libopac: "Number of incipit"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 0
authorised_value:
@ -4845,7 +4845,7 @@ tables:
liblibrarian: "Country of publication"
libopac: "Country of publication"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value: COUNTRY
@ -4899,7 +4899,7 @@ tables:
liblibrarian: "Monograph Coded Data"
libopac: "Monograph Coded Data"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -4917,7 +4917,7 @@ tables:
liblibrarian: "Form of resource: Coded Data: Medium Designator"
libopac: "Form of resource: Coded Data: Medium Designator"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -4953,7 +4953,7 @@ tables:
liblibrarian: "Coded Data - General"
libopac: "Coded Data - General"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5007,7 +5007,7 @@ tables:
liblibrarian: "Coded Data for Three-Dimensional Artefacts and Realia"
libopac: "Coded Data for Three-Dimensional Artefacts and Realia"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5025,7 +5025,7 @@ tables:
liblibrarian: "Cartographic Material Coded Data (General)"
libopac: "Cartographic Material Coded Data (General)"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5043,7 +5043,7 @@ tables:
liblibrarian: "Cartographic Material Coded Data: Physical attributes (General)"
libopac: "Cartographic Material Coded Data: Physical attributes (General)"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5079,7 +5079,7 @@ tables:
liblibrarian: "Time period, 9999 B.C. to present"
libopac: "Time period, 9999 B.C. to present"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5097,7 +5097,7 @@ tables:
liblibrarian: "Type of Scale"
libopac: "Type of Scale"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5547,7 +5547,7 @@ tables:
liblibrarian: "Sound Recording Coded Data (General)"
libopac: "Sound Recording Coded Data (General)"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5583,7 +5583,7 @@ tables:
liblibrarian: "Duration"
libopac: "Duration"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -5637,7 +5637,7 @@ tables:
liblibrarian: "Microform Coded Data Physical Attributes"
libopac: "Microform Coded Data Physical Attributes"
repeatable: 0
mandatory: 1
mandatory: 0
kohafield: ""
tab: 1
authorised_value:
@ -11325,7 +11325,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -11793,7 +11793,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -12261,7 +12261,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -12729,7 +12729,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -13197,7 +13197,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -13665,7 +13665,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -14133,7 +14133,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -14601,7 +14601,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -15069,7 +15069,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -15537,7 +15537,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -16005,7 +16005,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -16473,7 +16473,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -16941,7 +16941,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -17409,7 +17409,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -17877,7 +17877,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -18345,7 +18345,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -18813,7 +18813,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -19281,7 +19281,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -19749,7 +19749,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -20217,7 +20217,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -20685,7 +20685,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -21153,7 +21153,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -21621,7 +21621,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -22089,7 +22089,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -22557,7 +22557,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -23025,7 +23025,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -23493,7 +23493,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -23961,7 +23961,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -24429,7 +24429,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -24897,7 +24897,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -25365,7 +25365,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -25833,7 +25833,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -26301,7 +26301,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -26769,7 +26769,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -27237,7 +27237,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -27705,7 +27705,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -28173,7 +28173,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -28641,7 +28641,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -29109,7 +29109,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:
@ -29577,7 +29577,7 @@ tables:
liblibrarian: "Title"
libopac: "Title"
repeatable: 1
mandatory: 1
mandatory: 0
kohafield: ""
tab: 4
authorised_value:

View File

@ -451,7 +451,7 @@
</ul>
[% END %]
[% UNLESS error OR atomic_updates.error OR has_update_errors %]
[% UNLESS error OR atomic_updates.error.size OR has_update_errors %]
<p>Everything went okay. Update done.</p>
<p><a href="install.pl?step=3&amp;op=finished" class="btn btn-primary">Continue to log in to Koha</a></p>
[% ELSE %]

View File

@ -222,7 +222,7 @@
[% END %]
</div>
<form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validate">
<form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validated">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-add_validate" />
<input type="hidden" name="category" value="[% category | html %]" />
@ -262,8 +262,9 @@
</li>
[% END %]
<li>
<label for="from">Publication date: </label>
<input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickr" data-date_to="to" />
<label for="from" class="required">Publication date: </label>
<input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickr" data-date_to="to" required="required" class="required" />
<span class="required">Required</span>
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>

View File

@ -407,8 +407,10 @@ exit;
if ( $status == HTTP_UNAUTHORIZED || $status == HTTP_FORBIDDEN ) {
# Our token might have expired. Re-authenticate and post again.
$ua = _ua(); # fresh one, needs to authenticate
$self->{ua} = $ua;
$self->{csrf_token} = $self->authenticate;
$resp = $ua->post(
$resp = $ua->post(
$base_url . IMPORT_SVC_URI,
$post_body,
csrf_token => $self->{csrf_token},

View File

@ -858,10 +858,27 @@ subtest do_checkout_with_patron_blocked => sub {
};
subtest do_checkout_with_noblock => sub {
plan tests => 3;
plan tests => 1;
my $mockILS = Test::MockObject->new;
my $server = { ils => $mockILS };
my $library = $builder->build_object( { class => 'Koha::Libraries' } );
my $patron = $builder->build_object(
my $institution = {
id => $library->id,
implementation => "ILS",
policy => {
checkin => "true",
renewal => "true",
checkout => "true",
timeout => 100,
retries => 5,
}
};
my $ils = C4::SIP::ILS->new($institution);
my $patron = $builder->build_object(
{
class => 'Koha::Patrons',
value => {
@ -879,21 +896,15 @@ subtest do_checkout_with_noblock => sub {
}
);
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
my $co_transaction = C4::SIP::ILS::Transaction::Checkout->new();
is(
$co_transaction->patron($sip_patron),
$sip_patron, "Patron assigned to transaction"
);
is(
$co_transaction->item($sip_item),
$sip_item, "Item assigned to transaction"
);
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber );
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode );
$co_transaction->do_checkout( undef, '19990102 030405' );
my $circ =
$ils->checkout( $patron->cardnumber, $item->barcode, undef, undef,
$server->{account}, '19990102 030405' );
is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron' );
is( $patron->checkouts->count,
1, 'No Block checkout was performed for debarred patron' );
};
subtest do_checkout_with_holds => sub {
@ -917,7 +928,8 @@ subtest do_checkout_with_holds => sub {
}
);
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode, flags => 1 } );
t::lib::Mocks::mock_userenv(
{ branchcode => $library->branchcode, flags => 1 } );
my $item = $builder->build_sample_item(
{

View File

@ -36,6 +36,7 @@ use C4::Circulation qw( AddIssue AddReturn );
use Koha::Biblios;
use Koha::Database;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Checkouts;
use Koha::Old::Checkouts;
@ -164,7 +165,7 @@ subtest 'get() tests' => sub {
subtest 'list() tests' => sub {
plan tests => 17;
plan tests => 21;
$schema->storage->txn_begin;
@ -228,6 +229,27 @@ subtest 'list() tests' => sub {
$t->get_ok( "//$userid:$password@/api/v1/deleted/biblios?q=$query" => { Accept => 'text/plain' } )->status_is(200);
my $old_biblio_1 = Koha::Old::Biblios->find($biblio_id_1);
my $old_biblio_2 = Koha::Old::Biblios->find($biblio_id_2);
$old_biblio_1->set( { timestamp => dt_from_string('2024-12-12T17:33:57+00:00') } )->store();
$old_biblio_2->set( { timestamp => dt_from_string('2024-12-11T17:33:57+00:00') } )->store();
$query = encode_json(
{
"-and" => [
{ 'me.deleted_on' => { '>=' => '2024-12-12T00:00:00+00:00' } },
[
{ biblio_id => $old_biblio_1->id },
{ biblio_id => $old_biblio_2->id },
]
]
}
);
$t->get_ok( "//$userid:$password@/api/v1/deleted/biblios?q=$query" => { Accept => 'application/json' } )
->status_is(200)->json_is( '/0/biblio_id' => $old_biblio_1->id )->json_is( '/1/biblio_id' => undef );
# DELETE any biblio with ISBN = TOMAS
Koha::Biblios->search( { 'biblioitem.isbn' => 'TOMAS' }, { join => ['biblioitem'] } )->delete;

View File

@ -216,9 +216,9 @@ if ( $op eq 'cud-inventory'
err_data => $err_data );
}
my @items = Koha::Items->search( { barcode => { -in => \@barcodes } } )->as_list;
my %items = map { $_->barcode => $_ } @items;
my %items = map { lc($_->barcode) => $_ } @items;
foreach my $barcode (@barcodes) {
my $item = $items{ $barcode };
my $item = $items{ lc($barcode) };
if ( $item ) {
if ( $item->withdrawn ) {
push @errorloop, { 'barcode' => $barcode, 'ERR_WTHDRAWN' => 1 };