View | Details | Raw Unified | Return to bug 5191
Collapse All | Expand All

(-)a/serials/subscription-add.pl (-14 / +13 lines)
Lines 85-91 if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') { Link Here
85
            $subs->{$_} = format_date($subs->{$_});
85
            $subs->{$_} = format_date($subs->{$_});
86
        }
86
        }
87
	  }
87
	  }
88
    $subs->{'letter'}='' unless($subs->{'letter'});
88
      if (!defined $subs->{letter}) {
89
          $subs->{letter}= q{};
90
      }
89
    letter_loop($subs->{'letter'}, $template);
91
    letter_loop($subs->{'letter'}, $template);
90
    $nextexpected = GetNextExpected($subscriptionid);
92
    $nextexpected = GetNextExpected($subscriptionid);
91
    $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate}->output('iso') eq $firstissuedate ;
93
    $nextexpected->{'isfirstissue'} = $nextexpected->{planneddate}->output('iso') eq $firstissuedate ;
Lines 131-140 for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{b Link Here
131
$template->param(branchloop => $branchloop,
133
$template->param(branchloop => $branchloop,
132
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
134
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
133
);
135
);
134
my $count = 0;
135
# prepare template variables common to all $op conditions:
136
# prepare template variables common to all $op conditions:
136
$template->param(  'dateformat_' . C4::Context->preference('dateformat') => 1 ,
137
$template->param(  'dateformat_' . C4::Context->preference('dateformat') => 1 );
137
                );
138
if ($op!~/^mod/) {
139
    letter_loop(q{}, $template);
140
}
138
141
139
if ($op eq 'addsubscription') {
142
if ($op eq 'addsubscription') {
140
    redirect_add_subscription();
143
    redirect_add_subscription();
Lines 151-160 if ($op eq 'addsubscription') { Link Here
151
           }
154
           }
152
           push( @sub_type_data, \%row );
155
           push( @sub_type_data, \%row );
153
        }
156
        }
154
    $template->param(subtype => \@sub_type_data,
157
    $template->param(subtype => \@sub_type_data);
155
	);
156
158
157
    letter_loop('', $template);
158
159
159
    my $new_biblionumber = $query->param('biblionumber_for_new_subscription');
160
    my $new_biblionumber = $query->param('biblionumber_for_new_subscription');
160
    if (defined $new_biblionumber) {
161
    if (defined $new_biblionumber) {
Lines 170-185 if ($op eq 'addsubscription') { Link Here
170
sub letter_loop {
171
sub letter_loop {
171
    my ($selected_letter, $templte) = @_;
172
    my ($selected_letter, $templte) = @_;
172
    my $letters = GetLetters('serial');
173
    my $letters = GetLetters('serial');
173
    my @letterloop;
174
    my $letterloop;
174
    foreach my $thisletter (keys %$letters) {
175
    foreach my $thisletter (keys %{$letters}) {
175
        my $selected = $thisletter eq $selected_letter ? 1 : 0;
176
        push @{$letterloop}, {
176
        push @letterloop, {
177
            value => $thisletter,
177
            value => $thisletter,
178
            selected => $selected,
178
            selected => $thisletter eq $selected_letter,
179
            lettername => $letters->{$thisletter},
179
            lettername => $letters->{$thisletter},
180
        };
180
        };
181
    }
181
    }
182
    $templte->param(letterloop => \@letterloop) if @letterloop;
182
    $templte->param(letterloop => $letterloop);
183
    return;
183
    return;
184
}
184
}
185
185
186
- 

Return to bug 5191