[Koha-patches] [PATCH] [SIGNED-OFF] Bug 6321 Add a 1/4 months frequency

Katrin Fischer Katrin.Fischer.83 at web.de
Tue Oct 11 08:10:09 CEST 2011


From: Frédéric Demians <f.demians at tamil.fr>

Thanks Stefano Bargioni for the typo fix

[2011.09.16] Thanks Paul for catching the display error.
[2011.10.11] Thanks Katrin for finding display error on OPAC.

Signed-off-by: Colin Campbell <colin.campbell at ptfs-europe.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83 at web.de>
Tested prediction pattern and display in OPAC.
No problems found.
---
 C4/Serials.pm                                      |   11 ++++++++++-
 .../prog/en/modules/serials/subscription-add.tt    |    5 +++++
 .../prog/en/modules/serials/subscription-detail.tt |    2 +-
 .../prog/en/modules/opac-serial-issues.tt          |    3 +++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 8aa6ebc..18e0ce4 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 f21e72d..733fe36 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
@@ -1216,6 +1216,11 @@ $(document).ready(function() {
                 [% ELSE %]
                     <option value="8">1/quarter (seasonal)</option>
                 [% END %]
+                [% IF ( periodicity13 ) %]
+                    <option value="13" selected="selected">1/4 months (3/year)</option>
+                [% ELSE %]
+                    <option value="13">1/4 months (3/year)</option>
+                [% END %]
 
                 [% IF ( periodicity9 ) %]
                     <option value="9" selected="selected">2/years</option>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
index f3ab9a2..7e9a29e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
@@ -140,7 +140,7 @@ $(document).ready(function() {
                         1/day
                 [% END %]
                 [% IF ( periodicity13 ) %]
-                        3/week
+                        1/4 months (3/year)
                 [% END %]
                 [% IF ( periodicity2 ) %]
                         1/week
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tt
index 5d45b53..78bc22e 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-serial-issues.tt
@@ -42,6 +42,9 @@
 		[% IF ( subscription_LOO.periodicity7 ) %]
 				3 months
 		[% END %]
+		[% IF ( subscription_LOO.periodicity13 ) %]
+				4 months
+		[% END %]
 		[% IF ( subscription_LOO.periodicity8 ) %]
 				quarter
 		[% END %]
-- 
1.7.4.1



More information about the Koha-patches mailing list