X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=serials%2Fserials-collection.pl;h=0ee32defbd5af3e3d42a8e3a075025c970d3e8f3;hb=e8b2f04638ca4bcccf85d53f8c540c43b7615716;hp=4b9a656ee8c99112edeaef0dc94cfa81dac35bb9;hpb=48b0472a633251525820ab2c18f5ee3c7e49778b;p=koha.git diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index 4b9a656ee8..0ee32defbd 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -5,30 +5,30 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . use strict; use warnings; -use CGI; +use CGI qw ( -utf8 ); use C4::Auth; use C4::Koha; -use C4::Dates qw/format_date/; use C4::Serials; use C4::Letters; use C4::Output; use C4::Context; + use List::MoreUtils qw/uniq/; @@ -37,9 +37,8 @@ my $op = $query->param('op') || q{}; my $nbissues=$query->param('nbissues'); my $dbh = C4::Context->dbh; -my ($template, $loggedinuser, $cookie); -($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "serials/serials-collection.tmpl", +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "serials/serials-collection.tt", query => $query, type => "intranet", authnotrequired => 0, @@ -56,8 +55,12 @@ my $subscriptions; if($op eq 'gennext' && @subscriptionid){ my $subscriptionid = $subscriptionid[0]; - my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate - FROM serial WHERE status = 1 AND subscriptionid = ?"); + my $sth = $dbh->prepare(" + SELECT publisheddate, publisheddatetext, serialid, serialseq, + planneddate + FROM serial + WHERE status = 1 AND subscriptionid = ? + "); my $status = defined( $nbissues ) ? 2 : 3; $nbissues ||= 1; for ( my $i = 0; $i < $nbissues; $i++ ){ @@ -66,7 +69,7 @@ if($op eq 'gennext' && @subscriptionid){ if ( my $issue = $sth->fetchrow_hashref ) { ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, $issue->{planneddate}, $issue->{publisheddate}, - $status, "" ); + $issue->{publisheddatetext}, $status, "" ); } else { require C4::Serials::Numberpattern; my $subscription = GetSubscription($subscriptionid); @@ -107,18 +110,12 @@ if (@subscriptionid){ foreach my $subscriptionid (@subscriptionid){ my $subs= GetSubscription($subscriptionid); $closed = 1 if $subs->{closed}; + $subs->{opacnote} =~ s/\n/\/g; $subs->{missinglist} =~ s/\n/\/g; $subs->{recievedlist} =~ s/\n/\/g; + ##these are display information - $subs->{startdate} = format_date( $subs->{startdate} ); - $subs->{histstartdate} = format_date( $subs->{histstartdate} ); - if ( !defined $subs->{enddate} || $subs->{enddate} eq '0000-00-00' ) { - $subs->{enddate} = ''; - } - else { - $subs->{enddate} = format_date( $subs->{enddate} ); - } $subs->{'abouttoexpire'}=abouttoexpire($subs->{'subscriptionid'}); $subs->{'subscriptionexpired'}=HasSubscriptionExpired($subs->{'subscriptionid'}); $subs->{'subscriptionid'} = $subscriptionid; # FIXME - why was this lost ? @@ -128,6 +125,7 @@ if (@subscriptionid){ my $numberpattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subs->{numberpattern}); $subs->{frequency} = $frequency; $subs->{numberpattern} = $numberpattern; + $subs->{'hasRouting'} = check_routing($subscriptionid); push @$subscriptiondescs,$subs; my $tmpsubscription= GetFullSubscription($subscriptionid); @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation);