---
 .../prog/en/modules/serials/subscription-add.tmpl  |   14 +++-------
 serials/subscription-add.pl                        |   29 +++++--------------
 2 files changed, 12 insertions(+), 31 deletions(-)

diff --git 
a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl 
b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
index e45181b..f977ff8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
@@ -1053,7 +1053,7 @@ $(document).ready(function() {
             
                 <ul>
                     <li>The subscription <strong>must</strong> be associated 
with a bibliographic record.</li>
-                    <li>You <strong>must</strong> select a vendor if you wish 
to generate claims.</li>
+                    <li>You have to select a vendor if you wish to generate 
claims.</li>
                 </ul></div>
             
             
@@ -1276,15 +1276,9 @@ $(document).ready(function() {
             <label for="subtype" class="required">Subscription length:</label>
             
                 <select name="subtype" id="subtype">
-                    <!-- TMPL_LOOP NAME="subtype" -->
-                        <!-- TMPL_IF NAME="selected" -->
-                        <option value="<!-- TMPL_VAR NAME="name" -->" 
selected="selected">
-                        <!-- TMPL_ELSE -->
-                        <option value="<!-- TMPL_VAR NAME="name" -->">
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_VAR NAME="name" -->
-                        </option>
-                    <!-- /TMPL_LOOP -->
+                                       <!--TMPL_IF 
Name="subtype_numberlength"--><option value="numberlength" 
selected="selected"><!--TMPL_ELSE--><option 
value="numberlength"><!--/TMPL_IF--> Number of issues</option>                  
                     
+                                       <!--TMPL_IF 
Name="subtype_weeklength"--><option value="weeklength" 
selected="selected"><!--TMPL_ELSE--><option value="weeklength"><!--/TMPL_IF--> 
Number of weeks</option>                                      
+                                       <!--TMPL_IF 
Name="subtype_monthlength"--><option value="monthlength" 
selected="selected"><!--TMPL_ELSE--><option value="monthlength"><!--/TMPL_IF--> 
Number of months</option>                                  
                 </select>
                 <input type="text" name="sublength" value="<!-- TMPL_VAR 
name="sublength" -->" size="3" onkeypress="return check_input(event)" /> (enter 
amount in numerals)
             <span class="required">Required</span>
diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl
index 9150f19..d038be2 100755
--- a/serials/subscription-add.pl
+++ b/serials/subscription-add.pl
@@ -93,32 +93,19 @@ if ($op eq 'mod' || $op eq 'dup' || $op eq 
'modsubscription') {
     $nextexpected->{'isfirstissue'} = 
$nextexpected->{planneddate}->output('iso') eq $firstissuedate ;
     $subs->{nextacquidate} = $nextexpected->{planneddate}->output()  if($op eq 
'mod');
     unless($op eq 'modsubscription') {
-        if($subs->{numberlength} > 0){
-            $sublength = $subs->{numberlength};
-            $sub_on = $subscription_types[0];
-        } elsif ($subs->{weeklength}>0){
-            $sublength = $subs->{weeklength};
-            $sub_on = $subscription_types[1];
-        } else {
-            $sublength = $subs->{monthlength};
-            $sub_on = $subscription_types[2];
-        }
-        while (@subscription_types) {
-            my $sub_type = shift @subscription_types;
-            my %row = ( 'name' => $sub_type );
-            if ( $sub_on eq $sub_type ) {
-                $row{'selected'} = ' selected';
-            } else {
-                $row{'selected'} = '';
-            }
-            push( @sub_type_data, \%row );
-        }
+               foreach my $length_unit qw(numberlength weeklength monthlength){
+                       if ($subs->{$length_unit}){
+                               $sublength=$subs->{$length_unit};
+                               $sub_on=$length_unit;
+                               last;
+                       }
+               }
     
         $template->param($subs);
         $template->param("dow".$subs->{'dow'} => 1) if defined $subs->{'dow'};
         $template->param(
                     $op => 1,
-                    subtype => \...@sub_type_data,
+                    "subtype_$sub_on" => 1,
                     sublength =>$sublength,
                     history => ($op eq 'mod' && $subs->{manualhistory} == 1 ),
                     "periodicity".$subs->{'periodicity'} => 1,
-- 
1.6.0.4

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to