Lines 38-43
use C4::Serials;
Link Here
|
38 |
use Koha::AdditionalField; |
38 |
use Koha::AdditionalField; |
39 |
|
39 |
|
40 |
use Koha::DateUtils; |
40 |
use Koha::DateUtils; |
|
|
41 |
use Koha::SharedContent; |
41 |
|
42 |
|
42 |
my $query = new CGI; |
43 |
my $query = new CGI; |
43 |
my $title = $query->param('title_filter') || ''; |
44 |
my $title = $query->param('title_filter') || ''; |
Lines 52-57
my $location = $query->param('location_filter') || '';
Link Here
|
52 |
my $expiration_date = $query->param('expiration_date_filter') || ''; |
53 |
my $expiration_date = $query->param('expiration_date_filter') || ''; |
53 |
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); |
54 |
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); |
54 |
my $searched = $query->param('searched') || 0; |
55 |
my $searched = $query->param('searched') || 0; |
|
|
56 |
my $mana = $query->param('mana') || 0; |
55 |
my @subscriptionids = $query->multi_param('subscriptionid'); |
57 |
my @subscriptionids = $query->multi_param('subscriptionid'); |
56 |
my $op = $query->param('op'); |
58 |
my $op = $query->param('op'); |
57 |
|
59 |
|
Lines 95-101
for my $field ( @$additional_fields ) {
Link Here
|
95 |
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef; |
97 |
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef; |
96 |
my @subscriptions; |
98 |
my @subscriptions; |
97 |
if ($searched){ |
99 |
if ($searched){ |
98 |
@subscriptions = SearchSubscriptions( |
100 |
if ($mana) { |
|
|
101 |
my $result = Koha::SharedContent::manaGetRequest("subscription",{ |
102 |
title => $title, |
103 |
issn => $ISSN, |
104 |
ean => $EAN, |
105 |
publisher => $publisher |
106 |
}); |
107 |
@subscriptions = @{ $result->{data} }; |
108 |
} |
109 |
else { |
110 |
@subscriptions = SearchSubscriptions( |
99 |
{ |
111 |
{ |
100 |
biblionumber => $biblionumber, |
112 |
biblionumber => $biblionumber, |
101 |
title => $title, |
113 |
title => $title, |
Lines 108-153
if ($searched){
Link Here
|
108 |
additional_fields => [ map{ { name => $_, value => $additional_field_filters->{$_}{value}, authorised_value_category => $additional_field_filters->{$_}{authorised_value_category} } } keys %$additional_field_filters ], |
120 |
additional_fields => [ map{ { name => $_, value => $additional_field_filters->{$_}{value}, authorised_value_category => $additional_field_filters->{$_}{authorised_value_category} } } keys %$additional_field_filters ], |
109 |
location => $location, |
121 |
location => $location, |
110 |
expiration_date => $expiration_date_dt, |
122 |
expiration_date => $expiration_date_dt, |
111 |
} |
123 |
}); |
112 |
); |
124 |
} |
113 |
} |
125 |
} |
114 |
|
126 |
|
115 |
# to toggle between create or edit routing list options |
127 |
if ($mana) { |
116 |
if ($routing) { |
128 |
$template->param( |
117 |
for my $subscription ( @subscriptions) { |
129 |
subscriptions => \@subscriptions, |
118 |
$subscription->{routingedit} = check_routing( $subscription->{subscriptionid} ); |
130 |
total => scalar @subscriptions, |
119 |
} |
131 |
title_filter => $title, |
|
|
132 |
ISSN_filter => $ISSN, |
133 |
EAN_filter => $EAN, |
134 |
callnumber_filter => $callnumber, |
135 |
publisher_filter => $publisher, |
136 |
bookseller_filter => $bookseller, |
137 |
branch_filter => $branch, |
138 |
location_filter => $location, |
139 |
expiration_date_filter => $expiration_date_dt, |
140 |
done_searched => $searched, |
141 |
routing => $routing, |
142 |
additional_field_filters => $additional_field_filters, |
143 |
additional_fields_for_subscription => $additional_fields, |
144 |
marcflavour => (uc(C4::Context->preference("marcflavour"))), |
145 |
mana => $mana |
146 |
); |
120 |
} |
147 |
} |
|
|
148 |
else |
149 |
{ |
150 |
# to toggle between create or edit routing list options |
151 |
if ($routing) { |
152 |
for my $subscription ( @subscriptions) { |
153 |
$subscription->{routingedit} = check_routing( $subscription->{subscriptionid} ); |
154 |
} |
155 |
} |
121 |
|
156 |
|
122 |
my (@openedsubscriptions, @closedsubscriptions); |
157 |
my (@openedsubscriptions, @closedsubscriptions); |
123 |
for my $sub ( @subscriptions ) { |
158 |
for my $sub ( @subscriptions ) { |
124 |
unless ( $sub->{closed} ) { |
159 |
unless ( $sub->{closed} ) { |
125 |
push @openedsubscriptions, $sub |
160 |
push @openedsubscriptions, $sub |
126 |
unless $sub->{cannotdisplay}; |
161 |
unless $sub->{cannotdisplay}; |
127 |
} else { |
162 |
} else { |
128 |
push @closedsubscriptions, $sub |
163 |
push @closedsubscriptions, $sub |
129 |
unless $sub->{cannotdisplay}; |
164 |
unless $sub->{cannotdisplay}; |
|
|
165 |
} |
130 |
} |
166 |
} |
131 |
} |
|
|
132 |
|
167 |
|
133 |
$template->param( |
168 |
my $branches = GetBranches(); |
134 |
openedsubscriptions => \@openedsubscriptions, |
169 |
my @branches_loop; |
135 |
closedsubscriptions => \@closedsubscriptions, |
170 |
foreach (sort keys %$branches){ |
136 |
total => @openedsubscriptions + @closedsubscriptions, |
171 |
my $selected = 0; |
137 |
title_filter => $title, |
172 |
$selected = 1 if( defined $branch and $branch eq $_ ); |
138 |
ISSN_filter => $ISSN, |
173 |
push @branches_loop, { |
139 |
EAN_filter => $EAN, |
174 |
branchcode => $_, |
140 |
callnumber_filter => $callnumber, |
175 |
branchname => $branches->{$_}->{'branchname'}, |
141 |
publisher_filter => $publisher, |
176 |
selected => $selected, |
142 |
bookseller_filter => $bookseller, |
177 |
}; |
143 |
branch_filter => $branch, |
178 |
} |
144 |
location_filter => $location, |
|
|
145 |
expiration_date_filter => $expiration_date_dt, |
146 |
done_searched => $searched, |
147 |
routing => $routing, |
148 |
additional_field_filters => $additional_field_filters, |
149 |
additional_fields_for_subscription => $additional_fields, |
150 |
marcflavour => (uc(C4::Context->preference("marcflavour"))) |
151 |
); |
152 |
|
179 |
|
|
|
180 |
$template->param( |
181 |
openedsubscriptions => \@openedsubscriptions, |
182 |
closedsubscriptions => \@closedsubscriptions, |
183 |
total => @openedsubscriptions + @closedsubscriptions, |
184 |
title_filter => $title, |
185 |
ISSN_filter => $ISSN, |
186 |
EAN_filter => $EAN, |
187 |
callnumber_filter => $callnumber, |
188 |
publisher_filter => $publisher, |
189 |
bookseller_filter => $bookseller, |
190 |
branch_filter => $branch, |
191 |
location_filter => $location, |
192 |
expiration_date_filter => $expiration_date_dt, |
193 |
branches_loop => \@branches_loop, |
194 |
done_searched => $searched, |
195 |
routing => $routing, |
196 |
additional_field_filters => $additional_field_filters, |
197 |
additional_fields_for_subscription => $additional_fields, |
198 |
marcflavour => (uc(C4::Context->preference("marcflavour"))), |
199 |
mana => $mana |
200 |
); |
201 |
} |
153 |
output_html_with_http_headers $query, $cookie, $template->output; |
202 |
output_html_with_http_headers $query, $cookie, $template->output; |
154 |
- |
|
|