|
Lines 509-516
C<$opac> If set to a true value, displays OPAC descriptions rather than normal o
Link Here
|
| 509 |
=cut |
509 |
=cut |
| 510 |
|
510 |
|
| 511 |
sub GetAuthorisedValues { |
511 |
sub GetAuthorisedValues { |
| 512 |
my $category = shift // ''; # optional parameter |
512 |
my $category = shift // ''; # optional parameter |
| 513 |
my $opac = shift ? 1 : 0; # normalise to be safe |
513 |
my $opac = shift ? 1 : 0; # normalise to be safe |
| 514 |
my $options = shift // ''; |
514 |
my $options = shift // ''; |
| 515 |
my $no_limit; |
515 |
my $no_limit; |
| 516 |
if ($options) { $no_limit = $options->{'no_limit'}; } #optional parameter to ignore library limitation |
516 |
if ($options) { $no_limit = $options->{'no_limit'}; } #optional parameter to ignore library limitation |
|
Lines 523-529
sub GetAuthorisedValues {
Link Here
|
| 523 |
return $result if $result; |
523 |
return $result if $result; |
| 524 |
|
524 |
|
| 525 |
my @results; |
525 |
my @results; |
| 526 |
my $dbh = C4::Context->dbh; |
526 |
my $dbh = C4::Context->dbh; |
| 527 |
|
527 |
|
| 528 |
my $select_clause = 'SELECT av.*'; |
528 |
my $select_clause = 'SELECT av.*'; |
| 529 |
my @where_args; |
529 |
my @where_args; |
|
Lines 540-546
sub GetAuthorisedValues {
Link Here
|
| 540 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
540 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
| 541 |
} if $branch_limit; |
541 |
} if $branch_limit; |
| 542 |
my @where_strings; |
542 |
my @where_strings; |
| 543 |
if($category) { |
543 |
if ($category) { |
| 544 |
push @where_strings, "category = ?"; |
544 |
push @where_strings, "category = ?"; |
| 545 |
push @where_args, $category; |
545 |
push @where_args, $category; |
| 546 |
} |
546 |
} |
|
Lines 550-557
sub GetAuthorisedValues {
Link Here
|
| 550 |
push @where_args, $branch_limit; |
550 |
push @where_args, $branch_limit; |
| 551 |
} |
551 |
} |
| 552 |
|
552 |
|
| 553 |
if(@where_strings > 0) { |
553 |
if ( @where_strings > 0 ) { |
| 554 |
$query .= " WHERE " . join(" AND ", @where_strings); |
554 |
$query .= " WHERE " . join( " AND ", @where_strings ); |
| 555 |
} |
555 |
} |
| 556 |
$query .= ' ORDER BY category, ' |
556 |
$query .= ' ORDER BY category, ' |
| 557 |
. ( |
557 |
. ( |