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

(-)a/installer/data/mysql/atomicupdate/bug_38776.pl (+13 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "BUG_38776",
5
    description => "Add RESTRICTION_COMMENTS authorised_value category",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT INTO authorised_value_categories VALUES ('RESTRICTION_COMMENTS',0,0);});
11
        say $out "Added 'RESTRICTION_COMMENTS' authorised_values category";
12
    },
13
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-restrictions-tab.inc (-5 / +7 lines)
Lines 82-94 Link Here
82
                [% END %]
82
                [% END %]
83
                <li>
83
                <li>
84
                    <label for="rcomment">Comment:</label>
84
                    <label for="rcomment">Comment:</label>
85
                    <input type="text" id="rcomment" list="rcomments" name="comment" />
85
                    <select class="select-reason" id="restriction-reason">
86
                    <datalist id="rcomments">
86
                        <option value=""> -- Choose a reason -- </option>
87
                        [% FOREACH rcomment IN AuthorisedValues.Get( 'R_COMMENTS' ) %]
87
                        [% FOREACH rcomment IN AuthorisedValues.Get( 'RESTRICTION_COMMENTS' ) %]
88
                            <option value="[% rcomment.lib | html %]">[% rcomment.lib | html %]</option>
88
                            <option value="[% rcomment.lib | html %]">[% rcomment.lib | html %]</option>
89
                        [% END %]
89
                        [% END %]
90
                    </datalist>
90
                        <option value="other">Others...</option>
91
                    <input type="submit" />
91
                    </select>
92
                    <input type="text" id="other_reason" placeholder="please note your reason here..." />
93
                    <input type="hidden" id="rcomment" name="comment" />
92
                </li>
94
                </li>
93
                <li>
95
                <li>
94
                    <label for="rexpiration">Expiration:</label>
96
                    <label for="rexpiration">Expiration:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (-1 / +1 lines)
Lines 545-551 Link Here
545
        >
545
        >
546
    [% CASE 'RESTRICTED' %]
546
    [% CASE 'RESTRICTED' %]
547
        <p>Restricted status of an item</p>
547
        <p>Restricted status of an item</p>
548
    [% CASE 'R_COMMENTS' %]
548
    [% CASE 'RESTRICTION_COMMENTS' %]
549
        <p>Values for custom patron restriction comments to pre-fill the manual restrictions. The value in the description field should be the message text and is limited to 200 characters</p>
549
        <p>Values for custom patron restriction comments to pre-fill the manual restrictions. The value in the description field should be the message text and is limited to 200 characters</p>
550
    [% CASE 'ROADTYPE' %]
550
    [% CASE 'ROADTYPE' %]
551
        <p>Road types to be used in patron addresses</p>
551
        <p>Road types to be used in patron addresses</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 847-852 Link Here
847
    </script>
847
    </script>
848
    [% Asset.js("js/checkouts.js") | $raw %]
848
    [% Asset.js("js/checkouts.js") | $raw %]
849
    [% Asset.js("js/tables/bookings.js") | $raw %]
849
    [% Asset.js("js/tables/bookings.js") | $raw %]
850
    [% Asset.js("js/patron-restrictions.js") | $raw %]
850
[% END %]
851
[% END %]
851
852
852
[% INCLUDE 'intranet-bottom.inc' %]
853
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/patron-restrictions.js (-1 / +14 lines)
Line 0 Link Here
0
- 
1
$(document).ready(function () {
2
    $("#other_reason").on("change", function () {
3
        $("#rcomment").val($(this).val());
4
    });
5
    $("select#restriction-reason").on("change", function () {
6
        if ($(this).val() == "other") {
7
            $("#other_reason").show();
8
            $("#rcomment").val("");
9
            return;
10
        }
11
        $("#other_reason").hide();
12
        $("#rcomment").val($(this).val());
13
    });
14
});

Return to bug 38776