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

(-)a/Koha/REST/V1/Biblios.pm (-3 / +3 lines)
Lines 154-161 sub delete { Link Here
154
154
155
=head3 populate_empty_callnumbers
155
=head3 populate_empty_callnumbers
156
156
157
Controller function that populates the item callnumbers of any items
157
Controller function that populates the item call numbers of any items
158
for the record that currently have no callnumber. The generated callnumbers
158
for the record that currently have no call number. The generated call numbers
159
will be based on the 'itemcallnumber' system preference.
159
will be based on the 'itemcallnumber' system preference.
160
160
161
=cut
161
=cut
Lines 241-247 sub populate_empty_callnumbers { Link Here
241
241
242
=head3 default_item_callnumber
242
=head3 default_item_callnumber
243
243
244
Return the callnumber generated for the given record based on the "itemcallnumber" system preference.
244
Return the call number generated for the given record based on the "itemcallnumber" system preference.
245
=cut
245
=cut
246
246
247
sub default_item_callnumber {
247
sub default_item_callnumber {
(-)a/api/v1/swagger/paths/biblios.yaml (-24 / +24 lines)
Lines 92-98 Link Here
92
        schema:
92
        schema:
93
          $ref: "../swagger.yaml#/definitions/error"
93
          $ref: "../swagger.yaml#/definitions/error"
94
      "404":
94
      "404":
95
        description: Biblio not found
95
        description: Bibliographic record not found
96
        schema:
96
        schema:
97
          $ref: "../swagger.yaml#/definitions/error"
97
          $ref: "../swagger.yaml#/definitions/error"
98
      "406":
98
      "406":
Lines 143-149 Link Here
143
        schema:
143
        schema:
144
          $ref: "../swagger.yaml#/definitions/error"
144
          $ref: "../swagger.yaml#/definitions/error"
145
      "404":
145
      "404":
146
        description: Biblio not found
146
        description: Bibliographic record not found
147
        schema:
147
        schema:
148
          $ref: "../swagger.yaml#/definitions/error"
148
          $ref: "../swagger.yaml#/definitions/error"
149
      "406":
149
      "406":
Lines 179-185 Link Here
179
      - application/json
179
      - application/json
180
    responses:
180
    responses:
181
      "204":
181
      "204":
182
        description: Biblio deleted
182
        description: Bibliographic record deleted
183
        schema:
183
        schema:
184
          type: string
184
          type: string
185
      "401":
185
      "401":
Lines 191-197 Link Here
191
        schema:
191
        schema:
192
          $ref: "../swagger.yaml#/definitions/error"
192
          $ref: "../swagger.yaml#/definitions/error"
193
      "404":
193
      "404":
194
        description: Biblio not found
194
        description: Bibliographic record not found
195
        schema:
195
        schema:
196
          $ref: "../swagger.yaml#/definitions/error"
196
          $ref: "../swagger.yaml#/definitions/error"
197
      "409":
197
      "409":
Lines 250-256 Link Here
250
        schema:
250
        schema:
251
          $ref: "../swagger.yaml#/definitions/error"
251
          $ref: "../swagger.yaml#/definitions/error"
252
      "404":
252
      "404":
253
        description: Biblio not found
253
        description: Bibliographic record not found
254
        schema:
254
        schema:
255
          $ref: "../swagger.yaml#/definitions/error"
255
          $ref: "../swagger.yaml#/definitions/error"
256
      "406":
256
      "406":
Lines 320-326 Link Here
320
        schema:
320
        schema:
321
          $ref: ../swagger.yaml#/definitions/error
321
          $ref: ../swagger.yaml#/definitions/error
322
      "404":
322
      "404":
323
        description: Biblio not found
323
        description: Bibliographic record not found
324
        schema:
324
        schema:
325
          $ref: ../swagger.yaml#/definitions/error
325
          $ref: ../swagger.yaml#/definitions/error
326
      "406":
326
      "406":
Lines 387-393 Link Here
387
        schema:
387
        schema:
388
          $ref: "../swagger.yaml#/definitions/error"
388
          $ref: "../swagger.yaml#/definitions/error"
389
      "404":
389
      "404":
390
        description: Biblio not found
390
        description: Bibliographic record not found
391
        schema:
391
        schema:
392
          $ref: "../swagger.yaml#/definitions/error"
392
          $ref: "../swagger.yaml#/definitions/error"
393
      "500":
393
      "500":
Lines 455-461 Link Here
455
        schema:
455
        schema:
456
          $ref: "../swagger.yaml#/definitions/error"
456
          $ref: "../swagger.yaml#/definitions/error"
457
      "404":
457
      "404":
458
        description: Biblio not found
458
        description: Bibliographic record not found
459
        schema:
459
        schema:
460
          $ref: "../swagger.yaml#/definitions/error"
460
          $ref: "../swagger.yaml#/definitions/error"
461
      "406":
461
      "406":
Lines 542-555 Link Here
542
      - biblios
542
      - biblios
543
      - items
543
      - items
544
      - callnumbers
544
      - callnumbers
545
    summary: Populate empty item callnumbers from biblio callnumber for all items on record with no callnumber
545
    summary: Populate empty item call numbers from call number in bibliographic record for all items on record with no call number
546
    parameters:
546
    parameters:
547
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
547
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
548
    produces:
548
    produces:
549
      - application/json
549
      - application/json
550
    responses:
550
    responses:
551
      "200":
551
      "200":
552
        description: Callnumbers updated
552
        description: Call numbers updated
553
        schema:
553
        schema:
554
          type: object
554
          type: object
555
          properties:
555
          properties:
Lines 557-563 Link Here
557
              description: Number of items updated
557
              description: Number of items updated
558
              type: integer
558
              type: integer
559
            callnumber:
559
            callnumber:
560
              description: Callnumber added to updated items
560
              description: Call number added to updated items
561
              type: string
561
              type: string
562
      "400":
562
      "400":
563
        description: Bad request
563
        description: Bad request
Lines 601-607 Link Here
601
      - biblios
601
      - biblios
602
      - items
602
      - items
603
      - callnumbers
603
      - callnumbers
604
    summary: Populate empty item callnumber from biblio callnumber for a given item
604
    summary: Populate empty item call number from call number in the bibliographic record for a given item
605
    parameters:
605
    parameters:
606
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
606
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
607
      - $ref: "../swagger.yaml#/parameters/item_id_pp"
607
      - $ref: "../swagger.yaml#/parameters/item_id_pp"
Lines 609-615 Link Here
609
      - application/json
609
      - application/json
610
    responses:
610
    responses:
611
      "200":
611
      "200":
612
        description: Callnumbers updated
612
        description: Call numbers updated
613
        schema:
613
        schema:
614
          type: object
614
          type: object
615
          properties:
615
          properties:
Lines 617-623 Link Here
617
              description: Number of items updated
617
              description: Number of items updated
618
              type: integer
618
              type: integer
619
            callnumber:
619
            callnumber:
620
              description: Callnumber added to updated items
620
              description: Call number added to updated items
621
              type: string
621
              type: string
622
      "400":
622
      "400":
623
        description: Bad request
623
        description: Bad request
Lines 716-722 Link Here
716
    operationId: getBiblioPickupLocations
716
    operationId: getBiblioPickupLocations
717
    tags:
717
    tags:
718
      - biblios
718
      - biblios
719
    summary: Get valid pickup locations for a biblio
719
    summary: Get valid pickup locations for a bibliographic record
720
    parameters:
720
    parameters:
721
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
721
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
722
      - name: patron_id
722
      - name: patron_id
Lines 736-742 Link Here
736
      - application/json
736
      - application/json
737
    responses:
737
    responses:
738
      "200":
738
      "200":
739
        description: Biblio pickup locations
739
        description: Pickup locations for bibliographic record
740
        schema:
740
        schema:
741
          type: array
741
          type: array
742
          items:
742
          items:
Lines 754-760 Link Here
754
        schema:
754
        schema:
755
          $ref: "../swagger.yaml#/definitions/error"
755
          $ref: "../swagger.yaml#/definitions/error"
756
      "404":
756
      "404":
757
        description: Biblio not found
757
        description: Bibliographic record not found
758
        schema:
758
        schema:
759
          $ref: "../swagger.yaml#/definitions/error"
759
          $ref: "../swagger.yaml#/definitions/error"
760
      "500":
760
      "500":
Lines 777-783 Link Here
777
    operationId: getBiblioPublic
777
    operationId: getBiblioPublic
778
    tags:
778
    tags:
779
      - biblios
779
      - biblios
780
    summary: Get biblio (public)
780
    summary: Get bibliograpic record (public)
781
    parameters:
781
    parameters:
782
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
782
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
783
    produces:
783
    produces:
Lines 797-803 Link Here
797
        schema:
797
        schema:
798
          $ref: "../swagger.yaml#/definitions/error"
798
          $ref: "../swagger.yaml#/definitions/error"
799
      "404":
799
      "404":
800
        description: Biblio not found
800
        description: Bibliographic record not found
801
        schema:
801
        schema:
802
          $ref: "../swagger.yaml#/definitions/error"
802
          $ref: "../swagger.yaml#/definitions/error"
803
      "406":
803
      "406":
Lines 863-869 Link Here
863
        schema:
863
        schema:
864
          $ref: "../swagger.yaml#/definitions/error"
864
          $ref: "../swagger.yaml#/definitions/error"
865
      "404":
865
      "404":
866
        description: Biblio not found
866
        description: Bibliographic record not found
867
        schema:
867
        schema:
868
          $ref: "../swagger.yaml#/definitions/error"
868
          $ref: "../swagger.yaml#/definitions/error"
869
      "406":
869
      "406":
Lines 936-942 Link Here
936
        schema:
936
        schema:
937
          $ref: "../swagger.yaml#/definitions/error"
937
          $ref: "../swagger.yaml#/definitions/error"
938
      "404":
938
      "404":
939
        description: Biblio not found
939
        description: Bibliographic record not found
940
        schema:
940
        schema:
941
          $ref: "../swagger.yaml#/definitions/error"
941
          $ref: "../swagger.yaml#/definitions/error"
942
      "500":
942
      "500":
Lines 956-962 Link Here
956
    operationId: getBiblioDefaultItemCallnumber
956
    operationId: getBiblioDefaultItemCallnumber
957
    tags:
957
    tags:
958
      - biblios
958
      - biblios
959
    summary: Get default item callnumber for a biblio
959
    summary: Get default item call number for a bibliographic record
960
    parameters:
960
    parameters:
961
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
961
      - $ref: "../swagger.yaml#/parameters/biblio_id_pp"
962
    produces:
962
    produces:
Lines 968-974 Link Here
968
          type: object
968
          type: object
969
          properties:
969
          properties:
970
            callnumber:
970
            callnumber:
971
              description: Item call number benerated for biblio
971
              description: Item call number generated for bibliographic record
972
              type: string
972
              type: string
973
      "401":
973
      "401":
974
        description: Authentication required
974
        description: Authentication required
Lines 979-985 Link Here
979
        schema:
979
        schema:
980
          $ref: "../swagger.yaml#/definitions/error"
980
          $ref: "../swagger.yaml#/definitions/error"
981
      "404":
981
      "404":
982
        description: Biblio not found
982
        description: Bibliograpic record not found
983
        schema:
983
        schema:
984
          $ref: "../swagger.yaml#/definitions/error"
984
          $ref: "../swagger.yaml#/definitions/error"
985
      "500":
985
      "500":
(-)a/installer/data/mysql/atomicupdate/bug_34784.pl (-3 / +4 lines)
Lines 2-16 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number  => "34784",
4
    bug_number  => "34784",
5
    description => "Add ability to populate empty item callnumbers for a record based on the itemcallnumber syspref",
5
    description =>
6
    up          => sub {
6
        "Add ability to populate empty item call numbers for a record based on the itemcallnumber system preferene",
7
    up => sub {
7
        my ($args) = @_;
8
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
10
        $dbh->do(
11
        $dbh->do(
11
            q{
12
            q{
12
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
13
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
13
            VALUES ('EnablePopulateCallnumbers','0','','Enable populate callnumber feature','YesNo')
14
            VALUES ('EnablePopulateCallnumbers','0','','Enable populate call number feature','YesNo')
14
        }
15
        }
15
        );
16
        );
16
17
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 232-238 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
232
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
232
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
233
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
233
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
234
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
234
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
235
('EnablePopulateCallnumbers','0','','Enable populate callnumber feature','YesNo'),
235
('EnablePopulateCallnumbers','0','','Enable populate call number feature','YesNo'),
236
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
236
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
237
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
237
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
238
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
238
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +1 lines)
Lines 44-50 Link Here
44
            [% END %]
44
            [% END %]
45
45
46
            [% IF Koha.Preference('EnablePopulateCallnumbers') && ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
46
            [% IF Koha.Preference('EnablePopulateCallnumbers') && ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
47
                <li><a id="populate-callnumbers-biblio" href="#" data-biblionumber="[% biblionumber | html %]" data-toggle="tooltip" data-placement="left" title="Populate callnumbers for items with no call number.">Populate call numbers</a></li>
47
                <li><a id="populate-callnumbers-biblio" href="#" data-biblionumber="[% biblionumber | html %]" data-toggle="tooltip" data-placement="left" title="Populate call numbers for items with no call number.">Populate call numbers</a></li>
48
            [% END %]
48
            [% END %]
49
49
50
            [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
50
            [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-2 / +2 lines)
Lines 81-87 Cataloging: Link Here
81
              choices:
81
              choices:
82
                  1: Show
82
                  1: Show
83
                  0:  "Don't show"
83
                  0:  "Don't show"
84
            - buttons on the bibliographic details page to populate empty item callnumbers from the record based on the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=itemcallnumber">itemcallnumber</a> system preference.
84
            - buttons on the catalog details page to populate empty item call numbers from the bibliographic record based on the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=itemcallnumber">itemcallnumber</a> system preference.
85
        -
85
        -
86
    Record structure:
86
    Record structure:
87
        -
87
        -
Lines 115-121 Cataloging: Link Here
115
        -
115
        -
116
            - Map the MARC subfields
116
            - Map the MARC subfields
117
            - pref: itemcallnumber
117
            - pref: itemcallnumber
118
            - "to an item's callnumber. List multiple comma-separated fields to check them sequentially. Each field can include multiple subfields. The order of the subfields in the record will be preserved. For example: '082ab,092ab' will look in the 082$a and 082$b, then the 092$a and 092$b."
118
            - "to an item's call number. List multiple comma-separated fields to check them sequentially. Each field can include multiple subfields. The order of the subfields in the record will be preserved. For example: '082ab,092ab' will look in the 082$a and 082$b, then the 092$a and 092$b."
119
            - "Examples for MARC21: Dewey: 082ab,092ab; LOC: 050ab,090ab; from the Koha record: 942hi. Examples for UNIMARC: Dewey: 676a; LOC: 680ab."
119
            - "Examples for MARC21: Dewey: 082ab,092ab; LOC: 050ab,090ab; from the Koha record: 942hi. Examples for UNIMARC: Dewey: 676a; LOC: 680ab."
120
        -
120
        -
121
            - Display MARC subfield
121
            - Display MARC subfield
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +3 lines)
Lines 652-658 Link Here
652
                                            <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
652
                                            <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
653
                                        [% END %]
653
                                        [% END %]
654
                                        [% IF show_itemcallnumber_link %]
654
                                        [% IF show_itemcallnumber_link %]
655
                                            <li><a class="populate-callnumber-item" href="#" data-itemnumber="[% item.itemnumber | html %]" data-biblionumber="[% item.biblionumber | html %]" data-toggle="tooltip" data-placement="left" title="Populate callnumber for this item."><i class="fa fa-bars"></i> Populate callnumber</a></li>
655
                                            <li><a class="populate-callnumber-item" href="#" data-itemnumber="[% item.itemnumber | html %]" data-biblionumber="[% item.biblionumber | html %]" data-toggle="tooltip" data-placement="left" title="Populate call number for this item."><i class="fa fa-bars"></i> Populate call number</a></li>
656
                                        [% END %]
656
                                        [% END %]
657
                                    </ul>
657
                                    </ul>
658
                                </div>
658
                                </div>
Lines 794-800 Link Here
794
            [% END %]
794
            [% END %]
795
            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
795
            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
796
            [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
796
            [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
797
            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
797
            [% IF ( subscription.callnumber ) %]<p>Call number: [% subscription.callnumber | html %] </p>[% END %]
798
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
798
            [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
799
            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
799
            [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
800
            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
800
            [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
Lines 1902-1908 Link Here
1902
                        },
1902
                        },
1903
                        {
1903
                        {
1904
                            "data": "callnumber",
1904
                            "data": "callnumber",
1905
                            "title": _("Callnumber"),
1905
                            "title": _("Call number"),
1906
                            "searchable": true,
1906
                            "searchable": true,
1907
                            "orderable": true,
1907
                            "orderable": true,
1908
                        },
1908
                        },
(-)a/koha-tmpl/intranet-tmpl/prog/js/catalog.js (-4 / +4 lines)
Lines 128-139 $(document).ready(function() { Link Here
128
        .on('click', function() {
128
        .on('click', function() {
129
            $.getJSON( `/api/v1/biblios/${biblionumber}/default_item_callnumber`, function( cn ) {
129
            $.getJSON( `/api/v1/biblios/${biblionumber}/default_item_callnumber`, function( cn ) {
130
                const callnumber = cn.callnumber;
130
                const callnumber = cn.callnumber;
131
                if ( confirm(__(`Are you sure you want to populate callnumbers for all items without a callnumber on this record to the following value: ${callnumber}`)) ) {
131
                if ( confirm(__(`Are you sure you want to populate call numbers for all items without a call number on this record to the following value: ${callnumber}`)) ) {
132
                    const biblionumber = $(this).data('biblionumber');
132
                    const biblionumber = $(this).data('biblionumber');
133
                    $.post( `/api/v1/biblios/${biblionumber}/items/populate_empty_callnumbers`, function( data ) {
133
                    $.post( `/api/v1/biblios/${biblionumber}/items/populate_empty_callnumbers`, function( data ) {
134
                        const items_updated = data.items_updated;
134
                        const items_updated = data.items_updated;
135
                        const callnumber = data.callnumber;
135
                        const callnumber = data.callnumber;
136
                        let msg = __('Items populated with the callnumber "%s": %s').format(callnumber, items_updated);
136
                        let msg = __('Items populated with the call number "%s": %s').format(callnumber, items_updated);
137
137
138
                        if ( items_updated ) {
138
                        if ( items_updated ) {
139
                            msg += " " + __('Reload the page?');
139
                            msg += " " + __('Reload the page?');
Lines 152-164 $(document).ready(function() { Link Here
152
        .on('click', function() {
152
        .on('click', function() {
153
            $.getJSON( `/api/v1/biblios/${biblionumber}/default_item_callnumber`, function( cn ) {
153
            $.getJSON( `/api/v1/biblios/${biblionumber}/default_item_callnumber`, function( cn ) {
154
                const callnumber = cn.callnumber;
154
                const callnumber = cn.callnumber;
155
                if ( confirm(__(`Are you sure you want to populate the callnumber for this item to the following value: ${callnumber}`)) ) {
155
                if ( confirm(__(`Are you sure you want to populate the call number for this item to the following value: ${callnumber}`)) ) {
156
                    const biblionumber = $(this).data('biblionumber');
156
                    const biblionumber = $(this).data('biblionumber');
157
                    const itemnumber  = $(this).data('itemnumber');
157
                    const itemnumber  = $(this).data('itemnumber');
158
                    const button = $(this);
158
                    const button = $(this);
159
                    $.post( `/api/v1/biblios/${biblionumber}/items/${itemnumber}/populate_empty_callnumbers`, function( data ) {
159
                    $.post( `/api/v1/biblios/${biblionumber}/items/${itemnumber}/populate_empty_callnumbers`, function( data ) {
160
                        const callnumber = data.callnumber;
160
                        const callnumber = data.callnumber;
161
                        let msg = __('Item populated with the callnumber "%s"').format(callnumber);
161
                        let msg = __('Item populated with the call number "%s"').format(callnumber);
162
                        msg += " " + __('Reload the page?');
162
                        msg += " " + __('Reload the page?');
163
                        if( confirm(msg) ) {
163
                        if( confirm(msg) ) {
164
                            location.reload(true);
164
                            location.reload(true);
(-)a/t/db_dependent/api/v1/biblios.t (-2 / +1 lines)
Lines 1862-1868 subtest 'populate_empty_callnumbers() tests' => sub { Link Here
1862
1862
1863
    $t->post_ok(
1863
    $t->post_ok(
1864
        "//$userid:$password@/api/v1/biblios/$biblio_id/items/$item1_id/populate_empty_callnumbers" => json => {} )
1864
        "//$userid:$password@/api/v1/biblios/$biblio_id/items/$item1_id/populate_empty_callnumbers" => json => {} )
1865
        ->status_is( 404, 'Callnumber fields not found' );
1865
        ->status_is( 404, 'Call number fields not found' );
1866
1866
1867
    t::lib::Mocks::mock_preference( 'itemcallnumber', '245$a' );
1867
    t::lib::Mocks::mock_preference( 'itemcallnumber', '245$a' );
1868
1868
1869
- 

Return to bug 34784