@@ -, +, @@ --- Koha/RestrictionType.pm | 4 ++-- .../bug_23681_add_PatronRestrictionTypes_syspref.perl | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) --- a/Koha/RestrictionType.pm +++ a/Koha/RestrictionType.pm @@ -42,10 +42,10 @@ sub delete { my ( $self ) = @_; # Find out what the default is - my $default = Koha::RestrictionTypes->find({ dflt => 1 })->code; + my $default = Koha::RestrictionTypes->find({ is_system => 1 })->code; # Ensure we're not trying to delete a readonly type (this includes # the default type) - return 0 if $self->ronly == 1; + return 0 if $self->readonly == 1; # We can't use Koha objects here because Koha::Patron::Debarments # is not a Koha object. So we'll do it old skool my $rows = C4::Context->dbh->do( --- a/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl +++ a/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl @@ -1,6 +1,6 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('PatronRestrictionTypes', '0', 'If enabled, it is possible to specify the "type" of patron restriction being applied', '', 'YesNo'); | ); + $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('PatronRestrictionTypes', '0', 'If enabled, it is possible to specify the "type" of patron restriction being applied.', '', 'YesNo'); | ); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 23681 - Add PatronRestrictionTypes syspref)\n"; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -332,9 +332,9 @@ Patrons: - - pref: PatronRestrictionTypes choices: - yes: Allow - no: Don't allow - - "the type of patron restriction to be specified when applying manually" + 1: Allow + 0: Don't allow + - "the type of patron restriction to be specified when applying manually." Privacy: - --