From a7b229dcb690b942f92f90dcd907068c4ff760a3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 15 Aug 2011 14:21:29 -0400 Subject: [PATCH] Fix for Bug 6698, Detail page for organisations should show only valid fields The output of moremember.pl is supposed to change if the patron in question is an organization (has a category which is of type "I"). The script was checking borrowers.categorycode when it should have been checking categories.category_type. With this correction the right variable is passed to the template. The template needed additional corrections to be sure the correct fields were appearing. The patron entry form offers only phonepro and emailpro, so moremember.pl should output those fields in particular. This patch hides other fields as suggested by the Bug report. --- .../prog/en/modules/members/memberentrygen.tt | 13 +++++++++---- .../prog/en/modules/members/moremember.tt | 3 ++- members/moremember.pl | 3 +++ 3 files changed, 14 insertions(+), 5 deletions(-) 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 8a31738..8e15922 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -250,7 +250,7 @@ [% ELSE %] + [% IF ( I ) %] Name: [% ELSE %] Surname: [% END %] [% IF ( uppercasesurnames ) %] [% IF ( opduplicate ) %] @@ -607,6 +607,7 @@ [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
+ [% UNLESS ( I ) %] Contact
    [% UNLESS nophone %]
  1. @@ -624,6 +625,7 @@ [% IF ( mandatoryphone ) %]Required[% END %]
    Shows on transit slips
  2. + [% END %] [% END %] [% UNLESS nophonepro %]
  3. @@ -632,7 +634,7 @@ [% ELSE %] + [% IF ( I ) %]Phone: [% ELSE %]Secondary Phone:[% END %] [% IF ( opduplicate ) %] [% ELSE %] @@ -642,6 +644,7 @@
  4. [% END %] [% UNLESS nomobile %] + [% UNLESS ( I ) %]
  5. [% IF ( mandatorymobile ) %]
  6. [% END %] + [% END %] + [% UNLESS ( I ) %] [% UNLESS noemail %]
  7. [% IF ( mandatoryemail ) %] @@ -671,9 +676,9 @@ [% END %] [% IF ( mandatoryemail ) %]Required[% END %]
    Shows on transit slips
    -
  8. [% END %] + [% END %] [% UNLESS noemailpro %]
  9. [% IF ( mandatoryemailpro ) %] @@ -681,7 +686,7 @@ [% ELSE %] + [% IF ( I ) %]Email: [% ELSE %]Secondary Email:[% END %] [% IF ( opduplicate ) %] [% ELSE %] 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 b568ec9..d2b1140 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -182,7 +182,7 @@ function validate1(date) {
    - [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames %]”[% END %] + [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames %]”[% END %][% END %]

    [% streetnumber %] [% IF ( roaddetails ) %] @@ -215,6 +215,7 @@ function validate1(date) { [% IF ( email ) %]

  10. Primary email:[% email %]
  11. [% END %] [% IF ( emailpro ) %]
  12. Secondary email: [% emailpro %]
  13. [% END %] [% END %] + [% UNLESS ( I ) %] [% IF ( initials ) %]
  14. Initials: [% initials %]
  15. [% END %] [% IF ( dateofbirth ) %]
  16. Date of birth:[% dateofbirth %]
  17. [% END %] [% IF ( sex ) %]
  18. Gender: diff --git a/members/moremember.pl b/members/moremember.pl index 32541c9..7122882 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -134,6 +134,9 @@ my $category_type = $data->{'category_type'}; ### $category_type +# in template => instutitional (A for Adult& C for children) +$template->param( $data->{'category_type'} => 1 ); + $debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth); foreach (qw(dateenrolled dateexpiry dateofbirth)) { my $userdate = $data->{$_}; -- 1.7.2.5