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

(-)a/admin/library_groups.pl (+4 lines)
Lines 52-57 if ( $op eq 'cud-add' ) { Link Here
52
    my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0;
52
    my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0;
53
    my $ft_local_hold_group    = $cgi->param('ft_local_hold_group')    || 0;
53
    my $ft_local_hold_group    = $cgi->param('ft_local_hold_group')    || 0;
54
    my $ft_local_float_group   = $cgi->param('ft_local_float_group')   || 0;
54
    my $ft_local_float_group   = $cgi->param('ft_local_float_group')   || 0;
55
    my $ft_display_group       = $cgi->param('ft_display_group')       || 0;
55
56
56
    if ( !$branchcode && Koha::Library::Groups->search( { title => $title } )->count() ) {
57
    if ( !$branchcode && Koha::Library::Groups->search( { title => $title } )->count() ) {
57
        $template->param( error_duplicate_title => $title );
58
        $template->param( error_duplicate_title => $title );
Lines 68-73 if ( $op eq 'cud-add' ) { Link Here
68
                    ft_local_hold_group    => $ft_local_hold_group,
69
                    ft_local_hold_group    => $ft_local_hold_group,
69
                    ft_limit_item_editing  => $ft_limit_item_editing,
70
                    ft_limit_item_editing  => $ft_limit_item_editing,
70
                    ft_local_float_group   => $ft_local_float_group,
71
                    ft_local_float_group   => $ft_local_float_group,
72
                    ft_display_group       => $ft_display_group,
71
                    branchcode             => $branchcode,
73
                    branchcode             => $branchcode,
72
                }
74
                }
73
            )->store();
75
            )->store();
Lines 88-93 if ( $op eq 'cud-add' ) { Link Here
88
    my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0;
90
    my $ft_search_groups_staff = $cgi->param('ft_search_groups_staff') || 0;
89
    my $ft_local_hold_group    = $cgi->param('ft_local_hold_group')    || 0;
91
    my $ft_local_hold_group    = $cgi->param('ft_local_hold_group')    || 0;
90
    my $ft_local_float_group   = $cgi->param('ft_local_float_group')   || 0;
92
    my $ft_local_float_group   = $cgi->param('ft_local_float_group')   || 0;
93
    my $ft_display_group       = $cgi->param('ft_display_group')       || 0;
91
94
92
    if ($id) {
95
    if ($id) {
93
        my $group = Koha::Library::Groups->find($id);
96
        my $group = Koha::Library::Groups->find($id);
Lines 102-107 if ( $op eq 'cud-add' ) { Link Here
102
                ft_search_groups_staff => $ft_search_groups_staff,
105
                ft_search_groups_staff => $ft_search_groups_staff,
103
                ft_local_hold_group    => $ft_local_hold_group,
106
                ft_local_hold_group    => $ft_local_hold_group,
104
                ft_local_float_group   => $ft_local_float_group,
107
                ft_local_float_group   => $ft_local_float_group,
108
                ft_display_group       => $ft_display_group,
105
            }
109
            }
106
        )->store();
110
        )->store();
107
111
(-)a/basket/basket.pl (-4 / +15 lines)
Lines 17-22 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use CGI qw ( -utf8 );
19
use CGI qw ( -utf8 );
20
use C4::Context;
20
use C4::Koha;
21
use C4::Koha;
21
use C4::Biblio qw(
22
use C4::Biblio qw(
22
    GetMarcSeries
23
    GetMarcSeries
Lines 29-34 use C4::Output qw( output_html_with_http_headers ); Link Here
29
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
30
use Koha::Biblios;
31
use Koha::Biblios;
31
use Koha::CsvProfiles;
32
use Koha::CsvProfiles;
33
use Koha::Items;
32
34
33
my $query = CGI->new;
35
my $query = CGI->new;
34
36
Lines 87-93 foreach my $biblionumber (@bibs) { Link Here
87
89
88
    $num++;
90
    $num++;
89
    $dat->{biblionumber} = $biblionumber;
91
    $dat->{biblionumber} = $biblionumber;
90
    $dat->{ITEM_RESULTS} = $biblio->items->search_ordered;
92
    my $items = $biblio->items->search_ordered;
93
94
    # Add effective_location for display module support
95
    if ( C4::Context->preference('UseDisplayModule') ) {
96
        foreach my $item ( $items->as_list ) {
97
            $item->{effective_location} = $item->effective_location;
98
        }
99
    }
100
    $dat->{ITEM_RESULTS} = $items;
91
    $dat->{MARCNOTES}    = $marcnotesarray;
101
    $dat->{MARCNOTES}    = $marcnotesarray;
92
    $dat->{MARCSUBJCTS}  = $marcsubjctsarray;
102
    $dat->{MARCSUBJCTS}  = $marcsubjctsarray;
93
    $dat->{MARCAUTHORS}  = $marcauthorsarray;
103
    $dat->{MARCAUTHORS}  = $marcauthorsarray;
Lines 107-115 my $resultsarray = \@results; Link Here
107
# my $itemsarray=\@items;
117
# my $itemsarray=\@items;
108
118
109
$template->param(
119
$template->param(
110
    BIBLIO_RESULTS => $resultsarray,
120
    BIBLIO_RESULTS   => $resultsarray,
111
    csv_profiles   => Koha::CsvProfiles->search( { type => 'marc', used_for => 'export_records' } ),
121
    csv_profiles     => Koha::CsvProfiles->search( { type => 'marc', used_for => 'export_records' } ),
112
    bib_list       => $bib_list,
122
    bib_list         => $bib_list,
123
    UseDisplayModule => C4::Context->preference('UseDisplayModule'),
113
);
124
);
114
125
115
output_html_with_http_headers $query, $cookie, $template->output;
126
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/itemsearch.pl (+7 lines)
Lines 30-35 use C4::Koha qw( GetAuthorisedValues ); Link Here
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
use Koha::Biblios;
31
use Koha::Biblios;
32
use Koha::Item::Search::Field qw(GetItemSearchFields);
32
use Koha::Item::Search::Field qw(GetItemSearchFields);
33
use Koha::Items;
33
use Koha::ItemTypes;
34
use Koha::ItemTypes;
34
use Koha::Libraries;
35
use Koha::Libraries;
35
36
Lines 292-297 if ( defined $format and $format ne 'shareable' ) { Link Here
292
            $item->{biblioitem} = $biblio->biblioitem->unblessed;
293
            $item->{biblioitem} = $biblio->biblioitem->unblessed;
293
            my $checkout = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
294
            my $checkout = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
294
            $item->{checkout} = $checkout;
295
            $item->{checkout} = $checkout;
296
297
            # Add effective_location for display module support
298
            if ( C4::Context->preference('UseDisplayModule') ) {
299
                my $item_obj = Koha::Items->find( $item->{itemnumber} );
300
                $item->{effective_location} = $item_obj ? $item_obj->effective_location : $item->{location};
301
            }
295
        }
302
        }
296
    }
303
    }
297
304
(-)a/catalogue/moredetail.pl (-4 / +35 lines)
Lines 158-167 foreach my $item (@items) { Link Here
158
158
159
    my $item_info = $item->unblessed;
159
    my $item_info = $item->unblessed;
160
    $item_info->{object} = $item;
160
    $item_info->{object} = $item;
161
    $item_info->{itype}  = $itemtypes->{ $item->itype }->{'translated_description'}
161
    $item_info->{itype}  = $itemtypes->{ $item->effective_itemtype }->{'translated_description'}
162
        if exists $itemtypes->{ $item->itype };
162
        if exists $itemtypes->{ $item->effective_itemtype };
163
    $item_info->{effective_itemtype} = $itemtypes->{ $item->effective_itemtype };
163
    $item_info->{'ccode'} = $ccodes->{ $item->effective_collection_code }
164
    $item_info->{'ccode'} = $ccodes->{ $item->ccode } if $ccodes && $item->ccode && exists $ccodes->{ $item->ccode };
164
        if $ccodes && $item->effective_collection_code && exists $ccodes->{ $item->effective_collection_code };
165
    if ( defined $item->copynumber ) {
165
    if ( defined $item->copynumber ) {
166
        $item_info->{'displaycopy'} = 1;
166
        $item_info->{'displaycopy'} = 1;
167
        if ( defined $copynumbers->{ $item_info->{'copynumber'} } ) {
167
        if ( defined $copynumbers->{ $item_info->{'copynumber'} } ) {
Lines 256-261 foreach my $item (@items) { Link Here
256
256
257
    $item_info->{nomod} = !$patron->can_edit_items_from( $item->homebranch );
257
    $item_info->{nomod} = !$patron->can_edit_items_from( $item->homebranch );
258
258
259
    if ( C4::Context->preference('UseDisplayModule') ) {
260
        my @displays;
261
        my @display_items = Koha::DisplayItems->search(
262
            { itemnumber => $item->itemnumber },
263
            {
264
                order_by => { '-desc' => 'date_added' },
265
            }
266
        )->as_list;
267
268
        foreach my $display_item (@display_items) {
269
            push @displays, $display_item->display;
270
        }
271
272
        $item_info->{display_items} = \@display_items if @display_items;
273
        $item_info->{displays}      = \@displays      if @displays;
274
    }
275
276
    if ( C4::Context->preference('UseDisplayModule') && $item->effective_homebranch ) {
277
        my $effective_homebranch    = $item->effective_homebranch;
278
        my $effective_homebranch_id = $item->effective_homebranch->branchcode;
279
280
        $item_info->{homebranch} = $effective_homebranch_id;
281
    }
282
283
    if ( C4::Context->preference('UseDisplayModule') && $item->effective_holdingbranch ) {
284
        my $effective_holdingbranch    = $item->effective_holdingbranch;
285
        my $effective_holdingbranch_id = $item->effective_holdingbranch->branchcode;
286
287
        $item_info->{holdingbranch} = $effective_holdingbranch_id;
288
    }
289
259
    push @item_data, $item_info;
290
    push @item_data, $item_info;
260
}
291
}
261
292
(-)a/catalogue/search.pl (+1 lines)
Lines 708-713 if ($hits) { Link Here
708
            sort_by           => \@sort_by
708
            sort_by           => \@sort_by
709
        }
709
        }
710
        );
710
        );
711
711
    $template->param( hits_to_paginate => $hits_to_paginate );
712
    $template->param( hits_to_paginate => $hits_to_paginate );
712
    $template->param( SEARCH_RESULTS   => \@newresults );
713
    $template->param( SEARCH_RESULTS   => \@newresults );
713
714
(-)a/cataloguing/additem.pl (+15 lines)
Lines 165-170 if ( $op eq 'edititem' || $op eq 'dupeitem' ) { Link Here
165
    if ( !$item ) {
165
    if ( !$item ) {
166
        $template->param( biblio => $biblio, item_doesnt_exist => 1 );
166
        $template->param( biblio => $biblio, item_doesnt_exist => 1 );
167
        output_and_exit( $input, $cookie, $template, 'unknown_item' );
167
        output_and_exit( $input, $cookie, $template, 'unknown_item' );
168
    } else {
169
        my $ondisplay = $item->active_display ? 1 : undef;
170
        my $nomod     = $ondisplay;
171
172
        $template->param( ondisplay => $ondisplay, nomod => $nomod );
168
    }
173
    }
169
}
174
}
170
175
Lines 698-703 my @items; Link Here
698
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) {
703
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) {
699
    my $i = $item->columns_to_str;
704
    my $i = $item->columns_to_str;
700
    $i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch );
705
    $i->{nomod} = 1 unless $patron->can_edit_items_from( $item->homebranch );
706
707
    if ( C4::Context->preference('UseDisplayModule') ) {
708
        if ( $item->active_display ) {
709
            $i->{active_display_id}   = $item->active_display->display_id;
710
            $i->{active_display_name} = $item->active_display->display_name;
711
            $i->{ondisplay}           = 1;
712
            $i->{nomod}               = 1;
713
        }
714
    }
715
701
    push @items, $i;
716
    push @items, $i;
702
}
717
}
703
718
(-)a/circ/overdue.pl (-30 / +35 lines)
Lines 28-33 use Koha::DateUtils qw( dt_from_string ); Link Here
28
use Koha::Patron::Attribute::Types;
28
use Koha::Patron::Attribute::Types;
29
use DateTime;
29
use DateTime;
30
use DateTime::Format::MySQL;
30
use DateTime::Format::MySQL;
31
use Koha::Items;
31
32
32
my $input               = CGI->new;
33
my $input               = CGI->new;
33
my $showall             = $input->param('showall');
34
my $showall             = $input->param('showall');
Lines 349-384 if ($noreport) { Link Here
349
        }
350
        }
350
351
351
        push @overduedata, {
352
        push @overduedata, {
352
            patron                  => Koha::Patrons->find( $data->{borrowernumber} ),
353
            patron             => Koha::Patrons->find( $data->{borrowernumber} ),
353
            duedate                 => $data->{date_due},
354
            duedate            => $data->{date_due},
354
            borrowernumber          => $data->{borrowernumber},
355
            borrowernumber     => $data->{borrowernumber},
355
            cardnumber              => $data->{cardnumber},
356
            cardnumber         => $data->{cardnumber},
356
            borrowertitle           => $data->{borrowertitle},
357
            borrowertitle      => $data->{borrowertitle},
357
            surname                 => $data->{surname},
358
            surname            => $data->{surname},
358
            firstname               => $data->{firstname},
359
            firstname          => $data->{firstname},
359
            streetnumber            => $data->{streetnumber},
360
            streetnumber       => $data->{streetnumber},
360
            streettype              => $data->{streettype},
361
            streettype         => $data->{streettype},
361
            address                 => $data->{address},
362
            address            => $data->{address},
362
            address2                => $data->{address2},
363
            address2           => $data->{address2},
363
            city                    => $data->{city},
364
            city               => $data->{city},
364
            zipcode                 => $data->{zipcode},
365
            zipcode            => $data->{zipcode},
365
            country                 => $data->{country},
366
            country            => $data->{country},
366
            phone                   => $data->{phone},
367
            phone              => $data->{phone},
367
            email                   => $data->{email},
368
            email              => $data->{email},
368
            branchcode              => $data->{branchcode},
369
            branchcode         => $data->{branchcode},
369
            barcode                 => $data->{barcode},
370
            barcode            => $data->{barcode},
370
            datelastborrowed        => $data->{datelastborrowed},
371
            datelastborrowed   => $data->{datelastborrowed},
371
            itemnum                 => $data->{itemnumber},
372
            itemnum            => $data->{itemnumber},
372
            issuedate               => $data->{issuedate},
373
            issuedate          => $data->{issuedate},
373
            biblionumber            => $data->{biblionumber},
374
            biblionumber       => $data->{biblionumber},
374
            title                   => $data->{title},
375
            title              => $data->{title},
375
            subtitle                => $data->{subtitle},
376
            subtitle           => $data->{subtitle},
376
            part_number             => $data->{part_number},
377
            part_number        => $data->{part_number},
377
            part_name               => $data->{part_name},
378
            part_name          => $data->{part_name},
378
            author                  => $data->{author},
379
            author             => $data->{author},
379
            homebranchcode          => $data->{homebranch},
380
            homebranchcode     => $data->{homebranch},
380
            holdingbranchcode       => $data->{holdingbranch},
381
            holdingbranchcode  => $data->{holdingbranch},
381
            location                => $data->{location},
382
            location           => $data->{location},
383
            effective_location => do {
384
                my $item = Koha::Items->find( $data->{itemnumber} );
385
                $item ? $item->effective_location : '';
386
            },
382
            itemcallnumber          => $data->{itemcallnumber},
387
            itemcallnumber          => $data->{itemcallnumber},
383
            replacementprice        => $data->{replacementprice},
388
            replacementprice        => $data->{replacementprice},
384
            itemnotes_nonpublic     => $data->{itemnotes_nonpublic},
389
            itemnotes_nonpublic     => $data->{itemnotes_nonpublic},
(-)a/circ/pendingreserves.pl (-4 / +22 lines)
Lines 260-266 foreach my $bibnum (@biblionumbers) { Link Here
260
    # get available item types for each biblio
260
    # get available item types for each biblio
261
    my @res_itemtypes;
261
    my @res_itemtypes;
262
    if ( C4::Context->preference('item-level_itypes') ) {
262
    if ( C4::Context->preference('item-level_itypes') ) {
263
        @res_itemtypes = uniq map { defined $_->itype ? $_->itype : () } @$items;
263
        @res_itemtypes = uniq map { defined $_->effective_itemtype ? $_->effective_itemtype : () } @$items;
264
    } else {
264
    } else {
265
        @res_itemtypes = Koha::Biblioitems->search(
265
        @res_itemtypes = Koha::Biblioitems->search(
266
            { biblionumber => $bibnum, itemtype => { '!=', undef } },
266
            { biblionumber => $bibnum, itemtype => { '!=', undef } },
Lines 270-288 foreach my $bibnum (@biblionumbers) { Link Here
270
            }
270
            }
271
        )->get_column('itemtype');
271
        )->get_column('itemtype');
272
    }
272
    }
273
273
    $hold_info->{itemtypes} = \@res_itemtypes;
274
    $hold_info->{itemtypes} = \@res_itemtypes;
274
275
275
    my $res_info = $all_holds->{$bibnum};
276
    my $res_info = $all_holds->{$bibnum};
276
277
277
    # get available values for each biblio
278
    # get available values for each biblio
278
    my $fields = {
279
    my $fields = {
279
        collections     => 'ccode',
280
        collections     => 'effective_collection_code',
280
        locations       => 'location',
281
        locations       => 'effective_location',
281
        callnumbers     => 'itemcallnumber',
282
        callnumbers     => 'itemcallnumber',
282
        enumchrons      => 'enumchron',
283
        enumchrons      => 'enumchron',
283
        copynumbers     => 'copynumber',
284
        copynumbers     => 'copynumber',
284
        barcodes        => 'barcode',
285
        barcodes        => 'barcode',
285
        holdingbranches => 'holdingbranch'
286
        holdingbranches => 'effective_holdingbranch_id'
286
    };
287
    };
287
288
288
    while ( my ( $key, $field ) = each %$fields ) {
289
    while ( my ( $key, $field ) = each %$fields ) {
Lines 316-321 foreach my $bibnum (@biblionumbers) { Link Here
316
    $hold_info->{hold}       = $res_info;
317
    $hold_info->{hold}       = $res_info;
317
    $hold_info->{item_group} = $res_info->item_group;
318
    $hold_info->{item_group} = $res_info->item_group;
318
319
320
    if ( C4::Context->preference('UseDisplayModule') ) {
321
        my @displays;
322
        my @display_items = Koha::DisplayItems->search(
323
            { itemnumber => $hold_info->{item}->itemnumber },
324
            {
325
                order_by => { '-desc' => 'date_added' },
326
            }
327
        )->as_list;
328
329
        foreach my $display_item (@display_items) {
330
            push @displays, $display_item->display;
331
        }
332
333
        $hold_info->{display_items} = \@display_items if @display_items;
334
        $hold_info->{displays}      = \@displays      if @displays;
335
    }
336
319
    push @holds_info, $hold_info;
337
    push @holds_info, $hold_info;
320
}
338
}
321
339
(-)a/circ/returns.pl (+2 lines)
Lines 759-764 foreach my $code ( keys %$messages ) { Link Here
759
        ;
759
        ;
760
    } elsif ( $code eq 'InBundle' ) {
760
    } elsif ( $code eq 'InBundle' ) {
761
        $template->param( InBundle => $messages->{InBundle} );
761
        $template->param( InBundle => $messages->{InBundle} );
762
    } elsif ( $code eq 'RemovedFromDisplay' ) {
763
        $template->param( RemovedFromDisplay => $messages->{RemovedFromDisplay} );
762
    } elsif ( $code eq 'UpdateLastSeenError' ) {
764
    } elsif ( $code eq 'UpdateLastSeenError' ) {
763
        $err{UpdateLastSeenError} = $messages->{UpdateLastSeenError};
765
        $err{UpdateLastSeenError} = $messages->{UpdateLastSeenError};
764
    } else {
766
    } else {
(-)a/circ/view_holdsqueue.pl (-1 / +27 lines)
Lines 27-32 use C4::Auth qw( get_template_and_user ); Link Here
27
use C4::Output     qw( output_html_with_http_headers );
27
use C4::Output     qw( output_html_with_http_headers );
28
use C4::HoldsQueue qw( GetHoldsQueueItems );
28
use C4::HoldsQueue qw( GetHoldsQueueItems );
29
use Koha::BiblioFrameworks;
29
use Koha::BiblioFrameworks;
30
use Koha::Items;
30
use Koha::ItemTypes;
31
use Koha::ItemTypes;
31
32
32
my $query = CGI->new;
33
my $query = CGI->new;
Lines 59-71 if ($run_report) { Link Here
59
        }
60
        }
60
    );
61
    );
61
62
63
    my @itemsloop;
64
    foreach my $item ( $items->as_list ) {
65
        my $itemsloo = $item->unblessed;
66
        $itemsloo->{object} = $item;
67
68
        if ( C4::Context->preference('UseDisplayModule') ) {
69
            my @displays;
70
            my @display_items = Koha::DisplayItems->search(
71
                { itemnumber => $item->itemnumber },
72
                {
73
                    order_by => { '-desc' => 'date_added' },
74
                }
75
            )->as_list;
76
77
            foreach my $display_item (@display_items) {
78
                push @displays, $display_item->display;
79
            }
80
81
            $itemsloo->{display_items} = \@display_items if @display_items;
82
            $itemsloo->{displays}      = \@displays      if @displays;
83
        }
84
85
        push @itemsloop, $itemsloo;
86
    }
87
62
    $template->param(
88
    $template->param(
63
        branchlimit    => $branchlimit,
89
        branchlimit    => $branchlimit,
64
        itemtypeslimit => $itemtypeslimit,
90
        itemtypeslimit => $itemtypeslimit,
65
        ccodeslimit    => $ccodeslimit,
91
        ccodeslimit    => $ccodeslimit,
66
        locationslimit => $locationslimit,
92
        locationslimit => $locationslimit,
67
        total          => $items->count,
93
        total          => $items->count,
68
        itemsloop      => $items,
94
        itemsloop      => \@itemsloop,
69
        run_report     => $run_report,
95
        run_report     => $run_report,
70
    );
96
    );
71
}
97
}
(-)a/display/display-home.pl (+54 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2025-2026 Open Fifth Ltd
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <https://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use CGI        qw ( -utf8 );
23
use C4::Auth   qw( get_template_and_user );
24
use C4::Output qw( output_html_with_http_headers );
25
26
use Koha::Database::Columns;
27
28
my $query = CGI->new;
29
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
30
    {
31
        template_name => 'display/display-home.tt',
32
        query         => $query,
33
        type          => 'intranet',
34
        flagsrequired => { displays => '*' },
35
    }
36
);
37
38
my $columns = Koha::Database::Columns::columns;
39
$template->param(
40
    db_columns => {
41
        map {
42
            my $table = $_;
43
            map { ( $table . '.' . $_ => $columns->{$table}->{$_} ) }
44
                keys %{ $columns->{$table} }
45
        } qw( biblio biblioitems items )
46
    },
47
    api_mappings => {
48
        items       => Koha::Item->to_api_mapping,
49
        biblioitems => Koha::Biblioitem->to_api_mapping,
50
        biblio      => Koha::Biblio->to_api_mapping,
51
    },
52
);
53
54
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (+5 lines)
Lines 2028-2033 i { Link Here
2028
    font-style: italic;
2028
    font-style: italic;
2029
}
2029
}
2030
2030
2031
// style for displays in catalogsearch
2032
.displays {
2033
    display: block;
2034
}
2035
2031
#closewindow {
2036
#closewindow {
2032
    margin-top: 2em;
