Bugzilla – Attachment 168404 Details for
Bug 7223
Move borrowerRelationship to authorised values list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7223: DB updates
Bug-7223-DB-updates.patch (text/plain), 5.58 KB, created by
Sam Lau
on 2024-07-02 20:58:38 UTC
(
hide
)
Description:
Bug 7223: DB updates
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-07-02 20:58:38 UTC
Size:
5.58 KB
patch
obsolete
>From bb755344090a22d42b1c43ef5512c43ee3439a26 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Mon, 1 Jul 2024 20:37:57 +0000 >Subject: [PATCH] Bug 7223: DB updates > >This patch adds a new authorized value category 'BORR_RELATIONSHIP' and removes the 'borrowerRelationship' system preference >--- > installer/data/mysql/atomicupdate/bug_7223.pl | 49 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../en/modules/admin/authorised_values.tt | 2 + > .../en/modules/admin/preferences/patrons.pref | 5 -- > 4 files changed, 51 insertions(+), 6 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_7223.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_7223.pl b/installer/data/mysql/atomicupdate/bug_7223.pl >new file mode 100755 >index 0000000000..e337a6c31e >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_7223.pl >@@ -0,0 +1,49 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "7223", >+ description => "Add BOR_RELATIONSHIP", >+ up => sub { >+ my ($args) = @_; >+ >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ # Step 1: Create the authorized value category >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_value_categories (category_name, is_system) >+ VALUES ('BOR_RELATIONSHIP', 1) >+ }); >+ >+ say $out "Added BOR_RELATIONSHIP authorized value category"; >+ >+ # Step 2: Fetch existing borrowerRelationship values >+ my $sth = $dbh->prepare(q{ >+ SELECT value FROM systempreferences WHERE variable = 'borrowerRelationship' >+ }); >+ $sth->execute(); >+ my ($pipe_delimited_values) = $sth->fetchrow_array; >+ >+ # Check if we got any values >+ if (defined $pipe_delimited_values) { >+ # Step 3: Split the pipe-delimited values >+ my @values = split(/\|/, $pipe_delimited_values); >+ >+ # Step 4: Insert each value into the authorised_values table >+ for my $value (@values) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO authorised_values (category, authorised_value) >+ VALUES ('BOR_RELATIONSHIP', ?) >+ }, undef, $value); >+ } >+ >+ say $out "Transferred borrowerRelationship values to authorized values"; >+ } >+ >+ $dbh->do(q{ >+ DELETE FROM systempreferences WHERE variable='borrowerRelationship' >+ }); >+ >+ say $out "Deleted system preference 'borrowerRelationship'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 0496d3fd48..408ebb616f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -121,7 +121,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'), > ('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'), > ('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'), >-('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'), > ('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'), > ('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'), > ('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'), >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 3203d1c61b..2af64a7d86 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 >@@ -453,6 +453,8 @@ > <p>Used for acquisitions statistical purposes</p> > [% CASE 'BOR_NOTES' %] > <p>Values for custom patron messages that appear on the circulation screen and the OPAC. The value in the description field should be the message text and is limited to 200 characters</p> >+ [% CASE 'BOR_RELATIONSHIP' %] >+ <p>Values for valid relationships between a guarantor and a guarantee</p> > [% CASE 'branches' %] > <p></p> > [% CASE 'Bsort1' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index d2976e2d43..9f89abaddc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -338,11 +338,6 @@ Patrons: > source: borrowers > - "will be used to detect possible duplicates when adding a new patron." > Patron relationships: >- - >- - "Guarantors can be the following of those they guarantee:" >- - pref: borrowerRelationship >- class: multi >- - (input multiple choices separated by |). > - > - "When adding a guarantee to a guarantor, whether it's from the guarantor's form or the guarantee's form, fill the following fields in the guarantee's member entry form from the guarantors record:" > - pref: PrefillGuaranteeField >-- >2.39.2
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 7223
: 168404 |
168405