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

(-)a/acqui/addorderiso2709.pl (-3 / +16 lines)
Lines 24-29 Link Here
24
use strict;
24
use strict;
25
use warnings;
25
use warnings;
26
use CGI;
26
use CGI;
27
use Carp;
27
use Number::Format qw(:all);
28
use Number::Format qw(:all);
28
29
29
use C4::Context;
30
use C4::Context;
Lines 210-217 if ($op eq ""){ Link Here
210
        }
211
        }
211
        if ($price){
212
        if ($price){
212
            $orderinfo{'listprice'} = $price;
213
            $orderinfo{'listprice'} = $price;
213
            eval "use C4::Acquisition qw/GetBasket/;";
214
            eval {
214
            eval "use C4::Bookseller qw/GetBookSellerFromId/;";
215
		require C4::Acquisition;
216
		import C4::Acquisition qw/GetBasket/;
217
	    };
218
	    if ($@){
219
		croak $@;
220
	    }
221
            eval {
222
		require C4::Bookseller;
223
	        import C4::Bookseller qw/GetBookSellerFromId/;
224
	    };
225
	    if ($@){
226
		croak $@;
227
	    }
215
            my $basket     = GetBasket( $orderinfo{basketno} );
228
            my $basket     = GetBasket( $orderinfo{basketno} );
216
            my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
229
            my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
217
            my $gst        = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
230
            my $gst        = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
Lines 265-271 my $budget = GetBudget($budget_id); Link Here
265
278
266
# build budget list
279
# build budget list
267
my $budget_loop = [];
280
my $budget_loop = [];
268
my $budgets = GetBudgetHierarchy( q{}, $borrower->{branchcode}, $borrower->{borrowernumber} );
281
$budgets = GetBudgetHierarchy( q{}, $borrower->{branchcode}, $borrower->{borrowernumber} );
269
foreach my $r ( @{$budgets} ) {
282
foreach my $r ( @{$budgets} ) {
270
    if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
283
    if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
271
        next;
284
        next;
(-)a/acqui/basketgroup.pl (-5 / +31 lines)
Lines 45-50 The bookseller who we want to display the baskets (and basketgroups) of. Link Here
45
45
46
use strict;
46
use strict;
47
use warnings;
47
use warnings;
48
use Carp;
48
49
49
use C4::Input;
50
use C4::Input;
50
use C4::Auth;
51
use C4::Auth;
Lines 184-192 sub printbasketgrouppdf{ Link Here
184
    my ($basketgroupid) = @_;
185
    my ($basketgroupid) = @_;
185
    
186
    
186
    my $pdfformat = C4::Context->preference("OrderPdfFormat");
187
    my $pdfformat = C4::Context->preference("OrderPdfFormat");
187
    eval "use $pdfformat";
188
    if ($pdfformat eq 'pdfformat::layout3pages' || $pdfformat eq 'pdfformat::layout2pages'){
188
    # FIXME consider what would happen if $pdfformat does not
189
	eval {
189
    # contain the name of a valid Perl module.
190
	    require $pdfformat;
191
	    import $pdfformat;
192
	};
193
	if ($@){
194
	}
195
    }
196
    else {
197
	print $input->header;  
198
	print $input->start_html;  # FIXME Should do a nicer page
199
	print "<h1>Invalid PDF Format set</h1>";
200
	print "Please go to the systempreferences and set a valid pdfformat";
201
	exit;
202
    }
190
    
203
    
191
    my $basketgroup = GetBasketgroup($basketgroupid);
204
    my $basketgroup = GetBasketgroup($basketgroupid);
192
    my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
205
    my $bookseller = GetBookSellerFromId($basketgroup->{'booksellerid'});
Lines 202-209 sub printbasketgrouppdf{ Link Here
202
            #isbn, itemtype, author, title, publishercode, quantity, listprice ecost discount gstrate
215
            #isbn, itemtype, author, title, publishercode, quantity, listprice ecost discount gstrate
203
            my @ba_order;
216
            my @ba_order;
204
            if ( $ord->{biblionumber} && $ord->{quantity}> 0 ) {
217
            if ( $ord->{biblionumber} && $ord->{quantity}> 0 ) {
205
                eval "use C4::Biblio";
218
                eval {
206
                eval "use C4::Koha";
219
		    require C4::Biblio;
220
		    import C4::Biblio;
221
		};
222
		if ($@){
223
		    croak $@;
224
		}
225
                eval {
226
		    require C4::Koha;
227
		    import C4::Koha;
228
		};
229
		if ($@){
230
		    croak $@;
231
		}
207
                my $bib = GetBiblioData($ord->{biblionumber});
232
                my $bib = GetBiblioData($ord->{biblionumber});
208
                my $itemtypes = GetItemTypes();
233
                my $itemtypes = GetItemTypes();
209
                if($ord->{isbn}){
234
                if($ord->{isbn}){
Lines 246-251 sub printbasketgrouppdf{ Link Here
246
    );
271
    );
247
    my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed";
272
    my $pdf = printpdf($basketgroup, $bookseller, $baskets, \%orders, $bookseller->{gstrate} // C4::Context->preference("gist")) || die "pdf generation failed";
248
    print $pdf;
273
    print $pdf;
274
249
}
275
}
250
276
251
my $op = $input->param('op');
277
my $op = $input->param('op');
(-)a/acqui/neworderempty.pl (-1 / +2 lines)
Lines 330-336 if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { Link Here
330
    $template->param(items => \@itemloop);
330
    $template->param(items => \@itemloop);
331
}
331
}
332
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
332
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
333
my @itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes');
333
my @itemtypes;
334
@itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes');
334
335
335
# fill template
336
# fill template
336
$template->param(
337
$template->param(
(-)a/admin/authorised_values.pl (-1 / +1 lines)
Lines 27-33 use C4::Koha; Link Here
27
use C4::Output;
27
use C4::Output;
28
28
29
29
30
sub AuthorizedValuesForCategory ($) {
30
sub AuthorizedValuesForCategory {
31
    my ($searchstring) = shift or return;
31
    my ($searchstring) = shift or return;
32
    my $dbh = C4::Context->dbh;
32
    my $dbh = C4::Context->dbh;
33
    $searchstring=~ s/\'/\\\'/g;
33
    $searchstring=~ s/\'/\\\'/g;
(-)a/admin/preferences.pl (-10 / +9 lines)
Lines 194-205 sub SearchPrefs { Link Here
194
    my %tab_files = _get_pref_files( $input );
194
    my %tab_files = _get_pref_files( $input );
195
    our @terms = split( /\s+/, $searchfield );
195
    our @terms = split( /\s+/, $searchfield );
196
196
197
    sub matches {
198
        my ( $text ) = @_;
199
200
        return !grep( { $text !~ /$_/i } @terms );
201
    }
202
203
    foreach my $tab_name ( keys %tab_files ) {
197
    foreach my $tab_name ( keys %tab_files ) {
204
        my $data = GetTab( $input, $tab_name );
198
        my $data = GetTab( $input, $tab_name );
205
        my $title = ( keys( %$data ) )[0];
199
        my $title = ( keys( %$data ) )[0];
Lines 209-215 sub SearchPrefs { Link Here
209
        my $matched_groups;
203
        my $matched_groups;
210
204
211
        while ( my ( $group_title, $contents ) = each %$tab ) {
205
        while ( my ( $group_title, $contents ) = each %$tab ) {
212
            if ( matches( $group_title ) ) {
206
            if ( matches( $group_title, \@terms ) ) {
213
                $matched_groups->{$group_title} = $contents;
207
                $matched_groups->{$group_title} = $contents;
214
                next;
208
                next;
215
            }
209
            }
Lines 225-236 sub SearchPrefs { Link Here
225
                            my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield );
219
                            my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield );
226
220
227
                            return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES };
221
                            return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES };
228
                        } elsif ( matches( $piece->{'pref'} ) ) {
222
                        } elsif ( matches( $piece->{'pref'}, \@terms) ) {
229
                            $matched = 1;
223
                            $matched = 1;
230
                        } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_ ) } values( %{ $piece->{'choices'} } ) ) ) {
224
                        } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_, \@terms ) } values( %{ $piece->{'choices'} } ) ) ) {
231
                            $matched = 1;
225
                            $matched = 1;
232
                        }
226
                        }
233
                    } elsif ( matches( $piece ) ) {
227
                    } elsif ( matches( $piece, \@terms ) ) {
234
                        $matched = 1;
228
                        $matched = 1;
235
                    }
229
                    }
236
                    last if ( $matched );
230
                    last if ( $matched );
Lines 252-257 sub SearchPrefs { Link Here
252
    return @tabs;
246
    return @tabs;
253
}
247
}
254
248
249
sub matches {
250
    my ( $text, $terms ) = @_;
251
    return !grep( { $text !~ /$_/i } @$terms );
252
}
253
255
my $dbh = C4::Context->dbh;
254
my $dbh = C4::Context->dbh;
256
our $input = new CGI;
255
our $input = new CGI;
257
256
(-)a/t/00-testcritic.t (-2 / +1 lines)
Lines 16-22 my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing Link Here
16
labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
16
labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
17
serials sms suggestion t tags test tools virtualshelves);
17
serials sms suggestion t tags test tools virtualshelves);
18
18
19
my @dirs = qw( basket circ debian errors offline_circ reserve reviews rotating_collections
19
my @dirs = qw( acqui admin basket circ debian errors offline_circ reserve reviews rotating_collections
20
serials sms virtualshelves );
20
serials sms virtualshelves );
21
21
22
if ( not $ENV{TEST_QA} ) {
22
if ( not $ENV{TEST_QA} ) {
23
- 

Return to bug 6679