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

(-)a/Koha/Database/Columns.pm (+1 lines)
Lines 243-248 sub columns { Link Here
243
            "notforloan"                        => __("Not for loan"),
243
            "notforloan"                        => __("Not for loan"),
244
            "onloan"                            => __("Due date"),
244
            "onloan"                            => __("Due date"),
245
            "permanent_location"                => __("Permanent shelving location"),
245
            "permanent_location"                => __("Permanent shelving location"),
246
            "sub_location"                      => __("Sublocation"),
246
            "price"                             => __("Price"),
247
            "price"                             => __("Price"),
247
            "renewals"                          => __("Total renewals"),
248
            "renewals"                          => __("Total renewals"),
248
            "replacementprice"                  => __("Replacement price"),
249
            "replacementprice"                  => __("Replacement price"),
(-)a/Koha/Item.pm (+1 lines)
Lines 1983-1988 sub to_api_mapping { Link Here
1983
        stocknumber              => 'inventory_number',
1983
        stocknumber              => 'inventory_number',
1984
        new_status               => 'new_status',
1984
        new_status               => 'new_status',
1985
        deleted_on               => undef,
1985
        deleted_on               => undef,
1986
        sub_location             => 'sub_location'
1986
    };
1987
    };
1987
}
1988
}
1988
1989
(-)a/api/v1/swagger/definitions/item.yaml (+5 lines)
Lines 251-256 properties: Link Here
251
      - "null"
251
      - "null"
252
    description: "'new' value, whatever free-text information."
252
    description: "'new' value, whatever free-text information."
253
    maxLength: 32
253
    maxLength: 32
254
  sub_location:
255
    type:
256
      - string
257
      - "null"
258
    description: sub_location for this item
254
  exclude_from_local_holds_priority:
259
  exclude_from_local_holds_priority:
255
    type: boolean
260
    type: boolean
256
    description: Exclude this item from local holds priority.
261
    description: Exclude this item from local holds priority.
(-)a/circ/returns.pl (+9 lines)
Lines 760-765 my $shelflocations = { Link Here
760
        { frameworkcode => '', kohafield => 'items.location' }
760
        { frameworkcode => '', kohafield => 'items.location' }
761
    )
761
    )
762
};
762
};
763
my $sublocation = {
764
    map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field(
765
        { frameworkcode => '', kohafield => 'items.sub_location' }
766
    )
767
};
763
for my $checkin (@checkins) {
768
for my $checkin (@checkins) {
764
    my $item = Koha::Items->find( { barcode => $checkin->{barcode} } );
769
    my $item = Koha::Items->find( { barcode => $checkin->{barcode} } );
765
    next unless $item;    # FIXME The item has been deleted in the meantime,
770
    next unless $item;    # FIXME The item has been deleted in the meantime,
Lines 788-793 for my $checkin (@checkins) { Link Here
788
    my $shelfcode = $checkin->{item_location};
793
    my $shelfcode = $checkin->{item_location};
789
    $checkin->{item_location} = $shelflocations->{$shelfcode}
794
    $checkin->{item_location} = $shelflocations->{$shelfcode}
790
        if ( defined($shelfcode) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
795
        if ( defined($shelfcode) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
796
    $checkin->{sub_location} = $sublocation->{ $item->sub_location }
797
        if ( defined( $item->sub_location )
798
        && defined($sublocation)
799
        && exists( $sublocation->{ $item->sub_location } ) );
791
}
800
}
792
801
793
$template->param(
802
$template->param(
(-)a/installer/data/mysql/atomicupdate/bug_34142.pl (+20 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(q{ALTER TABLE items ADD COLUMN sub_location VARCHAR(80) DEFAULT NULL AFTER permanent_location});
12
            say $out "Added new column items.sub_location";
13
        }
14
        if ( !column_exists( 'deleteditems', 'sub_location' ) ) {
15
            $dbh->do(
16
                q{ALTER TABLE deleteditems ADD COLUMN sub_location VARCHAR(80) DEFAULT NULL AFTER permanent_location});
17
            say $out "Added new column deleteditems.sub_location";
18
        }
19
    },
20
};
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 2819-2824 CREATE TABLE `deleteditems` ( Link Here
2819
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2819
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2820
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2820
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2821
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2821
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2822
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
2822
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2823
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2823
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2824
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2824
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
2825
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
Lines 4140-4145 CREATE TABLE `items` ( Link Here
4140
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4141
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4141
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4142
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4142
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4143
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4144
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
4143
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4145
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4144
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4146
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4145
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
4147
  `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 226-231 Link Here
226
        const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
226
        const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
227
        const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
227
        const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
228
        const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
228
        const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
229
        const av_subloc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.sub_location' })) | $raw %].map( av => [av.authorised_value, av.lib]));
229
        const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
230
        const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
230
        const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
231
        const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
231
        const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
232
        const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
Lines 440-445 Link Here
440
                        } else {
441
                        } else {
441
                            nodes += escape_str(loc_str);
442
                            nodes += escape_str(loc_str);
442
                        }
443
                        }
444
                        if ( row.sub_location ) {
445
                            nodes += '<span class="sub_location">';
446
                            let sub_location_str = av_subloc.get(row.sub_location.toString());
447
                            nodes += '(%s)'.format(escape_str(sub_location_str));
448
                            nodes += '</span>';
449
                        }
443
                        nodes += '</span>';
450
                        nodes += '</span>';
444
                        return nodes;
451
                        return nodes;
445
                    }
452
                    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+6 lines)
Lines 193-198 Link Here
193
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
193
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
194
                                    </li>
194
                                    </li>
195
                                [% END %]
195
                                [% END %]
196
                                [% IF ( ITEM_DAT.sub_location ) %]
197
                                    <li>
198
                                        <span class="label">Sublocation:</span>
199
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.sub_location', authorised_value => ITEM_DAT.sub_location ) | html %]
200
                                    </li>
201
                                [% END %]
196
                                [% IF ( ITEM_DAT.replacementprice ) %]
202
                                [% IF ( ITEM_DAT.replacementprice ) %]
197
                                    <li class="replacementprice"><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
203
                                    <li class="replacementprice"><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
198
                                [% END %]
204
                                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +1 lines)
Lines 1362-1368 Link Here
1362
                            [%- END -%]
1362
                            [%- END -%]
1363
                        </td>
1363
                        </td>
1364
                        <td class="ci-shelvinglocation">
1364
                        <td class="ci-shelvinglocation">
1365
                            <span class="shelvingloc">[% checkin.item_location | html %]</span>
1365
                            <span class="shelvingloc">[% checkin.location | html %] [% IF ( checkin.sub_location ) %] ([% checkin.sub_location | html %]) [% END %]</span>
1366
                        </td>
1366
                        </td>
1367
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1367
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1368
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
1368
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
1369
- 

Return to bug 34142