2037
    margin-top: 2em;
2033
    text-align: center;
2038
    text-align: center;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc (+10 lines)
Lines 24-29 Link Here
24
        <span>Circulation</span>[% UNLESS Koha.Preference('IssueLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="IssueLog"></i>[% END %]
24
        <span>Circulation</span>[% UNLESS Koha.Preference('IssueLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="IssueLog"></i>[% END %]
25
    [% CASE 'CLAIMS' %]
25
    [% CASE 'CLAIMS' %]
26
        <span>Claims</span>[% UNLESS Koha.Preference('ClaimsLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="ClaimsLog"></i>[% END %]
26
        <span>Claims</span>[% UNLESS Koha.Preference('ClaimsLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="ClaimsLog"></i>[% END %]
27
    [% CASE 'DISPLAYS' %]
28
        <span>Displays</span>[% UNLESS Koha.Preference('DisplayItemsLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="DisplayItemsLog"></i>[% END %]
27
    [% CASE 'FINES' %]
29
    [% CASE 'FINES' %]
28
        <span>Fines</span>[% UNLESS Koha.Preference('FinesLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="FinesLog"></i>[% END %]
30
        <span>Fines</span>[% UNLESS Koha.Preference('FinesLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="FinesLog"></i>[% END %]
29
    [% CASE 'SYSTEMPREFERENCE' %]
31
    [% CASE 'SYSTEMPREFERENCE' %]
Lines 159-164 Link Here
159
        <span>Modify cardnumber</span>
161
        <span>Modify cardnumber</span>
160
    [% CASE 'RESET 2FA' %]
162
    [% CASE 'RESET 2FA' %]
161
        <span>Reset 2FA</span>
163
        <span>Reset 2FA</span>
164
    [% CASE 'ENABLE' %]
165
        <span>Enable</span>
166
    [% CASE 'DISABLE' %]
167
        <span>Disable</span>
168
    [% CASE 'ADD_ITEM' %]
169
        <span>Add item</span>
170
    [% CASE 'REMOVE_ITEM' %]
171
        <span>Remove item</span>
162
    [% CASE %]
172
    [% CASE %]
163
        [% action | html %]
173
        [% action | html %]
164
    [% END %]
174
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+70 lines)
Lines 308-318 Link Here
308
        [% END %]
308
        [% END %]
309
    [% END %]
309
    [% END %]
310
310
311
    [% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
312
        <div class="btn-group">
313
            <button type="button" class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa fa-tv"></i> Add to display</button>
314
            <ul class="dropdown-menu" id="display-dropdown">
315
                <li class="text-center"><i class="fa fa-spinner fa-spin"></i> Loading displays...</li>
316
            </ul>
317
        </div>
318
    [% END %]
319
311
    [% FOREACH p IN plugins %]
320
    [% FOREACH p IN plugins %]
312
        [% p.intranet_catalog_biblio_enhancements_toolbar_button | $raw %]
321
        [% p.intranet_catalog_biblio_enhancements_toolbar_button | $raw %]
313
    [% END %]
322
    [% END %]
314
</div>
323
</div>
315
324
325
<!-- Modal for Add to Display -->
326
[% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
327
    <div class="modal fade" id="addToDisplayModal" tabindex="-1" role="dialog" aria-labelledby="addToDisplayModalLabel" aria-hidden="true">
328
        <div class="modal-dialog modal-lg">
329
            <div class="modal-content">
330
                <div class="modal-header">
331
                    <h4 class="modal-title" id="addToDisplayModalLabel">Add items to display</h4>
332
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
333
                </div>
334
                <form id="addToDisplayForm">
335
                    <div class="modal-body">
336
                        <div class="row">
337
                            <div class="col-md-6">
338
                                <label for="display-select" class="form-label">Select display:</label>
339
                                <select id="display-select" class="form-select" required>
340
                                    <option value="">Loading displays...</option>
341
                                </select>
342
                            </div>
343
                            <div class="col-md-6">
344
                                <label for="date-remove" class="form-label">Remove date (optional):</label>
345
                                <div class="input-group">
346
                                    <input type="date" id="date-remove" class="form-control" />
347
                                    <button class="btn btn-outline-secondary" type="button" id="clear-date" title="Clear date">
348
                                        <i class="fa fa-times"></i>
349
                                    </button>
350
                                </div>
351
                            </div>
352
                        </div>
353
                        <div class="row mt-3">
354
                            <div class="col-12">
355
                                <label class="form-label">Select items to add:</label>
356
                                <div class="table-responsive">
357
                                    <table id="display-items-table" class="table table-striped">
358
                                        <thead>
359
                                            <tr>
360
                                                <th><input type="checkbox" id="select-all-display-items" /></th>
361
                                                <th>Barcode</th>
362
                                                <th>Current library</th>
363
                                                <th>Home library</th>
364
                                                <th>Location</th>
365
                                                <th>Collection</th>
366
                                                <th>Call number</th>
367
                                                <th>Status</th>
368
                                            </tr>
369
                                        </thead>
370
                                        <tbody> </tbody>
371
                                    </table>
372
                                </div>
373
                            </div>
374
                        </div>
375
                    </div>
376
                    <div class="modal-footer">
377
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
378
                        <button type="submit" class="btn btn-primary" id="add-to-display-btn">Add to display</button>
379
                    </div>
380
                </form>
381
            </div>
382
        </div>
383
    </div>
384
[% END %]
385
316
<!--Modal for Dublin Core-->
386
<!--Modal for Dublin Core-->
317
<div class="modal" id="exportModal_" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_" aria-hidden="true">
387
<div class="modal" id="exportModal_" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_" aria-hidden="true">
318
    <div class="modal-dialog">
388
    <div class="modal-dialog">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc (-1 / +1 lines)
Lines 8-11 Link Here
8
[%- SET biblioitem = item.biblioitem -%]
8
[%- SET biblioitem = item.biblioitem -%]
9
[%- SET delimiter = Koha.CSVDelimiter() -%]
9
[%- SET delimiter = Koha.CSVDelimiter() -%]
10
"[% biblio.title | replace('"', '""') | $raw %]
10
"[% biblio.title | replace('"', '""') | $raw %]
11
[% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by[% END %][% biblio.author | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% (biblioitem.publicationyear || biblio.copyrightdate) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% biblioitem.publishercode | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.barcode | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.itemnumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.enumchron | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.itemcallnumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% Branches.GetName(item.homebranch) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% Branches.GetName(item.holdingbranch) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% ItemTypes.GetDescription(item.itype) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.stocknumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.dateaccessioned | $KohaDates | $raw %]"[%- delimiter | $raw -%]"[% (item.issues || 0) | $raw %]"[%- delimiter | $raw -%]"[% item.datelastborrowed | $KohaDates | $raw %]"[%- delimiter | $raw -%]"[% IF item.checkout %][% item.checkout.date_due | $KohaDates | $raw %][% END %]"
11
[% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by[% END %][% biblio.author | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% (biblioitem.publicationyear || biblio.copyrightdate) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% biblioitem.publishercode | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.effective_collection_code ) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.barcode | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.itemnumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.enumchron | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.itemcallnumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% Branches.GetName(item.effective_homebranch) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% Branches.GetName(item.effective_holdingbranch) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.effective_location) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% ItemTypes.GetDescription(item.effective_itemtype) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.stocknumber | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) || "" | replace('"', '""') | $raw %]"[%- delimiter | $raw -%]"[% item.dateaccessioned | $KohaDates | $raw %]"[%- delimiter | $raw -%]"[% (item.issues || 0) | $raw %]"[%- delimiter | $raw -%]"[% item.datelastborrowed | $KohaDates | $raw %]"[%- delimiter | $raw -%]"[% IF item.checkout %][% item.checkout.date_due | $KohaDates | $raw %][% END %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc (-1 / +10 lines)
Lines 20-26 Link Here
20
    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]#item[% item.itemnumber | uri %]" title="Go to item details">[% item.barcode | html | $To %]</a>
20
    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]#item[% item.itemnumber | uri %]" title="Go to item details">[% item.barcode | html | $To %]</a>
21
[%~ END %]",
21
[%~ END %]",
22
"[% item.itemnumber | html %]", "[% item.enumchron | html | $To %]", "[% item.itemcallnumber | html | $To %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]",
22
"[% item.itemnumber | html %]", "[% item.enumchron | html | $To %]", "[% item.itemcallnumber | html | $To %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]",
23
"[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]",
23
[% IF Koha.Preference('UseDisplayModule') && item.effective_location %]
24
    [% SET effective_loc = item.effective_location %]
25
    [% IF effective_loc.match('^DISPLAY:') %]
26
        "[% effective_loc | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]",
27
    [% ELSE %]
28
        "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => effective_loc) | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]",
29
    [% END %]
30
[% ELSE %]
31
    "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]",
32
[% END %]
24
"[% item.stocknumber | html | $To %]", "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]",
33
"[% item.stocknumber | html | $To %]", "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]",
25
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]",
34
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]",
26
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]",
35
"[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]",
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/display-search.inc (+35 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Koha %]
3
[% PROCESS 'html_helpers.inc' %]
4
<!-- display-search.inc -->
5
[% WRAPPER tabs id="header_search" %]
6
    [% WRAPPER tab_panels %]
7
        [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
8
            [% INCLUDE 'patron-search-box.inc' bs_tab_active= 1 %]
9
            [% INCLUDE 'checkin-search-box.inc' %]
10
            [% INCLUDE 'renew-search-box.inc' %]
11
        [% END %]
12
        [% IF ( CAN_user_catalogue ) %]
13
            [% INCLUDE 'catalogue-search-box.inc' %]
14
        [% END %]
15
    [% END # /tab_panels %]
16
    [% WRAPPER tabs_nav %]
17
        [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
18
            [% WRAPPER tab_item tabname="circ_search" bt_active= 1 %]
19
                <i class="fa fa-fw fa-upload" aria-hidden="true"></i> <span class="tab-title">Check out</span>
20
            [% END %]
21
            [% WRAPPER tab_item tabname= "checkin_search" %]
22
                <i class="fa fa-fw fa-download" aria-hidden="true"></i> <span class="tab-title">Check in</span>
23
            [% END %]
24
            [% WRAPPER tab_item tabname= "renew_search" %]
25
                <i class="fa fa-fw fa-retweet" aria-hidden="true"></i> <span class="tab-title">Renew</span>
26
            [% END %]
27
        [% END %]
28
        [% IF ( CAN_user_catalogue ) %]
29
            [% WRAPPER tab_item tabname= "catalog_search" %]
30
                <i class="fa fa-fw fa-search" aria-hidden="true"></i> <span class="tab-title">Search catalog</span>
31
            [% END %]
32
        [% END %]
33
    [% END # /tabs_nav %]
34
[% END # /WRAPPER tabs %]
35
<!-- /display-search.inc -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (+3 lines)
Lines 70-75 Link Here
70
                        [% IF Koha.Preference('PreservationModule') && CAN_user_preservation %]
70
                        [% IF Koha.Preference('PreservationModule') && CAN_user_preservation %]
71
                            <li><a class="dropdown-item" href="/cgi-bin/koha/preservation/home.pl">Preservation</a></li>
71
                            <li><a class="dropdown-item" href="/cgi-bin/koha/preservation/home.pl">Preservation</a></li>
72
                        [% END %]
72
                        [% END %]
73
                        [% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
74
                            <li><a class="dropdown-item" href="/cgi-bin/koha/display/display-home.pl">Displays</a></li>
75
                        [% END %]
73
                        [% IF ( CAN_user_reports ) %]
76
                        [% IF ( CAN_user_reports ) %]
74
                            <li><a class="dropdown-item" href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
77
                            <li><a class="dropdown-item" href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></li>
75
                        [% END %]
78
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-24 / +198 lines)
Lines 25-30 Link Here
25
                <th id="[% tab | html %]_itemcallnumber" data-colname="itemcallnumber">Call number</th>
25
                <th id="[% tab | html %]_itemcallnumber" data-colname="itemcallnumber">Call number</th>
26
                <th id="[% tab | html %]_enumchron" data-colname="enumchron">Serial enumeration / chronology</th>
26
                <th id="[% tab | html %]_enumchron" data-colname="enumchron">Serial enumeration / chronology</th>
27
                <th id="[% tab | html %]_status" data-colname="status">Status</th>
27
                <th id="[% tab | html %]_status" data-colname="status">Status</th>
28
                <th id="[% tab | html %]_displays" data-colname="displays">Displays</th>
28
                <th id="[% tab | html %]_lastseen" data-colname="lastseen">Last seen</th>
29
                <th id="[% tab | html %]_lastseen" data-colname="lastseen">Last seen</th>
29
                <th id="[% tab | html %]_issues" data-colname="issues">Checkouts</th>
30
                <th id="[% tab | html %]_issues" data-colname="issues">Checkouts</th>
30
                <th id="[% tab | html %]_renewals" data-colname="renewals">Renewals</th>
31
                <th id="[% tab | html %]_renewals" data-colname="renewals">Renewals</th>
Lines 175-181 Link Here
175
                $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false);
176
                $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false);
176
                itemSelectionBuildActionLinks(tab_id);
177
                itemSelectionBuildActionLinks(tab_id);
177
            });
178
            });
178
179
        });
179
        });
180
180
181
        let filters_shown = false;
181
        let filters_shown = false;
Lines 256-262 Link Here
256
        [%# In case or SeparateHoldings we may need to display the number of biblios in each tab %]
256
        [%# In case or SeparateHoldings we may need to display the number of biblios in each tab %]
257
        [%# Do we need separate/new endpoints or do we hack the somewhere client-side? %]
257
        [%# Do we need separate/new endpoints or do we hack the somewhere client-side? %]
258
        let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
258
        let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
259
        let embed = ["+strings,_status,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"];
259
        let embed = ["+strings,_status,effective_home_library,effective_holding_library,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"];
260
        [% IF Koha.Preference('LocalCoverImages') %]
260
        [% IF Koha.Preference('LocalCoverImages') %]
261
            embed.push('cover_image_ids');
261
            embed.push('cover_image_ids');
262
        [% END %]
262
        [% END %]
Lines 332-337 Link Here
332
                return $("#" + tab_id + "_status select").val();
332
                return $("#" + tab_id + "_status select").val();
333
            };
333
            };
334
334
335
            [% IF Koha.Preference('UseDisplayModule') %]
336
                const displaysFetch = $.ajax({
337
                    url: '/api/v1/displays',
338
                    async: false,
339
                    method: 'GET',
340
                    headers: { 'x-koha-embed': 'display_items' },
341
                    error: error => {
342
                        console.error(error);
343
                    },
344
                });
345
                const displays = displaysFetch.responseJSON || [];
346
            [% ELSE %]
347
                const displays = [];
348
            [% END %]
349
335
            var items_table = $("#" + tab_id + '_table').kohaTable({
350
            var items_table = $("#" + tab_id + '_table').kohaTable({
336
                ajax: { url: item_table_url },
351
                ajax: { url: item_table_url },
337
                order: [],
352
                order: [],
Lines 382-395 Link Here
382
                [% END %]
397
                [% END %]
383
                [% IF ( item_level_itypes ) %]
398
                [% IF ( item_level_itypes ) %]
384
                {
399
                {
400
                    [% IF Koha.Preference('UseDisplayModule') %]
401
                    data: "me.effective_item_type_id", // FIXME Cannot filter by biblioitem.itemtype
402
                    searchable: false,
403
                    orderable: false,
404
                    [% ELSE %]
385
                    data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
405
                    data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
386
                    datatype: "coded_value:item_type",
406
                    datatype: "coded_value:item_type",
387
                    dataFilter: "item_types",
407
                    dataFilter: "item_types",
388
                    className: "itype",
408
                    className: "itype",
389
                    searchable: true,
409
                    searchable: true,
390
                    orderable: true,
410
                    orderable: true,
411
                    [% END %]
391
                    render: function (data, type, row, meta) {
412
                    render: function (data, type, row, meta) {
392
                        let node = '';
413
                        let node = '';
414
                        [% IF Koha.Preference('UseDisplayModule') %]
415
                        let effective_item_type_description = row._strings.effective_item_type_id ? row._strings.effective_item_type_id.str : row.effective_item_type_id;
416
                        [% UNLESS noItemTypeImages %]
417
                            let image_location = item_type_image_locations[row.effective_item_type_id];
418
                            node += image_location
419
                                ? '<img class="itemtype-image" src="%s" alt="" /> '.format(escape_str(image_location), escape_str(effective_item_type_description), escape_str(effective_item_type_description))
420
                                : '';
421
                        [% END %]
422
                        node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(effective_item_type_description));
423
                        [% ELSE %]
393
                        let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id;
424
                        let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id;
394
                        [% UNLESS noItemTypeImages %]
425
                        [% UNLESS noItemTypeImages %]
395
                            let image_location = item_type_image_locations[row.item_type_id];
426
                            let image_location = item_type_image_locations[row.item_type_id];
Lines 398-457 Link Here
398
                                : '';
429
                                : '';
399
                        [% END %]
430
                        [% END %]
400
                        node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(item_type_description));
431
                        node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(item_type_description));
432
                        [% END %]
433
401
                        return node;
434
                        return node;
402
                    }
435
                    }
403
                },
436
                },
404
                [% END %]
437
                [% END %]
405
                {
438
                {
439
                    [% IF Koha.Preference('UseDisplayModule') %]
440
                    data: "me.effective_holding_library_id",
441
                    searchable: false,
442
                    orderable: false,
443
                    [% ELSE %]
406
                    data: "holding_library.name:me.holding_library_id",
444
                    data: "holding_library.name:me.holding_library_id",
407
                    datatype: "coded_value:library",
445
                    datatype: "coded_value:library",
408
                    dataFilter: "libraries",
409
                    className: "location",
410
                    searchable: true,
446
                    searchable: true,
411
                    orderable: true,
447
                    orderable: true,
448
                    dataFilter: "libraries",
449
                    className: "location",
450
                    [% END %]
412
                    render: function (data, type, row, meta) {
451
                    render: function (data, type, row, meta) {
413
                        return escape_str(row._strings.holding_library_id ? row._strings.holding_library_id.str : row.holding_library_id);
452
                        let nodes = "";
453
                        let effective_holding_library_id_str = row._strings.effective_holding_library_id ? row._strings.effective_holding_library_id.str : row.effective_holding_library_id;
454
                        let holding_library_id_str = row._strings.holding_library_id ? row._strings.holding_library_id.str : row.holding_library_id;
455
456
                        [% IF Koha.Preference('UseDisplayModule') %]
457
                            if (holding_library_id_str != effective_holding_library_id_str) {
458
                                nodes += '<a href="javascript:void(0)" onClick="handlePermanentLocation(this)" data-header="' + _("Permanent holding branch") + '" data-body="' + holding_library_id_str + '">';
459
                                nodes += '  <i class="fa fa-info-circle" aria-hidden="true"></i>';
460
                                nodes += '</a> ';
461
                            }
462
                        [% END %]
463
464
                        nodes += escape_str(effective_holding_library_id_str || '');
465
466
                        nodes = '<span>' + nodes + '</span>';
467
                        return nodes;
414
                    }
468
                    }
415
                },
469
                },
416
                {
470
                {
471
                    [% IF Koha.Preference('UseDisplayModule') %]
472
                    data: "me.effective_home_library_id",
473
                    searchable: false,
474
                    orderable: false,
475
                    [% ELSE %]
417
                    data: "home_library.name:me.home_library_id",
476
                    data: "home_library.name:me.home_library_id",
418
                    datatype: "coded_value:library",
477
                    datatype: "coded_value:library",
419
                    dataFilter: "libraries",
420
                    className: "homebranch",
421
                    searchable: true,
478
                    searchable: true,
422
                    orderable: true,
479
                    orderable: true,
480
                    dataFilter: "libraries",
481
                    className: "location",
482
                    [% END %]
423
                    render: function (data, type, row, meta) {
483
                    render: function (data, type, row, meta) {
424
                        return escape_str(row._strings.home_library_id ? row._strings.home_library_id.str : row.home_library_id);
484
                        let nodes = "";
485
                        let effective_home_library_id_str = row._strings.effective_home_library_id ? row._strings.effective_home_library_id.str : row.effective_home_library_id;
486
                        let home_library_id_str = row._strings.home_library_id ? row._strings.home_library_id.str : row.home_library_id;
487
488
                        [% IF Koha.Preference('UseDisplayModule') %]
489
                            if (home_library_id_str != effective_home_library_id_str) {
490
                                nodes += '<a href="javascript:void(0)" onClick="handlePermanentLocation(this)" data-header="' + _("Permanent home branch") + '" data-body="' + home_library_id_str + '">';
491
                                nodes += '  <i class="fa fa-info-circle" aria-hidden="true"></i>';
492
                                nodes += '</a> ';
493
                            }
494
                        [% END %]
495
496
                        nodes += escape_str(effective_home_library_id_str || '');
497
498
                        nodes = '<span>' + nodes + '</span>';
499
                        return nodes;
425
                    }
500
                    }
426
                },
501
                },
427
                {
502
                {
503
                    [% IF Koha.Preference('UseDisplayModule') %]
504
                    data: "me.effective_location",
505
                    searchable: false,
506
                    orderable: false,
507
                    [% ELSE %]
428
                    data: "me.location",
508
                    data: "me.location",
429
                    datatype: "coded_value:location",
430
                    searchable: true,
509
                    searchable: true,
431
                    orderable: true,
510
                    orderable: true,
511
                    [% END %]
432
                    render: function (data, type, row, meta) {
512
                    render: function (data, type, row, meta) {
433
                        let nodes = '<span class="shelvingloc">';
513
                        let nodes = "";
434
                        [%# If permanent location is defined, show description or code and             %]
514
                        let effective_loc_str = row._strings.effective_location ? row._strings.effective_location.str : row.effective_location;
435
                        [%# display current location in parentheses. If not, display current location. %]
436
                        [%# Note that permanent location is a code, and location may be an authval.    %]
437
                        let loc_str = row._strings.location ? row._strings.location.str : row.location;
515
                        let loc_str = row._strings.location ? row._strings.location.str : row.location;
438
                        if ( row.permanent_location && row.permanent_location != row.location ) {
516
439
                            let permanent_loc_str = av_loc.get(row.permanent_location);
517
                        [% IF Koha.Preference('UseDisplayModule') %]
440
                            nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str));
518
                            if (loc_str != effective_loc_str) {
441
                        } else {
519
                                nodes += '<a href="javascript:void(0)" onClick="handlePermanentLocation(this)" data-header="' + _("Permanent shelving location") + '" data-body="' + loc_str + '">';
442
                            nodes += escape_str(loc_str);
520
                                nodes += '  <i class="fa fa-info-circle" aria-hidden="true"></i>';
443
                        }
521
                                nodes += '</a> ';
444
                        nodes += '</span>';
522
                            }
523
                        [% END %]
524
525
                        nodes += escape_str(effective_loc_str || '');
526
527
                        nodes = '<span>' + nodes + '</span>';
445
                        return nodes;
528
                        return nodes;
446
                    }
529
                    }
447
                },
530
                },
448
                {
531
                {
532
                    [% IF Koha.Preference('UseDisplayModule') %]
533
                    data: "me.effective_collection_code",
534
                    searchable: false,
535
                    orderable: false,
536
                    [% ELSE %]
449
                    data: "me.collection_code",
537
                    data: "me.collection_code",
450
                    datatype: "coded_value:collection_code",
451
                    searchable: true,
538
                    searchable: true,
452
                    orderable: true,
539
                    orderable: true,
540
                    [% END %]
453
                    render: function (data, type, row, meta) {
541
                    render: function (data, type, row, meta) {
454
                        return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code);
542
                        let nodes = "";
543
                        let effective_ccode_str = row._strings.effective_collection_code ? row._strings.effective_collection_code.str : row.effective_collection_code;
544
                        let ccode_str = row._strings.collection_code ? row._strings.collection_code.str : row.collection_code;
545
546
                        [% IF Koha.Preference('UseDisplayModule') %]
547
                            if (ccode_str != effective_ccode_str) {
548
                                nodes += '<a href="javascript:void(0)" onClick="handlePermanentLocation(this)" data-header="' + _("Permanent collection") + '" data-body="' + ccode_str + '">';
549
                                nodes += '  <i class="fa fa-info-circle" aria-hidden="true"></i>';
550
                                nodes += '</a> ';
551
                            }
552
                        [% END %]
553
554
                        nodes += escape_str(effective_ccode_str || '');
555
556
                        nodes = '<span>' + nodes + '</span>';
557
                        return nodes;
455
                    }
558
                    }
456
                },
559
                },
457
                [% IF Koha.Preference('EnableItemGroups') %]
560
                [% IF Koha.Preference('EnableItemGroups') %]
Lines 601-606 Link Here
601
                                }
704
                                }
602
                            }
705
                            }
603
                        [% END %]
706
                        [% END %]
707
604
                            if ( status == 'available' ) {
708
                            if ( status == 'available' ) {
605
                                nodes += ' <span>%s</span>'.format(_("Available"))
709
                                nodes += ' <span>%s</span>'.format(_("Available"))
606
                            }
710
                            }
Lines 615-620 Link Here
615
                        return nodes;
719
                        return nodes;
616
                    }
720
                    }
617
                },
721
                },
