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

(-)a/Koha/Database/Columns.pm (+1 lines)
Lines 234-239 sub columns { Link Here
234
            "notforloan"                        => __("Not for loan"),
234
            "notforloan"                        => __("Not for loan"),
235
            "onloan"                            => __("Due date"),
235
            "onloan"                            => __("Due date"),
236
            "permanent_location"                => __("Permanent shelving location"),
236
            "permanent_location"                => __("Permanent shelving location"),
237
            "sub_location"                      => __("Sublocation"),
237
            "price"                             => __("Price"),
238
            "price"                             => __("Price"),
238
            "renewals"                          => __("Total renewals"),
239
            "renewals"                          => __("Total renewals"),
239
            "replacementprice"                  => __("Replacement price"),
240
            "replacementprice"                  => __("Replacement price"),
(-)a/Koha/Item.pm (+1 lines)
Lines 1856-1861 sub to_api_mapping { Link Here
1856
        stocknumber              => 'inventory_number',
1856
        stocknumber              => 'inventory_number',
1857
        new_status               => 'new_status',
1857
        new_status               => 'new_status',
1858
        deleted_on               => undef,
1858
        deleted_on               => undef,
1859
        sub_location             => 'sub_location'
1859
    };
1860
    };
1860
}
1861
}
1861
1862
(-)a/api/v1/swagger/definitions/item.yaml (+5 lines)
Lines 237-242 properties: Link Here
237
      - string
237
      - string
238
      - "null"
238
      - "null"
239
    description: "'new' value, whatever free-text information."
239
    description: "'new' value, whatever free-text information."
240
  sub_location:
241
    type:
242
      - string
243
      - "null"
244
    description: sub_location for this item
240
  exclude_from_local_holds_priority:
245
  exclude_from_local_holds_priority:
241
    type: boolean
246
    type: boolean
242
    description: Exclude this item from local holds priority.
247
    description: Exclude this item from local holds priority.
(-)a/circ/returns.pl (+9 lines)
Lines 749-754 my $shelflocations = { Link Here
749
        { frameworkcode => '', kohafield => 'items.location' }
749
        { frameworkcode => '', kohafield => 'items.location' }
750
    )
750
    )
751
};
751
};
752
my $sublocation = {
753
    map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field(
754
        { frameworkcode => '', kohafield => 'items.sub_location' }
755
    )
756
};
752
for my $checkin (@checkins) {
757
for my $checkin (@checkins) {
753
    my $item = Koha::Items->find( { barcode => $checkin->{barcode} } );
758
    my $item = Koha::Items->find( { barcode => $checkin->{barcode} } );
754
    next unless $item;    # FIXME The item has been deleted in the meantime,
759
    next unless $item;    # FIXME The item has been deleted in the meantime,
Lines 777-782 for my $checkin (@checkins) { Link Here
777
    my $shelfcode = $checkin->{item_location};
782
    my $shelfcode = $checkin->{item_location};
778
    $checkin->{item_location} = $shelflocations->{$shelfcode}
783
    $checkin->{item_location} = $shelflocations->{$shelfcode}
779
        if ( defined($shelfcode) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
784
        if ( defined($shelfcode) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
785
    $checkin->{sub_location} = $sublocation->{ $item->sub_location }
786
        if ( defined( $item->sub_location )
787
        && defined($sublocation)
788
        && exists( $sublocation->{ $item->sub_location } ) );
780
}
789
}
781
790
782
$template->param(
791
$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 2818-2823 CREATE TABLE `deleteditems` ( Link Here
2818
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2818
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
2819
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2819
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
2820
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2820
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
2821
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
2821
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2822
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
2822
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2823
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
2823
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
2824
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
Lines 4139-4144 CREATE TABLE `items` ( Link Here
4139
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4140
  `deleted_on` datetime DEFAULT NULL COMMENT 'date/time of deletion',
4140
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4141
  `location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4141
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4142
  `permanent_location` varchar(80) DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
4143
  `sub_location` varchar(80) DEFAULT NULL COMMENT 'authorized value for the sublocation for this item',
4142
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4144
  `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
4143
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4145
  `cn_source` varchar(10) DEFAULT NULL COMMENT 'classification source used on this item (MARC21 952$2)',
4144
  `cn_sort` varchar(255) DEFAULT NULL COMMENT 'normalized form of the call number (MARC21 952$o) used for sorting',
4146
  `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 223-228 Link Here
223
        const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
223
        const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %];
224
        const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
224
        const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
225
        const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
225
        const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib]));
226
        const av_subloc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.sub_location' })) | $raw %].map( av => [av.authorised_value, av.lib]));
226
        const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
227
        const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib]));
227
        const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
228
        const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib]));
228
        const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
229
        const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib]));
Lines 421-426 Link Here
421
                        } else {
422
                        } else {
422
                            nodes += escape_str(loc_str);
423
                            nodes += escape_str(loc_str);
423
                        }
424
                        }
425
                        if ( row.sub_location ) {
426
                            nodes += '<span class="sub_location">';
427
                            let sub_location_str = av_subloc.get(row.sub_location.toString());
428
                            nodes += '(%s)'.format(escape_str(sub_location_str));
429
                            nodes += '</span>';
430
                        }
424
                        nodes += '</span>';
431
                        nodes += '</span>';
425
                        return nodes;
432
                        return nodes;
426
                    }
433
                    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+6 lines)
Lines 183-188 Link Here
183
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
183
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
184
                                    </li>
184
                                    </li>
185
                                [% END %]
185
                                [% END %]
186
                                [% IF ( ITEM_DAT.sub_location ) %]
187
                                    <li>
188
                                        <span class="label">Sublocation:</span>
189
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.sub_location', authorised_value => ITEM_DAT.sub_location ) | html %]
190
                                    </li>
191
                                [% END %]
186
                                [% IF ( ITEM_DAT.replacementprice ) %]
192
                                [% IF ( ITEM_DAT.replacementprice ) %]
187
                                    <li class="replacementprice"><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
193
                                    <li class="replacementprice"><span class="label">Replacement price:</span> [% ITEM_DAT.replacementprice | $Price %]&nbsp;</li>
188
                                [% END %]
194
                                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +1 lines)
Lines 1381-1387 Link Here
1381
                            [%- END -%]
1381
                            [%- END -%]
1382
                        </td>
1382
                        </td>
1383
                        <td class="ci-shelvinglocation">
1383
                        <td class="ci-shelvinglocation">
1384
                            <span class="shelvingloc">[% checkin.item_location | html %]</span>
1384
                            <span class="shelvingloc">[% checkin.location | html %] [% IF ( checkin.sub_location ) %] ([% checkin.sub_location | html %]) [% END %]</span>
1385
                        </td>
1385
                        </td>
1386
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1386
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1387
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
1387
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
1388
- 

Return to bug 34142