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

(-)a/Koha/Database/Columns.pm (+1 lines)
Lines 233-238 sub columns { Link Here
233
            "notforloan"                        => __("Not for loan"),
233
            "notforloan"                        => __("Not for loan"),
234
            "onloan"                            => __("Due date"),
234
            "onloan"                            => __("Due date"),
235
            "permanent_location"                => __("Permanent shelving location"),
235
            "permanent_location"                => __("Permanent shelving location"),
236
            "sub_location"                      => __("Sublocation"),
236
            "price"                             => __("Price"),
237
            "price"                             => __("Price"),
237
            "renewals"                          => __("Total renewals"),
238
            "renewals"                          => __("Total renewals"),
238
            "replacementprice"                  => __("Replacement price"),
239
            "replacementprice"                  => __("Replacement price"),
(-)a/Koha/Item.pm (+1 lines)
Lines 1822-1827 sub to_api_mapping { Link Here
1822
        stocknumber              => 'inventory_number',
1822
        stocknumber              => 'inventory_number',
1823
        new_status               => 'new_status',
1823
        new_status               => 'new_status',
1824
        deleted_on               => undef,
1824
        deleted_on               => undef,
1825
        sub_location             => 'sub_location'
1825
    };
1826
    };
1826
}
1827
}
1827
1828
(-)a/api/v1/swagger/definitions/item.yaml (+5 lines)
Lines 224-229 properties: Link Here
224
      - string
224
      - string
225
      - "null"
225
      - "null"
226
    description: "'new' value, whatever free-text information."
226
    description: "'new' value, whatever free-text information."
227
  sub_location:
228
    type:
229
      - string
230
      - "null"
231
    description: sub_location for this item
227
  exclude_from_local_holds_priority:
232
  exclude_from_local_holds_priority:
228
    type: boolean
233
    type: boolean
229
    description: Exclude this item from local holds priority.
234
    description: Exclude this item from local holds priority.
(-)a/circ/returns.pl (-1 / +3 lines)
Lines 791-796 my $count = 0; Link Here
791
my @riloop;
791
my @riloop;
792
my $shelflocations =
792
my $shelflocations =
793
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
793
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
794
my $sublocation =
795
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.sub_location' } ) };
794
foreach ( sort { $a <=> $b } keys %returneditems ) {
796
foreach ( sort { $a <=> $b } keys %returneditems ) {
795
    my %ri;
797
    my %ri;
796
    if ( $count++ < $returned_counter ) {
798
    if ( $count++ < $returned_counter ) {
Lines 849-855 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
849
        $ri{location} = $item->location;
851
        $ri{location} = $item->location;
850
        my $shelfcode = $ri{'location'};
852
        my $shelfcode = $ri{'location'};
851
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
853
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
852
854
        $ri{sub_location} = $sublocation->{$item->sub_location} if ( defined( $item->sub_location ) && defined($sublocation) && exists( $sublocation->{$item->sub_location} ) );
853
    }
855
    }
854
    else {
856
    else {
855
        last;
857
        last;
(-)a/installer/data/mysql/atomicupdate/bug_34142.pl (+23 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34142",
5
    description => "Add column sub_location to (deleted)items table",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        if ( !column_exists( 'items', 'sub_location' ) ) {
11
            $dbh->do(
12
q{ALTER TABLE items ADD COLUMN sub_location VARCHAR(80) DEFAULT NULL AFTER permanent_location}
13
            );
14
            say $out "Added new column items.sub_location";
15
        }
16
        if ( !column_exists( 'deleteditems', 'sub_location' ) ) {
17
            $dbh->do(
18
q{ALTER TABLE deleteditems ADD COLUMN sub_location VARCHAR(80) DEFAULT NULL AFTER permanent_location}
19
            );
20
            say $out "Added new column deleteditems.sub_location";
21
        }
22
    },
23
};
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 2785-2790 CREATE TABLE `deleteditems` ( Link Here
2785
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2785
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2786
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2786
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2787
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2787
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2788
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
2788
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2789
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2789
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2790
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2790
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
2791
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
Lines 4043-4048 CREATE TABLE `items` ( Link Here
4043
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4044
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4044
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4045
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4045
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4046
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4047
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
4046
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4048
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4047
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4049
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4048
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
4050
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (+7 lines)
Lines 190-195 Link Here
190
    const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
190
    const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
191
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
191
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
192
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
192
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
193
    const av_subloc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.sub_location' })) | $raw %].map( av => [av.authorised_value, av.lib]));
193
    const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
194
    const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
194
    const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
195
    const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
195
    const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
196
    const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
Lines 376-381 Link Here
376
                    } else {
377
                    } else {
377
                        nodes += escape_str(loc_str);
378
                        nodes += escape_str(loc_str);
378
                    }
379
                    }
380
                    if ( row.sub_location ) {
381
                        nodes += '<span class="sub_location">';
382
                        let sub_location_str = av_subloc.get(row.sub_location.toString());
383
                        nodes += '(%s)'.format(escape_str(sub_location_str));
384
                        nodes += '</span>';
385
                    }
379
                    nodes += '</span>';
386
                    nodes += '</span>';
380
                    return nodes;
387
                    return nodes;
381
                }
388
                }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+6 lines)
Lines 147-152 Link Here
147
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
147
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
148
                                            </li>
148
                                            </li>
149
                                        [% END %]
149
                                        [% END %]
150
                                        [% IF ( ITEM_DAT.sub_location ) %]
151
                                            <li>
152
                                                <span class="label">Sublocation:</span>
153
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.sub_location', authorised_value => ITEM_DAT.sub_location ) | html %]
154
                                            </li>
155
                                        [% END %]
150
                                        [% IF ( ITEM_DAT.replacementprice ) %]
156
                                        [% IF ( ITEM_DAT.replacementprice ) %]
151
                                            <li><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
157
                                            <li><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
152
                                        [% END %]
158
                                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +1 lines)
Lines 1325-1331 Link Here
1325
                                                 [%- END -%]
1325
                                                 [%- END -%]
1326
                                            </td>
1326
                                            </td>
1327
                                            <td class="ci-shelvinglocation">
1327
                                            <td class="ci-shelvinglocation">
1328
                                                <span class="shelvingloc">[% riloo.location | html %]</span>
1328
                                                <span class="shelvingloc">[% riloo.location | html %] [% IF ( riloo.sub_location ) %] ([% riloo.sub_location | html %]) [% END %]</span>
1329
                                            </td>
1329
                                            </td>
1330
                                            <td class="ci-callnumber">
1330
                                            <td class="ci-callnumber">
1331
                                                [% riloo.itemcallnumber | html %]
1331
                                                [% riloo.itemcallnumber | html %]
1332
- 

Return to bug 34142