From f87bb01b858832b0d1922caf318ffa80fae5503a Mon Sep 17 00:00:00 2001 From: Phan Tung Bui Date: Thu, 29 Feb 2024 15:05:55 -0500 Subject: [PATCH] Bug 35145 : (follow-up) Rename number to display_order --- admin/patron-attr-types.pl | 4 ++-- .../bug_35145_order_patron_attributes.pl | 4 ++-- installer/data/mysql/kohastructure.sql | 2 +- .../prog/en/modules/admin/patron-attr-types.tt | 12 ++++++------ members/memberentry.pl | 2 +- opac/opac-memberentry.pl | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index 720a929715..dff581876a 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -124,7 +124,7 @@ sub add_update_attribute_type { my $display_checkout = $input->param('display_checkout') ? 1 : 0; my $category_code = $input->param('category_code') || undef; my $class = $input->param('class'); - my $number = $input->param('number') || undef; + my $display_order = $input->param('display_order') || undef; my $attr_type = Koha::Patron::Attribute::Types->find($code); if ( $op eq 'edit' ) { @@ -161,7 +161,7 @@ sub add_update_attribute_type { display_checkout => $display_checkout, category_code => $category_code, class => $class, - number => $number, + display_order => $display_order, } )->store; diff --git a/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl b/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl index 9fe71f2edd..b1650cd378 100755 --- a/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl +++ b/installer/data/mysql/atomicupdate/bug_35145_order_patron_attributes.pl @@ -2,7 +2,7 @@ use Modern::Perl; return { bug_number => "35145", - description => "Add number column to borrower_attribute_types table", + description => "Add display_order column to borrower_attribute_types table", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; @@ -11,7 +11,7 @@ return { $dbh->do( q{ ALTER TABLE borrower_attribute_types - ADD number int(11); + ADD display_order int(11); } ); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index d47818605f..65c3a45ed3 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1242,7 +1242,7 @@ CREATE TABLE `borrower_attribute_types` ( `class` varchar(255) NOT NULL DEFAULT '' COMMENT 'defines a class for an attribute_type', `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', - `number` int(11) DEFAULT NULL COMMENT 'the order in which this attribute type appears in patron form', + `display_order` int(11) DEFAULT NULL COMMENT 'the order in which this attribute type appears in patron form', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code` (`category_code`), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt index ec89b1d548..c69dc4657a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt @@ -105,11 +105,11 @@ Required
  • - - [% IF ( attribute_type.number ) %] - + + [% IF ( attribute_type.display_order ) %] + [% ELSE %] - + [% END %]
  • @@ -325,7 +325,7 @@ Authorized value category Mandatory Searching - Number + Display order Actions @@ -376,7 +376,7 @@ Not searchable [% END %] - [% item.number | html %] + [% item.display_order | html %] Edit Delete diff --git a/members/memberentry.pl b/members/memberentry.pl index 790b47f046..1eff46b46d 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -866,7 +866,7 @@ sub patron_attributes_form { my $op = shift; my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; - my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, { order_by => 'number' }, $library_id); + my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, { order_by => 'display_order' }, $library_id); if ( $attribute_types->count == 0 ) { $template->param(no_patron_attribute_types => 1); return; diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 064e8389a9..53964222bc 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -672,7 +672,7 @@ sub GeneratePatronAttributesForm { # Get all attribute types and the values for this patron (if applicable) my @types = grep { $_->opac_editable() or $_->opac_display } # FIXME filter using DBIC - Koha::Patron::Attribute::Types->search( {}, { order_by => 'number' } )->as_list(); + Koha::Patron::Attribute::Types->search( {}, { order_by => 'display_order' } )->as_list(); if ( scalar(@types) == 0 ) { return []; } -- 2.34.1