I dunno, C4::Auth doesn't seem right to me, from the standpoint of separation of concerns. I seems more natural to me in C4::Members.On Wed, Jun 3, 2015 at 3:11 PM, Tomas Cohen Arazi <tomascohen@gmail.com> wrote:I'd say it could belong to C4::Auth.×2015-06-03 13:07 GMT-03:00 Mark Tompsett <mtompset@hotmail.com>:_______________________________________________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
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/--Tomás Cohen AraziProsecretaría de InformáticaUniversidad Nacional de CórdobaGPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/