From 1ab1e913e8e4e338ba3bd375b997dcd572843755 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Apr 2015 15:24:50 +0200 Subject: [PATCH] [PASSED QA] 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 --- .../prog/en/includes/members-toolbar.inc | 22 +++++++--------------- .../prog/en/modules/members/memberentrygen.tt | 10 +++++++--- .../prog/en/modules/members/nl-search.tt | 8 +------- .../en/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 828c564..70edbc0 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 82025f6..02c9df7 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 a3629ad..b8a9791 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 f4dcc61..e4b7337 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 967ebd1..1dcd811 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; @@ -241,12 +239,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... @@ -715,7 +707,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 -- 1.9.1