From 175cc45fcb26dba704d20ad1ac5b82c65cd2046e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Apr 2015 15:24:50 +0200 Subject: [PATCH] Bug 13970: Remove category_type related code Working on bug 13497 and bug 9314, I run into some Koha vestiges. The category_type parameter should not be passed to memberentry. On creating a new patron, the categorycode should be passed, and on editing, it's useless. We can work with the borrowernumber and retrieve these values. Details of the changes: - members-toolbar.inc: Remove the category_type parameter passed to memberentry.pl - memberentrygen.tt: Just remove the useless category_type parameter on editing a patron. Also remove the unused one passed to guarantor_search.pl. - tables/members_results.tt: the borrowernumber is enough to edit a patron. - memberentry.pl: check_categorytype is never used in the template, all the process to calculate/retrieve it is unnecessary. - members/nl-search.tt: The borrowernumber is enough to edit a patron. Test plan: Try to create and edit patrons and verify that - the guarantor search still work - the form (memberentry) behave as before Edit a patron from the nl-search.pl script (Magnus?) Signed-off-by: Bernardo Gonzalez Kriegel On top of 9314 (13497 already pushed) No evident regressions found, add/edit patron works, search/set guarantor works. Cant test nl-patron.pl save for exec it. prove -v t/NorwegianPatronDB.t runs No koha-qa errors Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c34569480884a543d19f3e87d13153cc771fa135) Signed-off-by: Chris Cormack --- .../prog/en/includes/members-toolbar.inc | 22 ++++++------------- .../prog/en/modules/members/memberentrygen.tt | 10 ++++++--- .../prog/en/modules/members/nl-search.tt | 8 +------ .../modules/members/tables/members_results.tt | 2 +- members/memberentry.pl | 9 -------- 5 files changed, 16 insertions(+), 35 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 828c564955..70edbc085a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -130,30 +130,22 @@ function searchToHold(){
[% IF ( CAN_user_borrowers ) %] - [% IF ( category_type ) %] - [% IF ( guarantor ) %] - - [% ELSE %] - - [% END %] - Edit - [% ELSE %] - [% IF ( categorycode ) %] - Edit - [% ELSE %] - Edit - [% END %] + [% IF ( guarantor ) %] + + [% ELSE %] + [% END %] + Edit [% END %] [% IF ( CAN_user_borrowers ) %] [% IF ( adultborrower AND activeBorrowerRelationship ) %] - Add child + Add child [% END %] [% IF ( CAN_user_borrowers ) %] Change password [% END %] - Duplicate + Duplicate [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 1296a9c2cd..1a904b15cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -184,7 +184,11 @@

Duplicate patron record?

View existing record

-
+
+ + + +
@@ -459,9 +463,9 @@
  •   [% IF ( guarantorid ) %] - + [% ELSE %] - + [% END %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt index a3629ad07e..b8a9791170 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt @@ -32,15 +32,9 @@

    Existing patrons

      [% FOREACH patron IN local_result %] - [%# Find the category_type %] - [% FOREACH category IN categories %] - [% IF category.categorycode == patron.categorycode %] - [% patron.category_type = category.category_type %] - [% END %] - [% END %]
    • [% patron.firstname %] [% patron.surname %] [% patron.cardnumber %] | Details | - Edit | + Edit | Check out
    • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt index f4dcc618a0..e4b7337eba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt @@ -28,7 +28,7 @@ "dt_borrowernotes": "[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]", "dt_action": - "[% IF data.category_type %]Edit[% ELSE %][% IF data.categorycode %]Edit[% ELSE %]Edit[% END %][% END %]", + "Edit", "borrowernumber": "[% data.borrowernumber %]" }[% UNLESS loop.last %],[% END %] diff --git a/members/memberentry.pl b/members/memberentry.pl index 8beececeee..514bdd85da 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -90,8 +90,6 @@ my $guarantorinfo = $input->param('guarantorinfo'); my $step = $input->param('step') || 0; my @errors; my $default_city; -# $check_categorytype contains the value of duplicate borrowers category type to redirect in good template in step =2 -my $check_categorytype=$input->param('check_categorytype'); # NOTE: Alert for ethnicity and ethnotes fields, they are invalid in all borrowers form my $borrower_data; my $NoUpdateLogin; @@ -237,12 +235,6 @@ if ( ( $op eq 'insert' ) and !$nodouble ) { if ( !$check_member ) { $nodouble = 1; } - - # recover the category type if the borrowers is a doublon - if ($check_category) { - my $tmpborrowercategory = GetBorrowercategory($check_category); - $check_categorytype = $tmpborrowercategory->{'category_type'}; - } } #recover all data from guarantor address phone ,fax... @@ -711,7 +703,6 @@ $template->param( borrotitlepopup => $borrotitlepopup, guarantorinfo => $guarantorinfo, flagloop => \@flagdata, - check_categorytype =>$check_categorytype,#to recover the category type with checkcategorytype function category_type =>$category_type, modify => $modify, nok => $nok,#flag to konw if an error -- 2.39.5