Bugzilla – Attachment 162055 Details for
Bug 6796
Overnight checkouts taking into account opening and closing hours
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6796: Merge and correct database update
Bug-6796-Merge-and-correct-database-update.patch (text/plain), 3.15 KB, created by
Martin Renvoize (ashimema)
on 2024-02-12 15:50:48 UTC
(
hide
)
Description:
Bug 6796: Merge and correct database update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-02-12 15:50:48 UTC
Size:
3.15 KB
patch
obsolete
>From e37adbc6d4b6d181dff7a8a782e6b7313dc80749 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 12 Feb 2024 15:21:08 +0000 >Subject: [PATCH] Bug 6796: Merge and correct database update > >--- > ...nsiderLibraryHoursInCirculation_syspref.pl | 16 -------------- > .../bug_6796_-_add_library_hours_table.pl | 21 +++++++++++++------ > 2 files changed, 15 insertions(+), 22 deletions(-) > delete mode 100755 installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursInCirculation_syspref.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursInCirculation_syspref.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursInCirculation_syspref.pl >deleted file mode 100755 >index 823504319ae..00000000000 >--- a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursInCirculation_syspref.pl >+++ /dev/null >@@ -1,16 +0,0 @@ >-use Modern::Perl; >- >-return { >- bug_number => "6796", >- description => "Overnight checkouts taking into account opening and closing hours", >- up => sub { >- my ($args) = @_; >- my ( $dbh, $out ) = @$args{qw(dbh out)}; >- >- $dbh->do( >- q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'ConsiderLibraryHoursInCirculation', 'ignore', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when circulating.", 'Choice' ) } >- ); >- >- say $out "Added system preference 'ConsiderLibraryHoursInCirculation'"; >- }, >-}; >diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_library_hours_table.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_library_hours_table.pl >index f3a506c806d..a275d67d327 100755 >--- a/installer/data/mysql/atomicupdate/bug_6796_-_add_library_hours_table.pl >+++ b/installer/data/mysql/atomicupdate/bug_6796_-_add_library_hours_table.pl >@@ -21,15 +21,24 @@ return { > } > ); > >- my @indexes = ( 0 .. 6 ); >- for my $i (@indexes) { >- $dbh->do( >- q{ INSERT INTO library_hours (library_id, day) SELECT branchcode, ? FROM branches }, undef, >- $i >- ); >+ my $branches = >+ $dbh->selectall_arrayref( "SELECT branchcode FROM branches", { Slice => {} } ); >+ for my $branch (@$branches) { >+ my $branchcode = $branch->{branchcode}; >+ >+ my @indexes = ( 0 .. 6 ); >+ for my $i (@indexes) { >+ $dbh->do( q{ INSERT INTO library_hours (library_id, day) VALUES ( ?, ? ) }, undef, $branchcode, $i ); >+ } > } > > say $out "Added table `library_hours`"; >+ >+ $dbh->do( >+ q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'ConsiderLibraryHoursInCirculation', 'ignore', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when circulating.", 'Choice' ) } >+ ); >+ >+ say $out "Added system preference 'ConsiderLibraryHoursInCirculation'"; > } > }, > }; >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6796
:
124669
|
124670
|
124671
|
124672
|
134323
|
134324
|
134325
|
134326
|
134327
|
145669
|
145670
|
145671
|
145672
|
145673
|
146988
|
146989
|
146990
|
146991
|
146992
|
150442
|
150443
|
150444
|
150445
|
150446
|
150447
|
150448
|
150477
|
150478
|
153252
|
153253
|
153254
|
153255
|
153256
|
153257
|
153258
|
153259
|
153260
|
153261
|
153271
|
153272
|
153273
|
153274
|
153275
|
153276
|
153277
|
153278
|
153279
|
153280
|
156772
|
156773
|
156774
|
156775
|
156776
|
156777
|
156778
|
156779
|
156780
|
161970
|
161971
|
161972
|
161973
|
161974
|
161975
|
161976
|
161977
|
161978
|
161979
|
161980
|
161986
|
161987
|
161988
|
161989
|
162043
|
162044
|
162045
|
162046
|
162047
|
162048
|
162049
|
162050
|
162051
|
162052
|
162053
|
162054
|
162055
|
162056
|
162090
|
162091
|
162092
|
162093
|
162094
|
162095
|
162096
|
162097
|
162098
|
162099
|
162100
|
162101
|
162102
|
162103
|
162104
|
164511
|
164512
|
164513
|
164514
|
164515
|
164516
|
164517
|
164518
|
164538
|
164539
|
164540
|
164541
|
164542
|
164543
|
164544
|
164545
|
164546
|
164547
|
164548
|
164549
|
164550
|
164551
|
164552