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
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 Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F ×
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 Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: 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/
It is more related to the running environment/session than borrowers handling itself. 2015-06-03 17:23 GMT-03:00 Barton Chittenden <barton@bywatersolutions.com>:
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 Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: 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/
-- Tomás Cohen Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
participants (3)
-
Barton Chittenden -
Mark Tompsett -
Tomas Cohen Arazi