Bug 13877 - Make serialseq season name translatable regardless its position in a...
authorAlex Arnaud <alex.arnaud@biblibre.com>
Tue, 15 Mar 2016 15:36:28 +0000 (16:36 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Fri, 29 Apr 2016 02:44:47 +0000 (02:44 +0000)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.z>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/showpredictionpattern.tt

index ad60863..affb3b2 100644 (file)
@@ -270,14 +270,14 @@ $(document).ready(function() {
                     </span>
                 </td>
                 <td>
-                    [% IF ( matches = serial.serialseq.match('Spring(.*)') ) %]
-                        Spring[% matches.join("") %]
-                    [% ELSIF ( matches = serial.serialseq.match('Summer(.*)') ) %]
-                        Summer[% matches.join("") %]
-                    [% ELSIF ( matches = serial.serialseq.match('Fall(.*)') ) %]
-                        Fall[% matches.join("") %]
-                    [% ELSIF ( matches = serial.serialseq.match('Winter(.*)') ) %]
-                        Winter[% matches.join("") %]
+                    [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %]
+                        [% matches.0 %]Spring[% matches.1 %]
+                    [% IF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %]
+                        [% matches.0 %]Summer[% matches.1 %]
+                    [% IF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %]
+                        [% matches.0 %]Fall[% matches.1 %]
+                    [% IF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %]
+                        [% matches.0 %]Winter[% matches.1 %]
                     [% ELSE %]
                         [% serial.serialseq %]
                     [% END %]
index db8a9ec..deed7d4 100644 (file)
     [% FOREACH prediction IN predictions_loop %]
       <tr>
         <td>
-            [% IF ( matches = prediction.number.match('Spring(.*)') ) %]
-                Spring[% matches.join("") %]
-            [% ELSIF ( matches = prediction.number.match('Summer(.*)') ) %]
-                Summer[% matches.join("") %]
-            [% ELSIF ( matches = prediction.number.match('Fall(.*)') ) %]
-                Fall[% matches.join("") %]
-            [% ELSIF ( matches = prediction.number.match('Winter(.*)') ) %]
-                Winter[% matches.join("") %]
+            [% IF ( matches = prediction.number.match('(.*)Spring(.*)') ) %]
+                [% matches.0 %]Spring[% matches.1 %]
+            [% ELSIF ( matches = prediction.number.match('(.*)Summer(.*)') ) %]
+                [% matches.0 %]Summer[% matches.1 %]
+            [% ELSIF ( matches = prediction.number.match('(.*)Fall(.*)') ) %]
+                [% matches.0 %]Fall[% matches.1 %]
+            [% ELSIF ( matches = prediction.number.match('(.*)Winter(.*)') ) %]
+                [% matches.0 %]Winter[% matches.1 %]
             [% ELSE %]
                 [% prediction.number %]
             [% END %]