View | Details | Raw Unified | Return to bug 41101
Collapse All | Expand All

(-)a/Koha/Schema/Result/BorrowerAttributeType.pm (+2 lines)
Lines 188-193 __PACKAGE__->add_columns( Link Here
188
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
188
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
189
  "opac_mandatory",
189
  "opac_mandatory",
190
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
190
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
191
  "staff_viewonly",
192
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
191
);
193
);
192
194
193
=head1 PRIMARY KEY
195
=head1 PRIMARY KEY
(-)a/installer/data/mysql/atomicupdate/bug_41101_add_staff_editable.pl (+33 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "41101",
6
    description => "Add staff_viewonly column to borrower_attribute_type table",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( !column_exists( 'borrower_attribute_types', 'staff_viewonly' ) ) {
12
13
            $dbh->do(
14
                q{
15
                    ALTER TABLE borrower_attribute_types
16
                    ADD COLUMN `staff_viewonly` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is view-only by staff in the staff interface'
17
                    AFTER `opac_mandatory`
18
                }
19
            );
20
21
            say $out "Added column 'borrower_attribute_types.staff_viewonly'";
22
23
            $dbh->do(
24
                q{
25
                UPDATE borrower_attribute_types
26
                SET staff_viewonly = 0;
27
            }
28
            );
29
            say $out "Update staff_viewonly to make all existing attributes editable by default";
30
        }
31
    },
32
33
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 1263-1268 CREATE TABLE `borrower_attribute_types` ( Link Here
1263
  `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)',
1263
  `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)',
1264
  `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the staff interface',
1264
  `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the staff interface',
1265
  `opac_mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the OPAC',
1265
  `opac_mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the OPAC',
1266
  `staff_viewonly` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is view-only by staff in the staff interface',
1266
  PRIMARY KEY (`code`),
1267
  PRIMARY KEY (`code`),
1267
  KEY `auth_val_cat_idx` (`authorised_value_category`),
1268
  KEY `auth_val_cat_idx` (`authorised_value_category`),
1268
  KEY `category_code` (`category_code`),
1269
  KEY `category_code` (`category_code`),
1269
- 

Return to bug 41101