Bug 19129 - Clean up Details tab for Organisation patrons

Problem: A patron category "I" would cause display problems
on the details in the intranet. This is because the templates
confused patron category "I" with patron type "I" (organisation).

Patch:
- Cleans up variable confusion between categorycode and
  categorytype.
- The template contained code to change the labels below
  the address to 'Organisational phone:" etc., I have removed
  this part as it does not match the edit form anymore.
- Initials, date of birth and gender are still hidden for
  organisation - matching the edit form.

Bonus:
- The patron category description was missing on the
  right and left side of the details tab. Now it displays.
- Fixes some html issues:
  - doubled up class attribute in a tag
  - doubled up </li></li>

To test:
- Create 3 patrons
  - patron category code doesn't matter, but category type organisation
  - patron category code 'I', category type NOT organisation
  - patron category code NOT I, category type NOT organisaton
- Check details tab in patron account in staff for all 3
  - Verify patron category description shows correctly
  - Verify information added to the account displays correctly
    (phone numbers, emails, ...)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Katrin Fischer 2017-08-17 14:51:08 +00:00 committed by Jonathan Druart
parent ee49d5698a
commit 82f183c5ea
4 changed files with 41 additions and 50 deletions

View File

@ -23,7 +23,8 @@
[% INCLUDE 'member-display-address-style-us.inc' %]
[% END %]
[% IF ( phone ) %]<li class="patronphone">
[% IF ( phone || mobile || phonepro ) %]<li class="patronphone">
[% IF ( phone ) %]
<a href="tel:[% phone | url %]">[% phone | html %]</a>
[% ELSE %]
[% IF ( mobile ) %]
@ -32,8 +33,8 @@
[% IF ( phonepro ) %]
<a href="tel:[% phonepro | url %]">[% phonepro | html %]</a>
[% END %]
[% END %]</li>
[% END %]
[% END %]
[% END %]</li>[% END %]
[% IF ( email ) %]
<li class="email"> <a href="mailto:[% email | url %]" title="[% email | html %]">[% email | html %]</a></li>
[% ELSE %]

View File

