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

(-)a/C4/Serials.pm (+2 lines)
Lines 640-645 sub SearchSubscriptions { Link Here
640
        $subscription->{additional_fields} = { map { $_->field->name => $_->value }
640
        $subscription->{additional_fields} = { map { $_->field->name => $_->value }
641
            $subscription_object->additional_field_values->as_list };
641
            $subscription_object->additional_field_values->as_list };
642
642
643
        #FIXME: The above $subscription->{additional_fields} may be redundant. Remove if so.
644
        $subscription->{additional_field_values} = $subscription_object->get_additional_field_values_for_template;
643
    }
645
    }
644
646
645
    return wantarray ? @{$results} : { results => $results, total => $total_results };
647
    return wantarray ? @{$results} : { results => $results, total => $total_results };
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-advsearch.inc (-1 / +1 lines)
Lines 50-56 Link Here
50
                    <label for="to">Expires before:</label>
50
                    <label for="to">Expires before:</label>
51
                    <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
51
                    <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | html %]" size="10" maxlength="10" class="flatpickr" />
52
                </li>
52
                </li>
53
                [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
53
                [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 search_form=1 %]
54
            </ol>
54
            </ol>
55
            <input type="hidden" name="searched" value="1" />
55
            <input type="hidden" name="searched" value="1" />
56
            [% IF ( mana ) %]
56
            [% IF ( mana ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-7 / +1 lines)
Lines 165-177 Link Here
165
                                            <td data-order="[% missingissue.claimdate | html %]">
165
                                            <td data-order="[% missingissue.claimdate | html %]">
166
                                                [% missingissue.claimdate | $KohaDates %]
166
                                                [% missingissue.claimdate | $KohaDates %]
167
                                            </td>
167
                                            </td>
168
                                            [% FOR field IN additional_fields_for_subscription %]
168
                                            [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=missingissue.additional_field_values value_only=1 is_table_cell=1 %]
169
                                                [% IF field.authorised_value_category %]
170
                                                    <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
171
                                                [% ELSE %]
172
                                                    <td>[% missingissue.additional_fields.${field.name} | html %]</td>
173
                                                [% END %]
174
                                            [% END %]
175
                                        </tr>
169
                                        </tr>
176
                                    [% END # /FOREACH missingissue %]
170
                                    [% END # /FOREACH missingissue %]
177
                                </tbody>
171
                                </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-7 / +1 lines)
Lines 121-133 Link Here
121
                                    </td>
121
                                    </td>
122
                                [% END %]
122
                                [% END %]
123
123
124
                                [% FOR field IN additional_fields_for_subscription %]
124
                                [% INCLUDE 'additional-fields-display.inc' available=additional_fields_for_subscription values=subscription.additional_field_values value_only=1 is_table_cell=1 %]
125
                                    [% IF field.authorised_value_category %]
126
                                        <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) | html %]</td>
127
                                    [% ELSE %]
128
                                        <td>[% subscription.additional_fields.${field.name} | html %]</td>
129
                                    [% END %]
130
                                [% END %]
131
125
132
                                <td>
126
                                <td>
133
                                    <div class="btn-group dropup">
127
                                    <div class="btn-group dropup">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (+1 lines)
Lines 594-599 fieldset.rows table { clear: none; margin: 0; } Link Here
594
    </script>
594
    </script>
595
    [% Asset.js("js/subscription-add.js") | $raw %]
595
    [% Asset.js("js/subscription-add.js") | $raw %]
596
    [% Asset.js("js/showpredictionpattern.js") | $raw %]
596
    [% Asset.js("js/showpredictionpattern.js") | $raw %]
597
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
597
[% END %]
598
[% END %]
598
599
599
[% INCLUDE 'intranet-bottom.inc' %]
600
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/claims.pl (+3 lines)
Lines 86-91 if ($supplierid) { Link Here
86
    foreach my $issue (@missingissues) {
86
    foreach my $issue (@missingissues) {
87
        $issue->{cannot_claim} = 1
87
        $issue->{cannot_claim} = 1
88
          unless C4::Serials::can_claim_subscription($issue);
88
          unless C4::Serials::can_claim_subscription($issue);
89
90
        $issue->{additional_field_values} =
91
            Koha::Subscriptions->find( $issue->{subscriptionid} )->get_additional_field_values_for_template;
89
    }
92
    }
90
    $template->param( suppliername => $supplier->name );
93
    $template->param( suppliername => $supplier->name );
91
}
94
}
(-)a/serials/subscription-add.pl (-19 / +17 lines)
Lines 132-148 $template->param( Link Here
132
);
132
);
133
133
134
my @additional_fields = Koha::AdditionalFields->search({ tablename => 'subscription' })->as_list;
134
my @additional_fields = Koha::AdditionalFields->search({ tablename => 'subscription' })->as_list;
135
my %additional_field_values;
135
my @additional_field_values = Koha::Subscriptions->find($subscriptionid)->get_additional_field_values_for_template if $subscriptionid;
136
if ($subscriptionid) {
137
    my $subscription = Koha::Subscriptions->find($subscriptionid);
138
    foreach my $value ($subscription->additional_field_values->as_list) {
139
        $additional_field_values{$value->field_id} = $value->value;
140
    }
141
}
142
136
143
$template->param(
137
$template->param(
144
    additional_fields => \@additional_fields,
138
    additional_fields       => \@additional_fields,
145
    additional_field_values => \%additional_field_values,
139
    additional_field_values => @additional_field_values,
146
);
140
);
147
141
148
my $typeloop = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
142
my $typeloop = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
Lines 368-378 sub redirect_add_subscription { Link Here
368
    my $biblio = Koha::Biblios->find($biblionumber);
362
    my $biblio = Koha::Biblios->find($biblionumber);
369
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
363
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
370
    while ( my $field = $subscription_fields->next ) {
364
    while ( my $field = $subscription_fields->next ) {
371
        my $value = $query->param('additional_field_' . $field->id);
365
        my @field_values = $query->param( 'additional_field_' . $field->id );
372
        push @additional_fields, {
366
        foreach my $value (@field_values) {
373
            id => $field->id,
367
            push @additional_fields, {
374
            value => $value,
368
                id    => $field->id,
375
        };
369
                value => $value,
370
            } if $value;
371
        }
376
    }
372
    }
377
    Koha::Subscriptions->find($subscriptionid)->set_additional_fields(\@additional_fields);
373
    Koha::Subscriptions->find($subscriptionid)->set_additional_fields(\@additional_fields);
378
374
Lines 482-492 sub redirect_mod_subscription { Link Here
482
    my $biblio = Koha::Biblios->find($biblionumber);
478
    my $biblio = Koha::Biblios->find($biblionumber);
483
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
479
    my $subscription_fields = Koha::AdditionalFields->search({ tablename => 'subscription' });
484
    while ( my $field = $subscription_fields->next ) {
480
    while ( my $field = $subscription_fields->next ) {
485
        my $value = $query->param('additional_field_' . $field->id);
481
        my @field_values = $query->param( 'additional_field_' . $field->id );
486
        push @additional_fields, {
482
        foreach my $value (@field_values) {
487
            id => $field->id,
483
            push @additional_fields, {
488
            value => $value,
484
                id    => $field->id,
489
        };
485
                value => $value,
486
            } if $value;
487
        }
490
    }
488
    }
491
    Koha::Subscriptions->find($subscriptionid)->set_additional_fields(\@additional_fields);
489
    Koha::Subscriptions->find($subscriptionid)->set_additional_fields(\@additional_fields);
492
490
(-)a/serials/subscription-detail.pl (-2 / +1 lines)
Lines 127-133 my $numberpattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($su Link Here
127
127
128
$template->param(
128
$template->param(
129
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
129
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'subscription' } ),
130
    additional_field_values => { map { $_->field->name => $_->value } $subscription->additional_field_values->as_list },
130
    additional_field_values => $subscription->get_additional_field_values_for_template,
131
);
131
);
132
132
133
# FIXME Do we want to hide canceled orders?
133
# FIXME Do we want to hide canceled orders?
134
- 

Return to bug 35044