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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (+19 lines)
Lines 258-263 Link Here
258
                [% END %]
258
                [% END %]
259
                <th class="anti-the">Title</th>
259
                <th class="anti-the">Title</th>
260
                <th class="holds_count" title="Item holds / Total holds">Holds</th>
260
                <th class="holds_count" title="Item holds / Total holds">Holds</th>
261
                <th class="linked_order" title="Linked order">Linked order</th>
262
                <th class="linked_subscription" title="Linked subscription">Linked subscription</th>
261
                [% FOREACH item_header IN headers %]
263
                [% FOREACH item_header IN headers %]
262
                    [% IF item_header.column_name %]
264
                    [% IF item_header.column_name %]
263
                        <th data-colname="[% item_header.column_name | html %]">
265
                        <th data-colname="[% item_header.column_name | html %]">
Lines 272-277 Link Here
272
        <tbody>
274
        <tbody>
273
            [% FOREACH item IN items %]
275
            [% FOREACH item IN items %]
274
                [% SET can_be_edited = !item.nomod && !( Koha.Preference('IndependentBranches') && ! logged_in_user && item.homebranch != Branches.GetLoggedInBranchname() ) %]
276
                [% SET can_be_edited = !item.nomod && !( Koha.Preference('IndependentBranches') && ! logged_in_user && item.homebranch != Branches.GetLoggedInBranchname() ) %]
277
                [% SET current_itemnumber = item.itemnumber %]
278
                [% SET linked_order = linked_orders_subscriptions.$current_itemnumber %]
279
                [% SET linked_subscription = linked_orders_subscriptions.$current_itemnumber.subscription %]
275
280
276
                <tr>
281
                <tr>
277
                    <td>[% item.index + 1 | html %]</td>
282
                    <td>[% item.index + 1 | html %]</td>
Lines 342-347 Link Here
342
                        [% END %]
347
                        [% END %]
343
                        </a>
348
                        </a>
344
                    </td>
349
                    </td>
350
                    <td class="linked_order">
351
                        [% IF linked_order.ordernumber %]
352
                            <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% linked_order.basket | uri %]" title="See basket details">[% linked_order.ordernumber | html %]<a>
353
                        [% ELSE %]
354
                            None
355
                        [% END %]
356
                    </td>
357
                    <td class="linked_subscription">
358
                        [% IF linked_subscription %]
359
                            <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% linked_subscription | uri %]" title="Subscription id [% linked_subscription | html %]">Subscription details<a>
360
                        [% ELSE %]
361
                            None
362
                        [% END %]
363
                    </td>
345
                    [% FOREACH header IN headers %]
364
                    [% FOREACH header IN headers %]
346
                        [% SET attribute = header.attribute %]
365
                        [% SET attribute = header.attribute %]
347
                        [% IF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
366
                        [% IF header.attribute AND date_fields.grep('^' _ attribute _ '$').size %]
(-)a/tools/batchMod.pl (-4 / +21 lines)
Lines 26-31 use C4::Auth qw( get_template_and_user haspermission ); Link Here
26
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
27
use C4::Circulation qw( barcodedecode );
27
use C4::Circulation qw( barcodedecode );
28
use C4::Context;
28
use C4::Context;
29
use C4::Acquisition qw( GetOrderFromItemnumber );
29
use MARC::File::XML;
30
use MARC::File::XML;
30
use List::MoreUtils qw( uniq );
31
use List::MoreUtils qw( uniq );
31
use Encode qw( encode_utf8 );
32
use Encode qw( encode_utf8 );
Lines 40-45 use Koha::BackgroundJob::BatchDeleteItem; Link Here
40
use Koha::BackgroundJob::BatchUpdateItem;
41
use Koha::BackgroundJob::BatchUpdateItem;
41
use Koha::UI::Form::Builder::Item;
42
use Koha::UI::Form::Builder::Item;
42
use Koha::UI::Table::Builder::Items;
43
use Koha::UI::Table::Builder::Items;
44
use Koha::Serial::Items;
45
use Koha::Serials;
43
46
44
my $input = CGI->new;
47
my $input = CGI->new;
45
my $dbh = C4::Context->dbh;
48
my $dbh = C4::Context->dbh;
Lines 85-90 my $nextop=""; Link Here
85
my $display_items;
88
my $display_items;
86
89
87
my @messages;
90
my @messages;
91
my %linked_orders_subscriptions;
88
92
89
if ( $op eq "action" ) {
93
if ( $op eq "action" ) {
90
94
Lines 238-243 if ($op eq "show"){ Link Here
238
        if (defined $biblionumber && !@itemnumbers){
242
        if (defined $biblionumber && !@itemnumbers){
239
            my $biblio = Koha::Biblios->find($biblionumber);
243
            my $biblio = Koha::Biblios->find($biblionumber);
240
            @itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : ();
244
            @itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : ();
245
            foreach my $itemnumber (@itemnumbers) {
246
                $linked_orders_subscriptions{$itemnumber} = [];
247
                my $order     = GetOrderFromItemnumber($itemnumber);
248
                my $serial_id = Koha::Serial::Items->search( { itemnumber => $itemnumber } )->get_column('serialid');
249
                if ($order) {
250
                    $linked_orders_subscriptions{$itemnumber} =
251
                        { ordernumber => $order->{ordernumber}, basket => $order->{basketno} };
252
                }
253
                if ($serial_id) {
254
                    my $subscription_id = Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid');
255
                    $linked_orders_subscriptions{$itemnumber} = { subscription => $subscription_id };
256
                }
257
            }
241
        }
258
        }
242
        if ( my $list = $input->param('barcodelist') ) {
259
        if ( my $list = $input->param('barcodelist') ) {
243
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
260
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
Lines 290-298 if ($op eq "show"){ Link Here
290
307
291
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
308
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
292
    $template->param(
309
    $template->param(
293
        subfields           => $subfields,
310
        subfields                   => $subfields,
294
        notfoundbarcodes    => \@notfoundbarcodes,
311
        notfoundbarcodes            => \@notfoundbarcodes,
295
        notfounditemnumbers => \@notfounditemnumbers
312
        notfounditemnumbers         => \@notfounditemnumbers,
313
        linked_orders_subscriptions => \%linked_orders_subscriptions,
296
    );
314
    );
297
    $nextop="action"
315
    $nextop="action"
298
} # -- End action="show"
316
} # -- End action="show"
299
- 

Return to bug 13870