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

(-)a/C4/Budgets.pm (-40 lines)
Lines 57-64 BEGIN { Link Here
57
        &AddBudgetPeriod
57
        &AddBudgetPeriod
58
	    &DelBudgetPeriod
58
	    &DelBudgetPeriod
59
59
60
        &GetAuthvalueDropbox
61
62
        &ModBudgetPlan
60
        &ModBudgetPlan
63
61
64
        &GetCurrency
62
        &GetCurrency
Lines 401-444 sub GetBudgetAuthCats { Link Here
401
}
399
}
402
400
403
# -------------------------------------------------------------------
401
# -------------------------------------------------------------------
404
sub GetAuthvalueDropbox {
405
    my ( $authcat, $default ) = @_;
406
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
407
    my $dbh = C4::Context->dbh;
408
409
    my $query = qq{
410
        SELECT *
411
        FROM authorised_values
412
    };
413
    $query .= qq{
414
          LEFT JOIN authorised_values_branches ON ( id = av_id )
415
    } if $branch_limit;
416
    $query .= qq{
417
        WHERE category = ?
418
    };
419
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
420
    $query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
421
    my $sth = $dbh->prepare($query);
422
    $sth->execute( $authcat, $branch_limit ? $branch_limit : () );
423
424
425
    my $option_list = [];
426
    my @authorised_values = ( q{} );
427
    while (my $av = $sth->fetchrow_hashref) {
428
        push @{$option_list}, {
429
            value => $av->{authorised_value},
430
            label => $av->{lib},
431
            default => ($default eq $av->{authorised_value}),
432
        };
433
    }
434
435
    if ( @{$option_list} ) {
436
        return $option_list;
437
    }
438
    return;
439
}
440
441
# -------------------------------------------------------------------
442
sub GetBudgetPeriods {
402
sub GetBudgetPeriods {
443
	my ($filters,$orderby) = @_;
403
	my ($filters,$orderby) = @_;
444
    return SearchInTable("aqbudgetperiods",$filters, $orderby, undef,undef, undef, "wide");
404
    return SearchInTable("aqbudgetperiods",$filters, $orderby, undef,undef, undef, "wide");
(-)a/C4/Koha.pm (+38 lines)
Lines 1392-1397 sub GetNormalizedOCLCNumber { Link Here
1392
    }
1392
    }
1393
}
1393
}
1394
1394
1395
sub GetAuthvalueDropbox {
1396
    my ( $authcat, $default ) = @_;
1397
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
1398
    my $dbh = C4::Context->dbh;
1399
1400
    my $query = qq{
1401
        SELECT *
1402
        FROM authorised_values
1403
    };
1404
    $query .= qq{
1405
          LEFT JOIN authorised_values_branches ON ( id = av_id )
1406
    } if $branch_limit;
1407
    $query .= qq{
1408
        WHERE category = ?
1409
    };
1410
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
1411
    $query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
1412
    my $sth = $dbh->prepare($query);
1413
    $sth->execute( $authcat, $branch_limit ? $branch_limit : () );
1414
1415
1416
    my $option_list = [];
1417
    my @authorised_values = ( q{} );
1418
    while (my $av = $sth->fetchrow_hashref) {
1419
        push @{$option_list}, {
1420
            value => $av->{authorised_value},
1421
            label => $av->{lib},
1422
            default => ($default eq $av->{authorised_value}),
1423
        };
1424
    }
1425
1426
    if ( @{$option_list} ) {
1427
        return $option_list;
1428
    }
1429
    return;
1430
}
1431
1432
1395
=head2 GetDailyQuote($opts)
1433
=head2 GetDailyQuote($opts)
1396
1434
1397
Takes a hashref of options
1435
Takes a hashref of options
(-)a/acqui/fetch_sort_dropbox.pl (-1 / +1 lines)
Lines 24-29 use C4::Context; Link Here
24
use C4::Output;
24
use C4::Output;
25
use C4::Auth;
25
use C4::Auth;
26
use C4::Budgets;
26
use C4::Budgets;
27
use C4::Koha;
27
28
28
=head1 NAME
29
=head1 NAME
29
30
30
- 

Return to bug 766