|
Lines 2597-2603
sub PrepareItemrecordDisplay {
Link Here
|
| 2597 |
$itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); |
2597 |
$itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum ); |
| 2598 |
} |
2598 |
} |
| 2599 |
my @loop_data; |
2599 |
my @loop_data; |
| 2600 |
my $authorised_values_sth = $dbh->prepare( "SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib" ); |
2600 |
|
|
|
2601 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
| 2602 |
my $query = qq{ |
| 2603 |
SELECT authorised_value,lib FROM authorised_values |
| 2604 |
}; |
| 2605 |
$query .= qq{ |
| 2606 |
LEFT JOIN authorised_values_branches ON ( id = av_id ) |
| 2607 |
} if $branch_limit; |
| 2608 |
$query .= qq{ |
| 2609 |
WHERE category = ? |
| 2610 |
}; |
| 2611 |
$query .= qq{ AND ( branchcode = ? OR branchcode IS NULL )} if $branch_limit; |
| 2612 |
$query .= qq{ ORDER BY lib}; |
| 2613 |
my $authorised_values_sth = $dbh->prepare( $query ); |
| 2601 |
foreach my $tag ( sort keys %{$tagslib} ) { |
2614 |
foreach my $tag ( sort keys %{$tagslib} ) { |
| 2602 |
my $previous_tag = ''; |
2615 |
my $previous_tag = ''; |
| 2603 |
if ( $tag ne '' ) { |
2616 |
if ( $tag ne '' ) { |
|
Lines 2726-2732
sub PrepareItemrecordDisplay {
Link Here
|
| 2726 |
|
2739 |
|
| 2727 |
#---- "true" authorised value |
2740 |
#---- "true" authorised value |
| 2728 |
} else { |
2741 |
} else { |
| 2729 |
$authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value} ); |
2742 |
$authorised_values_sth->execute( |
|
|
2743 |
$tagslib->{$tag}->{$subfield}->{authorised_value}, |
| 2744 |
$branch_limit ? $branch_limit : () |
| 2745 |
); |
| 2730 |
push @authorised_values, "" |
2746 |
push @authorised_values, "" |
| 2731 |
unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); |
2747 |
unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); |
| 2732 |
while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { |
2748 |
while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { |