C4::Branch - Koha branch module
use C4::Branch;
The functions in this module deal with branches.
$branches = &GetBranches(); returns informations about ALL branches. Create a branch selector with the following code IndependantBranches Insensitive... GetBranchInfo() returns the same information without the problems of this function (namespace collision, mainly). You should probably use that, and replace GetBranches() with GetBranchInfo() where you see it in the code.
my $branches = GetBranches; my @branchloop; foreach my $thisbranch (keys %$branches) { my $selected = 1 if $thisbranch eq $branch; my %row =(value => $thisbranch, selected => $selected, branchname => $branches->{$thisbranch}->{'branchname'}, ); push @branchloop, \%row; }
&ModBranch($newvalue);
This function modify an existing branches.
$newvalue
is a ref to an array wich is containt all the column from branches table.
$results = GetBranchCategory($categorycode);
$results
is an ref to an array.
my $categories = GetBranchCategories($branchcode,$categorytype);
Returns a list ref of anon hashrefs with keys eq columns of branchcategories table, i.e. categorycode, categorydescription, categorytype, categoryname. if $branchcode and/or $categorytype are passed, limit set to categories that $branchcode is a member of , and to $categorytype.
$categorytypes = GetCategoryTypes; returns a list of category types. Currently these types are HARDCODED. type: 'searchdomain' defines a group of agencies that the calling library may search in. Other usage of agency categories falls under type: 'properties'. to allow for other uses of categories. The searchdomain bit may be better implemented as a separate module, but the categories were already here, and minimally used.
$branch = GetBranch( $query, $branches );
$branchname = &GetBranchDetail($branchcode);
Given the branch code, the function returns the corresponding branch name for a comprehensive information display
my $branchinfos_of = get_branchinfos_of(@branchcodes);
Associates a list of branchcodes to the information of the branch, taken in branches table.
Returns a href where keys are branchcodes and values are href where keys are branch information key.
print 'branchname is ', $branchinfos_of->{$code}->{branchname};
my $branches = GetBranchesInCategory($categorycode);
Returns a href: keys %$branches eq (branchcode,branchname) .
$results = GetBranchInfo($branchcode);
returns $results
, a reference to an array of hashes containing branches. if $branchcode, just this branch, with associated categories. if ! $branchcode && $categorytype, all branches in the category.
&DelBranch($branchcode);
&ModBranchCategoryInfo($data); sets the data from the editbranch form, and writes to the database...
DeleteBranchCategory($categorycode);
$number_rows_affected = CheckBranchCategorycode($categorycode);
Koha Developement team <info@koha.org>