722
                {
723
                    data: "me.displays",
724
                    searchable: false,
725
                    orderable: false,
726
                    render: function (data, type, row, meta) {
727
                        let nodes = "";
728
729
                        [% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
730
                            displays.forEach(display => {
731
                                display.display_items.forEach(display_item => {
732
                                    if (display_item.itemnumber === row.item_id)
733
                                        nodes += '<li><span class="on_display"><a href="/cgi-bin/koha/display/displays/%s">%s</a></span></li>'.format(display.display_id, display.display_name);
734
                                });
735
                            });
736
737
                            if (nodes != "")
738
                                nodes = '<ul>' + nodes + '</ul>';
739
                        [% END %]
740
741
                        return nodes;
742
                    }
743
                },
618
                {
744
                {
619
                    data: "me.last_seen_date",
745
                    data: "me.last_seen_date",
620
                    type: "date",
746
                    type: "date",
Lines 744-762 Link Here
744
                {
870
                {
745
                    data: "me.public_notes",
871
                    data: "me.public_notes",
746
                    className: "itemnotes",
872
                    className: "itemnotes",
873
                    [% IF Koha.Preference('UseDisplayModule') %]
874
                    searchable: false,
875
                    orderable: false,
876
                    [% ELSE %]
747
                    searchable: true,
877
                    searchable: true,
748
                    orderable: true,
878
                    orderable: true,
879
                    [% END %]
749
                    render: function (data, type, row, meta) {
880
                    render: function (data, type, row, meta) {
750
                        return row.public_notes ? escape_str(row.public_notes).replaceAll('\n', '<br />') : '';
881
                        let nodes = "";
882
883
                        nodes = row.public_notes ? escape_str(row.public_notes).replaceAll('\n', '<br />') : '';
884
885
                        [% IF Koha.Preference('UseDisplayModule') %]
886
                            displays.forEach(display => {
887
                                display.display_items.forEach(display_item => {
888
                                    if ((display_item.itemnumber === row.item_id) && (display.public_note))
889
                                        nodes += '<p><span class="public_note on_display">%s</span></p>'.format(display.public_note);
890
                                });
891
                            });
892
                        [% END %]
893
894
                        return nodes;
751
                    }
895
                    }
752
                },
896
                },
753
                {
897
                {
754
                    data: "me.internal_notes",
898
                    data: "me.internal_notes",
755
                    className: "nonpublicnote",
899
                    className: "nonpublicnote",
900
                    [% IF Koha.Preference('UseDisplayModule') %]
901
                    searchable: false,
902
                    orderable: false,
903
                    [% ELSE %]
756
                    searchable: true,
904
                    searchable: true,
757
                    orderable: true,
905
                    orderable: true,
906
                    [% END %]
758
                    render: function (data, type, row, meta) {
907
                    render: function (data, type, row, meta) {
759
                        return escape_str(row.internal_notes);
908
                        let nodes = "";
909
910
                        nodes = row.internal_notes ? escape_str(row.internal_notes) : '';
911
912
                        [% IF Koha.Preference('UseDisplayModule') %]
913
                            displays.forEach(display => {
914
                                display.display_items.forEach(display_item => {
915
                                    if ((display_item.itemnumber === row.item_id) && (display.staff_note))
916
                                        nodes += '<p><span class="internal_note on_display">%s</span></p>'.format(display.staff_note);
917
                                });
918
                            });
919
                        [% END %]
920
921
                        return nodes;
760
                    }
922
                    }
761
                },
923
                },
762
                [% IF Koha.Preference('EasyAnalyticalRecords') %]
924
                [% IF Koha.Preference('EasyAnalyticalRecords') %]
Lines 920-925 Link Here
920
            });
1082
            });
921
            return items_table;
1083
            return items_table;
922
        }
1084
        }
1085
1086
        const handlePermanentLocation = ((element) => {
1087
            const header = $(element).attr('data-header');
1088
            const body = $(element).attr('data-body');
1089
1090
            $('#permanant_location_modal_label').text(header);
1091
            $('#permanant_location_modal_body').html('<ul><li>' + body + '</li></ul>');
1092
            $('#permanant_location_modal').modal('show');
1093
1094
            return false;
1095
        });
1096
923
        function safe_link(uri,link_text) {
1097
        function safe_link(uri,link_text) {
924
            let node = document.createElement('a');
1098
            let node = document.createElement('a');
925
            let url_str = '#';
1099
            let url_str = '#';
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+24 lines)
Lines 51-56 Link Here
51
    [%- CASE 'coursereserves' -%]
51
    [%- CASE 'coursereserves' -%]
52
        <span class="main_permission coursereserves_permission">Course reserves</span>
52
        <span class="main_permission coursereserves_permission">Course reserves</span>
53
        <span class="permissioncode">([% name | html %])</span>
53
        <span class="permissioncode">([% name | html %])</span>
54
    [%- CASE 'displays' -%]
55
        <span class="main_permission displays_permission">Display module</span>
56
        <span class="permissioncode">([% name | html %])</span>
54
    [%- CASE 'plugins' -%]
57
    [%- CASE 'plugins' -%]
55
        <span class="main_permission plugins_permission">Koha plugins</span>
58
        <span class="main_permission plugins_permission">Koha plugins</span>
56
        <span class="permissioncode">([% name | html %])</span>
59
        <span class="permissioncode">([% name | html %])</span>
Lines 520-525 Link Here
520
    [%- CASE 'manage_courses' -%]
523
    [%- CASE 'manage_courses' -%]
521
        <span class="sub_permission manage_courses_subpermission"> Add, edit and delete courses </span>
524
        <span class="sub_permission manage_courses_subpermission"> Add, edit and delete courses </span>
522
        <span class="permissioncode">([% name | html %])</span>
525
        <span class="permissioncode">([% name | html %])</span>
526
    [%- CASE 'view_display' -%]
527
        <span class="sub_permission view_display_subpermission"> View displays </span>
528
        <span class="permissioncode">([% name | html %])</span>
529
    [%- CASE 'add_display' -%]
530
        <span class="sub_permission add_display_subpermission"> Add displays </span>
531
        <span class="permissioncode">([% name | html %])</span>
532
    [%- CASE 'edit_display' -%]
533
        <span class="sub_permission edit_display_subpermission"> Edit displays </span>
534
        <span class="permissioncode">([% name | html %])</span>
535
    [%- CASE 'delete_display' -%]
536
        <span class="sub_permission delete_display_subpermission"> Delete displays </span>
537
        <span class="permissioncode">([% name | html %])</span>
538
    [%- CASE 'add_items_to_display' -%]
539
        <span class="sub_permission add_items_to_display_subpermission"> Add items to displays </span>
540
        <span class="permissioncode">([% name | html %])</span>
541
    [%- CASE 'add_items_to_display_from_any_libraries' -%]
542
        <span class="sub_permission add_items_to_display_from_any_libraries_subpermission"> Add items to displays from any libraries </span>
543
        <span class="permissioncode">([% name | html %])</span>
544
    [%- CASE 'remove_items_from_display' -%]
545
        <span class="sub_permission remove_items_from_display_subpermission"> Remove items from displays </span>
546
        <span class="permissioncode">([% name | html %])</span>
523
    [%- CASE 'configure' -%]
547
    [%- CASE 'configure' -%]
524
        <span class="sub_permission configure_subpermission"> Configure plugins </span>
548
        <span class="sub_permission configure_subpermission"> Configure plugins </span>
525
        <span class="permissioncode">([% name | html %])</span>
549
        <span class="permissioncode">([% name | html %])</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc (-1 / +1 lines)
Lines 83-89 Link Here
83
                </td>
83
                </td>
84
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
84
                <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td>
85
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id  ) %], [% reserveloo.desk.desk_name | html %][% END %]</td>
85
                <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id  ) %], [% reserveloo.desk.desk_name | html %][% END %]</td>
86
                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => reserveloo.item.location) | html %]</td>
86
                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => reserveloo.item.effective_location ) | html %]</td>
87
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
87
                <td>[% reserveloo.item.itemcallnumber | html %]</td>
88
                <td>[% reserveloo.item.copynumber | html %]</td>
88
                <td>[% reserveloo.item.copynumber | html %]</td>
