my $userenv = C4::Context->userenv;
if ( C4::Context->preference("IndependentBranches") ) {
- if ( ( $userenv ) and ( $userenv->{flags} != 1 ) ) {
+ unless ( C4::Context->IsSuperLibrarian() ) {
$query .= q{
AND (
borrowers.branchcode = ?
my @query_params = ( $supplierid, $code, $datereceived );
if ( C4::Context->preference("IndependentBranches") ) {
- my $userenv = C4::Context->userenv;
- if ( ($userenv) && ( $userenv->{flags} != 1 ) ) {
+ unless ( C4::Context->IsSuperLibrarian() ) {
$strsth .= " and (borrowers.branchcode = ?
or borrowers.branchcode = '')";
- push @query_params, $userenv->{branch};
+ push @query_params, C4::Context->userenv->{branch};
}
}
$strsth .= " ORDER BY aqbasket.basketno";
$from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
}
if (C4::Context->preference("IndependentBranches")
- && C4::Context->userenv
- && C4::Context->userenv->{flags} != 1 ) {
+ && !C4::Context->IsSuperLibrarian() ) {
$from .= ' AND borrowers.branchcode LIKE ? ';
push @query_params, C4::Context->userenv->{branch};
}
title
author
name
+ isbn
+ ean
from_placed_on
to_placed_on
basket - search both basket name and number
booksellerinvoicenumber
+ basketgroupname
+ budget
+ orderstatus (note that orderstatus '' will retrieve orders
+ of any status except cancelled)
+ biblionumber
+ get_canceled_order (if set to a true value, cancelled orders will
+ be included)
returns:
$order_loop is a list of hashrefs that each look like this:
$query .= " WHERE 1 ";
- $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
- if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne 'cancelled' );
+ unless ($get_canceled_order or (defined $orderstatus and $orderstatus eq 'cancelled')) {
+ $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') ";
+ }
my @query_params = ();
}
if ( C4::Context->preference("IndependentBranches") ) {
- my $userenv = C4::Context->userenv;
- if ( $userenv && ($userenv->{flags} || 0) != 1 ) {
+ unless ( C4::Context->IsSuperLibrarian() ) {
$query .= " AND (borrowers.branchcode = ? OR borrowers.branchcode ='' ) ";
- push @query_params, $userenv->{branch};
+ push @query_params, C4::Context->userenv->{branch};
}
}
$query .= " ORDER BY id";