@ -199,7 +199,7 @@ function searchToHold(){
[% IF ( is_child ) %]
<li><a id="updatechild" href="#">Update child to adult patron</a></li>
[% ELSE %]
<li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li></li>
<li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li>
[% END %]
[% IF Koha.Preference('intranetreadinghistory') %]
[%IF ( privacy == 2 ) %]
@ -249,7 +249,7 @@ function searchToHold(){
</div>
<div class="modal-footer">
<button class="btn btn-default approve" type="submit"><i class="fa fa-check"></i> Save</button>
<button class="btn btn-default deny" href="#" class="cancel" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
<button class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Cancel</button>
</div>
</form>
</div>

View File

@ -223,7 +223,7 @@ function validate1(date) {
<div class="yui-u first">
<div id="patron-information" style="padding : .5em;">
[% UNLESS ( I ) %][% IF ( othernames ) %]&ldquo;[% othernames | html %]&rdquo;[% END %]
[% IF ( othernames ) %]&ldquo;[% othernames | html %]&rdquo;[% END %]
<div class = "address">
[% IF Koha.Preference( 'AddressFormat' ) %]
@ -234,46 +234,40 @@ function validate1(date) {
</div>
<div class="rows">
<ol>
[% IF ( I ) %]
[% IF ( phonepro ) %]<li><span class="label">Organization phone: </span><a href="tel:[% phonepro %]">[% phonepro | html %]</a></li>[% END %]
[% IF ( emailpro ) %]<li class="email"><span class="label">Organization email: </span>[% emailpro | html %]</li>[% END %]
[% ELSE %]
[% IF ( phone ) %]<li><span class="label">Primary phone: </span><a href="tel:[% phone %]">[% phone | html %]</a></li>[% END %]
[% IF ( phonepro ) %]<li><span class="label">Secondary phone: </span><a href="tel:[% phonepro %]">[% phonepro | html %]</a></li>[% END %]
[% IF ( mobile ) %]<li><span class="label">Other phone: </span><a href="tel:[% mobile %]">[% mobile | html %]</a></li>[% END %]
[% END %]
[% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax %]</li>[% END %]
[% UNLESS ( I ) %]
<ol>
[% IF ( phone ) %]<li><span class="label">Primary phone: </span><a href="tel:[% phone %]">[% phone | html %]</a></li>[% END %]
[% IF ( phonepro ) %]<li><span class="label">Secondary phone: </span><a href="tel:[% phonepro %]">[% phonepro | html %]</a></li>[% END %]
[% IF ( mobile ) %]<li><span class="label">Other phone: </span><a href="tel:[% mobile %]">[% mobile | html %]</a></li>[% END %]
[% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax %]</li>[% END %]
[% IF ( email ) %]<li class="email"><span class="label">Primary email:</span><a title="[% email %]" href="mailto:[% email | url %]">[% email | html %]</a></li>[% END %]
[% IF ( emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a title="[% emailpro %]" href="mailto:[% emailpro | url %]">[% emailpro | html %]</a></li>[% END %]
[% END %]
[% IF ( initials ) %]<li><span class="label">Initials: </span>[% initials %]</li>[% END %]
[% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %]
[% IF ( sex ) %]<li><span class="label">Gender:</span>
[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
</li>[% END %][% END %]
[% IF guarantees %]
<li>
<span class="label">Guarantees:</span>
<ul>
[% FOREACH guarantee IN guarantees %]
<li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
[% UNLESS ( I ) %]
[% IF ( initials ) %]<li><span class="label">Initials: </span>[% initials %]</li>[% END %]
[% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %]
[% IF ( sex ) %]<li><span class="label">Gender:</span>
[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
</li>[% END %]
[% END %]
[% IF guarantees %]
<li>
<span class="label">Guarantees:</span>
<ul>
[% FOREACH guarantee IN guarantees %]
<li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
[% END %]
</ul>
</li>
[% ELSIF guarantor %]
<li>
<span class="label">Guarantor:</span>
[% IF guarantor.borrowernumber %]
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname | html %] [% guarantor.surname | html %]</a>
[% ELSE %]
[% guarantor.firstname | html %] [% guarantor.surname | html %]
[% END %]
</ul>
</li>
[% ELSIF guarantor %]
<li>
<span class="label">Guarantor:</span>
[% IF guarantor.borrowernumber %]
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname | html %] [% guarantor.surname | html %]</a>
[% ELSE %]
[% guarantor.firstname | html %] [% guarantor.surname | html %]
[% END %]
</li>
[% END %]
</ol>
</li>
[% END %]
</ol>
</div>
<div class="action">
[% IF ( guarantor.borrowernumber ) %]
@ -400,7 +394,7 @@ function validate1(date) {
<ol>
<li><span class="label">Card number: </span>[% cardnumber %]</li>
<li><span class="label">Borrowernumber: </span> [% borrowernumber %]</li>
<li><span class="label">Category: </span>[% description %] ([% categorycode %])</li>
<li><span class="label">Category: </span>[% categoryname %] ([% categorycode %])</li>
<li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li>
<li><span class="label">Expiration date: </span>
@ -471,7 +465,6 @@ function validate1(date) {
</div>
<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=3">Edit</a></div>
[% UNLESS ( I ) %]
<div id="patron-alternate-address" style="padding-top: 1em;">
<h3>Alternate address</h3>
@ -489,7 +482,6 @@ function validate1(date) {
</div>
</div>
<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=6">Edit</a></div>
[% END %]
<div id="patron-alternative-contact" style="padding-top: 1em;">
<h3>Alternative contact</h3>

View File

@ -332,9 +332,6 @@ if ( C4::Context->preference("ExportCircHistory") ) {
$template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
}
# in template <TMPL_IF name="I"> => institutional (A for Adult, C for children)
$template->param( $data->{'categorycode'} => 1 );
# Display the language description instead of the code
# Note that this is certainly wrong
my ( $subtag, $region ) = split '-', $patron->lang;
@ -346,7 +343,7 @@ $template->param(
detailview => 1,
borrowernumber => $borrowernumber,
othernames => $data->{'othernames'},
categoryname => $data->{'description'},
categoryname => $patron->category->description,
was_renewed => scalar $input->param('was_renewed') ? 1 : 0,
todaysdate => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
totalprice => sprintf("%.2f", $totalprice),
@ -355,6 +352,7 @@ $template->param(
overdues_exist => $overdues_exist,
StaffMember => $category_type eq 'S',
is_child => $category_type eq 'C',
$category_type => 1, # [% IF ( I ) %] = institutional/organisation
samebranch => $samebranch,
quickslip => $quickslip,
housebound_role => scalar $patron->housebound_role,