From a4ab63cec54ee78e160856a222b7496500c89a75 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 29 Sep 2023 13:22:17 +0000 Subject: [PATCH] Bug 33845: Tidy and add update Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_33845.pl | 19 ++++++ svc/holds | 61 +++++++++---------- 2 files changed, 48 insertions(+), 32 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_33845.pl diff --git a/installer/data/mysql/atomicupdate/bug_33845.pl b/installer/data/mysql/atomicupdate/bug_33845.pl new file mode 100755 index 0000000000..32367ed602 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33845.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => "33845", + description => "Update holds_table column settings entries to holds-table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + UPDATE columns_settings SET tablename="holds-table" + WHERE page="circulation" and tablename="holds_table" + } + ); + + say $out "Update columns settings to use table name holds-table"; + }, +}; diff --git a/svc/holds b/svc/holds index 49888cdaf2..dde088e16a 100755 --- a/svc/holds +++ b/svc/holds @@ -92,40 +92,37 @@ while ( my $h = $holds_rs->next() ) { my $biblio = $h->biblio(); my @subtitles = split(/ \| /, $biblio->subtitle() // ''); my $hold = { - DT_RowId => $h->reserve_id(), - biblionumber => $biblionumber, - title => $biblio->title(), - subtitle => \@subtitles, - medium => $biblio->medium() // '', - part_number => $biblio->part_number() // '', - part_name => $biblio->part_name() // '', - author => $biblio->author(), - reserve_id => $h->reserve_id(), - branchcode => $h->branch()->branchname(), - branches => $libraries, - desk_name => $desk_name, - reservedate => $h->reservedate(), - expirationdate => $h->expirationdate(), - suspend => $h->suspend(), - suspend_until => $h->suspend_until(), - found => $h->found(), - waiting => $h->is_waiting(), - waiting_at => $h->branch()->branchname(), - waiting_here => $h->branch()->branchcode() eq $branch, - priority => $h->priority(), - reservenotes => $h->reservenotes(), - itemtype_limit => $itemtype_limit, - reservedate_formatted => $h->reservedate() ? output_pref( - { dt => dt_from_string( $h->reservedate() ), dateonly => 1 } - ) + DT_RowId => $h->reserve_id(), + biblionumber => $biblionumber, + title => $biblio->title(), + subtitle => \@subtitles, + medium => $biblio->medium() // '', + part_number => $biblio->part_number() // '', + part_name => $biblio->part_name() // '', + author => $biblio->author(), + reserve_id => $h->reserve_id(), + branchcode => $h->branch()->branchname(), + branches => $libraries, + desk_name => $desk_name, + reservedate => $h->reservedate(), + expirationdate => $h->expirationdate(), + suspend => $h->suspend(), + suspend_until => $h->suspend_until(), + found => $h->found(), + waiting => $h->is_waiting(), + waiting_at => $h->branch()->branchname(), + waiting_here => $h->branch()->branchcode() eq $branch, + priority => $h->priority(), + reservenotes => $h->reservenotes(), + itemtype_limit => $itemtype_limit, + reservedate_formatted => $h->reservedate() + ? output_pref( { dt => dt_from_string( $h->reservedate() ), dateonly => 1 } ) : q{}, - suspend_until_formatted => $h->suspend_until() ? output_pref( - { dt => dt_from_string( $h->suspend_until() ), dateonly => 1 } - ) + suspend_until_formatted => $h->suspend_until() + ? output_pref( { dt => dt_from_string( $h->suspend_until() ), dateonly => 1 } ) : q{}, - expirationdate_formatted => $h->expirationdate() ? output_pref( - { dt => dt_from_string( $h->expirationdate() ), dateonly => 1 } - ) + expirationdate_formatted => $h->expirationdate() + ? output_pref( { dt => dt_from_string( $h->expirationdate() ), dateonly => 1 } ) : q{}, }; -- 2.30.2