From 3c4159bed4463a3b21c33e3cec98efd86975c90a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 16 Oct 2008 10:10:09 -0500 Subject: [PATCH] followup on Owen's patron attributes patch Hide the display of the patron attributes only if no types are defined; the patron attributes section (and more importantly, the edit link), should still be displayed if an attribute type is defined, even if the patron has no attributes currently set. Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/modules/members/moremember.tmpl | 4 ++-- members/moremember.pl | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index 6f52ed7c85..f42fcaf9ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -231,7 +231,7 @@ if (nodename =="barcodes[]"){ - +

Additional attributes and identifiers

@@ -252,7 +252,7 @@ if (nodename =="barcodes[]"){
- +
diff --git a/members/moremember.pl b/members/moremember.pl index ae3f82d910..b0299f2e9a 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -38,6 +38,7 @@ use C4::Auth; use C4::Output; use C4::Members; use C4::Members::Attributes; +use C4::Members::AttributeTypes; use C4::Dates; use C4::Reserves; use C4::Circulation; @@ -340,6 +341,10 @@ $template->param($data); if (C4::Context->preference('ExtendedPatronAttributes')) { $template->param(ExtendedPatronAttributes => 1); $template->param(patron_attributes => C4::Members::Attributes::GetBorrowerAttributes($borrowernumber)); + my @types = C4::Members::AttributeTypes::GetAttributeTypes(); + if (scalar(@types) == 0) { + $template->param(no_patron_attribute_types => 1); + } } $template->param( -- 2.39.5