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

(-)a/C4/Circulation.pm (+5 lines)
Lines 2738-2748 sub SendCirculationAlert { Link Here
2738
        borrowernumber => $borrower->{borrowernumber},
2738
        borrowernumber => $borrower->{borrowernumber},
2739
        message_name   => $message_name{$type},
2739
        message_name   => $message_name{$type},
2740
    });
2740
    });
2741
    my $issues_table = ( $type eq 'CHECKOUT' ) ? 'issues' : 'old_issues';
2742
    warn "TYPE: $type";
2743
    warn "ISSUES TABLE: $issues_table";
2741
    my $letter =  C4::Letters::GetPreparedLetter (
2744
    my $letter =  C4::Letters::GetPreparedLetter (
2742
        module => 'circulation',
2745
        module => 'circulation',
2743
        letter_code => $type,
2746
        letter_code => $type,
2744
        branchcode => $branch,
2747
        branchcode => $branch,
2745
        tables => {
2748
        tables => {
2749
            $issues_table => $item->{itemnumber},
2750
            'items'       => $item->{itemnumber},
2746
            'biblio'      => $item->{biblionumber},
2751
            'biblio'      => $item->{biblionumber},
2747
            'biblioitems' => $item->{biblionumber},
2752
            'biblioitems' => $item->{biblionumber},
2748
            'borrowers'   => $borrower,
2753
            'borrowers'   => $borrower,
(-)a/C4/Letters.pm (-11 / +12 lines)
Lines 552-568 sub _parseletter_sth { Link Here
552
    # check cache first
552
    # check cache first
553
    (defined $handles{$table}) and return $handles{$table};
553
    (defined $handles{$table}) and return $handles{$table};
554
    my $query = 
554
    my $query = 
555
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                      :
555
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
556
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                      :
556
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
557
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                      :
557
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
558
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                      :
558
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
559
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" :
559
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1" :
560
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                      :
560
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"            :
561
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                      :
561
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                 :
562
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                      :
562
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                 :
563
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                      :
563
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                 :
564
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                      :
564
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                 :
565
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                      :
565
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                 :
566
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                 :
566
    undef ;
567
    undef ;
567
    unless ($query) {
568
    unless ($query) {
568
        warn "ERROR: No _parseletter_sth query for table '$table'";
569
        warn "ERROR: No _parseletter_sth query for table '$table'";
(-)a/tools/letter.pl (-2 / +8 lines)
Lines 196-204 sub add_form { Link Here
196
        push @{$field_selection}, add_fields('biblio','biblioitems'),
196
        push @{$field_selection}, add_fields('biblio','biblioitems'),
197
            {value => q{},             text => '---ITEMS---'  },
197
            {value => q{},             text => '---ITEMS---'  },
198
            {value => 'items.content', text => 'items.content'},
198
            {value => 'items.content', text => 'items.content'},
199
            add_fields('issues','borrowers');
199
            add_fields('borrowers');
200
        if ($module eq 'circulation') {
200
        if ($module eq 'circulation') {
201
            push @{$field_selection}, add_fields('opac_news');
201
            push @{$field_selection}, add_fields('opac_news');
202
203
        }
204
205
        if ( $module eq 'circulation' && $code eq "CHECKIN" ) {
206
            push @{$field_selection}, add_fields('old_issues');
207
        } else {
208
            push @{$field_selection}, add_fields('issues');
202
        }
209
        }
203
    }
210
    }
204
211
205
- 

Return to bug 7848