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

(-)a/installer/data/mysql/atomicupdate/bug_17378.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('RecordItemLimit',NULL,NULL,'If this number is exceeded, a librarian will be unable to manually add more items to a record','Integer');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 451-456 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
451
('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'),
451
('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'),
452
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
452
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
453
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
453
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
454
('RecordItemLimit',NULL,NULL,'If this number is exceeded, a librarian will be unable to manually add more items to a record','Integer'),
454
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
455
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
455
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
456
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
456
('RenewalLog','0','','If ON, log information about renewals','YesNo'),
457
('RenewalLog','0','','If ON, log information about renewals','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +10 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'blocking_errors.inc' %]
2
[% INCLUDE 'blocking_errors.inc' %]
2
<div id="toolbar" class="btn-toolbar">
3
<div id="toolbar" class="btn-toolbar">
3
4
Lines 55-61 CAN_user_serials_create_subscription ) %] Link Here
55
                [% END %]
56
                [% END %]
56
            [% END %]
57
            [% END %]
57
58
58
            [% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>[% END %]
59
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
60
                [% IF Koha.Preference('RecordItemLimit') && count > Koha.Preference('RecordItemLimit') %]
61
                    <li class="disabled">
62
                        <a id="attachitem" data-toggle="tooltip" data-placement="left" title="[% count %] item(s) are attached to this record exceeding the threshold of [% Koha.Preference('RecordItemLimit') %] items. You cannot add more items." href="#">Attach item</a>
63
                    </li>
64
                [% ELSE %]
65
                    <li><a href="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]">Attach item</a></li>
66
                [% END %]
67
            [% END %]
59
68
60
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]">Link to host item</a>[% END %][% END %]
69
            [% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]<li><a href="/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]">Link to host item</a>[% END %][% END %]
61
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image">Upload image</a>[% END %][% END %]
70
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image">Upload image</a>[% END %][% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+3 lines)
Lines 47-52 Cataloging: Link Here
47
                  no:  "Don't display"
47
                  no:  "Don't display"
48
            - buttons on the bib details page to print item spine labels.
48
            - buttons on the bib details page to print item spine labels.
49
        -
49
        -
50
            - If a record has more than
51
            - pref: RecordItemLimit
52
            - items, don't allow a librarian to add more manually.
50
    Record Structure:
53
    Record Structure:
51
        -
54
        -
52
            - Fill in the default language for field 008 Range 35-37 of MARC21 records (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>)
55
            - Fill in the default language for field 008 Range 35-37 of MARC21 records (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-19 / +39 lines)
Lines 17-22 Link Here
17
    browser.show();
17
    browser.show();
18
18
19
$(document).ready(function(){
19
$(document).ready(function(){
20
    [% IF opisadd && Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %]
21
        $("#f fieldset.rows").hide();
22
    [% END %]
20
23
21
    // Remove the onclick event defined in browser.js,
24
    // Remove the onclick event defined in browser.js,
22
    // otherwise the deletion confirmation will not work correctly
25
    // otherwise the deletion confirmation will not work correctly
Lines 118-123 function CheckMultipleAdd(f) { Link Here
118
    if (f>99) {
121
    if (f>99) {
119
        return confirm(_("You are about to add %s items. Continue?").format(f));
122
        return confirm(_("You are about to add %s items. Continue?").format(f));
120
    }
123
    }
124
    [% IF Koha.Preference('RecordItemLimit') %]
125
        [% SET max_new_items = Koha.Preference('RecordItemLimit') - item_loop.size %]
126
        if (f > [% max_new_items %]) {
127
            alert(_("You are exceeding the [% Koha.Preference('RecordItemLimit') %] limit of items per record. You can only add [% max_new_items %] new item(s)."));
128
            return false;
129
        }
130
    [% END %]
121
}
131
}
122
function Dopop(link,i) {
132
function Dopop(link,i) {
123
    defaultvalue=document.forms[0].field_value[i].value;
133
    defaultvalue=document.forms[0].field_value[i].value;
Lines 336-366 function confirm_deletion() { Link Here
336
    <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
346
    <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
337
347
338
<fieldset class="action">    [% IF ( opisadd ) %]
348
<fieldset class="action">    [% IF ( opisadd ) %]
339
    <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
349
    [% IF Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %]
340
    <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
350
        <div class="dialog alert">
341
		when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
351
            [% item_loop.size %] items are attached to this record exceeding the threshold of [% Koha.Preference('RecordItemLimit') %] items. You cannot add more items.
342
		It is a bit tricky, but necessary in the sake of UI correctness.
352
        </div>
343
    -->
353
    [% ELSE %]
344
    <span id="addsingle">
354
        <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
345
        <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
355
        <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
346
        <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
356
            when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
347
    </span>
357
            It is a bit tricky, but necessary in the sake of UI correctness.
348
    <span id="addmultiple">
358
        -->
349
        <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
359
        <span id="addsingle">
350
    </span>
360
            <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
351
    <fieldset id="add_multiple_copies_span">
361
            <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
352
        <label for="number_of_copies">Number of copies of this item to add: </label>
362
        </span>
353
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
363
        <span id="addmultiple">
354
        <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
364
            <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
355
        <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
365
        </span>
356
    </fieldset>
366
        <fieldset id="add_multiple_copies_span">
367
            <label for="number_of_copies">Number of copies of this item to add: </label>
368
            <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
369
            <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
370
            <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
371
        </fieldset>
372
    [% END %]
357
373
358
    [% ELSE %]
374
    [% ELSE %]
359
    <input type="hidden" name="tag" value="[% itemtagfield %]" />
375
    <input type="hidden" name="tag" value="[% itemtagfield %]" />
360
    <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
376
    <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
361
    <input type="hidden" name="field_value" value="[% itemnumber %]" />
377
    <input type="hidden" name="field_value" value="[% itemnumber %]" />
362
    <input type="submit" value="Save changes" onclick="return Check(this.form)">
378
    <input type="submit" value="Save changes" onclick="return Check(this.form)">
363
    <input type="button" id="addnewitem" value="Add a new item">
379
    [% IF Koha.Preference('RecordItemLimit') && item_loop.size > Koha.Preference('RecordItemLimit') %]
380
        <input type="button" id="addnewitem" value="Add a new item" disabled="disabled" title="[% item_loop.size %] item(s) are attached to this record exceeding the threshold of [% Koha.Preference('RecordItemLimit') %] items. You cannot add more items.">
381
    [% ELSE %]
382
        <input type="button" id="addnewitem" value="Add a new item">
383
    [% END %]
364
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Cancel</a>
384
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Cancel</a>
365
    [% END %]</fieldset>
385
    [% END %]</fieldset>
366
    
386
    
(-)a/koha-tmpl/intranet-tmpl/prog/js/catalog.js (-2 / +1 lines)
Lines 102-108 $(document).ready(function() { Link Here
102
        return false;
102
        return false;
103
    });
103
    });
104
    $("#export").remove(); // Hide embedded export form if JS menus available
104
    $("#export").remove(); // Hide embedded export form if JS menus available
105
    $("#deletebiblio").tooltip();
105
    $("#deletebiblio,#attachitem").tooltip();
106
    $("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
106
    $("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
107
        .on("click",function(e){
107
        .on("click",function(e){
108
            e.preventDefault();
108
            e.preventDefault();
109
- 

Return to bug 17378