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

(-)a/Koha/Database/Columns.pm (+1 lines)
Lines 229-234 sub columns { Link Here
229
            "deleted_on"                        => __("Deleted on"),
229
            "deleted_on"                        => __("Deleted on"),
230
            "location"                          => __("Shelving location"),
230
            "location"                          => __("Shelving location"),
231
            "permanent_location"                => __("Permanent shelving location"),
231
            "permanent_location"                => __("Permanent shelving location"),
232
            "sub_location"                      => __("Sublocation"),
232
            "onloan"                            => __("Due date"),
233
            "onloan"                            => __("Due date"),
233
            "cn_source"                         => __("Source of classification / shelving scheme"),
234
            "cn_source"                         => __("Source of classification / shelving scheme"),
234
            "cn_sort"                           => __("Koha normalized classification for sorting"),
235
            "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 219-224 properties: Link Here
219
      - string
219
      - string
220
      - "null"
220
      - "null"
221
    description: "'new' value, whatever free-text information."
221
    description: "'new' value, whatever free-text information."
222
  sub_location:
223
    type:
224
      - string
225
      - "null"
226
    description: sub_location for this item
222
  exclude_from_local_holds_priority:
227
  exclude_from_local_holds_priority:
223
    type: boolean
228
    type: boolean
224
    description: Exclude this item from local holds priority.
229
    description: Exclude this item from local holds priority.
(-)a/circ/returns.pl (-1 / +3 lines)
Lines 761-766 my $count = 0; Link Here
761
my @riloop;
761
my @riloop;
762
my $shelflocations =
762
my $shelflocations =
763
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
763
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
764
my $sublocation =
765
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.sub_location' } ) };
764
foreach ( sort { $a <=> $b } keys %returneditems ) {
766
foreach ( sort { $a <=> $b } keys %returneditems ) {
765
    my %ri;
767
    my %ri;
766
    if ( $count++ < $returned_counter ) {
768
    if ( $count++ < $returned_counter ) {
Lines 816-822 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
816
        $ri{location} = $item->location;
818
        $ri{location} = $item->location;
817
        my $shelfcode = $ri{'location'};
819
        my $shelfcode = $ri{'location'};
818
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
820
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
819
821
        $ri{sub_location} = $sublocation->{$item->sub_location} if ( defined( $item->sub_location ) && defined($sublocation) && exists( $sublocation->{$item->sub_location} ) );
820
    }
822
    }
821
    else {
823
    else {
822
        last;
824
        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 2768-2773 CREATE TABLE `deleteditems` ( Link Here
2768
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2768
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2769
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2769
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2770
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2770
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2771
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
2771
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2772
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2772
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2773
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2773
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
2774
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
Lines 4025-4030 CREATE TABLE `items` ( Link Here
4025
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4026
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4026
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4027
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4027
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4028
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4029
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
4028
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4030
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4029
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4031
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4030
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
4032
  `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 192-197 Link Here
192
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
192
    const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %];
193
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
193
    const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
194
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
194
    const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
195
    const av_subloc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.sub_location' })) | $raw %].map( av => [av.authorised_value, av.lib]));
195
    const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $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]));
196
    const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $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]));
197
    const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $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]));
Lines 383-388 Link Here
383
                    } else {
384
                    } else {
384
                        nodes += escape_str(loc_str);
385
                        nodes += escape_str(loc_str);
385
                    }
386
                    }
387
                    if ( row.sub_location ) {
388
                        nodes += '<span class="sub_location">';
389
                        let sub_location_str = av_subloc.get(row.sub_location.toString());
390
                        nodes += '(%s)'.format(escape_str(sub_location_str));
391
                        nodes += '</span>';
392
                    }
386
                    nodes += '</span>';
393
                    nodes += '</span>';
387
                    return nodes;
394
                    return nodes;
388
                }
395
                }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+6 lines)
Lines 148-153 Link Here
148
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
148
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
149
                                            </li>
149
                                            </li>
150
                                        [% END %]
150
                                        [% END %]
151
                                        [% IF ( ITEM_DAT.sub_location ) %]
152
                                            <li>
153
                                                <span class="label">Sublocation:</span>
154
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.sub_location', authorised_value => ITEM_DAT.sub_location ) | html %]
155
                                            </li>
156
                                        [% END %]
151
                                        [% IF ( ITEM_DAT.replacementprice ) %]
157
                                        [% IF ( ITEM_DAT.replacementprice ) %]
152
                                            <li><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
158
                                            <li><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
153
                                        [% END %]
159
                                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +1 lines)
Lines 1306-1312 Link Here
1306
                                                 [%- END -%]
1306
                                                 [%- END -%]
1307
                                            </td>
1307
                                            </td>
1308
                                            <td class="ci-shelvinglocation">
1308
                                            <td class="ci-shelvinglocation">
1309
                                                <span class="shelvingloc">[% riloo.location | html %]</span>
1309
                                                <span class="shelvingloc">[% riloo.location | html %] [% IF ( riloo.sub_location ) %] ([% riloo.sub_location | html %]) [% END %]</span>
1310
                                            </td>
1310
                                            </td>
1311
                                            <td class="ci-callnumber">
1311
                                            <td class="ci-callnumber">
1312
                                                [% riloo.itemcallnumber | html %]
1312
                                                [% riloo.itemcallnumber | html %]
1313
- 

Return to bug 34142