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

(-)a/catalogue/detail.pl (-5 / +2 lines)
Lines 495-505 if ( C4::Context->preference('UseCourseReserves') ) { Link Here
495
    $template->param( course_reserves => $course_reserves );
495
    $template->param( course_reserves => $course_reserves );
496
}
496
}
497
497
498
my @libraries = $biblio->items($items_params)->get_column('homebranch');
498
my @libraries = $patron->libraries_where_can_edit_items;
499
my %can_edit_items_from = map {
499
$template->param(can_edit_items_from => \@libraries);
500
    $_ => $patron->can_edit_items_from($_)
501
} @libraries;
502
$template->param(can_edit_items_from => \%can_edit_items_from);
503
500
504
my @itemtypes = Koha::ItemTypes->search->as_list;
501
my @itemtypes = Koha::ItemTypes->search->as_list;
505
my %item_type_image_locations = map {
502
my %item_type_image_locations = map {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-4 / +3 lines)
Lines 190-196 Link Here
190
            });
190
            });
191
    const item_types_notforloan = new Map(all_item_types.map( it => [it.itemtype, it.notforloan] ));
191
    const item_types_notforloan = new Map(all_item_types.map( it => [it.itemtype, it.notforloan] ));
192
192
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_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]));
Lines 300-306 Link Here
300
                searchable: false,
300
                searchable: false,
301
                orderable: false,
301
                orderable: false,
302
                render: function (data, type, row, meta) {
302
                render: function (data, type, row, meta) {
303
                    if ( can_edit_items_from[row.holding_library_id] ){
303
                    if ( can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length ){
304
                        if ( items_selection[tab_id].includes(row.item_id) ) {
304
                        if ( items_selection[tab_id].includes(row.item_id) ) {
305
                            return '<input type="checkbox" value="%s" name="itemnumber" checked />'.format(row.item_id);
305
                            return '<input type="checkbox" value="%s" name="itemnumber" checked />'.format(row.item_id);
306
                        } else {
306
                        } else {
Lines 752-758 Link Here
752
            {
752
            {
753
                data: function( row, type, val, meta ) {
753
                data: function( row, type, val, meta ) {
754
                    let nodes = '';
754
                    let nodes = '';
755
                    if ( can_edit_items_from[row.holding_library_id] ){
755
                    if ( can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length ){
756
                        [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
756
                        [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
757
                            nodes += '<div class="btn-group">';
757
                            nodes += '<div class="btn-group">';
758
                            nodes += ' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>'.format(row.biblio_id, row.item_id, _("Edit"));
758
                            nodes += ' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>'.format(row.biblio_id, row.item_id, _("Edit"));
759
- 

Return to bug 37383