&DelBranchCategory
&CheckCategoryUnique
&mybranch
+ &GetBranchesCount
);
@EXPORT_OK = qw( &onlymine &mybranch get_branch_code_from_name );
}
return C4::Context->userenv->{branch} || '';
}
-sub GetBranchesLoop (;$$) { # since this is what most pages want anyway
+sub GetBranchesLoop { # since this is what most pages want anyway
my $branch = @_ ? shift : mybranch(); # optional first argument is branchcode of "my branch", if preselection is wanted.
my $onlymine = @_ ? shift : onlymine();
my $branches = GetBranches($onlymine);
=cut
#TODO manage category types. rename possibly to 'agency domains' ? as borrowergroups are called categories.
-sub GetCategoryTypes() {
+sub GetCategoryTypes {
return ( 'searchdomain','properties');
}
=cut
-sub GetBranch ($$) {
+sub GetBranch {
my ( $query, $branches ) = @_; # get branch for this query from branches
my $branch = $query->param('branch');
my %cookie = $query->cookie('userenv');
=cut
-sub GetBranchesInCategory($) {
+sub GetBranchesInCategory {
my ($categorycode) = @_;
my @branches;
my $dbh = C4::Context->dbh();
return $sth->fetchrow_array;
}
+sub GetBranchesCount {
+ my $dbh = C4::Context->dbh();
+ my $query = "SELECT COUNT(*) AS branches_count FROM branches";
+ my $sth = $dbh->prepare( $query );
+ $sth->execute();
+ my $row = $sth->fetchrow_hashref();
+ return $row->{'branches_count'};
+}
+
1;
__END__