89
                <td>[% reserveloo.item.enumchron | html %]</td>
89
                <td>[% reserveloo.item.enumchron | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt (-2 / +22 lines)
Lines 152-157 Link Here
152
                                    Is local float group
152
                                    Is local float group
153
                                </label>
153
                                </label>
154
                            </p>
154
                            </p>
155
                            <p>
156
                                <label>
157
                                    <input type="checkbox" name="ft_display_group" id="add-group-modal-ft_display_group" value="1" />
158
                                    Is display group
159
                                </label>
160
                            </p>
155
                        </div>
161
                        </div>
156
                    </div>
162
                    </div>
157
                </div>
163
                </div>
Lines 235-240 Link Here
235
                                    Is local float group
241
                                    Is local float group
236
                                </label>
242
                                </label>
237
                            </p>
243
                            </p>
244
                            <p>
245
                                <label>
246
                                    <input type="checkbox" id="edit-group-modal-ft_display_group" name="ft_display_group" value="1" />
247
                                    Is display group
248
                                </label>
249
                            </p>
238
                        </div>
250
                        </div>
239
                    </div>
251
                    </div>
240
                </div>
252
                </div>
Lines 331-337 Link Here
331
                var ft_search_groups_staff = $(this).data("groupFt_search_groups_staff");
343
                var ft_search_groups_staff = $(this).data("groupFt_search_groups_staff");
332
                var ft_local_hold_group = $(this).data("groupFt_local_hold_group");
344
                var ft_local_hold_group = $(this).data("groupFt_local_hold_group");
333
                var ft_local_float_group = $(this).data("groupFt_local_float_group");
345
                var ft_local_float_group = $(this).data("groupFt_local_float_group");
334
                edit_group(id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group, ft_limit_item_editing, ft_local_float_group);
346
                var ft_display_group = $(this).data("groupFt_display_group");
347
                edit_group(id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group, ft_limit_item_editing, ft_local_float_group, ft_display_group);
335
            });
348
            });
336
349
337
            $(".delete-group").on("click", function (e) {
350
            $(".delete-group").on("click", function (e) {
Lines 368-373 Link Here
368
            $("#add-group-modal-ft_search_groups_staff").prop("checked", false);
381
            $("#add-group-modal-ft_search_groups_staff").prop("checked", false);
369
            $("#add-group-modal-ft_local_hold_group").prop("checked", false);
382
            $("#add-group-modal-ft_local_hold_group").prop("checked", false);
370
            $("#add-group-modal-ft_local_float_group").prop("checked", false);
383
            $("#add-group-modal-ft_local_float_group").prop("checked", false);
384
            $("#add-group-modal-ft_display_group").prop("checked", false);
371
            if (parent_id) {
385
            if (parent_id) {
372
                $("#root-group-features-add").hide();
386
                $("#root-group-features-add").hide();
373
            } else {
387
            } else {
Lines 376-382 Link Here
376
            $("#add-group-modal").modal("show");
390
            $("#add-group-modal").modal("show");
377
        }
391
        }
378
392
379
        function edit_group(id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group, ft_limit_item_editing, ft_local_float_group) {
393
        function edit_group(id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group, ft_limit_item_editing, ft_local_float_group, ft_display_group) {
380
            $("#edit-group-modal-id").val(id);
394
            $("#edit-group-modal-id").val(id);
381
            $("#edit-group-modal-title").val(title);
395
            $("#edit-group-modal-title").val(title);
382
            $("#edit-group-modal-description").val(description);
396
            $("#edit-group-modal-description").val(description);
Lines 387-392 Link Here
387
                $("#edit-group-modal-ft_search_groups_staff").prop("checked", false);
401
                $("#edit-group-modal-ft_search_groups_staff").prop("checked", false);
388
                $("#edit-group-modal-ft_local_hold_group").prop("checked", false);
402
                $("#edit-group-modal-ft_local_hold_group").prop("checked", false);
389
                $("#edit-group-modal-ft_local_float_group").prop("checked", false);
403
                $("#edit-group-modal-ft_local_float_group").prop("checked", false);
404
                $("#edit-group-modal-ft_display_group").prop("checked", false);
390
                $("#root-group-features-edit").hide();
405
                $("#root-group-features-edit").hide();
391
            } else {
406
            } else {
392
                $("#edit-group-modal-ft_hide_patron_info").prop("checked", ft_hide_patron_info ? true : false);
407
                $("#edit-group-modal-ft_hide_patron_info").prop("checked", ft_hide_patron_info ? true : false);
Lines 395-400 Link Here
395
                $("#edit-group-modal-ft_search_groups_staff").prop("checked", ft_search_groups_staff ? true : false);
410
                $("#edit-group-modal-ft_search_groups_staff").prop("checked", ft_search_groups_staff ? true : false);
396
                $("#edit-group-modal-ft_local_hold_group").prop("checked", ft_local_hold_group ? true : false);
411
                $("#edit-group-modal-ft_local_hold_group").prop("checked", ft_local_hold_group ? true : false);
397
                $("#edit-group-modal-ft_local_float_group").prop("checked", ft_local_float_group ? true : false);
412
                $("#edit-group-modal-ft_local_float_group").prop("checked", ft_local_float_group ? true : false);
413
                $("#edit-group-modal-ft_display_group").prop("checked", ft_display_group ? true : false);
398
                $("#root-group-features-edit").show();
414
                $("#root-group-features-edit").show();
399
            }
415
            }
400
416
Lines 455-460 Link Here
455
                    [% IF group.ft_local_float_group %]
471
                    [% IF group.ft_local_float_group %]
456
                        <li>Is local float group</li>
472
                        <li>Is local float group</li>
457
                    [% END %]
473
                    [% END %]
474
                    [% IF group.ft_display_group %]
475
                        <li>Is display group</li>
476
                    [% END %]
458
                </ul>
477
                </ul>
459
            [% END %]
478
            [% END %]
460
        </td>
479
        </td>
Lines 486-491 Link Here
486
                                data-group-ft_local_hold_group="[% group.ft_local_hold_group | html %]"
505
                                data-group-ft_local_hold_group="[% group.ft_local_hold_group | html %]"
487
                                data-group-ft_limit_item_editing="[% group.ft_limit_item_editing | html %]"
506
                                data-group-ft_limit_item_editing="[% group.ft_limit_item_editing | html %]"
488
                                data-group-ft_local_float_group="[% group.ft_local_float_group | html %]"
507
                                data-group-ft_local_float_group="[% group.ft_local_float_group | html %]"
508
                                data-group-ft_display_group="[% group.ft_display_group | html %]"
489
                            >
509
                            >
490
                                <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit
510
                                <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit
491
                            </a>
511
                            </a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+7 lines)
Lines 1375-1380 Circulation: Link Here
1375
                  1: Use
1375
                  1: Use
1376
                  0: "Don't use"
1376
                  0: "Don't use"
1377
            - "course reserves."
1377
            - "course reserves."
1378
    Display module:
1379
        -
1380
            - pref: UseDisplayModule
1381
              choices:
1382
                  1: Use
1383
                  0: "Don't use"
1384
            - "the display module for managing item displays."
1378
    Batch checkout:
1385
    Batch checkout:
1379
        -
1386
        -
1380
            - pref: BatchCheckouts
1387
            - pref: BatchCheckouts
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (+6 lines)
Lines 90-95 Logging: Link Here
90
                  1: Log
90
                  1: Log
91
                  0: "Don't log"
91
                  0: "Don't log"
92
            - information from cron jobs.
92
            - information from cron jobs.
93
        -
94
            - pref: DisplayItemsLog
95
              choices:
96
                  1: Log
97
                  0: "Don't log"
98
            - when displays are created, edited, deleted, or when items are added to or removed from displays.
93
        -
99
        -
94
            - pref: ReportsLog
100
            - pref: ReportsLog
95
              choices:
101
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-2 / +2 lines)
Lines 243-249 Link Here
243
                                        [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
243
                                        [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
244
                                            <p>
244
                                            <p>
245
                                                [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
245
                                                [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
246
                                                <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %] </span>
246
                                                <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.effective_location ) | html %] </span>
247
                                                [% IF ( ITEM_RESULT.itemcallnumber ) %]
247
                                                [% IF ( ITEM_RESULT.itemcallnumber ) %]
248
                                                    ([% ITEM_RESULT.itemcallnumber | html %])
248
                                                    ([% ITEM_RESULT.itemcallnumber | html %])
249
                                                [% END %]
249
                                                [% END %]
Lines 337-343 Link Here
337
                                                        <span class="callnumber">[% ITEM_RESULT.itemcallnumber | html %]</span>
337
                                                        <span class="callnumber">[% ITEM_RESULT.itemcallnumber | html %]</span>
338
                                                    </strong>
338
                                                    </strong>
339
                                                    [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
339
                                                    [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
340
                                                    <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %] </span>
340
                                                    <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.effective_location ) | html %] </span>
341
                                                </span>
341
                                                </span>
342
                                            </div>
342
                                            </div>
343
                                        [% END %]
343
                                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+413 lines)
Lines 1046-1051 Link Here
1046
    <!-- /#elasticPreview.modal -->
1046
    <!-- /#elasticPreview.modal -->
1047
[% END %]
1047
[% END %]
1048
1048
1049
<div class="modal" id="permanent_location_modal" tabindex="-1" aria-labelledby="permanent_location_modal_label" aria-modal="true" role="dialog">
1050
    <div class="modal-dialog">
1051
        <div class="modal-content">
1052
            <div class="modal-header">
1053
                <h1 class="modal-title" id="permanent_location_modal_label"></h1>
1054
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1055
            </div>
1056
            <div class="modal-body">
1057
                <ul>
1058
                    <li><span id="permanent_location_modal_body"></span></li>
1059
                </ul>
1060
            </div>
1061
            <div class="modal-footer">
1062
                <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
1063
            </div>
1064
        </div>
1065
        <!-- /.modal-content -->
1066
    </div>
1067
    <!-- /.modal-dialog -->
1068
</div>
1069
1049
<div class="modal" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
1070
<div class="modal" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
1050
    <div class="modal-dialog">
1071
    <div class="modal-dialog">
1051
        <div class="modal-content">
1072
        <div class="modal-content">
Lines 1188-1193 Link Here
1188
</div>
1209
</div>
1189
<!-- /#.modal -->
1210
<!-- /#.modal -->
1190
1211
1212
<!-- Permenant Location Modal -->
1213
<div class="modal" id="permanant_location_modal" tabindex="-1" aria-labelledby="permanant_location_modal_label" aria-hidden="true">
1214
    <div class="modal-dialog">
1215
        <div class="modal-content">
1216
            <div class="modal-header">
1217
                <h1 class="modal-title" id="permanant_location_modal_label"></h1>
1218
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1219
            </div>
1220
            <div class="modal-body">
1221
                <div id="permanant_location_modal_body"></div>
1222
            </div>
1223
            <div class="modal-footer">
1224
                <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
1225
            </div>
1226
        </div>
1227
        <!-- /.modal-content -->
1228
    </div>
1229
    <!-- /.modal-dialog -->
1230
</div>
1231
<!-- /.modal -->
1232
1191
[% IF bundlesEnabled %]
1233
[% IF bundlesEnabled %]
1192
    <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
1234
    <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
1193
        <div class="modal-dialog">
1235
        <div class="modal-dialog">
Lines 2383-2389 Link Here
2383
        });
2425
        });
2384
2426
2385
        specific_dt_errors = _("Have a look at the 'Audit' button in the toolbar");
2427
        specific_dt_errors = _("Have a look at the 'Audit' button in the toolbar");
