Lines 1085-1100
sub GetAuthorisedValues {
Link Here
|
1085 |
# what it's for. |
1085 |
# what it's for. |
1086 |
|
1086 |
|
1087 |
# Is this cached already? |
1087 |
# Is this cached already? |
1088 |
$opac = $opac ? 1 : 0; # normalise to be safe |
1088 |
$opac = $opac ? 1 : 0; # normalise to be safe |
|
|
1089 |
my $branch_limit = |
1090 |
C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
1089 |
my $selected_key = defined($selected) ? $selected : ''; |
1091 |
my $selected_key = defined($selected) ? $selected : ''; |
1090 |
my $cache_key = "AuthorisedValues-$category-$selected_key-$opac"; |
1092 |
my $cache_key = |
1091 |
my $cache = Koha::Cache->get_instance(); |
1093 |
"AuthorisedValues-$category-$selected_key-$opac-$branch_limit"; |
1092 |
my $result = $cache->get_from_cache($cache_key); |
1094 |
my $cache = Koha::Cache->get_instance(); |
1093 |
warn "fetched $result from cache"; |
1095 |
my $result = $cache->get_from_cache($cache_key); |
1094 |
return $result if $result; |
1096 |
return $result if $result; |
1095 |
|
1097 |
|
1096 |
my $branch_limit = |
|
|
1097 |
C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
1098 |
my @results; |
1098 |
my @results; |
1099 |
my $dbh = C4::Context->dbh; |
1099 |
my $dbh = C4::Context->dbh; |
1100 |
my $query = qq{ |
1100 |
my $query = qq{ |
1101 |
- |
|
|