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

(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+20 lines)
Lines 4896-4898 div .suggestion_note { Link Here
4896
        }
4896
        }
4897
    }
4897
    }
4898
}
4898
}
4899
4900
#cat_additem .replacementprice_error_message {
4901
  color: red;
4902
  margin-left: 20vw;
4903
}
4904
4905
#tools_batchMod-edit .replacementprice_error_message {
4906
    color: red;
4907
    margin-left: 24.5vw;
4908
}
4909
4910
.replacementprice_error_message.hidden {
4911
    display: none;
4912
}
4913
4914
@media (max-width: 1000px) {
4915
  .replacementprice_error_message {
4916
    margin-left: 23.5vw;
4917
  }
4918
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (+4 lines)
Lines 216-221 Link Here
216
                    <span class="hint" id="hint[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"></span>
216
                    <span class="hint" id="hint[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"></span>
217
217
218
                </div>
218
                </div>
219
220
                [% IF subfield.subfield == 'v' %]
221
                    <span class="replacementprice_error_message hidden"> Only numbers and periods (e.g., 10.99) are allowed.</span>
222
                [% END %]
219
            </li>
223
            </li>
220
        [% END %]
224
        [% END %]
221
    </ol>
225
    </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-replacementprice.inc (+16 lines)
Line 0 Link Here
1
<!-- Modal for Replacement Price Validation -->
2
<div id="replacementpriceModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="replacementpriceModalLabel" aria-hidden="true">
3
    <div class="modal-dialog" role="document">
4
        <div class="modal-content">
5
            <div class="modal-header">
6
                <h5 class="modal-title" id="replacementpriceModalLabel">Invalid Replacement Price</h5>
7
            </div>
8
            <div class="modal-body">
9
                <p>The replacement price format is invalid. Please only use numbers and periods (.) as the decimal separator.</p>
10
            </div>
11
            <div class="modal-footer">
12
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal">OK</button>
13
            </div>
14
        </div>
15
    </div>
16
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (+1 lines)
Lines 7-12 Link Here
7
[% USE TablesSettings %]
7
[% USE TablesSettings %]
8
[% PROCESS 'i18n.inc' %]
8
[% PROCESS 'i18n.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'modal-replacementprice.inc' %]
10
<title>[% FILTER collapse %]
11
<title>[% FILTER collapse %]
11
    [% t("Items") | html %] &rsaquo;
12
    [% t("Items") | html %] &rsaquo;
12
    [% IF ( biblio.author ) %]
13
    [% IF ( biblio.author ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js (+19 lines)
Lines 4-9 var browser = KOHA.browser(searchid, parseInt(biblionumber, 10)); Link Here
4
browser.show();
4
browser.show();
5
5
6
$(document).ready(function(){
6
$(document).ready(function(){
7
    $("#cataloguing_additem_newitem form").on("submit", function (e) {
8
        var replacementprice = $("input[name='items.replacementprice']").val();
9
        if (!/^[0-9.]+$/.test(replacementprice)) {
10
            e.preventDefault();
11
            return false;
12
        }
13
        return true;
14
    });
15
16
    $("input[name='items.replacementprice']").on("input", function () {
17
        var value = $(this).val();
18
        var isValid = /^[0-9.]*$/.test(value);
19
20
        if (!isValid) {
21
            $('.replacementprice_error_message').removeClass('hidden');
22
        } else {
23
            $('.replacementprice_error_message').addClass('hidden');
24
        }
25
    });
7
26
8
    // Remove the onclick event defined in browser.js,
27
    // Remove the onclick event defined in browser.js,
9
    // otherwise the deletion confirmation will not work correctly
28
    // otherwise the deletion confirmation will not work correctly
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js (-1 / +20 lines)
Lines 118-123 function hideAllColumns() { Link Here
118
}
118
}
119
119
120
$(document).ready(function () {
120
$(document).ready(function () {
121
    $('form[action="batchMod.pl"]').on("submit", function (e) {
122
        var replacementprice = $("input[name='items.replacementprice']").val();
123
        if (!/^[0-9.]+$/.test(replacementprice)) {
124
            e.preventDefault();
125
            return false;
126
        }
127
        return true;
128
    });
129
130
    $("input[name='items.replacementprice']").on("input", function () {
131
        var value = $(this).val();
132
        var isValid = /^[0-9.]*$/.test(value);
133
134
        if (!isValid) {
135
            $('.replacementprice_error_message').removeClass('hidden');
136
        } else {
137
            $('.replacementprice_error_message').addClass('hidden');
138
        }
139
    });
140
121
    var items_table = KohaTable("itemst", {
141
    var items_table = KohaTable("itemst", {
122
        "columnDefs":  [
142
        "columnDefs":  [
123
            { "targets":  [0, 1], "orderable":  false, "searchable":  true },
143
            { "targets":  [0, 1], "orderable":  false, "searchable":  true },
124
- 

Return to bug 38839