@@ -, +, @@
Koha::AuthorisedValues
- from the AuthorisedValues TT plugin (called from av-build-dropbox.inc
- from the acqui/ajax-getauthvaluedropbox.pl ajax script
- Link a fund to an authorised value category
- Create a new order
- Create some authorised values for Bsort1
- Edit a patron
- Enable the housebound module (pref HouseboundModule)
- On the patron detail page, click on the "Housebound" tab
---
Koha/Template/Plugin/AuthorisedValues.pm | 14 +++++++++--
acqui/ajax-getauthvaluedropbox.pl | 28 +++++++++++++++-------
.../prog/en/includes/av-build-dropbox.inc | 8 +++----
.../prog/en/modules/members/housebound.tt | 6 ++---
4 files changed, 38 insertions(+), 18 deletions(-)
--- a/Koha/Template/Plugin/AuthorisedValues.pm
+++ a/Koha/Template/Plugin/AuthorisedValues.pm
@@ -40,8 +40,18 @@ sub Get {
}
sub GetAuthValueDropbox {
- my ( $self, $category, $default ) = @_;
- return C4::Koha::GetAuthvalueDropbox($category, $default);
+ my ( $self, $category ) = @_;
+ my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+ return Koha::AuthorisedValues->search(
+ {
+ branchcode => $branch_limit,
+ category => $category,
+ },
+ {
+ group_by => 'lib',
+ order_by => [ 'category', 'lib', 'lib_opac' ],
+ }
+ );
}
sub GetCategories {
--- a/acqui/ajax-getauthvaluedropbox.pl
+++ a/acqui/ajax-getauthvaluedropbox.pl
@@ -48,9 +48,9 @@ Default value for the dropbox.
use Modern::Perl;
use CGI qw ( -utf8 );
-use C4::Koha;
use C4::Charset;
use C4::Auth qw/check_api_auth/;
+use Koha::AuthorisedValues;
my $query = CGI->new();
binmode STDOUT, ':encoding(UTF-8)';
@@ -67,18 +67,28 @@ my $name = $input->param('name');
my $category = $input->param('category');
my $default = $input->param('default');
$default = C4::Charset::NormalizeString($default);
-
-binmode STDOUT, ':encoding(UTF-8)';
-print $input->header(-type => 'text/plain', -charset => 'UTF-8');
-my $avs = C4::Koha::GetAuthvalueDropbox($category, $default);
+my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+
+my $avs = Koha::AuthorisedValues->search(
+ {
+ branchcode => $branch_limit,
+ category => $category,
+ },
+ {
+ group_by => 'lib',
+ order_by => [ 'category', 'lib', 'lib_opac' ],
+ }
+);
my $html = qq||;
+binmode STDOUT, ':encoding(UTF-8)';
+print $input->header(-type => 'text/plain', -charset => 'UTF-8');
print $html;
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
@@ -9,7 +9,7 @@
all: add a "All" entry
%]
-[% SET avs = AuthorisedValues.GetAuthValueDropbox( category, default ) %]
+[% SET avs = AuthorisedValues.GetAuthValueDropbox( category ) %]
[% DEFAULT
class = ''
size = 20
@@ -19,10 +19,10 @@
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt
@@ -141,10 +141,10 @@
--