2428
2429
        [% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
2430
        // Display functionality
2431
        let availableDisplays = [];
2432
        let displayItemsTable = null;
2433
        let selectedDisplayItems = [];
2434
2435
        // Load displays on page load
2436
        $(document).ready(function() {
2437
            // Load available displays for dropdown
2438
            $.ajax({
2439
                url: '/api/v1/displays',
2440
                method: 'GET',
2441
                headers: { 'x-koha-embed': 'display_items' },
2442
                success: function(displays) {
2443
                    availableDisplays = displays.filter(display => display.enabled);
2444
                    updateDisplayDropdown();
2445
                    updateDisplaySelect();
2446
                },
2447
                error: function() {
2448
                    $('#display-dropdown').html('<li class="text-center text-muted">Failed to load displays</li>');
2449
                }
2450
            });
2451
        });
2452
2453
        function updateDisplayDropdown() {
2454
            const dropdown = $('#display-dropdown');
2455
            if (availableDisplays.length === 0) {
2456
                dropdown.html('<li class="dropdown-item text-muted">No active displays available</li>');
2457
                return;
2458
            }
2459
2460
            let html = '';
2461
            availableDisplays.forEach(display => {
2462
                html += `<li><a class="dropdown-item" href="#" data-display-id="${display.display_id}" onclick="openDisplayModal(${display.display_id})">${display.display_name}</a></li>`;
2463
            });
2464
            dropdown.html(html);
2465
        }
2466
2467
        function updateDisplaySelect() {
2468
            // Update display select
2469
            const displaySelect = $('#display-select');
2470
            let selectHtml = '<option value="">Select a display</option>';
2471
            availableDisplays.forEach(display => {
2472
                selectHtml += `<option value="${display.display_id}">${display.display_name}</option>`;
2473
            });
2474
            displaySelect.html(selectHtml);
2475
        }
2476
2477
        function initializeDisplayItemsTable() {
2478
            if (displayItemsTable && displayItemsTable.DataTable) {
2479
                displayItemsTable.DataTable().destroy();
2480
                displayItemsTable = null;
2481
            }
2482
2483
            selectedDisplayItems = [];
2484
2485
            // Use the same API endpoint and embed options as the main items table
2486
            let item_table_url = "/api/v1/biblios/[% biblionumber | uri %]/items?";
2487
            let embed = ["+strings,_status,effective_home_library,effective_holding_library,home_library,holding_library"];
2488
2489
            displayItemsTable = $("#display-items-table").kohaTable({
2490
                ajax: { url: item_table_url },
2491
                embed: embed,
2492
                order: [[1, 'asc']], // Sort by barcode
2493
                autoWidth: false,
2494
                paging: false,
2495
                searching: true,
2496
                info: false,
2497
                columns: [
2498
                    {
2499
                        data: "me.item_id",
2500
                        searchable: false,
2501
                        orderable: false,
2502
                        render: function (data, type, row, meta) {
2503
                            return `<input type="checkbox" class="display-item-checkbox" value="${row.item_id}" data-item-id="${row.item_id}">`;
2504
                        }
2505
                    },
2506
                    {
2507
                        data: "me.external_id",
2508
                        searchable: true,
2509
                        orderable: true,
2510
                        render: function (data, type, row, meta) {
2511
                            return escape_str(row.external_id || 'No barcode');
2512
                        }
2513
                    },
2514
                    {
2515
                        [% IF Koha.Preference('UseDisplayModule') %]
2516
                        data: "me.effective_holding_library_id",
2517
                        searchable: false,
2518
                        orderable: false,
2519
                        [% ELSE %]
2520
                        data: "holding_library.name:me.holding_library_id",
2521
                        datatype: "coded_value:library",
2522
                        searchable: true,
2523
                        orderable: true,
2524
                        dataFilter: "libraries",
2525
                        className: "location",
2526
                        [% END %]
2527
                        render: function (data, type, row, meta) {
2528
                            let nodes = "";
2529
                            let effective_holding_library_id_str = row._strings.effective_holding_library_id ? row._strings.effective_holding_library_id.str : row.effective_holding_library_id;
2530
                            let holding_library_id_str = row._strings.holding_library_id ? row._strings.holding_library_id.str : row.holding_library_id;
2531
2532
                            nodes += escape_str(effective_holding_library_id_str || '');
2533
2534
                            [% IF Koha.Preference('UseDisplayModule') %]
2535
                                if (holding_library_id_str != effective_holding_library_id_str) {
2536
                                    nodes += '<a href="javascript:void(0)" onClick="handlePermanentLocation(this)" data-header="Permanent holding branch" data-body="' + holding_library_id_str + '">';
2537
                                    nodes += '  <i class="fa fa-info-circle" aria-hidden="true"></i>';
2538
                                    nodes += '</a>';
2539
                                }
2540
                            [% END %]
2541
2542
                            nodes = '<span>' + nodes + '</span>';
2543
                            return nodes;
2544
                        }
2545
                    },
2546
                    {
2547
                        [% IF Koha.Preference('UseDisplayModule') %]
2548
                        data: "me.effective_home_library_id",
2549
                        searchable: false,
2550
                        orderable: false,
2551
                        [% ELSE %]
2552
                        data: "me.home_library_id",
2553
                        searchable: true,
2554
                        orderable: true,
2555
                        [% END %]
2556
                        render: function (data, type, row, meta) {
2557
                            [% IF Koha.Preference('UseDisplayModule') %]
2558
                            let effective_home_library_id_str = row._strings.effective_home_library_id ? row._strings.effective_home_library_id.str : row.effective_home_library_id;
2559
                            return escape_str(effective_home_library_id_str || '');
2560
                            [% ELSE %]
2561
                            let home_library_id_str = row._strings.home_library_id ? row._strings.home_library_id.str : row.home_library_id;
2562
                            return escape_str(home_library_id_str || '');
2563
                            [% END %]
2564
                        }
2565
                    },
2566
                    {
2567
                        [% IF Koha.Preference('UseDisplayModule') %]
2568
                        data: "me.effective_location",
2569
                        searchable: false,
2570
                        orderable: false,
2571
                        [% ELSE %]
2572
                        data: "me.location",
2573
                        searchable: true,
2574
                        orderable: true,
2575
                        [% END %]
2576
                        render: function (data, type, row, meta) {
2577
                            [% IF Koha.Preference('UseDisplayModule') %]
2578
                            let loc_str = row._strings.effective_location ? row._strings.effective_location.str : row.effective_location;
2579
                            return escape_str(effective_loc_str || '');
2580
                            [% ELSE %]
2581
                            let loc_str = row._strings.location ? row._strings.location.str : row.location;
2582
                            return escape_str(loc_str || '');
2583
                            [% END %]
2584
                        }
2585
                    },
2586
                    {
2587
                        [% IF Koha.Preference('UseDisplayModule') %]
2588
                        data: "me.effective_collection_code",
2589
                        searchable: false,
2590
                        orderable: false,
2591
                        [% ELSE %]
2592
                        data: "me.collection_code",
2593
                        searchable: true,
2594
                        orderable: true,
2595
                        [% END %]
2596
                        render: function (data, type, row, meta) {
2597
                            [% IF Koha.Preference('UseDisplayModule') %]
2598
                            let effective_ccode_str = row._strings.effective_collection_code ? row._strings.effective_collection_code.str : row.effective_collection_code;
2599
                            return escape_str(effective_ccode_str || '');
2600
                            [% ELSE %]
2601
                            let ccode_str = row._strings.collection_code ? row._strings.collection_code.str : row.collection_code;
2602
                            return escape_str(ccode_str || '');
2603
                            [% END %]
2604
                        }
2605
                    },
2606
                    {
2607
                        data: "me.callnumber",
2608
                        searchable: true,
2609
                        orderable: true,
2610
                        render: function (data, type, row, meta) {
2611
                            return escape_str(row.callnumber || '');
2612
                        }
2613
                    },
2614
                    {
2615
                        data: "",
2616
                        searchable: false,
2617
                        orderable: false,
2618
                        render: function (data, type, row, meta) {
2619
                            let status = '';
2620
                            if (row._status && row._status.length > 0) {
2621
                                status = row._status.map(s => s.replace(/_/g, ' ')).join(', ');
2622
                            } else {
2623
                                status = 'Available';
2624
                            }
2625
                            return escape_str(status);
2626
                        }
2627
                    }
2628
                ],
2629
                [% IF Koha.Preference('UseDisplayModule') %]
2630
                rowCallback: function(row, data) {
2631
                    // Hide items that are already on displays (effective_location starts with "DISPLAY:")
2632
                    if (data.effective_location && data.effective_location.startsWith && data.effective_location.startsWith('DISPLAY:')) {
2633
                        $(row).hide();
2634
                        return;
2635
                    }
2636
                    $(row).show();
2637
                },
2638
                [% END %]
2639
                drawCallback: function(settings) {
2640
                    // Handle individual checkbox changes
2641
                    $('.display-item-checkbox').off('change').on('change', function() {
2642
                        const itemId = parseInt($(this).val());
2643
                        if ($(this).is(':checked')) {
2644
                            if (!selectedDisplayItems.includes(itemId)) {
2645
                                selectedDisplayItems.push(itemId);
2646
                            }
2647
                        } else {
2648
                            selectedDisplayItems = selectedDisplayItems.filter(id => id !== itemId);
2649
                        }
2650
                        updateSelectAllState();
2651
                    });
2652
2653
                    // Handle select all checkbox
2654
                    $('#select-all-display-items').off('change').on('change', function() {
2655
                        const isChecked = $(this).is(':checked');
2656
                        $('.display-item-checkbox').prop('checked', isChecked);
2657
2658
                        if (isChecked) {
2659
                            selectedDisplayItems = [];
2660
                            $('.display-item-checkbox').each(function() {
2661
                                selectedDisplayItems.push(parseInt($(this).val()));
2662
                            });
2663
                        } else {
2664
                            selectedDisplayItems = [];
2665
                        }
2666
                    });
2667
                }
2668
            });
2669
        }
2670
2671
        function updateSelectAllState() {
2672
            const totalCheckboxes = $('.display-item-checkbox').length;
2673
            const checkedCheckboxes = $('.display-item-checkbox:checked').length;
2674
2675
            if (checkedCheckboxes === 0) {
2676
                $('#select-all-display-items').prop('indeterminate', false).prop('checked', false);
2677
            } else if (checkedCheckboxes === totalCheckboxes) {
2678
                $('#select-all-display-items').prop('indeterminate', false).prop('checked', true);
2679
            } else {
2680
                $('#select-all-display-items').prop('indeterminate', true);
2681
            }
2682
        }
2683
2684
        function openDisplayModal(displayId = null) {
2685
            if (displayId) {
2686
                $('#display-select').val(displayId);
2687
            }
2688
            // Initialize the DataTable when the modal is opened
2689
            initializeDisplayItemsTable();
2690
            $('#addToDisplayModal').modal('show');
2691
        }
2692
2693
        // Clear date button functionality
2694
        $('#clear-date').on('click', function() {
2695
            $('#date-remove').val('');
2696
        });
2697
2698
        // Form submission
2699
        $('#addToDisplayForm').on('submit', function(e) {
2700
            e.preventDefault();
2701
2702
            const displayId = $('#display-select').val();
2703
            const removeDate = $('#date-remove').val();
2704
2705
            if (!displayId) {
2706
                alert('Please select a display');
2707
                return;
2708
            }
2709
2710
            if (selectedDisplayItems.length === 0) {
2711
                alert('Please select at least one item');
2712
                return;
2713
            }
2714
2715
            $('#add-to-display-btn').prop('disabled', true).text('Adding...');
2716
2717
            // Add each item to the display
2718
            let promises = selectedDisplayItems.map(itemId => {
2719
                const data = {
2720
                    display_id: parseInt(displayId),
2721
                    itemnumber: parseInt(itemId),
2722
                    biblionumber: [% biblionumber | html %],
2723
                    date_added: new Date().toISOString().split('T')[0]
2724
                };
2725
                if (removeDate) {
2726
                    data.date_remove = removeDate;
2727
                }
2728
2729
                return $.ajax({
2730
                    url: '/api/v1/display/items',
2731
                    method: 'POST',
2732
                    contentType: 'application/json',
2733
                    data: JSON.stringify(data)
2734
                });
2735
            });
2736
2737
            Promise.all(promises).then(() => {
2738
                alert(`Successfully added ${selectedDisplayItems.length} item(s) to display`);
2739
                $('#addToDisplayModal').modal('hide');
2740
                $('#addToDisplayForm')[0].reset();
2741
                selectedDisplayItems = [];
2742
2743
                // Safely refresh modal table
2744
                try {
2745
                    if (displayItemsTable && displayItemsTable.DataTable) {
2746
                        displayItemsTable.DataTable().draw();
2747
                    }
2748
                } catch (e) {
2749
                    // Modal table refresh failed - not critical
2750
                }
2751
2752
                // Safely refresh the main items table to show updated locations
2753
                try {
2754
                    if (typeof build_items_table === 'function') {
2755
                        $('.items_table').each(function() {
2756
                            let table_id = $(this).attr('id').replace('_table', '');
2757
                            build_items_table(table_id, false, { destroy: true });
2758
                        });
2759
                    }
2760
                } catch (e) {
2761
                    // Main table refresh failed - reload page as fallback
2762
                    window.location.reload();
2763
                }
2764
            }).catch((error) => {
2765
                console.error('Error adding items to display:', error);
2766
                alert('Failed to add some items to display. Please try again.');
2767
            }).finally(() => {
2768
                $('#add-to-display-btn').prop('disabled', false).text('Add to display');
2769
            });
2770
        });
2771
2772
        // Clean up when modal is hidden
2773
        $('#addToDisplayModal').on('hidden.bs.modal', function() {
2774
            if (displayItemsTable && displayItemsTable.DataTable) {
2775
                displayItemsTable.DataTable().destroy();
2776
                displayItemsTable = null;
2777
            }
2778
            selectedDisplayItems = [];
2779
            $('#addToDisplayForm')[0].reset();
2780
        });
2781
        [% END %]
2386
    </script>
2782
    </script>
2387
    [% CoverImagePlugins | $raw %]
2783
    [% CoverImagePlugins | $raw %]
2388
[% END # /jsinclude %]
2784
[% END # /jsinclude %]
2785
2786
[% BLOCK cssinclude %]
2787
    <style>
2788
        .display-location {
2789
            font-weight: bold;
2790
            color: #d9534f;
2791
        }
2792
        .display-location::before {
2793
            content: "\1F4FA ";
2794
            font-size: 0.8em;
2795
        }
2796
        .original-location {
2797
            font-size: 0.9em;
2798
            font-style: italic;
2799
        }
2800
    </style>
2801
[% END %]
2389
[% INCLUDE 'intranet-bottom.inc' %]
2802
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-2 / +15 lines)
Lines 187-196 Link Here
187
                                [% IF ( ITEM_DAT.displaycopy ) %]
187
                                [% IF ( ITEM_DAT.displaycopy ) %]
188
                                    <li class="copynumber"><span class="label">Copy number:</span> [% ITEM_DAT.copyvol | html %]&nbsp;</li>
188
                                    <li class="copynumber"><span class="label">Copy number:</span> [% ITEM_DAT.copyvol | html %]&nbsp;</li>
189
                                [% END %]
189
                                [% END %]
190
                                [% IF ( ITEM_DAT.location ) %]
190
                                [% IF ( ITEM_DAT.effective_location ) %]
191
                                    <li class="location">
191
                                    <li class="location">
192
                                        <span class="label">Shelving location:</span>
192
                                        <span class="label">Shelving location:</span>
193
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.location ) | html %]
193
                                        [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_DAT.effective_location ) | html %]
194
                                    </li>
195
                                [% END %]
196
                                [% IF ( ITEM_DAT.displays ) %]
197
                                    <li class="displays" class="nowrap">
198
                                        [% IF ITEM_DAT.displays.size > 1 %]
199
                                            <span class="label">In displays:</span>
200
                                        [% ELSE %]
201
                                            <span class="label">In display:</span>
202
                                        [% END %]
203
                                        [% FOR display IN ITEM_DAT.displays %]
204
                                            <a href="/cgi-bin/koha/display/displays/[% display.display_id | url %]">[% display.display_name | html %]</a>
205
                                            [% UNLESS loop.last %],[% END %]
206
                                        [% END %]
194
                                    </li>
207
                                    </li>
195
                                [% END %]
208
                                [% END %]
196
                                [% IF ( ITEM_DAT.replacementprice ) %]
209
                                [% IF ( ITEM_DAT.replacementprice ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+10 lines)
Lines 860-865 Link Here
860
                                                                        [% END %]
860
                                                                        [% END %]
861
                                                                        <span class="item_count">[% items_loo.count | html %]</span>
861
                                                                        <span class="item_count">[% items_loo.count | html %]</span>
862
                                                                    </div>
862
                                                                    </div>
863
                                                                    [% IF ( items_loo.displays ) %]
864
                                                                        <span class="displays"
865
                                                                            >In display(s):
866
                                                                            <ul>
867
                                                                                [% FOR display IN items_loo.displays %]
868
                                                                                    <li><a href="/cgi-bin/koha/display/displays/[% display.display_id | url %]">[% display.display_name | html %]</a></li>
869
                                                                                [% END %]
870
                                                                            </ul>
871
                                                                        </span>
872
                                                                    [% END %]
863
                                                                    <!-- /.result_item_details -->
873
                                                                    <!-- /.result_item_details -->
864
874
865
                                                                    [% IF status_count == "onloancount" %]
875
                                                                    [% IF status_count == "onloancount" %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-115 / +152 lines)
Lines 5-10 Link Here
5
[% USE KohaDates %]
5
[% USE KohaDates %]
6
[% USE Price %]
6
[% USE Price %]
7
[% USE Item %]
7
[% USE Item %]
8
[% USE AuthorisedValues %]
8
[% USE TablesSettings %]
9
[% USE TablesSettings %]
9
[% PROCESS 'i18n.inc' %]
10
[% PROCESS 'i18n.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
11
[% INCLUDE 'doc-head-open.inc' %]
Lines 86-91 Link Here
86
            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]#holdings">go to the records holdings</a>.
87
            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]#holdings">go to the records holdings</a>.
87
        </div>
88
        </div>
88
    [% END %]
89
    [% END %]
90
    [% IF ( items ) %]
91
        [% FOREACH item IN items %]
92
            [% IF item.ondisplay %]
93
                <div class="alert alert-warning">
94
                    <p> <strong>Item(s) on display:</strong> The following item is currently on display, and cannot be modified: </p>
95
                    <ul>
96
                        <li><a href="/cgi-bin/koha/display/displays/[% item.active_display_id | url %]">[% item.barcode | html %]</a></li>
97
                    </ul>
98
                    <p> The permanent location for these item(s) is found below. To modify these details, edit the display, or remove the item from the display. </p>
99
                </div>
100
            [% END %]
101
        [% END %]
102
    [% END %]
89
    <h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %]by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
103
    <h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %]by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
90
    <a id="newitem_jump" href="#f"><i class="fa fa-arrow-down"></i> Jump to form</a>
104
    <a id="newitem_jump" href="#f"><i class="fa fa-arrow-down"></i> Jump to form</a>
91
105
Lines 104-110 Link Here
104
    [% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
118
    [% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
105
119
106
    <div id="cataloguing_additem_itemlist">
120
    <div id="cataloguing_additem_itemlist">
107
        [% IF items %]
121
        [% IF ( items ) %]
108
            [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %]
122
            [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %]
109
            <div class="page-section">
123
            <div class="page-section">
110
                <table id="itemst">
124
                <table id="itemst">
Lines 118-124 Link Here
118
                    </thead>
132
                    </thead>
119
                    <tbody>
133
                    <tbody>
120
                        [% FOREACH item IN items %]
134
                        [% FOREACH item IN items %]
121
                            [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %]
135
                            [% SET can_be_edited = ! ( ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) || ( item.nomod ) ) %]
122
                            [% SET tr_class = [] %]
136
                            [% SET tr_class = [] %]
123
                            [% SET tr_title = "" %]
137
                            [% SET tr_title = "" %]
124
                            [% IF item.itemnumber == itemnumber %]
138
                            [% IF item.itemnumber == itemnumber %]
Lines 135-141 Link Here
135
                            [% END %]
149
                            [% END %]
136
                            <tr id="row[% item.itemnumber | html %]" class="[% tr_class.join(' ') | html %]" title="[% tr_title | html %]">
150
                            <tr id="row[% item.itemnumber | html %]" class="[% tr_class.join(' ') | html %]" title="[% tr_title | html %]">
137
                                [% UNLESS can_be_edited %]
151
                                [% UNLESS can_be_edited %]
138
                                    <td>&nbsp;</td>
152
                                    [% IF ( item.ondisplay ) %]
153
                                        <td>
154
                                            <em>Item on display:</em>
155
                                            <ul>
156
                                                <li>
157
                                                    <em><a href="/cgi-bin/koha/display/displays/[% item.active_display_id | url %]">[% item.active_display_name | html %]</a></em>
158
                                                </li>
159
                                            </ul>
160
                                        </td>
161
                                    [% ELSE %]
162
                                        <td>&nbsp;</td>
163
                                    [% END %]
139
                                [% ELSE %]
164
                                [% ELSE %]
140
                                    <td>
165
                                    <td>
141
                                        <div class="btn-group dropup">
166
                                        <div class="btn-group dropup">
Lines 218-223 Link Here
218
                                        <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $Price %]</td>
243
                                        <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $Price %]</td>
219
                                    [% ELSIF item.$attribute && attribute == 'itemcallnumber' %]
244
                                    [% ELSIF item.$attribute && attribute == 'itemcallnumber' %]
220
                                        <td class="[% can_mod | html %]" data-order="[% item.cn_sort | html %]">[% item.$attribute | html %]</td>
245
                                        <td class="[% can_mod | html %]" data-order="[% item.cn_sort | html %]">[% item.$attribute | html %]</td>
246
                                    [% ELSIF attribute == 'location' %]
247
                                        <td class="[% can_mod | html %]"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] </td>
221
                                    [% ELSE %]
248
                                    [% ELSE %]
222
                                        <td class="[% can_mod | html %]">[% item.$attribute | html %]</td>
249
                                        <td class="[% can_mod | html %]">[% item.$attribute | html %]</td>
223
                                    [% END %]
250
                                    [% END %]
Lines 295-422 Link Here
295
                            </div>
322
                            </div>
296
                        [% END %]
323
                        [% END %]
297
324
298
                        <fieldset class="rows"> [% PROCESS subfields_for_item subfields => subfields %] </fieldset>
325
                        [% UNLESS ( nomod ) %]
299
                        [% IF op != 'cud-additem' %]
326
                            <fieldset class="rows"> [% PROCESS subfields_for_item subfields => subfields %] </fieldset>
300
                            <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
327
                            [% IF op != 'cud-additem' %]
301
                        [% END %]
328
                                <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
329
                            [% END %]
302
330
303
                        [% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %]
331
                            [% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %]
304
                            <fieldset class="rows">
332
                                <fieldset class="rows">
305
                                <legend><i class="fa fa-plus"></i> Add to item group</legend>
333
                                    <legend><i class="fa fa-plus"></i> Add to item group</legend>
306
                                [% FOREACH ig IN item_groups %]
334
                                    [% FOREACH ig IN item_groups %]
307
                                    <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
335
                                        <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
308
                                [% END %]
336
                                    [% END %]
309
                                <ol>
337
                                    <ol>
310
                                    <li>
311
                                        <label for="select_item_group">Options: </label>
312
                                        <select name="item_group" id="item-group-add-or-create-form-select">
313
                                            <optgroup label="Use existing item group">
