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 |
search_only => 1 |
147 |
); |
120 |
} |
148 |
} |
|
|
149 |
else |
150 |
{ |
151 |
# to toggle between create or edit routing list options |
152 |
if ($routing) { |
153 |
for my $subscription ( @subscriptions) { |
154 |
$subscription->{routingedit} = check_routing( $subscription->{subscriptionid} ); |
155 |
} |
156 |
} |
121 |
|
157 |
|
122 |
my (@openedsubscriptions, @closedsubscriptions); |
158 |
my (@openedsubscriptions, @closedsubscriptions); |
123 |
for my $sub ( @subscriptions ) { |
159 |
for my $sub ( @subscriptions ) { |
124 |
unless ( $sub->{closed} ) { |
160 |
unless ( $sub->{closed} ) { |
125 |
push @openedsubscriptions, $sub |
161 |
push @openedsubscriptions, $sub |
126 |
unless $sub->{cannotdisplay}; |
162 |
unless $sub->{cannotdisplay}; |
127 |
} else { |
163 |
} else { |
128 |
push @closedsubscriptions, $sub |
164 |
push @closedsubscriptions, $sub |
129 |
unless $sub->{cannotdisplay}; |
165 |
unless $sub->{cannotdisplay}; |
|
|
166 |
} |
130 |
} |
167 |
} |
131 |
} |
|
|
132 |
|
168 |
|
133 |
$template->param( |
169 |
my @branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] } ); |
134 |
openedsubscriptions => \@openedsubscriptions, |
170 |
my @branches_loop; |
135 |
closedsubscriptions => \@closedsubscriptions, |
171 |
foreach my $b ( @branches ) { |
136 |
total => @openedsubscriptions + @closedsubscriptions, |
172 |
my $selected = 0; |
137 |
title_filter => $title, |
173 |
$selected = 1 if( defined $branch and $branch eq $b->branchcode ); |
138 |
ISSN_filter => $ISSN, |
174 |
push @branches_loop, { |
139 |
EAN_filter => $EAN, |
175 |
branchcode => $b->branchcode, |
140 |
callnumber_filter => $callnumber, |
176 |
branchname => $b->branchname, |
141 |
publisher_filter => $publisher, |
177 |
selected => $selected, |
142 |
bookseller_filter => $bookseller, |
178 |
}; |
143 |
branch_filter => $branch, |
179 |
} |
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 |
|
180 |
|
|
|
181 |
$template->param( |
182 |
openedsubscriptions => \@openedsubscriptions, |
183 |
closedsubscriptions => \@closedsubscriptions, |
184 |
total => @openedsubscriptions + @closedsubscriptions, |
185 |
title_filter => $title, |
186 |
ISSN_filter => $ISSN, |
187 |
EAN_filter => $EAN, |
188 |
callnumber_filter => $callnumber, |
189 |
publisher_filter => $publisher, |
190 |
bookseller_filter => $bookseller, |
191 |
branch_filter => $branch, |
192 |
location_filter => $location, |
193 |
expiration_date_filter => $expiration_date_dt, |
194 |
branches_loop => \@branches_loop, |
195 |
done_searched => $searched, |
196 |
routing => $routing, |
197 |
additional_field_filters => $additional_field_filters, |
198 |
additional_fields_for_subscription => $additional_fields, |
199 |
marcflavour => (uc(C4::Context->preference("marcflavour"))), |
200 |
mana => $mana |
201 |
); |
202 |
} |
153 |
output_html_with_http_headers $query, $cookie, $template->output; |
203 |
output_html_with_http_headers $query, $cookie, $template->output; |
154 |
- |
|
|