Bugzilla – Attachment 148825 Details for
Bug 32610
Add ability to specify patron attribute as a date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32610: Add borrower_attribute_types.is_date to the database
Bug-32610-Add-borrowerattributetypesisdate-to-the-.patch (text/plain), 3.23 KB, created by
Philip Orr
on 2023-03-28 14:00:44 UTC
(
hide
)
Description:
Bug 32610: Add borrower_attribute_types.is_date to the database
Filename:
MIME Type:
Creator:
Philip Orr
Created:
2023-03-28 14:00:44 UTC
Size:
3.23 KB
patch
obsolete
>From e9498a815287fcb25f5796438c6af45272b96f67 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sat, 18 Mar 2023 00:08:28 +0000 >Subject: [PATCH] Bug 32610: Add borrower_attribute_types.is_date to the > database > >* Change to kohastructure.sql for new installations >* Atomic database update to add the column for updating > installations > >Signed-off-by: Philip Orr <philip.orr@lmscloud.de> >--- > Koha/Schema/Result/BorrowerAttributeType.pm | 4 ++++ > .../bug_32610_patron_attr_type_date.pl | 15 +++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 3 files changed, 20 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_32610_patron_attr_type_date.pl > >diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm >index 9a4b7125ce..bd1bbba124 100644 >--- a/Koha/Schema/Result/BorrowerAttributeType.pm >+++ b/Koha/Schema/Result/BorrowerAttributeType.pm >@@ -251,6 +251,10 @@ __PACKAGE__->add_columns( > '+mandatory' => { is_boolean => 1 }, > ); > >+__PACKAGE__->add_columns( >+ '+is_date' => { is_boolean => 1 }, >+); >+ > sub koha_object_class { > 'Koha::Patron::Attribute::Type'; > } >diff --git a/installer/data/mysql/atomicupdate/bug_32610_patron_attr_type_date.pl b/installer/data/mysql/atomicupdate/bug_32610_patron_attr_type_date.pl >new file mode 100755 >index 0000000000..f6d8002ead >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32610_patron_attr_type_date.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32610", >+ description => "Add option for additional patron attributes of type date", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ unless ( column_exists( 'borrower_attribute_types', 'is_date' ) ) { >+ $dbh->do(q{ALTER TABLE borrower_attribute_types >+ ADD COLUMN `is_date` tinyint(1) NOT NULL default 0 AFTER `unique_id`}); >+ say $out "Added column 'borrower_attribute_types.is_date'"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a3faa37d79..106c0d7e3f 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1127,6 +1127,7 @@ CREATE TABLE `borrower_attribute_types` ( > `description` varchar(255) NOT NULL COMMENT 'description for each custom field', > `repeatable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines whether one patron/borrower can have multiple values for this custom field (1 for yes, 0 for no)', > `unique_id` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this value needs to be unique (1 for yes, 0 for no)', >+ `is_date` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is displayed as a date', > `opac_display` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is visible to patrons on their account in the OPAC (1 for yes, 0 for no)', > `opac_editable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is editable by patrons on their account in the OPAC (1 for yes, 0 for no)', > `staff_searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is searchable via the patron search in the staff interface (1 for yes, 0 for no)', >-- >2.30.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 32610
:
148400
|
148401
|
148402
|
148403
|
148404
|
148405
|
148825
|
148826
|
148827
|
148828
|
148829
|
148830
|
157862
|
157863
|
157864
|
157865
|
157866
|
157867
|
157868
|
158994
|
158995
|
158996
|
158997
|
158998
|
158999
|
159000
|
165747
|
165750
|
165854
|
165855
|
165856
|
165857
|
165858
|
165859
|
165860
|
165861
|
165862
|
165863
|
165864
|
165865
|
165925
|
165926