314
                                                [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
315
                                                    <option value="[% ig.id | html %]">[% ig.description | html %]</option>
316
                                                [% END %]
317
                                            </optgroup>
318
                                            <optgroup label="Other options">
319
                                                <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
320
                                                <option value="create">Create new item group</option>
321
                                            </optgroup>
322
                                        </select>
323
                                    </li>
324
                                    <div id="item-group-add-or-create-form-description-block">
325
                                        <li>
326
                                            <label for="item_group_description" class="required">Name: </label>
327
                                            <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
328
                                            <span class="required">Required</span>
329
                                        </li>
330
                                        <li>
338
                                        <li>
331
                                            <label for="item_group_display_order">Display order: </label>
339
                                            <label for="select_item_group">Options: </label>
332
                                            <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" />
340
                                            <select name="item_group" id="item-group-add-or-create-form-select">
333
                                            <div class="hint">Display order must be numerical</div>
341
                                                <optgroup label="Use existing item group">
342
                                                    [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
343
                                                        <option value="[% ig.id | html %]">[% ig.description | html %]</option>
344
                                                    [% END %]
345
                                                </optgroup>
346
                                                <optgroup label="Other options">
347
                                                    <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
348
                                                    <option value="create">Create new item group</option>
349
                                                </optgroup>
350
                                            </select>
334
                                        </li>
351
                                        </li>
335
                                    </div>
352
                                        <div id="item-group-add-or-create-form-description-block">
336
                                </ol>
353
                                            <li>
337
                            </fieldset>
354
                                                <label for="item_group_description" class="required">Name: </label>
338
                        [% END %]
355
                                                <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
339
356
                                                <span class="required">Required</span>
340
                        <fieldset class="action">
357
                                            </li>
341
                            [% IF op != 'cud-saveitem' %]
358
                                            <li>
342
                                <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
359
                                                <label for="item_group_display_order">Display order: </label>
343
                                <!-- Note:
360
                                                <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" />
344
                                    We use here a false submit button because we have several submit buttons and we do not want the user to believe they validated the adding of multiple items
361
                                                <div class="hint">Display order must be numerical</div>
345
                                    when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
362
                                            </li>
346
                                    It is a bit tricky, but necessary in the sake of UI correctness.
363
                                        </div>
347
                                -->
364
                                    </ol>
348
                                <span id="addsingle">
349
                                    <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
350
                                    <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
351
                                </span>
352
                                <span id="addmultiple">
353
                                    <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
354
                                </span>
355
                                <fieldset id="add_multiple_copies_span">
356
                                    <label for="number_of_copies">Number of copies of this item to add: </label>
357
                                    <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" maxlength="3" />
358
                                    <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" />
359
                                    <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
360
                                    <div class="hint"><p>Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.</p></div>
361
                                </fieldset>
365
                                </fieldset>
366
                            [% END %]
362
367
363
                                <span id="savetemplate">
368
                            <fieldset class="action">
364
                                    <input type="button" name="save_as_template" id="save_as_template" value="Save as template" />
369
                                [% IF op != 'cud-saveitem' %]
365
                                </span>
370
                                    <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
366
                                <fieldset id="save_as_template_span">
371
                                    <!-- Note:
367
                                    <legend>Save template</legend>
372
                                        We use here a false submit button because we have several submit buttons and we do not want the user to believe they validated the adding of multiple items
368
                                    <div class="btn-group">
373
                                        when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
369
                                        <select name="replace_template_id" id="replace_template_id" class="select2" style="width: 20em">
374
                                        It is a bit tricky, but necessary in the sake of UI correctness.
370
                                            <option value="0" selected="selected">Save as new template</option>
375
                                    -->
371
                                            <optgroup label="Update existing template">
376
                                    <span id="addsingle">
372
                                                [% FOREACH t IN item_templates.owned %]
377
                                        <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
373
                                                    <option data-editor="1" data-shared="[% t.is_shared | html %]" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
378
                                        <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
374
                                                [% END %]
379
                                    </span>
375
                                                [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
380
                                    <span id="addmultiple">
376
                                                    <optgroup label="Update shared template">
381
                                        <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
377
                                                        [% FOREACH t IN item_templates.shared %]
382
                                    </span>
378
                                                            <option data-editor="1" data-shared="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
383
                                    <fieldset id="add_multiple_copies_span">
379
                                                        [% END %]
384
                                        <label for="number_of_copies">Number of copies of this item to add: </label>
380
                                                    </optgroup>
385
                                        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" maxlength="3" />
381
                                                [% END %]
386
                                        <input
382
                                            </optgroup>
387
                                            type="submit"
383
                                        </select>
388
                                            id="add_multiple_copies_submit"
384
                                    </div>
389
                                            name="add_multiple_copies_submit"
390
                                            value="Add"
391
                                            onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);"
392
                                        />
393
                                        <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
394
                                        <div class="hint"><p>Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.</p></div>
395
                                    </fieldset>
385
396
386
                                    <div class="btn-group">
397
                                    <span id="savetemplate">
387
                                        <span id="template_name_block">
398
                                        <input type="button" name="save_as_template" id="save_as_template" value="Save as template" />
388
                                            <label for="template_name" class="required">Template name: </label>
399
                                    </span>
389
                                            <input type="text" id="template_name" name="template_name" class="required" />
400
                                    <fieldset id="save_as_template_span">
390
                                            <span class="required">Required</span>
401
                                        <legend>Save template</legend>
391
                                        </span>
402
                                        <div class="btn-group">
392
                                    </div>
403
                                            <select name="replace_template_id" id="replace_template_id" class="select2" style="width: 20em">
404
                                                <option value="0" selected="selected">Save as new template</option>
405
                                                <optgroup label="Update existing template">
406
                                                    [% FOREACH t IN item_templates.owned %]
407
                                                        <option data-editor="1" data-shared="[% t.is_shared | html %]" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
408
                                                    [% END %]
409
                                                    [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
410
                                                        <optgroup label="Update shared template">
411
                                                            [% FOREACH t IN item_templates.shared %]
412
                                                                <option data-editor="1" data-shared="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
413
                                                            [% END %]
414
                                                        </optgroup>
415
                                                    [% END %]
416
                                                </optgroup>
417
                                            </select>
418
                                        </div>
393
419
394
                                    <div class="btn-group">
420
                                        <div class="btn-group">
395
                                        <label for="template_is_shared">
421
                                            <span id="template_name_block">
396
                                            <input type="checkbox" id="template_is_shared" name="template_is_shared" />
422
                                                <label for="template_name" class="required">Template name: </label>
397
                                            Share template
423
                                                <input type="text" id="template_name" name="template_name" class="required" />
398
                                        </label>
424
                                                <span class="required">Required</span>
399
                                    </div>
425
                                            </span>
426
                                        </div>
400
427
401
                                    <div class="btn-group">
428
                                        <div class="btn-group">
402
                                        <input type="submit" id="save_as_template_submit" name="save_as_template_submit" value="Save" onclick="javascript:return CheckTemplateForm(this.form);" />
429
                                            <label for="template_is_shared">
403
                                        <a href="#" id="cancel_save_as_template" class="cancel">Cancel</a>
430
                                                <input type="checkbox" id="template_is_shared" name="template_is_shared" />
404
                                    </div>
431
                                                Share template
405
                                </fieldset>
432
                                            </label>
406
                            [% ELSE %]
433
                                        </div>
407
                                [% IF op != 'add_item' %]
434
408
                                    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
435
                                        <div class="btn-group">
409
                                [% END %]
436
                                            <input type="submit" id="save_as_template_submit" name="save_as_template_submit" value="Save" onclick="javascript:return CheckTemplateForm(this.form);" />
410
                                [% IF Item.HasSerialItem(itemnumber) == 0 %]
437
                                            <a href="#" id="cancel_save_as_template" class="cancel">Cancel</a>
411
                                    <input type="submit" value="Save changes" onclick="return Check(this.form)" />
438
                                        </div>
439
                                    </fieldset>
412
                                [% ELSE %]
440
                                [% ELSE %]
413
                                    <input type="button" class="submit" value="Save changes" onclick="return ShowSerialEditingConfirmation(this.form)" />
441
                                    [% IF op != 'add_item' %]
414
                                    <input type="hidden" name="edit-serial-issue" id="edit-serial-issue" value />
442
                                        <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
443
                                    [% END %]
444
                                    [% IF Item.HasSerialItem(itemnumber) == 0 %]
445
                                        <input type="submit" value="Save changes" onclick="return Check(this.form)" />
446
                                    [% ELSE %]
447
                                        <input type="button" class="submit" value="Save changes" onclick="return ShowSerialEditingConfirmation(this.form)" />
448
                                        <input type="hidden" name="edit-serial-issue" id="edit-serial-issue" value />
449
                                    [% END %]
450
                                    <input type="button" id="addnewitem" value="Add a new item" />
451
                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a>
415
                                [% END %]
452
                                [% END %]
416
                                <input type="button" id="addnewitem" value="Add a new item" />
453
                            </fieldset>
417
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a>
454
                        [% ELSE %]
418
                            [% END %]</fieldset
455
                            <em>This item is not presently editable. Please check the alert dialog above for details.</em>
419
                        >
456
                        [% END %]
420
457
421
                        [%# Fields for fast cataloging %]
458
                        [%# Fields for fast cataloging %]
422
                        <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
459
                        <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (-6 / +6 lines)
Lines 273-280 Link Here
273
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
273
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
274
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
274
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
275
                                <td class="ar-callnumber">
275
                                <td class="ar-callnumber">
276
                                    [% IF ar.item.location %]
276
                                    [% IF ar.item.effective_location %]
277
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
277
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.effective_location ) | html %]</em>
278
                                    [% END %]
278
                                    [% END %]
279
279
280
                                    [% ar.item.itemcallnumber | html %]
280
                                    [% ar.item.itemcallnumber | html %]
Lines 380-387 Link Here
380
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
380
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
381
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
381
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
382
                                <td class="ar-callnumber">
382
                                <td class="ar-callnumber">
383
                                    [% IF ar.item.location %]
383
                                    [% IF ar.item.effective_location %]
384
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
384
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.effective_location ) | html %]</em>
385
                                    [% END %]
385
                                    [% END %]
386
386
387
                                    [% ar.item.itemcallnumber | html %]
387
                                    [% ar.item.itemcallnumber | html %]
Lines 484-491 Link Here
484
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
484
                                <td class="ar-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => ar.item.ccode ) | html %]</td>
485
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
485
                                <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) | html %]</td>
486
                                <td class="ar-callnumber">
486
                                <td class="ar-callnumber">
487
                                    [% IF ar.item.location %]
487
                                    [% IF ar.item.effective_location %]
488
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.location ) | html %]</em>
488
                                        <em>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ar.item.effective_location ) | html %]</em>
489
                                    [% END %]
489
                                    [% END %]
490
490
491
                                    [% ar.item.itemcallnumber | html %]
491
                                    [% ar.item.itemcallnumber | html %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt (-1 / +1 lines)
Lines 274-280 Link Here
274
                                    >[% trsfitemloo.item.barcode | html %]</a
274
                                    >[% trsfitemloo.item.barcode | html %]</a
275
                                ></td
275
                                ></td
276
                            >
276
                            >
277
                            <td class="tf-location"><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => trsfitemloo.item.location ) | html %]</span></td>
277
                            <td class="tf-location"><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => trsfitemloo.item.effective_location ) | html %]</span></td>
278
                            <td class="tf-itemcallnumber">[% trsfitemloo.item.itemcallnumber | html %]</td>
278
                            <td class="tf-itemcallnumber">[% trsfitemloo.item.itemcallnumber | html %]</td>
279
                            <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %]</td>
279
                            <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %]</td>
280
                            <td class="tf-ccode">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => trsfitemloo.item.ccode ) | html %]</td>
280
                            <td class="tf-ccode">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => trsfitemloo.item.ccode ) | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt (-1 / +1 lines)
Lines 63-69 Link Here
63
                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a>
63
                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a>
64
                            </td>
64
                            </td>
65
                            <td>[% Branches.GetName(item.branchcode) | html %]</td>
65
                            <td>[% Branches.GetName(item.branchcode) | html %]</td>
66
                            <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</td>
66
                            <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => (item.effective_location || item.location) ) | html %]</td>
67
                        </tr>
67
                        </tr>
68
                    [% END %]
68
                    [% END %]
69
                </tbody>
69
                </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-1 / +1 lines)
Lines 144-150 Link Here
144
                                            >
144
                                            >
145
                                            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
145
                                            <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
146
                                            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
146
                                            <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
147
                                            <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => overdueloo.location ) | html %]</td>
147
                                            <td> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => overdueloo.effective_location ) | html %] </td>
148
                                            <td data-order="[% overdueloo.datelastborrowed | html %]">[% overdueloo.datelastborrowed | $KohaDates %]</td>
148
                                            <td data-order="[% overdueloo.datelastborrowed | html %]">[% overdueloo.datelastborrowed | $KohaDates %]</td>
149
                                            <td
149
                                            <td
150
                                                ><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]"
150
                                                ><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]"
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt (-5 / +5 lines)
Lines 235-250 Link Here
235
                    }
235
                    }
236
                },
236
                },
237
                {
237
                {
238
                    data: "item.location",
238
                    "data": "item.effective_location",
239
                    title: _("Location"),
239
                    "title": _("Location"),
240
                    searchable: false,
240
                    "searchable": false,
241
                    orderable: false,
241
                    "orderable": false,
242
                    render: function(data,type,row,meta) {
242
                    render: function(data,type,row,meta) {
243
                        if ( row.item ) {
243
                        if ( row.item ) {
244
                            if ( row.item.checked_out_date ) {
244
                            if ( row.item.checked_out_date ) {
245
                                return _("On loan, due: ") + $date(row.item.checked_out_date);
245
                                return _("On loan, due: ") + $date(row.item.checked_out_date);
246
                            } else {
246
                            } else {
247
                                return row.item._strings.location.str;
247
                                return row.item._strings.effective_location.str;
248
                            }
248
                            }
249
                        } else {
249
                        } else {
250
                                return null;
250
                                return null;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +21 lines)
Lines 80-85 Link Here
80
                                    <th class="string-sort">Available item types</th>
80
                                    <th class="string-sort">Available item types</th>
81
                                    <th class="string-sort">Available locations</th>
81
                                    <th class="string-sort">Available locations</th>
82
                                    <th class="string-sort">Available collections</th>
82
                                    <th class="string-sort">Available collections</th>
83
                                    <th class="string-sort">Displays</th>
83
                                    <th>Earliest hold date</th>
84
                                    <th>Earliest hold date</th>
84
                                    <th>Hold notes</th>
85
                                    <th>Hold notes</th>
85
                                    <th class="string-sort">Pickup location</th>
86
                                    <th class="string-sort">Pickup location</th>
Lines 196-201 Link Here
196
                                                [% END %]
197
                                                [% END %]
197
                                            </ul>
198
                                            </ul>
198
                                        </td>
199
                                        </td>
200
                                        <td>
201
                                            [% IF ( hold_info.displays.size ) %]
202
                                                <ul>
203
                                                    [% FOREACH display IN hold_info.displays %]
204
                                                        <li><a href="/cgi-bin/koha/display/displays/[% display.display_id | url %]">[% display.display_name | html %]</a></li>
205
                                                    [% END %]
206
                                                </ul>
207
                                            [% END %]
208
                                        </td>
199
                                        <td data-order="[% hold.reservedate | html %]"> [% hold.reservedate | $KohaDates %] in [% Branches.GetName ( hold.branchcode ) | html %] </td>
209
                                        <td data-order="[% hold.reservedate | html %]"> [% hold.reservedate | $KohaDates %] in [% Branches.GetName ( hold.branchcode ) | html %] </td>
200
                                        <td>[% hold.reservenotes | html %]</td>
210
                                        <td>[% hold.reservenotes | html %]</td>
201
                                        <td> [% Branches.GetName ( hold.branchcode ) | html %] </td>
211
                                        <td> [% Branches.GetName ( hold.branchcode ) | html %] </td>
Lines 322-329 Link Here
322
                pickup_locations : (table_dt) => get_options(table_dt.column(15)),
332
                pickup_locations : (table_dt) => get_options(table_dt.column(15)),
323
            };
333
            };
324
334
325
326
            var table_settings = [% TablesSettings.GetTableSettings('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
335
            var table_settings = [% TablesSettings.GetTableSettings('circ', 'holds', 'holds-to-pull', 'json') | $raw %];
336
337
            [% UNLESS Koha.Preference('UseDisplayModule') %]
338
            table_settings.columns = table_settings.columns.map((element, idx) => {
339
                if(element.columnname == "displays")
340
                    element.is_hidden = 1;
341
342
                return element;
343
            });
344
            [% END %]
345
327
            var holdst = $("#holdst").kohaTable(
346
            var holdst = $("#holdst").kohaTable(
328
                {
347
                {
329
                    pagingType: "full_numbers",
348
                    pagingType: "full_numbers",
Lines 341-346 Link Here
341
                        {name: "itemtypes", dataFilter: "item_types" },
360
                        {name: "itemtypes", dataFilter: "item_types" },
342
                        {name: "locations", dataFilter: "locations" },
361
                        {name: "locations", dataFilter: "locations" },
343
                        {name: "collection" },
362
                        {name: "collection" },
363
                        {name: "displays" },
344
                        {name: "hold_date" },
364
                        {name: "hold_date" },
345
                        {name: "reserve_nodes" },
365
                        {name: "reserve_nodes" },
346
                        {name: "pickup_location", dataFilter: "pickup_locations" },
366
                        {name: "pickup_location", dataFilter: "pickup_locations" },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +8 lines)
Lines 269-274 Link Here
269
            </div>
269
            </div>
270
        [% END %]
270
        [% END %]
271
271
272
        [% IF RemovedFromDisplay %]
273
            <div id="removed_from_display" class="alert alert-info">
274
                <h3>Item removed from display</h3>
275
                <p>This item has been removed from the display: <strong>[% RemovedFromDisplay.display_name | html %]</strong></p>
276
            </div>
277
        [% END %]
278
272
        [% IF ( errmsgloop ) %]
279
        [% IF ( errmsgloop ) %]
273
            <div class="alert alert-warning audio-alert-warning">
280
            <div class="alert alert-warning audio-alert-warning">
274
                <h3>Check in message</h3>
281
                <h3>Check in message</h3>
Lines 1385-1391 Link Here
1385
                            [%- END -%]
1392
                            [%- END -%]
1386
                        </td>
1393
                        </td>
1387
                        <td class="ci-shelvinglocation">
1394
                        <td class="ci-shelvinglocation">
1388
                            <span class="shelvingloc">[% checkin.item_location | html %]</span>
1395
                            <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => checkin.item.effective_location ) | html %] </span>
1389
                        </td>
1396
                        </td>
1390
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1397
                        <td class="ci-callnumber"> [% checkin.item.itemcallnumber | html %] </td>
1391
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
1398
                        <td class="ci-dateaccessioned"> [% checkin.item.dateaccessioned | $KohaDates %] </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-6 / +28 lines)
Lines 113-118 Link Here
113
                                                <th class="hq-collection">Collection</th>
113
                                                <th class="hq-collection">Collection</th>
114
                                                <th class="hq-location">Shelving location</th>
114
                                                <th class="hq-location">Shelving location</th>
115
                                                <th class="hq-itemtype">Item type</th>
115
                                                <th class="hq-itemtype">Item type</th>
116
                                                [% IF Koha.Preference('UseDisplayModule') %]
117
                                                    <th class="hq-displays">Displays</th>
118
                                                [% END %]
116
                                                <th class="hq-callnumber">Call number</th>
119
                                                <th class="hq-callnumber">Call number</th>
117
                                                <th class="hq-copynumber">Copy number</th>
120
                                                <th class="hq-copynumber">Copy number</th>
118
                                                <th class="hq-enumchron">Enumeration</th>
121
                                                <th class="hq-enumchron">Enumeration</th>
Lines 164-169 Link Here
164
                                                        <input type="text" placeholder="Item type" />
167
                                                        <input type="text" placeholder="Item type" />
165
                                                    </span>
168
                                                    </span>
166
                                                </td>
169
                                                </td>
170
                                                [% IF Koha.Preference('UseDisplayModule') %]
171
                                                    <td class="hq-displays">
172
                                                        <span class="filter_column filter_text">
173
                                                            <input type="text" placeholder="Displays" />
174
                                                        </span>
175
                                                    </td>
176
                                                [% END %]
167
                                                <td class="hq-callnumber">
177
                                                <td class="hq-callnumber">
168
                                                    <span class="filter_column filter_text">
178
                                                    <span class="filter_column filter_text">
169
                                                        <input type="text" placeholder="Call number" />
179
                                                        <input type="text" placeholder="Call number" />
Lines 211-218 Link Here
211
                                                </td>
221
                                                </td>
212
                                            </tr>
222
                                            </tr>
213
                                        </thead>
223
                                        </thead>
214
                                        <tbody
224
                                        <tbody>
215
                                            >[% FOREACH itemsloo IN itemsloop %]
225
                                            [% FOREACH itemsloo IN itemsloop %]
226
                                                [% SET displays = itemsloo.displays %]
227
                                                [% SET display_items = itemsloo.display_items %]
228
                                                [% SET itemsloo = itemsloo.object %]
216
                                                <tr>
229
                                                <tr>
217
                                                    <td class="hq-title">
230
                                                    <td class="hq-title">
218
                                                        <p> [% INCLUDE 'biblio-title.inc' biblio=itemsloo.biblio link = 1 %] </p>
231
                                                        <p> [% INCLUDE 'biblio-title.inc' biblio=itemsloo.biblio link = 1 %] </p>
Lines 237-247 Link Here
237
                                                            [% IF ( itemsloo.biblio.biblioitem.isbn ) %]<span>ISBN: [% itemsloo.biblio.biblioitem.isbn | html %]</span>[% END %]
250
                                                            [% IF ( itemsloo.biblio.biblioitem.isbn ) %]<span>ISBN: [% itemsloo.biblio.biblioitem.isbn | html %]</span>[% END %]
238
                                                        </div>
251
                                                        </div>
239
                                                    </td>
252
                                                    </td>
240
                                                    <td class="hq-holdingbranch">[% Branches.GetName( itemsloo.holdingbranch ) | html %]</td>
253
                                                    <td class="hq-holdingbranch">[% itemsloo.item.effective_holdingbranch.branchname | html %]</td>
241
                                                    <td class="hq-homebranch">[% Branches.GetName( itemsloo.item.homebranch ) | html %]</td>
254
                                                    <td class="hq-homebranch">[% itemsloo.item.effective_homebranch.branchname | html %]</td>
242
                                                    <td class="hq-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemsloo.item.ccode ) | html %]</td>
255
                                                    <td class="hq-collection">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemsloo.item.effective_collection_code ) | html %]</td>
243
                                                    <td class="hq-location">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => itemsloo.item.location ) | html %]</td>
256
                                                    <td class="hq-location"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => itemsloo.item.effective_location ) | html %] </td>
