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

(-)a/Koha/Database/Columns.pm (+1 lines)
Lines 228-233 sub columns { Link Here
228
            "deleted_on"                        => __("Deleted on"),
228
            "deleted_on"                        => __("Deleted on"),
229
            "location"                          => __("Shelving location"),
229
            "location"                          => __("Shelving location"),
230
            "permanent_location"                => __("Permanent shelving location"),
230
            "permanent_location"                => __("Permanent shelving location"),
231
            "sub_location"                      => __("Sublocation"),
231
            "onloan"                            => __("Due date"),
232
            "onloan"                            => __("Due date"),
232
            "cn_source"                         => __("Source of classification / shelving scheme"),
233
            "cn_source"                         => __("Source of classification / shelving scheme"),
233
            "cn_sort"                           => __("Koha normalized classification for sorting"),
234
            "cn_sort"                           => __("Koha normalized classification for sorting"),
(-)a/Koha/Item.pm (+1 lines)
Lines 1795-1800 sub to_api_mapping { Link Here
1795
        stocknumber              => 'inventory_number',
1795
        stocknumber              => 'inventory_number',
1796
        new_status               => 'new_status',
1796
        new_status               => 'new_status',
1797
        deleted_on               => undef,
1797
        deleted_on               => undef,
1798
        sub_location             => 'sub_location'
1798
    };
1799
    };
1799
}
1800
}
1800
1801
(-)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 781-786 my $count = 0; Link Here
781
my @riloop;
781
my @riloop;
782
my $shelflocations =
782
my $shelflocations =
783
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
783
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
784
my $sublocation =
785
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.sub_location' } ) };
784
foreach ( sort { $a <=> $b } keys %returneditems ) {
786
foreach ( sort { $a <=> $b } keys %returneditems ) {
785
    my %ri;
787
    my %ri;
786
    if ( $count++ < $returned_counter ) {
788
    if ( $count++ < $returned_counter ) {
Lines 839-845 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
839
        $ri{location} = $item->location;
841
        $ri{location} = $item->location;
840
        my $shelfcode = $ri{'location'};
842
        my $shelfcode = $ri{'location'};
841
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
843
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
842
844
        $ri{sub_location} = $sublocation->{$item->sub_location} if ( defined( $item->sub_location ) && defined($sublocation) && exists( $sublocation->{$item->sub_location} ) );
843
    }
845
    }
844
    else {
846
    else {
845
        last;
847
        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 2781-2786 CREATE TABLE `deleteditems` ( Link Here
2781
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2781
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2782
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2782
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2783
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2783
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2784
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
2784
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2785
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2785
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2786
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2786
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
2787
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
Lines 4039-4044 CREATE TABLE `items` ( Link Here
4039
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4040
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4040
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4041
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4041
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4042
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4043
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
4042
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4044
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4043
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4045
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4044
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
4046
  `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 193-198 Link Here
193
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
193
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
194
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
194
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
195
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
195
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
196
    const av_subloc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.sub_location' })) | $raw %].map( av => [av.authorised_value, av.lib]));
196
    const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
197
    const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
197
    const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
198
    const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
198
    const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
199
    const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
Lines 384-389 Link Here
384
                    } else {
385
                    } else {
385
                        nodes += escape_str(loc_str);
386
                        nodes += escape_str(loc_str);
386
                    }
387
                    }
388
                    if ( row.sub_location ) {
389
                        nodes += '<span class="sub_location">';
390
                        let sub_location_str = av_subloc.get(row.sub_location.toString());
391
                        nodes += '(%s)'.format(escape_str(sub_location_str));
392
                        nodes += '</span>';
393
                    }
387
                    nodes += '</span>';
394
                    nodes += '</span>';
388
                    return nodes;
395
                    return nodes;
389
                }
396
                }
(-)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 1317-1323 Link Here
1317
                                                 [%- END -%]
1317
                                                 [%- END -%]
1318
                                            </td>
1318
                                            </td>
1319
                                            <td class="ci-shelvinglocation">
1319
                                            <td class="ci-shelvinglocation">
1320
                                                <span class="shelvingloc">[% riloo.location | html %]</span>
1320
                                                <span class="shelvingloc">[% riloo.location | html %] [% IF ( riloo.sub_location ) %] ([% riloo.sub_location | html %]) [% END %]</span>
1321
                                            </td>
1321
                                            </td>
1322
                                            <td class="ci-callnumber">
1322
                                            <td class="ci-callnumber">
1323
                                                [% riloo.itemcallnumber | html %]
1323
                                                [% riloo.itemcallnumber | html %]
1324
- 

Return to bug 34142