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

(-)a/Koha/RestrictionType.pm (-2 / +2 lines)
Lines 42-51 sub delete { Link Here
42
    my ( $self ) = @_;
42
    my ( $self ) = @_;
43
43
44
    # Find out what the default is
44
    # Find out what the default is
45
    my $default = Koha::RestrictionTypes->find({ dflt => 1 })->code;
45
    my $default = Koha::RestrictionTypes->find({ is_system => 1 })->code;
46
    # Ensure we're not trying to delete a readonly type (this includes
46
    # Ensure we're not trying to delete a readonly type (this includes
47
    # the default type)
47
    # the default type)
48
    return 0 if $self->ronly == 1;
48
    return 0 if $self->readonly == 1;
49
    # We can't use Koha objects here because Koha::Patron::Debarments
49
    # We can't use Koha objects here because Koha::Patron::Debarments
50
    # is not a Koha object. So we'll do it old skool
50
    # is not a Koha object. So we'll do it old skool
51
    my $rows = C4::Context->dbh->do(
51
    my $rows = C4::Context->dbh->do(
(-)a/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl (-1 / +1 lines)
Lines 1-6 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    $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'); | );
3
    $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'); | );
4
    SetVersion( $DBversion );
4
    SetVersion( $DBversion );
5
    print "Upgrade to $DBversion done (Bug 23681 - Add PatronRestrictionTypes syspref)\n";
5
    print "Upgrade to $DBversion done (Bug 23681 - Add PatronRestrictionTypes syspref)\n";
6
}
6
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-4 / +3 lines)
Lines 332-340 Patrons: Link Here
332
     -
332
     -
333
         - pref: PatronRestrictionTypes
333
         - pref: PatronRestrictionTypes
334
           choices:
334
           choices:
335
               yes: Allow
335
               1: Allow
336
               no: Don't allow
336
               0: Don't allow
337
         - "the type of patron restriction to be specified when applying manually"
337
         - "the type of patron restriction to be specified when applying manually."
338
338
339
    Privacy:
339
    Privacy:
340
     -
340
     -
341
- 

Return to bug 23681