3 Jun
2015
3 Jun
'15
5:07 p.m.
Greetings, One of the bugs I was working on needs a function which is duplicated in a a couple places, so I was thinking it would be best to place it somewhere. The question is where? sub getUserBranchAndCategorycode { my $borrowernumber = 0; my $homebranch = q{}; my $categorycode = q{}; if (C4::Context->userenv) { $borrowernumber = C4::Context->userenv->{'number'} || 0; $homebranch = C4::Context->userenv->{'branch'} || q{}; } if ($borrowernumber) { $categorycode = C4::Members::GetBorrowerCategorycode($borrowernumber); } return { ‘branch’ => $homebranch, ‘categorycode’ => $categorycode }; } GPML, Mark Tompsett