From 6870eb53291a9bceb57e37bfb901deaaa3e7904c Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 30 Jan 2024 14:32:50 -0300 Subject: [PATCH] Bug 34478: op=modify should be op=add_form - memberentry.pl Signed-off-by: Jonathan Druart --- .../prog/en/includes/members-toolbar.inc | 2 +- .../prog/en/includes/patron-search.inc | 2 +- .../prog/en/includes/patron_messages.inc | 6 ++-- .../prog/en/modules/members/moremember.tt | 28 +++++++++---------- .../modules/reports/guided_reports_start.tt | 2 +- members/memberentry.pl | 18 ++++++------ t/db_dependent/selenium/patrons_search.t | 2 +- 7 files changed, 30 insertions(+), 30 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 dfabf98fa0..47a47a3c80 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -6,7 +6,7 @@ [% USE scalar %]
[% IF CAN_user_borrowers_edit_borrowers %] - Edit + Edit [% END %] [% IF CAN_user_borrowers_edit_borrowers %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 91b72e6b38..a62e5e7270 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -600,7 +600,7 @@ [% CASE 'add' %] action_node += '' + _("Add") + ''; [% CASE 'edit' %] - action_node += ' ' + _("Edit") + ''; + action_node += ' ' + _("Edit") + ''; [% CASE 'checkout' %] [% IF CAN_user_circulate_circulate_remaining_permissions %] action_node += ' ' + _("Check out") + ''; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index 2754bffb97..910d3883af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -22,7 +22,7 @@
  • Expiration: Patron's card expires on [% patron.dateexpiry | $KohaDates %]. - Renew or Edit details + Renew or Edit details
  • [% END %] @@ -39,7 +39,7 @@ [% IF ( expiry ) %] Patron's card expired on [% expiry | $KohaDates %] [% END %] - Renew or Edit details + Renew or Edit details [% END %] @@ -93,7 +93,7 @@
  • Patron's age is incorrect for their category. Ages allowed are [% age_low | html %]-[% age_high | html %]. - Change category + Change category
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index bb230f3c3d..feb55effa6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -117,9 +117,9 @@

    Contact information

    [% IF ( guarantor.borrowernumber ) %] - Edit + Edit [% ELSE %] - Edit + Edit [% END %]
    @@ -277,7 +277,7 @@ [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %]

    Housebound roles

    - Edit + Edit
      @@ -302,7 +302,7 @@ [% ELSE %]

      Housebound roles

      - Add + Add
      [% END %]
    [% #/ div#houseboundroles %] @@ -314,7 +314,7 @@ [% IF ( attributes_loop ) %]

    Additional attributes and identifiers

    - Edit + Edit
    [% FOREACH attribute IN attributes_loop %] [% IF attribute.class %] @@ -338,7 +338,7 @@ [% ELSE %]

    Additional attributes and identifiers

    - Add + Add
    [% END %]
    [% # /div#patron-extended-attributes %] @@ -349,7 +349,7 @@

    Patron messaging preferences

    - Edit + Edit
    [% INCLUDE 'messaging-preference-form.inc' %] [% IF Koha.Preference('SMSSendDriver') %] @@ -379,7 +379,7 @@

    Library use

    - Edit + Edit
      @@ -415,12 +415,12 @@ [% patron.dateexpiry | $KohaDates %] Expired - Renew or Edit details + Renew or Edit details [% ELSIF ( patron.is_going_to_expire ) %] [% patron.dateexpiry | $KohaDates %] Patron expires soon - Renew or Edit details + Renew or Edit details [% ELSE %] [% patron.dateexpiry | $KohaDates %] [% END %] @@ -529,7 +529,7 @@ [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %]

      Alternate address

      - Edit + Edit
        @@ -563,7 +563,7 @@ [% ELSE %]

        Alternate address

        - Add + Add
        [% END %]
      [% # /div#patron-alternate-address %] @@ -572,7 +572,7 @@ [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %]

      Alternative contact

      - Edit + Edit
        @@ -636,7 +636,7 @@ [% ELSE %]

        Alternative contact

        - Add + Add
        [% END %]
      [% # /div#patron-alternative-contact %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 3dc82af992..0cbf7106cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1210,7 +1210,7 @@ diff --git a/members/memberentry.pl b/members/memberentry.pl index e108b33817..68e1777d99 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -83,7 +83,7 @@ my $nodouble = $input->param('nodouble'); my $duplicate = $input->param('duplicate'); my $quickadd = $input->param('quickadd'); -$nodouble = 1 if ($op eq 'modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're +$nodouble = 1 if ($op eq 'add_form' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're # modifying an existing patron, it ipso facto # isn't a duplicate. Marking FIXME because this # script needs to be refactored. @@ -167,7 +167,7 @@ $template->param( "cud-add" => 1 ) if ( $op eq 'cud-add' ); $template->param( "quickadd" => 1 ) if ( $quickadd ); $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); -if ( $op eq 'modify' or $op eq 'cud-save' or $op eq 'duplicate' ) { +if ( $op eq 'add_form' or $op eq 'cud-save' or $op eq 'duplicate' ) { my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); @@ -191,7 +191,7 @@ $template->param( patron_category => $category ); # initialize %newdata my %newdata; # comes from $input->param() -if ( $op eq 'cud-insert' || $op eq 'modify' || $op eq 'cud-save' || $op eq 'duplicate' ) { +if ( $op eq 'cud-insert' || $op eq 'add_form' || $op eq 'cud-save' || $op eq 'duplicate' ) { my @names = ( $borrower_data && $op ne 'cud-save' ) ? keys %$borrower_data : $input->param(); foreach my $key (@names) { if (defined $input->param($key)) { @@ -400,7 +400,7 @@ elsif ( $borrowernumber ) { $extended_patron_attributes = Koha::Patrons->find($borrowernumber)->extended_attributes->unblessed; } -if ( ($op eq 'modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ +if ( ($op eq 'add_form' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ unless ($newdata{'dateexpiry'}){ $newdata{'dateexpiry'} = $category->get_expiry_date( $newdata{dateenrolled} ) if $category; } @@ -527,7 +527,7 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ warn "Patron modification failed! - $@"; # Maybe we must die instead of just warn push @messages, {error => 'error_on_update_patron'}; } - $op = "modify"; + $op = 'add_form'; }; if ( $success ) { @@ -597,8 +597,8 @@ if ($delete){ } if ($nok or !$nodouble){ - $op="cud-add" if ($op eq "cud-insert"); - $op="modify" if ($op eq "cud-save"); + $op = 'cud-add' if ( $op eq 'cud-insert' ); + $op = 'add_form' if ( $op eq 'cud-save' ); %data=%newdata; $template->param( updtype => ($op eq 'cud-add' ?'I':'M')); # used to check for $op eq "cud-insert"... but we just changed $op! unless ($step){ @@ -627,7 +627,7 @@ if ($op eq 'cud-add'){ } $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1); } -if ($op eq "modify") { +if ($op eq 'add_form') { $template->param( updtype => 'M',modify => 1 ); $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1) unless $step; if ( $step == 4 ) { @@ -708,7 +708,7 @@ if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { $userbranch = C4::Context->userenv->{'branch'}; } -if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) { +if (defined ($data{'branchcode'}) and ( $op eq 'add_form' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) { $userbranch = $data{'branchcode'}; } $template->param( userbranch => $userbranch ); diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t index 928e64f36f..f4f663e918 100755 --- a/t/db_dependent/selenium/patrons_search.t +++ b/t/db_dependent/selenium/patrons_search.t @@ -240,7 +240,7 @@ subtest 'Search patrons' => sub { ); $driver->find_element( - '//a[@href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=' + '//a[@href="/cgi-bin/koha/members/memberentry.pl?op=add_form&destination=circ&borrowernumber=' . $first_patron->borrowernumber . '"]' )->click; is( -- 2.39.5