Bugzilla – Attachment 189064 Details for
Bug 41101
Allow extended patron attribute to be non-editable in the staff interface.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41101: DB Updates
Bug-41101-DB-Updates.patch (text/plain), 3.35 KB, created by
CJ Lynce
on 2025-11-04 20:52:13 UTC
(
hide
)
Description:
Bug 41101: DB Updates
Filename:
MIME Type:
Creator:
CJ Lynce
Created:
2025-11-04 20:52:13 UTC
Size:
3.35 KB
patch
obsolete
>From e5a55ad5559b79e7e33b23a5f4f466cdeb105f16 Mon Sep 17 00:00:00 2001 >From: CJ Lynce <cj.lynce@westlakelibrary.org> >Date: Sat, 25 Oct 2025 17:58:00 +0000 >Subject: [PATCH] Bug 41101: DB Updates > >--- > Koha/Schema/Result/BorrowerAttributeType.pm | 2 ++ > .../bug_41101_add_staff_editable.pl | 33 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 3 files changed, 36 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_41101_add_staff_editable.pl > >diff --git a/Koha/Schema/Result/BorrowerAttributeType.pm b/Koha/Schema/Result/BorrowerAttributeType.pm >index 36bf42d4c9..bdf4f6a94d 100644 >--- a/Koha/Schema/Result/BorrowerAttributeType.pm >+++ b/Koha/Schema/Result/BorrowerAttributeType.pm >@@ -188,6 +188,8 @@ __PACKAGE__->add_columns( > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > "opac_mandatory", > { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+ "staff_viewonly", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, > ); > > =head1 PRIMARY KEY >diff --git a/installer/data/mysql/atomicupdate/bug_41101_add_staff_editable.pl b/installer/data/mysql/atomicupdate/bug_41101_add_staff_editable.pl >new file mode 100644 >index 0000000000..70a73ed33b >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_41101_add_staff_editable.pl >@@ -0,0 +1,33 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "41101", >+ description => "Add staff_viewonly column to borrower_attribute_type table", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ if ( !column_exists( 'borrower_attribute_types', 'staff_viewonly' ) ) { >+ >+ $dbh->do( >+ q{ >+ ALTER TABLE borrower_attribute_types >+ ADD COLUMN `staff_viewonly` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is view-only by staff in the staff interface' >+ AFTER `opac_mandatory` >+ } >+ ); >+ >+ say $out "Added column 'borrower_attribute_types.staff_viewonly'"; >+ >+ $dbh->do( >+ q{ >+ UPDATE borrower_attribute_types >+ SET staff_viewonly = 0; >+ } >+ ); >+ say $out "Update staff_viewonly to make all existing attributes editable by default"; >+ } >+ }, >+ >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 1e57660d28..67ae75d6cc 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1263,6 +1263,7 @@ CREATE TABLE `borrower_attribute_types` ( > `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)', > `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the staff interface', > `opac_mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the OPAC', >+ `staff_viewonly` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is view-only by staff in the staff interface', > PRIMARY KEY (`code`), > KEY `auth_val_cat_idx` (`authorised_value_category`), > KEY `category_code` (`category_code`), >-- >2.39.5
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 41101
: 189064 |
189065