Return-path: Envelope-to: frederic@localhost Delivery-date: Fri, 13 May 2011 12:43:37 +0200 Received: from localhost ([127.0.0.1] helo=gateway.tamil.fr) by gateway.tamil.fr with esmtp (Exim 4.69) (envelope-from ) id 1QKpqL-0005ur-Gh for frederic@localhost; Fri, 13 May 2011 12:43:37 +0200 Delivered-To: postmaster@tamil.fr Received: from ns0.ovh.net [213.186.33.20] by gateway.tamil.fr with POP3 (fetchmail-6.3.9-rc2) for (single-drop); Fri, 13 May 2011 12:43:37 +0200 (CEST) Received: from b0.ovh.net (HELO queue) (213.186.33.50) by b0.ovh.net with SMTP; 13 May 2011 12:34:21 +0200 Received: from localhost (HELO mail507.ha.ovh.net) (127.0.0.1) by localhost with SMTP; 13 May 2011 12:34:21 +0200 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 13 May 2011 12:34:21 +0200 Delivered-To: tamil.fr-f.demians@tamil.fr Received: from b0.ovh.net (HELO queue) (213.186.33.50) by b0.ovh.net with SMTP; 13 May 2011 12:34:21 +0200 Received: from firefly.xssl.net (89.145.77.23) by mx0.ovh.net with SMTP; 13 May 2011 12:34:19 +0200 Received: from 188-220-41-106.zone11.bethere.co.uk ([188.220.41.106] helo=zazou.config) by firefly.xssl.net with esmtpa (Exim 4.69) (envelope-from ) id 1QKphL-00071a-0Y; Fri, 13 May 2011 11:34:19 +0100 From: Colin Campbell To: koha-patches@lists.koha-community.org Cc: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= , Colin Campbell Subject: [Signed Off] Bug 6321 Add a 1/4 months frequency Date: Fri, 13 May 2011 11:33:58 +0100 Message-Id: <1305282838-24026-1-git-send-email-colin.campbell@ptfs-europe.com> X-Mailer: git-send-email 1.7.4.4 Content-Type: text/plain; charset="utf-8" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - firefly.xssl.net X-AntiAbuse: Original Domain - tamil.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ptfs-europe.com X-Ovh-Tracer-Id: 660621772058552915 X-Ovh-Remote: 89.145.77.23 (firefly.xssl.net) X-Ovh-Local: 213.186.33.32 (mx0.ovh.net) X-Spam-Check: DONE|U 0.5/N From: Frédéric Demians Thanks Stefano Bargioni for the typo fix Signed-off-by: Colin Campbell --- C4/Serials.pm | 11 ++++++++++- .../prog/en/modules/serials/subscription-add.tt | 5 +++++ 2 files changed, 15 insertions(+), 1 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 20ae7a3..9726971 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -2154,7 +2154,7 @@ sub abouttoexpire { @res=Date::Calc::Today; } my @endofsubscriptiondate=split(/-/,$expirationdate); - my @per_list = (0, 7, 7, 14, 21, 31, 62, 93, 93, 190, 365, 730, 0, 0, 0, 0); + my @per_list = (0, 7, 7, 14, 21, 31, 62, 93, 93, 190, 365, 730, 0, 124, 0, 0); my @datebeforeend; @datebeforeend = Add_Delta_Days( $endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2], - (3 * $per_list[$per])) if (@endofsubscriptiondate && $endofsubscriptiondate[0]*$endofsubscriptiondate[1]*$endofsubscriptiondate[2]); @@ -2317,6 +2317,15 @@ sub GetNextDate(@) { } @resultdate = Add_Delta_YMD( $year, $month, $day, 0, 3, 0 ); } + if ( $subscription->{periodicity} == 13 ) { + for ( my $i = 0 ; $i < @irreg ; $i++ ) { + if ( $irreg[$i] == ( ( $tmpmonth != 8 ) ? ( $tmpmonth + 4 ) % 12 : 12 ) ) { + ( $year, $month, $day ) = Add_Delta_YMD( $year, $month, $day, 0, 4, 0 ); + $tmpmonth = ( ( $tmpmonth != 8 ) ? ( $tmpmonth + 4 ) % 12 : 12 ); + } + } + @resultdate = Add_Delta_YMD( $year, $month, $day, 0, 4, 0 ); + } if ( $subscription->{periodicity} == 9 ) { for ( my $i = 0 ; $i < @irreg ; $i++ ) { if ( $irreg[$i] == ( ( $tmpmonth != 9 ) ? ( $tmpmonth + 3 ) % 12 : 12 ) ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index b20ced4..3a0633f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -1215,6 +1215,11 @@ $(document).ready(function() { [% ELSE %] [% END %] + [% IF ( periodicity13 ) %] + + [% ELSE %] + + [% END %] [% IF ( periodicity9 ) %] -- 1.7.4.4