244
                                                    <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.item.effective_itemtype ) | html %]</td>
257
                                                    <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.item.effective_itemtype ) | html %]</td>
258
                                                    [% IF Koha.Preference('UseDisplayModule') %]
259
                                                        <td class="hq-displays">
260
                                                            <ul>
261
                                                                [% FOREACH display IN displays %]
262
                                                                    <li><a href="/cgi-bin/koha/display/displays/[% display.display_id | url %]" target="_blank">[% display.display_name | html %]</a></li>
263
                                                                [% END %]
264
                                                            </ul>
265
                                                        </td>
266
                                                    [% END %]
245
                                                    <td class="hq-callnumber"><span class="itemcallnumber">[% itemsloo.item.itemcallnumber | html %]</span></td>
267
                                                    <td class="hq-callnumber"><span class="itemcallnumber">[% itemsloo.item.itemcallnumber | html %]</span></td>
246
                                                    <td class="hq-copynumber">[% itemsloo.item.copynumber | html %]</td>
268
                                                    <td class="hq-copynumber">[% itemsloo.item.copynumber | html %]</td>
247
                                                    <td class="hq-enumchron">[% itemsloo.item.enumchron | html %]</td>
269
                                                    <td class="hq-enumchron">[% itemsloo.item.enumchron | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/display/display-home.tt (+36 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE To %]
3
[% USE Asset %]
4
[% USE Koha %]
5
[% USE KohaDates %]
6
[% USE TablesSettings %]
7
[% USE AuthorisedValues %]
8
[% SET footerjs = 1 %]
9
[% PROCESS 'i18n.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
11
<title> Displays &rsaquo; Koha </title>
12
[% INCLUDE 'doc-head-close.inc' %]
13
</head>
14
15
<body id="display_home" class="display">
16
[% WRAPPER 'header.inc' %]
17
    [% INCLUDE 'display-search.inc' %]
18
[% END %]
19
20
<div id="display"></div>
21
22
[% MACRO jsinclude BLOCK %]
23
    [% INCLUDE 'calendar.inc' %]
24
    [% INCLUDE 'datatables.inc' %]
25
    [% INCLUDE 'js-date-format.inc' %]
26
    [% INCLUDE 'js-biblio-format.inc' %]
27
    <script>
28
        const authorised_value_categories = [% To.json(AuthorisedValues.GetCategories()) | $raw %].map(c => c.category);
29
        const db_columns = [% To.json(db_columns) | $raw %];
30
        const api_mappings = [% To.json(api_mappings) | $raw %];
31
32
        const csrf_token = "[% Koha.GenerateCSRF | $raw %]";
33
    </script>
34
    [% Asset.js("js/vue/dist/display.js") | $raw %]
35
[% END %]
36
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (+6 lines)
Lines 167-172 Link Here
167
                            </li>
167
                            </li>
168
                        [% END %]
168
                        [% END %]
169
169
170
                        [% IF Koha.Preference('UseDisplayModule') && CAN_user_displays %]
171
                            <li>
172
                                <a class="icon_general icon_display" href="/cgi-bin/koha/display/display-home.pl"><i class="fa-solid fa-fw fa-image-portrait"></i>Displays</a>
173
                            </li>
174
                        [% END %]
175
170
                        [% IF ( CAN_user_tools || CAN_user_clubs ) %]
176
                        [% IF ( CAN_user_tools || CAN_user_clubs ) %]
171
                            <li>
177
                            <li>
172
                                <a class="icon_general icon_tools" href="/cgi-bin/koha/tools/tools-home.pl"><i class="fa fa-fw fa-wrench"></i>Tools</a>
178
                                <a class="icon_general icon_tools" href="/cgi-bin/koha/tools/tools-home.pl"><i class="fa fa-fw fa-wrench"></i>Tools</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt (-2 / +2 lines)
Lines 111-118 Link Here
111
                                </td>
111
                                </td>
112
                                <td class="recall-locations">
112
                                <td class="recall-locations">
113
                                    <ul>
113
                                    <ul>
114
                                        [% FOREACH loc IN recall.locations %]
114
                                        [% FOREACH location IN recall.locations %]
115
                                            <li>[% AuthorisedValues.GetByCode('LOC', loc) | html %]</li>
115
                                            <li>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => location ) | html %]</li>
116
                                        [% END %]
116
                                        [% END %]
117
                                    </ul>
117
                                    </ul>
118
                                </td>
118
                                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-1 / +1 lines)
Lines 126-132 Link Here
126
                                <td>[% ItemTypes.GetDescription(item.effective_itemtype) | html %]</td>
126
                                <td>[% ItemTypes.GetDescription(item.effective_itemtype) | html %]</td>
127
                                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
127
                                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
128
                                <td>[% Branches.GetName(item.holdingbranch) | html %]</td>
128
                                <td>[% Branches.GetName(item.holdingbranch) | html %]</td>
129
                                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</td>
129
                                <td> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.effective_location ) | html %] </td>
130
                                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %] </td><td>[% item.itemnotes | $raw %]</td>
130
                                <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %] </td><td>[% item.itemnotes | $raw %]</td>
131
                            </tr>
131
                            </tr>
132
                        [% END %]
132
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt (-1 / +1 lines)
Lines 96-102 Link Here
96
                                                >[% FOREACH item IN title.items %]
96
                                                >[% FOREACH item IN title.items %]
97
                                                    <li>
97
                                                    <li>
98
                                                        [% Branches.GetName(item.holdingbranch) | html %]
98
                                                        [% Branches.GetName(item.holdingbranch) | html %]
99
                                                        <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] </span>
99
                                                        <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.effective_location ) | html %] </span>
100
                                                        [% IF ( item.itemcallnumber ) %]
100
                                                        [% IF ( item.itemcallnumber ) %]
101
                                                            ([% item.itemcallnumber | html %])
101
                                                            ([% item.itemcallnumber | html %])
102
                                                        [% END %]
102
                                                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-1 / +1 lines)
Lines 123-129 Link Here
123
                            [% ELSE %]
123
                            [% ELSE %]
124
                                <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value="" /> All</label>
124
                                <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value="" /> All</label>
125
                            [% END %]
125
                            [% END %]
126
                            [% FOREACH modx IN [ 'APIKEYS' 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION', 'TRANSFERS' ] %]
126
                            [% FOREACH modx IN [ 'APIKEYS' 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'CLAIMS' 'DISPLAYS' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE', 'NOTICES', 'NEWS', 'RECALLS', 'SUGGESTION', 'TRANSFERS' ] %]
127
                                [% IF modules.grep(modx).size %]
127
                                [% IF modules.grep(modx).size %]
128
                                    <label for="module[% modx | html %]" class="viewlog"
128
                                    <label for="module[% modx | html %]" class="viewlog"
129
                                        ><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked" /> [% PROCESS translate_log_module module=modx %]</label
129
                                        ><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked" /> [% PROCESS translate_log_module module=modx %]</label
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-2 / +2 lines)
Lines 388-395 Link Here
388
                                        [% FOREACH item IN itemsloo.ITEM_RESULTS %]
388
                                        [% FOREACH item IN itemsloo.ITEM_RESULTS %]
389
                                            <li>
389
                                            <li>
390
                                                [% Branches.GetName(item.holdingbranch) | html %]
390
                                                [% Branches.GetName(item.holdingbranch) | html %]
391
                                                [% IF ( item.location ) %]
391
                                                [% IF ( item.effective_location ) %]
392
                                                    <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] </span>
392
                                                    <span class="shelvingloc"> [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.effective_location ) | html %] </span>
393
                                                [% END %]
393
                                                [% END %]
394
                                                [% IF ( item.itemcallnumber ) %]
394
                                                [% IF ( item.itemcallnumber ) %]
395
                                                    [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>]
395
                                                    [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>]
(-)a/koha-tmpl/intranet-tmpl/prog/js/fetch/display-api-client.js (-2 / +4 lines)
Lines 33-46 export class DisplayAPIClient { Link Here
33
                this.httpClientDisplays.get({
33
                this.httpClientDisplays.get({
34
                    endpoint: "" + id,
34
                    endpoint: "" + id,
35
                    headers: {
35
                    headers: {
36
                        "x-koha-embed": "display_items,home_library,holding_library,item_type,+strings",
36
                        "x-koha-embed":
37
                            "display_items,home_library,holding_library,item_type,+strings",
37
                    },
38
                    },
38
                }),
39
                }),
39
            getAll: (query, params) =>
40
            getAll: (query, params) =>
40
                this.httpClientDisplays.getAll({
41
                this.httpClientDisplays.getAll({
41
                    endpoint: "",
42
                    endpoint: "",
42
                    headers: {
43
                    headers: {
43
                        "x-koha-embed": "display_items,home_library,holding_library,+strings",
44
                        "x-koha-embed":
45
                            "display_items,home_library,holding_library,+strings",
44
                    },
46
                    },
45
                    params,
47
                    params,
46
                    query,
48
                    query,
(-)a/koha-tmpl/intranet-tmpl/prog/js/fetch/item-api-client.js (-5 / +6 lines)
Lines 20-30 export class ItemAPIClient { Link Here
20
                }),
20
                }),
21
            getByExternalId: external_id =>
21
            getByExternalId: external_id =>
22
                this.httpClient.get({
22
                this.httpClient.get({
23
                    endpoint: "items?" +
23
                    endpoint:
24
                    new URLSearchParams({
24
                        "items?" +
25
                        _match: 'starts_with',
25
                        new URLSearchParams({
26
                        external_id: external_id,
26
                            _match: "starts_with",
27
                    }),
27
                            external_id: external_id,
28
                        }),
28
                }),
29
                }),
29
        };
30
        };
30
    }
31
    }
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysBatchAddItems.vue (-17 / +30 lines)
Lines 3-12 Link Here
3
    <div class="page-section" id="list">
3
    <div class="page-section" id="list">
4
        <form @submit="batchAdd($event)">
4
        <form @submit="batchAdd($event)">
5
            <fieldset class="rows" id="display_list">
5
            <fieldset class="rows" id="display_list">
6
                <h3>{{ $__("Sepcify items to add") }}:</h3>
6
                <h3>{{ $__("Specify items to add") }}:</h3>
7
                <ol>
7
                <ol>
8
                    <li>
8
                    <li>
9
                        <label for="barcodes">{{ $__("Item barcodes") }}:</label>
9
                        <label for="barcodes"
10
                            >{{ $__("Item barcodes") }}:</label
11
                        >
10
                        <textarea
12
                        <textarea
11
                            id="barcodes"
13
                            id="barcodes"
12
                            v-model="barcodes"
14
                            v-model="barcodes"
Lines 17-23 Link Here
17
                        />
19
                        />
18
                        <span class="required">{{ $__("Required") }}</span>
20
                        <span class="required">{{ $__("Required") }}</span>
19
                        <div class="hint">
21
                        <div class="hint">
20
                            {{ $__("List of item barcodes, one per line") }}<br />
22
                            {{ $__("List of item barcodes, one per line")
23
                            }}<br />
21
                        </div>
24
                        </div>
22
                    </li>
25
                    </li>
23
                    <li>
26
                    <li>
Lines 58-66 Link Here
58
                </ol>
61
                </ol>
59
            </fieldset>
62
            </fieldset>
60
            <fieldset class="action">
63
            <fieldset class="action">
61
                <ButtonSubmit
64
                <ButtonSubmit :title="$__('Save')" />
62
                    :title="$__('Save')"
63
                />
64
                <router-link
65
                <router-link
65
                    :to="{
66
                    :to="{
66
                        name: 'DisplaysList',
67
                        name: 'DisplaysList',
Lines 104-117 export default { Link Here
104
            event.preventDefault();
105
            event.preventDefault();
105
106
106
            barcodes.value = barcodes.value
107
            barcodes.value = barcodes.value
107
            .split("\n")
108
                .split("\n")
108
            .map(n => Number(n))
109
                .map(n => Number(n))
109
            .filter(n => {
110
                .filter(n => {
110
                if (n == '')
111
                    if (n == "") return false;
111
                    return false;
112
112
113
                return true;
113
                    return true;
114
            });
114
                });
115
115
116
            const client = APIClient.display;
116
            const client = APIClient.display;
117
            const importData = {
117
            const importData = {
Lines 124-138 export default { Link Here
124
            client.displayItems.batchAdd(importData).then(
124
            client.displayItems.batchAdd(importData).then(
125
                success => {
125
                success => {
126
                    if (success.job_id)
126
                    if (success.job_id)
127
                        setMessage(`${$__('Batch job successfully queued.')} <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=${success.job_id}" target="_blank">${$__('Click here to view job progress')}</a>`, true);
127
                        setMessage(
128
                            `${$__("Batch job successfully queued.")} <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=${success.job_id}" target="_blank">${$__("Click here to view job progress")}</a>`,
129
                            true
130
                        );
128
131
129
                    if (!success.job_id)
132
                    if (!success.job_id)
130
                        setWarning($__('Batch job failed to queue. Please check your list, and try again.'), true);
133
                        setWarning(
134
                            $__(
135
                                "Batch job failed to queue. Please check your list, and try again."
136
                            ),
137
                            true
138
                        );
131
                },
139
                },
132
                error => {
140
                error => {
133
                    setError($__('Internal Server Error. Please check the browser console for diagnostic information.'), true);
141
                    setError(
142
                        $__(
143
                            "Internal Server Error. Please check the browser console for diagnostic information."
144
                        ),
145
                        true
146
                    );
134
                    console.error(error);
147
                    console.error(error);
135
                },
148
                }
136
            );
149
            );
137
            clearForm();
150
            clearForm();
138
        };
151
        };
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysBatchRemoveItems.vue (-15 / +23 lines)
Lines 6-12 Link Here
6
                <h3>{{ $__("Specify items to remove") }}:</h3>
6
                <h3>{{ $__("Specify items to remove") }}:</h3>
7
                <ol>
7
                <ol>
8
                    <li>
8
                    <li>
9
                        <label for="barcodes">{{ $__("Item barcodes") }}:</label>
9
                        <label for="barcodes"
10
                            >{{ $__("Item barcodes") }}:</label
11
                        >
10
                        <textarea
12
                        <textarea
11
                            id="barcodes"
13
                            id="barcodes"
12
                            v-model="barcodes"
14
                            v-model="barcodes"
Lines 17-23 Link Here
17
                        />
19
                        />
18
                        <span class="required">{{ $__("Required") }}</span>
20
                        <span class="required">{{ $__("Required") }}</span>
19
                        <div class="hint">
21
                        <div class="hint">
20
                            {{ $__("List of item barcodes, one per line") }}<br />
22
                            {{ $__("List of item barcodes, one per line")
23
                            }}<br />
21
                        </div>
24
                        </div>
22
                    </li>
25
                    </li>
23
                    <li>
26
                    <li>
Lines 47-55 Link Here
47
                </ol>
50
                </ol>
48
            </fieldset>
51
            </fieldset>
49
            <fieldset class="action">
52
            <fieldset class="action">
50
                <ButtonSubmit
53
                <ButtonSubmit :title="$__('Save')" />
51
                    :title="$__('Save')"
52
                />
53
                <router-link
54
                <router-link
54
                    :to="{
55
                    :to="{
55
                        name: 'DisplaysList',
56
                        name: 'DisplaysList',
Lines 89-102 export default { Link Here
89
            event.preventDefault();
90
            event.preventDefault();
90
91
91
            barcodes.value = barcodes.value
92
            barcodes.value = barcodes.value
92
            .split("\n")
93
                .split("\n")
93
            .map(n => Number(n))
94
                .map(n => Number(n))
94
            .filter(n => {
95
                .filter(n => {
95
                if (n == '')
96
                    if (n == "") return false;
96
                    return false;
97
97
98
                return true;
98
                    return true;
99
            });
99
                });
100
100
101
            const client = APIClient.display;
101
            const client = APIClient.display;
102
            const importData = {
102
            const importData = {
Lines 106-117 export default { Link Here
106
106
107
            client.displayItems.batchDelete(importData).then(
107
            client.displayItems.batchDelete(importData).then(
108
                success => {
108
                success => {
109
                    setMessage(`${$__('Batch job successfully queued.')} <a href="/cgi-bin/koha/admin/background_jobs.pl" target="_blank">${$__('Click here to view job progress')}</a>`, true);
109
                    setMessage(
110
                        `${$__("Batch job successfully queued.")} <a href="/cgi-bin/koha/admin/background_jobs.pl" target="_blank">${$__("Click here to view job progress")}</a>`,
111
                        true
112
                    );
110
                },
113
                },
111
                error => {
114
                error => {
112
                    setError($__('Internal Server Error. Please check the browser console for diagnostic information.'), true);
115
                    setError(
116
                        $__(
117
                            "Internal Server Error. Please check the browser console for diagnostic information."
118
                        ),
119
                        true
120
                    );
113
                    console.error(error);
121
                    console.error(error);
114
                },
122
                }
115
            );
123
            );
116
            clearForm();
124
            clearForm();
117
        };
125
        };
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/DisplaysResource.vue (-88 / +86 lines)
Lines 89-96 export default { Link Here
89
                    name: "display_branch",
89
                    name: "display_branch",
90
                    label: $__("Home library"),
90
                    label: $__("Home library"),
91
                    type: "relationshipSelect",
91
                    type: "relationshipSelect",
92
                    relationshipAPIClient:
92
                    relationshipAPIClient: APIClient.library.libraries,
93
                        APIClient.library.libraries,
94
                    relationshipOptionLabelAttr: "name",
93
                    relationshipOptionLabelAttr: "name",
95
                    relationshipRequiredKey: "library_id",
94
                    relationshipRequiredKey: "library_id",
96
                    tableColumnDefinition: {
95
                    tableColumnDefinition: {
Lines 100-125 export default { Link Here
100
                        orderable: true,
99
                        orderable: true,
101
                        render: function (data, type, row, meta) {
100
                        render: function (data, type, row, meta) {
102
                            if (row.home_library === null)
101
                            if (row.home_library === null)
103
                                return (escape_str(
102
                                return escape_str(``);
104
                                    ``
105
                                ));
106
                            else
103
                            else
107
                                return (escape_str(
104
                                return escape_str(
108
                                    `${row["home_library"]["name"]}`
105
                                    `${row["home_library"]["name"]}`
109
                                ));
106
                                );
110
                        },
107
                        },
111
                    },
108
                    },
112
                    showElement: {
109
                    showElement: {
113
                        type: "text",
110
                        type: "text",
114
                        value: "home_library.name"
111
                        value: "home_library.name",
115
                    },
112
                    },
116
                },
113
                },
117
                {
114
                {
118
                    name: "display_holding_branch",
115
                    name: "display_holding_branch",
119
                    label: $__("Holding library"),
116
                    label: $__("Holding library"),
120
                    type: "relationshipSelect",
117
                    type: "relationshipSelect",
121
                    relationshipAPIClient:
118
                    relationshipAPIClient: APIClient.library.libraries,
122
                        APIClient.library.libraries,
123
                    relationshipOptionLabelAttr: "name",
119
                    relationshipOptionLabelAttr: "name",
124
                    relationshipRequiredKey: "library_id",
120
                    relationshipRequiredKey: "library_id",
125
                    tableColumnDefinition: {
121
                    tableColumnDefinition: {
Lines 129-146 export default { Link Here
129
                        orderable: true,
125
                        orderable: true,
130
                        render: function (data, type, row, meta) {
126
                        render: function (data, type, row, meta) {
131
                            if (row.holding_library === null)
127
                            if (row.holding_library === null)
132
                                return (escape_str(
128
                                return escape_str(``);
133
                                    ``
134
                                ));
135
                            else
129
                            else
136
                                return (escape_str(
130
                                return escape_str(
137
                                    `${row["holding_library"]["name"]}`
131
                                    `${row["holding_library"]["name"]}`
138
                                ));
132
                                );
139
                        },
133
                        },
140
                    },
134
                    },
141
                    showElement: {
135
                    showElement: {
142
                        type: "text",
136
                        type: "text",
143
                        value: "holding_library.name"
137
                        value: "holding_library.name",
144
                    },
138
                    },
145
                },
139
                },
146
                {
140
                {
Lines 159-166 export default { Link Here
159
                    name: "display_itype",
153
                    name: "display_itype",
160
                    label: $__("Item type"),
154
                    label: $__("Item type"),
161
                    type: "relationshipSelect",
155
                    type: "relationshipSelect",
162
                    relationshipAPIClient:
156
                    relationshipAPIClient: APIClient.item_type.item_types,
163
                        APIClient.item_type.item_types,
164
                    relationshipOptionLabelAttr: "description",
157
                    relationshipOptionLabelAttr: "description",
165
                    relationshipRequiredKey: "item_type_id",
158
                    relationshipRequiredKey: "item_type_id",
166
                    tableColumnDefinition: {
159
                    tableColumnDefinition: {
Lines 169-187 export default { Link Here
169
                        searchable: true,
162
                        searchable: true,
170
                        orderable: true,
163
                        orderable: true,
171
                        render: function (data, type, row, meta) {
164
                        render: function (data, type, row, meta) {
172
                            if (row.item_type === null)
165
                            if (row.item_type === null) return escape_str(``);
173
                                return (escape_str(
174
                                    ``
175
                                ));
176
                            else
166
                            else
177
                                return (escape_str(
167
                                return escape_str(
178
                                    `${row["item_type"]["description"]}`
168
                                    `${row["item_type"]["description"]}`
179
                                ));
169
                                );
180
                        },
170
                        },
181
                    },
171
                    },
182
                    showElement: {
172
                    showElement: {
183
                        type: "text",
173
                        type: "text",
184
                        value: "item_type.description"
174
                        value: "item_type.description",
185
                    },
175
                    },
186
                },
176
                },
187
                {
177
                {
Lines 200-214 export default { Link Here
200
                        searchable: false,
190
                        searchable: false,
201
                        orderable: true,
191
                        orderable: true,
202
                        render: function (data, type, row, meta) {
192
                        render: function (data, type, row, meta) {
203
                            let this_value = '';
193
                            let this_value = "";
204
194
205
                            DisplayStore.displayReturnOverMapping.forEach(mapping => {
195
                            DisplayStore.displayReturnOverMapping.forEach(
206
                                if(mapping.variable == data) this_value = mapping.value;
196
                                mapping => {
207
                            });
197
                                    if (mapping.variable == data)
198
                                        this_value = mapping.value;
199
                                }
200
                            );
208
201
209
                            return (escape_str(
202
                            return escape_str(`${this_value}`);
210
                                `${this_value}`
211
                            ));
212
                        },
203
                        },
213
                    },
204
                    },
214
                },
205
                },
Lines 308-316 export default { Link Here
308
                        },
299
                        },
309
                        relationshipI18n: {
300
                        relationshipI18n: {
310
                            nameUpperCase: __("Display item"),
301
                            nameUpperCase: __("Display item"),
311
                            removeThisMessage: __(
302
                            removeThisMessage: __("Remove this display item"),
312
                                "Remove this display item"
313
                            ),
314
                            addNewMessage: __("Add new display item"),
303
                            addNewMessage: __("Add new display item"),
315
                            noneCreatedYetMessage: __(
304
                            noneCreatedYetMessage: __(
316
                                "There are no display items created yet"
305
                                "There are no display items created yet"
Lines 367-414 export default { Link Here
367
            actions: {
356
            actions: {
368
                0: ["show"],
357
                0: ["show"],
369
                1: ["show"],
358
                1: ["show"],
370
                "-1": ["edit", "delete"]
359
                "-1": ["edit", "delete"],
371
            },
360
            },
372
        };
361
        };
373
362
374
        const getItemFromId = (async id => {
363
        const getItemFromId = async id => {
375
            const itemsApiClient = APIClient.item.items;
364
            const itemsApiClient = APIClient.item.items;
376
            let item = undefined;
365
            let item = undefined;
377
366
378
            await itemsApiClient.get(id)
367
            await itemsApiClient
379
            .then(data => {
368
                .get(id)
380
                item = data;
369
                .then(data => {
381
            })
370
                    item = data;
382
            .catch(error => {
371
                })
383
                console.error(error);
372
                .catch(error => {
384
            });
373
                    console.error(error);
374
                });
385
375
386
            return item;
376
            return item;
387
        });
377
        };
388
378
389
        const getItemFromExternalId = (async external_id => {
379
        const getItemFromExternalId = async external_id => {
390
            const itemsApiClient = APIClient.item.items;
380
            const itemsApiClient = APIClient.item.items;
391
            let item = undefined;
381
            let item = undefined;
392
382
393
            await itemsApiClient.getByExternalId(external_id)
383
            await itemsApiClient
394
            .then(data => {
384
                .getByExternalId(external_id)
395
                if (data.length == 1)
385
                .then(data => {
396
                    item = data[0];
386
                    if (data.length == 1) item = data[0];
397
            })
387
                })
398
            .catch(error => {
388
                .catch(error => {
399
                console.error(error);
389
                    console.error(error);
400
            });
390
                });
401
391
402
            return item;
392
            return item;
403
        });
393
        };
404
394
405
        const checkForm = (async display => {
395
        const checkForm = async display => {
406
            let errors = [];
396
            let errors = [];
407
397
408
            let display_items = display.display_items;
398
            let display_items = display.display_items;
409
            // Do not use di.display_item.name here! Its name is not the one linked with di.display_item_id
399
            // Do not use di.display_item.name here! Its name is not the one linked with di.display_item_id
410
            // At this point di.display_item is meaningless, form/template only modified di.display_item_id
400
            // At this point di.display_item is meaningless, form/template only modified di.display_item_id
411
            const display_item_ids = display_items.map(di => di.display_item_id);
401
            const display_item_ids = display_items.map(
402
                di => di.display_item_id
403
            );
412
            const duplicate_display_item_ids = display_item_ids.filter(
404
            const duplicate_display_item_ids = display_item_ids.filter(
413
                (id, i) => display_item_ids.indexOf(id) !== i
405
                (id, i) => display_item_ids.indexOf(id) !== i
414
            );
406
            );
Lines 419-440 export default { Link Here
419
411
420
            for await (const display_item of display_items) {
412
            for await (const display_item of display_items) {
421
                const item = await getItemFromExternalId(display_item.barcode);
413
                const item = await getItemFromExternalId(display_item.barcode);
422
                
414
423
                if (item == undefined || item.item_id === undefined || item.external_id !== display_item.barcode)
415
                if (
424
                    errors.push($__("The barcode entered does not match an item"));
416
                    item == undefined ||
417
                    item.item_id === undefined ||
418
                    item.external_id !== display_item.barcode
419
                )
420
                    errors.push(
421
                        $__("The barcode entered does not match an item")
422
                    );
425
            }
423
            }
426
424
427
            baseResource.setWarning(errors.join("<br>"));
425
            baseResource.setWarning(errors.join("<br>"));
428
            return !errors.length;
426
            return !errors.length;
429
        });
427
        };
430
        const onFormSave = (async (e, displayToSave) => {
428
        const onFormSave = async (e, displayToSave) => {
431
            e.preventDefault();
429
            e.preventDefault();
432
430
433
            const display = JSON.parse(JSON.stringify(displayToSave));
431
            const display = JSON.parse(JSON.stringify(displayToSave));
434
            const displayId = display.display_id;
432
            const displayId = display.display_id;
435
            const epoch = new Date();
433
            const epoch = new Date();
436
434
437
            if (!await checkForm(display)) {
435
            if (!(await checkForm(display))) {
438
                return false;
436
                return false;
439
            }
437
            }
440
438
Lines 445-452 export default { Link Here
445
            delete display._strings;
443
            delete display._strings;
446
444
447
            display.display_items = display.display_items.map(
445
            display.display_items = display.display_items.map(
448
                ({ display_item_id, ...keepAttrs }) =>
446
                ({ display_item_id, ...keepAttrs }) => keepAttrs
449
                    keepAttrs
450
            );
447
            );
451
448
452
            let display_items = display.display_items;
449
            let display_items = display.display_items;
Lines 464-473 export default { Link Here
464
                await display.display_items.push(display_item);
461
                await display.display_items.push(display_item);
465
            }
462
            }
466
463
467
            if (display.start_date == null) display.start_date = epoch.toISOString().substr(0, 10);
464
            if (display.start_date == null)
465
                display.start_date = epoch.toISOString().substr(0, 10);
468
            if (display.end_date == null && display.display_days != undefined) {
466
            if (display.end_date == null && display.display_days != undefined) {
469
                let calculated_date = epoch;
467
                let calculated_date = epoch;
470
                calculated_date.setDate(epoch.getDate() + Number(display.display_days));
468
                calculated_date.setDate(
469
                    epoch.getDate() + Number(display.display_days)
470
                );
471
471
472
                display.end_date = calculated_date.toISOString().substr(0, 10);
472
                display.end_date = calculated_date.toISOString().substr(0, 10);
473
            }
473
            }
Lines 476-489 export default { Link Here
476
            if (display.staff_note == "") display.staff_note = null;
476
            if (display.staff_note == "") display.staff_note = null;
477
477
478
            if (displayId) {
478
            if (displayId) {
479
                baseResource.apiClient
479
                baseResource.apiClient.update(display, displayId).then(
480
                    .update(display, displayId)
480
                    success => {
481
                    .then(
481
                        baseResource.setMessage($__("Display updated"));
482
                        success => {
482
                        baseResource.router.push({ name: "DisplaysList" });
483
                            baseResource.setMessage($__("Display updated"));
483
                    },
484
                            baseResource.router.push({ name: "DisplaysList" });
484
                    error => {}
485
                        },
486
                        error => {}
487
                );
485
                );
488
            } else {
486
            } else {
489
                baseResource.apiClient.create(display).then(
487
                baseResource.apiClient.create(display).then(
Lines 494-516 export default { Link Here
494
                    error => {}
492
                    error => {}
495
                );
493
                );
496
            }
494
            }
497
        });
495
        };
498
        const afterResourceFetch = ((componentData, resource, caller) => {
496
        const afterResourceFetch = (componentData, resource, caller) => {
499
            if(caller === "show" || caller === "form") {
497
            if (caller === "show" || caller === "form") {
500
                resource.display_items.forEach((display_item, idx) => {
498
                resource.display_items.forEach((display_item, idx) => {
501
                    getItemFromId(display_item.itemnumber)
499
                    getItemFromId(display_item.itemnumber)
502
                    .then(item => {
500
                        .then(item => {
503
                        componentData.resource.value.display_items[idx] = {
501
                            componentData.resource.value.display_items[idx] = {
504
                            barcode: item.external_id,
502
                                barcode: item.external_id,
505
                            ...display_item,
503
                                ...display_item,
506
                        };
504
                            };
507
                    })
505
                        })
508
                    .catch(error => {
506
                        .catch(error => {
509
                        console.error(error);
507
                            console.error(error);
510
                    });
508
                        });
511
                });
509
                });
512
            }
510
            }
513
        });
511
        };
514
512
515
        onBeforeMount(() => {});
513
        onBeforeMount(() => {});
516
514
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Display/Main.vue (-14 / +12 lines)
Lines 65-90 export default { Link Here
65
                }
65
                }
66
66
67
                DisplayStore.displayReturnOverMapping.push({
67
                DisplayStore.displayReturnOverMapping.push({
68
                    "variable": "yes - any library",
68
                    variable: "yes - any library",
69
                    "value": $__('Yes, any library'),
69
                    value: $__("Yes, any library"),
70
                });
70
                });
71
                DisplayStore.displayReturnOverMapping.push({
71
                DisplayStore.displayReturnOverMapping.push({
72
                    "variable": "yes - except at home library",
72
                    variable: "yes - except at home library",
73
                    "value": $__('Yes, except at home library'),
73
                    value: $__("Yes, except at home library"),
74
                });
74
                });
75
                DisplayStore.displayReturnOverMapping.push({
75
                DisplayStore.displayReturnOverMapping.push({
76
                    "variable": "no",
76
                    variable: "no",
77
                    "value": $__('No'),
77
                    value: $__("No"),
78
                });
79
80
                loadAuthorisedValues(
81
                    authorisedValues.value,
82
                    DisplayStore
83
                ).then(() => {
84
                    loaded();
85
                    initialized.value = true;
86
                });
78
                });
87
79
80
                loadAuthorisedValues(authorisedValues.value, DisplayStore).then(
81
                    () => {
82
                        loaded();
83
                        initialized.value = true;
84
                    }
85
                );
88
            });
86
            });
89
        });
87
        });
90
88
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js (-2 / +2 lines)
Lines 6-15 import AcquisitionAPIClient from "@fetch/acquisition-api-client"; Link Here
6
import AdditionalFieldsAPIClient from "@fetch/additional-fields-api-client";
6
import AdditionalFieldsAPIClient from "@fetch/additional-fields-api-client";
7
import AVAPIClient from "@fetch/authorised-values-api-client";
7
import AVAPIClient from "@fetch/authorised-values-api-client";
8
import CashAPIClient from "@fetch/cash-api-client";
8
import CashAPIClient from "@fetch/cash-api-client";
9
import BiblioAPIClient from '@fetch/biblio-api-client.js';
9
import BiblioAPIClient from "@fetch/biblio-api-client.js";
10
import DisplayAPIClient from "@fetch/display-api-client";
10
import DisplayAPIClient from "@fetch/display-api-client";
11
import ItemAPIClient from "@fetch/item-api-client";
11
import ItemAPIClient from "@fetch/item-api-client";
12
import ItemTypeAPIClient from '@fetch/item-type-api-client.js';
12
import ItemTypeAPIClient from "@fetch/item-type-api-client.js";
13
import LibraryAPIClient from "@fetch/library-api-client";
13
import LibraryAPIClient from "@fetch/library-api-client";
14
import RecordSourcesAPIClient from "@fetch/record-sources-api-client";
14
import RecordSourcesAPIClient from "@fetch/record-sources-api-client";
15
import SysprefAPIClient from "@fetch/system-preferences-api-client";
15
import SysprefAPIClient from "@fetch/system-preferences-api-client";
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/routes/display.js (-6 / +2 lines)
Lines 62-78 export const routes = [ Link Here
62
                    {
62
                    {
63
                        path: "batch-add",
63
                        path: "batch-add",
64
                        name: "DisplaysBatchAddItems",
64
                        name: "DisplaysBatchAddItems",
65
                        component: markRaw(
65
                        component: markRaw(DisplaysBatchAddItems),
66
                            DisplaysBatchAddItems
67
                        ),
68
                        title: $__("Batch add items from list"),
66
                        title: $__("Batch add items from list"),
69
                    },
67
                    },
70
                    {
68
                    {
71
                        path: "batch-remove",
69
                        path: "batch-remove",
72
                        name: "DisplaysBatchRemoveItems",
70
                        name: "DisplaysBatchRemoveItems",
73
                        component: markRaw(
71
                        component: markRaw(DisplaysBatchRemoveItems),
74
                            DisplaysBatchRemoveItems
75
                        ),
76
                        title: $__("Batch remove items from list"),
72
                        title: $__("Batch remove items from list"),
77
                    },
73
                    },
78
                ],
74
                ],
(-)a/recalls/recalls_to_pull.pl (-1 / +1 lines)
Lines 98-104 if ( $op eq 'list' ) { Link Here
98
                    push( @copynumbers, $item->copynumber )         if ( $item->copynumber );
98
                    push( @copynumbers, $item->copynumber )         if ( $item->copynumber );
99
                    push( @enumchrons,  $item->enumchron )          if ( $item->enumchron );
99
                    push( @enumchrons,  $item->enumchron )          if ( $item->enumchron );
100
                    push( @itemtypes,   $item->effective_itemtype ) if ( $item->effective_itemtype );
100
                    push( @itemtypes,   $item->effective_itemtype ) if ( $item->effective_itemtype );
101
                    push( @locations,   $item->location )           if ( $item->location );
101
                    push( @locations,   $item->effective_location ) if ( $item->effective_location );
102
                    push( @libraries,   $item->holdingbranch )      if ( $item->holdingbranch );
102
                    push( @libraries,   $item->holdingbranch )      if ( $item->holdingbranch );
103
                }
103
                }
104
            }
104
            }
(-)a/reserve/request.pl (-1 / +5 lines)
Lines 458-463 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
458
                my $do_check;
458
                my $do_check;
459
                my $item = $item_object->unblessed;
459
                my $item = $item_object->unblessed;
460
                $item->{object} = $item_object;
460
                $item->{object} = $item_object;
461
462
                $item->{ccode}         = $item_object->effective_collection_code;
463
                $item->{holdingbranch} = $item_object->effective_holdingbranch->unblessed;
464
                $item->{homebranch}    = $item_object->effective_homebranch->unblessed;
465
461
                if ($patron) {
466
                if ($patron) {
462
                    $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
467
                    $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
463
                    if ( $do_check && $wants_check ) {
468
                    if ( $do_check && $wants_check ) {
464
- 

Return to bug 14962