View | Details | Raw Unified | Return to bug 15295
Collapse All | Expand All

(-)a/C4/Branch.pm (-19 lines)
Lines 37-43 BEGIN { Link Here
37
		&get_branchinfos_of
37
		&get_branchinfos_of
38
		&ModBranch
38
		&ModBranch
39
		&GetBranchInfo
39
		&GetBranchInfo
40
		&GetCategoryTypes
41
		&GetBranchesInCategory
40
		&GetBranchesInCategory
42
		&ModBranchCategoryInfo
41
		&ModBranchCategoryInfo
43
		&mybranch
42
		&mybranch
Lines 283-306 sub ModBranch { Link Here
283
    }
282
    }
284
}
283
}
285
284
286
=head2 GetCategoryTypes
287
288
$categorytypes = GetCategoryTypes;
289
returns a list of category types.
290
Currently these types are HARDCODED.
291
type: 'searchdomain' defines a group of agencies that the calling library may search in.
292
Other usage of agency categories falls under type: 'properties'.
293
	to allow for other uses of categories.
294
The searchdomain bit may be better implemented as a separate module, but
295
the categories were already here, and minimally used.
296
297
=cut
298
299
	#TODO  manage category types.  rename possibly to 'agency domains' ? as borrowergroups are called categories.
300
sub GetCategoryTypes {
301
	return ( 'searchdomain','properties');
302
}
303
304
=head2 GetBranch
285
=head2 GetBranch
305
286
306
$branch = GetBranch( $query, $branches );
287
$branch = GetBranch( $query, $branches );
(-)a/t/db_dependent/Branch.t (-7 / +1 lines)
Lines 21-27 use Modern::Perl; Link Here
21
use C4::Context;
21
use C4::Context;
22
use Data::Dumper;
22
use Data::Dumper;
23
23
24
use Test::More tests => 24;
24
use Test::More tests => 23;
25
25
26
use C4::Branch;
26
use C4::Branch;
27
use Koha::Libraries;
27
use Koha::Libraries;
Lines 42-48 can_ok( Link Here
42
      get_branchinfos_of
42
      get_branchinfos_of
43
      ModBranch
43
      ModBranch
44
      GetBranchInfo
44
      GetBranchInfo
45
      GetCategoryTypes
46
      GetBranchesInCategory
45
      GetBranchesInCategory
47
      ModBranchCategoryInfo
46
      ModBranchCategoryInfo
48
      mybranch
47
      mybranch
Lines 293-302 $brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); Link Here
293
push( @b, $b3->{branchcode} );
292
push( @b, $b3->{branchcode} );
294
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' );
293
is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' );
295
294
296
#Test GetCategoryTypes
297
my @category_types = GetCategoryTypes();
298
is_deeply(\@category_types, [ 'searchdomain', 'properties' ], 'received expected library category types');
299
300
#TODO later: test mybranchine and onlymine
295
#TODO later: test mybranchine and onlymine
301
# Actually we cannot mock C4::Context->userenv in unit tests
296
# Actually we cannot mock C4::Context->userenv in unit tests
302
297
303
- 

Return to bug 15295