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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (+1 lines)
Lines 319-324 $(document).ready(function() { Link Here
319
319
320
		</li>
320
		</li>
321
		</ol>
321
		</ol>
322
                [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
322
		</fieldset>
323
		</fieldset>
323
		<fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset>
324
		<fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset>
324
      <input type="hidden" name="searchfield" value="[% searchfield %]" />
325
      <input type="hidden" name="searchfield" value="[% searchfield %]" />
(-)a/misc/cronjobs/advance_notices.pl (-5 / +35 lines)
Lines 160-166 UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { Link Here
160
              my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
160
              my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
161
              $titles .= join("\t",@item_info) . "\n";
161
              $titles .= join("\t",@item_info) . "\n";
162
            }
162
            }
163
        
163
164
            ## Get branch info for borrowers home library.
164
            $letter = parse_letter( { letter_code    => $letter_type,
165
            $letter = parse_letter( { letter_code    => $letter_type,
165
                                      borrowernumber => $upcoming->{'borrowernumber'},
166
                                      borrowernumber => $upcoming->{'borrowernumber'},
166
                                      branchcode     => $upcoming->{'branchcode'},
167
                                      branchcode     => $upcoming->{'branchcode'},
Lines 191-197 UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { Link Here
191
              my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
192
              my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
192
              $titles .= join("\t",@item_info) . "\n";
193
              $titles .= join("\t",@item_info) . "\n";
193
            }
194
            }
194
        
195
196
            ## Get branch info for borrowers home library.
195
            $letter = parse_letter( { letter_code    => $letter_type,
197
            $letter = parse_letter( { letter_code    => $letter_type,
196
                                      borrowernumber => $upcoming->{'borrowernumber'},
198
                                      borrowernumber => $upcoming->{'borrowernumber'},
197
                                      branchcode     => $upcoming->{'branchcode'},
199
                                      branchcode     => $upcoming->{'branchcode'},
Lines 252-261 PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) { Link Here
252
      my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
254
      my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
253
      $titles .= join("\t",@item_info) . "\n";
255
      $titles .= join("\t",@item_info) . "\n";
254
    }
256
    }
257
258
    ## Get branch info for borrowers home library.
259
    my %branch_info = get_branch_info( $borrowernumber );
260
255
    my $letter = parse_letter( { letter_code    => $letter_type,
261
    my $letter = parse_letter( { letter_code    => $letter_type,
256
                              borrowernumber => $borrowernumber,
262
                              borrowernumber => $borrowernumber,
257
                              substitute     => { count => $count,
263
                              substitute     => { count => $count,
258
                                                  'items.content' => $titles
264
                                                  'items.content' => $titles,
265
                                                  %branch_info,
259
                                                }
266
                                                }
260
                         } )
267
                         } )
261
      or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
268
      or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
Lines 290-299 PATRON: while ( my ( $borrowernumber, $digest ) = each %$due_digest ) { Link Here
290
      my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
297
      my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
291
      $titles .= join("\t",@item_info) . "\n";
298
      $titles .= join("\t",@item_info) . "\n";
292
    }
299
    }
300
301
    ## Get branch info for borrowers home library.
302
    my %branch_info = get_branch_info( $borrowernumber );
303
293
    my $letter = parse_letter( { letter_code    => $letter_type,
304
    my $letter = parse_letter( { letter_code    => $letter_type,
294
                              borrowernumber => $borrowernumber,
305
                              borrowernumber => $borrowernumber,
295
                              substitute     => { count => $count,
306
                              substitute     => { count => $count,
296
                                                  'items.content' => $titles
307
                                                  'items.content' => $titles,
308
                                                  %branch_info,
297
                                                }
309
                                                }
298
                         } )
310
                         } )
299
      or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
311
      or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
Lines 353-358 sub format_date { Link Here
353
    return output_pref($dt);
365
    return output_pref($dt);
354
}
366
}
355
367
368
=head2 get_branch_info
369
370
=cut
371
372
sub get_branch_info {
373
    my ( $borrowernumber ) = @_;
374
375
    ## Get branch info for borrowers home library.
376
    my $borrower_details = C4::Members::GetMemberDetails( $borrowernumber );
377
    my $borrower_branchcode = $borrower_details->{'branchcode'};
378
    my $branch = C4::Branch::GetBranchDetail( $borrower_branchcode );
379
    my %branch_info;
380
    foreach my $key( keys %$branch ) {
381
        $branch_info{"branches.$key"} = $branch->{$key};
382
    }
383
384
    return %branch_info;
385
}
386
356
1;
387
1;
357
388
358
__END__
389
__END__
359
- 

Return to bug 3383