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

(-)a/installer/data/mysql/atomicupdate/bug_23681_add_debarment_types.perl (-3 / +3 lines)
Lines 7-18 if ( CheckVersion( $DBversion ) ) { Link Here
7
            CREATE TABLE debarment_types (
7
            CREATE TABLE debarment_types (
8
                code varchar(50) NOT NULL PRIMARY KEY,
8
                code varchar(50) NOT NULL PRIMARY KEY,
9
                display_text text NOT NULL,
9
                display_text text NOT NULL,
10
                ronly tinyint(1) NOT NULL DEFAULT 0,
10
                readonly tinyint(1) NOT NULL DEFAULT 0,
11
                dflt tinyint(1) NOT NULL DEFAULT 0
11
                system tinyint(1) NOT NULL DEFAULT 0
12
            ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
12
            ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
13
        | );
13
        | );
14
        $dbh->do( q|
14
        $dbh->do( q|
15
            INSERT INTO debarment_types (code, display_text, ronly, dflt) VALUES
15
            INSERT INTO debarment_types (code, display_text, readonly, system) VALUES
16
            ('MANUAL', 'Manual', 1, 1),
16
            ('MANUAL', 'Manual', 1, 1),
17
            ('OVERDUES', 'Overdues', 1, 0),
17
            ('OVERDUES', 'Overdues', 1, 0),
18
            ('SUSPENSION', 'Suspension', 1, 0),
18
            ('SUSPENSION', 'Suspension', 1, 0),
(-)a/installer/data/mysql/en/mandatory/patron_restrictions.sql (-1 / +1 lines)
Lines 1-4 Link Here
1
INSERT INTO debarment_types (code, display_text, ronly, dflt) VALUES
1
INSERT INTO debarment_types (code, display_text, readonly, system) VALUES
2
    ('MANUAL', 'Manual', 1, 1),
2
    ('MANUAL', 'Manual', 1, 1),
3
    ('OVERDUES', 'Overdues', 1, 0),
3
    ('OVERDUES', 'Overdues', 1, 0),
4
    ('SUSPENSION', 'Suspension', 1, 0),
4
    ('SUSPENSION', 'Suspension', 1, 0),
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 2015-2022 DROP TABLE IF EXISTS `debarment_types`; Link Here
2015
CREATE TABLE debarment_types (
2015
CREATE TABLE debarment_types (
2016
    code varchar(50) NOT NULL PRIMARY KEY,
2016
    code varchar(50) NOT NULL PRIMARY KEY,
2017
    display_text text NOT NULL,
2017
    display_text text NOT NULL,
2018
    ronly tinyint(1) NOT NULL DEFAULT 0,
2018
    readonly tinyint(1) NOT NULL DEFAULT 0,
2019
    dflt tinyint(1) NOT NULL DEFAULT 0
2019
    is_system tinyint(1) NOT NULL DEFAULT 0
2020
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2020
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2021
2021
2022
--
2022
--
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt (-2 / +2 lines)
Lines 170-180 Link Here
170
                            [% restriction.display_text | html %]
170
                            [% restriction.display_text | html %]
171
                        </td>
171
                        </td>
172
                        <td>
172
                        <td>
173
                            [% IF restriction.dflt %]Yes[% END %]
173
                            [% IF restriction.is_system %]Yes[% END %]
174
                        </td>
174
                        </td>
175
                        <td class="actions">
175
                        <td class="actions">
176
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=add_form&amp;code=[% restriction.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
176
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=add_form&amp;code=[% restriction.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
177
                            [% IF !restriction.ronly %]
177
                            [% IF !restriction.readonly %]
178
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=delete_confirm&amp;code=[% restriction.code | uri %]"><i class="fa fa-trash"></i> Delete</a>
178
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=delete_confirm&amp;code=[% restriction.code | uri %]"><i class="fa fa-trash"></i> Delete</a>
179
                            [% END %]
179
                            [% END %]
180
                        </td>
180
                        </td>
(-)a/t/db_dependent/RestrictionType.t (-8 / +8 lines)
Lines 24-31 $builder->build({ Link Here
24
    value  => {
24
    value  => {
25
        code         => 'ONE',
25
        code         => 'ONE',
26
        display_text => 'One',
26
        display_text => 'One',
27
        ronly        => 1,
27
        readonly     => 1,
28
        dflt         => 0
28
        is_system    => 0
29
    }
29
    }
30
});
30
});
31
$builder->build({
31
$builder->build({
Lines 33-40 $builder->build({ Link Here
33
    value  => {
33
    value  => {
34
        code         => 'TWO',
34
        code         => 'TWO',
35
        display_text => 'Two',
35
        display_text => 'Two',
36
        ronly        => 1,
36
        readonly     => 1,
37
        dflt         => 1
37
        is_system    => 1
38
    }
38
    }
39
});
39
});
40
40
Lines 44-57 my $expecting = { Link Here
44
    ONE => {
44
    ONE => {
45
        code         => 'ONE',
45
        code         => 'ONE',
46
        display_text => 'One',
46
        display_text => 'One',
47
        ronly        => 1,
47
        readonly     => 1,
48
        dflt         => 0
48
        is_system    => 0
49
    },
49
    },
50
    TWO => {
50
    TWO => {
51
        code         => 'TWO',
51
        code         => 'TWO',
52
        display_text => 'Two',
52
        display_text => 'Two',
53
        ronly        => 1,
53
        readonly     => 1,
54
        dflt         => 1
54
        is_system    => 1
55
    }
55
    }
56
};
56
};
57
57
(-)a/t/db_dependent/RestrictionTypes.t (-11 / +10 lines)
Lines 24-31 $builder->build({ Link Here
24
    value  => {
24
    value  => {
25
        code         => 'ONE',
25
        code         => 'ONE',
26
        display_text => 'One',
26
        display_text => 'One',
27
        ronly        => 1,
27
        readonly     => 1,
28
        dflt         => 0
28
        is_system    => 0
29
    }
29
    }
30
});
30
});
31
$builder->build({
31
$builder->build({
Lines 33-40 $builder->build({ Link Here
33
    value  => {
33
    value  => {
34
        code         => 'TWO',
34
        code         => 'TWO',
35
        display_text => 'Two',
35
        display_text => 'Two',
36
        ronly        => 1,
36
        readonly     => 1,
37
        dflt         => 1
37
        is_system    => 1
38
    }
38
    }
39
});
39
});
40
$builder->build({
40
$builder->build({
Lines 42-49 $builder->build({ Link Here
42
    value  => {
42
    value  => {
43
        code         => 'THREE',
43
        code         => 'THREE',
44
        display_text => 'Three',
44
        display_text => 'Three',
45
        ronly        => 1,
45
        readonly     => 1,
46
        dflt         => 0
46
        is_system    => 0
47
    }
47
    }
48
});
48
});
49
$builder->build({
49
$builder->build({
Lines 51-58 $builder->build({ Link Here
51
    value  => {
51
    value  => {
52
        code         => 'FOUR',
52
        code         => 'FOUR',
53
        display_text => 'Four',
53
        display_text => 'Four',
54
        ronly        => 0,
54
        readonly     => 0,
55
        dflt         => 0
55
        is_system    => 0
56
    }
56
    }
57
});
57
});
58
$builder->build({
58
$builder->build({
Lines 60-67 $builder->build({ Link Here
60
    value  => {
60
    value  => {
61
        code         => 'FIVE',
61
        code         => 'FIVE',
62
        display_text => 'Five',
62
        display_text => 'Five',
63
        ronly        => 0,
63
        readonly     => 0,
64
        dflt         => 0
64
        is_system    => 0
65
    }
65
    }
66
});
66
});
67
67
68
- 

Return to bug 23681