[Koha-patches] [PATCH] [SIGNED-OFF] [Combined patch] Bug 5436: Extended patron attributes display improvements

Magnus Enger magnus at enger.priv.no
Sat Jul 16 01:27:59 CEST 2011


From: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>

This patch combines the changes pushed to new/awaiting_qa/bug_5436 with
this follow-up patch: http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=4608

(MT #2262) member search improving
if only one member is found, go directly to his details.

change borrower link in return.pl
go to circulation.pl instead of moremembers.pl

(MT #2262) Show extended attributes in borrower toolbar
This made some modifications to be more generic, and to show extended attributes in borrower "toolbar".
It hide by default the borrower address, and the user have a toggle link to show/hide the user address.

(bug #MT2262) don't show all attributes
this hide non-active extended attributes in circulation.

(MT2262) Followup : Enhancement to extended attributes display
View/Hide address improvement in moremember.pl

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent at biblibre.com>

Bug 5436 Followup : expiry message was badly displayed

This patch assigns the comment expressed
Signed-off-by: Magnus Enger <magnus at enger.priv.no>
---
 C4/Members.pm                                      |   46 ++++++++-
 C4/Members/AttributeTypes.pm                       |   31 +++++-
 C4/Members/Attributes.pm                           |    3 +-
 admin/patron-attr-types.pl                         |    9 ++-
 circ/circulation.pl                                |   15 +--
 .../0009-patron-attr-display-checkout.pl           |    7 ++
 installer/data/mysql/kohastructure.sql             |    1 +
 .../intranet-tmpl/prog/en/css/staff-global.css     |   35 ++++++-
 .../intranet-tmpl/prog/en/includes/circ-menu.inc   |  108 +++++++++++++-------
 .../prog/en/modules/admin/patron-attr-types.tt     |    5 +
 .../prog/en/modules/circ/circulation.tt            |    2 +-
 .../intranet-tmpl/prog/en/modules/circ/returns.tt  |    7 +-
 .../prog/en/modules/members/moremember.tt          |   48 +++++----
 .../intranet-tmpl/prog/img/more-right-arrow.gif    |  Bin 0 -> 81 bytes
 members/member.pl                                  |    6 +
 members/moremember.pl                              |    4 +-
 16 files changed, 242 insertions(+), 85 deletions(-)
 create mode 100644 installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl
 create mode 100644 koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif

diff --git a/C4/Members.pm b/C4/Members.pm
index 670042f..7fb14a7 100644
--- a/C4/Members.pm
+++ b/C4/Members.pm
@@ -26,12 +26,13 @@ use C4::Dates qw(format_date_in_iso);
 use Digest::MD5 qw(md5_base64);
 use Date::Calc qw/Today Add_Delta_YM/;
 use C4::Log; # logaction
+use C4::Branch;
 use C4::Overdues;
 use C4::Reserves;
 use C4::Accounts;
 use C4::Biblio;
 use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable);
-use C4::Members::Attributes qw(SearchIdMatchingAttribute);
+use C4::Members::Attributes qw(SearchIdMatchingAttribute GetBorrowerAttributes);
 
 our ($VERSION, at ISA, at EXPORT, at EXPORT_OK,$debug);
 
@@ -91,6 +92,8 @@ BEGIN {
 		&DeleteMessage
 		&GetMessages
 		&GetMessagesCount
+
+        &SetMemberInfosInTemplate
 	);
 
 	#Modify data
@@ -1725,6 +1728,47 @@ sub DelMember {
     return $sth->rows;
 }
 
+=head2 SetMemberInfosInTemplate
+    &SetMemberInfosInTemplate($borrowernumber, $template)
+    
+    
+Settings borrower informations for template user
+
+=cut
+
+sub SetMemberInfosInTemplate {
+    my ($borrowernumber, $template) = @_;
+    
+    my $borrower = GetMemberDetails( $borrowernumber, 0 );
+    foreach my $key (keys %$borrower){
+        $template->param($key => $borrower->{$key});
+    }
+    
+    # Computes full borrower address
+    my (undef, $roadttype_hashref) = &GetRoadTypes();
+    my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
+    $template->param(is_child  => ($borrower->{'category_type'} eq 'C'),
+                    address    => $address,
+                    branchname => GetBranchName($borrower->{'branchcode'}),
+                    );
+                    
+    foreach (qw(dateenrolled dateexpiry dateofbirth)) {
+		my $userdate = $borrower->{$_};
+		unless ($userdate) {
+			$borrower->{$_} = '';
+			next;
+		}
+		$userdate = C4::Dates->new($userdate,'iso')->output('syspref');
+		$borrower->{$_} = $userdate || '';
+		$template->param( $_ => $userdate );
+    }
+    
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        extendedattributes => $attributes,
+    );
+}
+
 =head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE)
 
     $date = ExtendMemberSubscriptionTo($borrowerid, $date);
diff --git a/C4/Members/AttributeTypes.pm b/C4/Members/AttributeTypes.pm
index 3a05268..e36557b 100644
--- a/C4/Members/AttributeTypes.pm
+++ b/C4/Members/AttributeTypes.pm
@@ -118,6 +118,7 @@ sub new {
     $self->{'opac_display'} = 0;
     $self->{'password_allowed'} = 0;
     $self->{'staff_searchable'} = 0;
+    $self->{'display_checkout'} = 0;
     $self->{'authorised_value_category'} = '';
 
     bless $self, $class;
@@ -152,6 +153,7 @@ sub fetch {
     $self->{'opac_display'}              = $row->{'opac_display'};
     $self->{'password_allowed'}          = $row->{'password_allowed'};
     $self->{'staff_searchable'}          = $row->{'staff_searchable'};
+    $self->{'display_checkout'}          = $row->{'display_checkout'};
     $self->{'authorised_value_category'} = $row->{'authorised_value_category'};
 
     bless $self, $class;
@@ -182,14 +184,15 @@ sub store {
                                          opac_display = ?,
                                          password_allowed = ?,
                                          staff_searchable = ?,
-                                         authorised_value_category = ?
+                                         authorised_value_category = ?,
+                                         display_checkout = ?
                                      WHERE code = ?");
     } else {
         $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types 
                                         (description, repeatable, unique_id, opac_display, password_allowed,
-                                         staff_searchable, authorised_value_category, code)
+                                         staff_searchable, authorised_value_category, display_checkout, code)
                                         VALUES (?, ?, ?, ?, ?,
-                                                ?, ?, ?)");
+                                                ?, ?, ?, ?)");
     }
     $sth->bind_param(1, $self->{'description'});
     $sth->bind_param(2, $self->{'repeatable'});
@@ -198,7 +201,8 @@ sub store {
     $sth->bind_param(5, $self->{'password_allowed'});
     $sth->bind_param(6, $self->{'staff_searchable'});
     $sth->bind_param(7, $self->{'authorised_value_category'});
-    $sth->bind_param(8, $self->{'code'});
+    $sth->bind_param(8, $self->{'display_checkout'});
+    $sth->bind_param(9, $self->{'code'});
     $sth->execute;
 
 }
@@ -304,6 +308,25 @@ sub staff_searchable {
     @_ ? $self->{'staff_searchable'} = ((shift) ? 1 : 0) : $self->{'staff_searchable'};
 }
 
+=head2 display_checkout
+
+=over 4
+
+my $display_checkout = $attr_type->display_checkout();
+$attr_type->display_checkout($display_checkout);
+
+=back
+
+Accessor.  The C<$display_checkout> argument
+is interpreted as a Perl boolean.
+
+=cut
+
+sub display_checkout {
+    my $self = shift;
+    @_ ? $self->{'display_checkout'} = ((shift) ? 1 : 0) : $self->{'display_checkout'};
+}
+
 =head2 authorised_value_category
 
   my $authorised_value_category = $attr_type->authorised_value_category();
diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm
index 35d6702..29a31e6 100644
--- a/C4/Members/Attributes.pm
+++ b/C4/Members/Attributes.pm
@@ -72,7 +72,7 @@ sub GetBorrowerAttributes {
     my $opac_only = @_ ? shift : 0;
 
     my $dbh = C4::Context->dbh();
-    my $query = "SELECT code, description, attribute, lib, password
+    my $query = "SELECT code, description, attribute, lib, password, display_checkout
                  FROM borrower_attributes
                  JOIN borrower_attribute_types USING (code)
                  LEFT JOIN authorised_values ON (category = authorised_value_category AND attribute = authorised_value)
@@ -89,6 +89,7 @@ sub GetBorrowerAttributes {
             value             => $row->{'attribute'},  
             value_description => $row->{'lib'},  
             password          => $row->{'password'},
+            display_checkout  => $row->{'display_checkout'},
         }
     }
     return \@results;
diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl
index 1dfe442..c32b6c2 100755
--- a/admin/patron-attr-types.pl
+++ b/admin/patron-attr-types.pl
@@ -106,6 +106,9 @@ sub error_add_attribute_type_form {
     if ($input->param('staff_searchable')) {
         $template->param(staff_searchable_checked => 'checked="checked"');
     }
+    if ($input->param('display_checkout')) {
+        $template->param(display_checkout_checked => 'checked="checked"');
+    }
 
     $template->param(
         attribute_type_form => 1,
@@ -147,6 +150,8 @@ sub add_update_attribute_type {
     $attr_type->authorised_value_category($authorised_value_category);
     my $password_allowed = $input->param('password_allowed');
     $attr_type->password_allowed($password_allowed);
+    my $display_checkout = $input->param('display_checkout');
+    $attr_type->display_checkout($display_checkout);
 
     if ($op eq 'edit') {
         $template->param(edited_attribute_type => $attr_type->code());
@@ -222,7 +227,9 @@ sub edit_attribute_type_form {
     if ($attr_type->staff_searchable()) {
         $template->param(staff_searchable_checked => 'checked="checked"');
     }
-
+    if ($attr_type->display_checkout()) {
+        $template->param(display_checkout_checked => 'checked="checked"');
+    }
     authorised_value_category_list($template, $attr_type->authorised_value_category());
 
     $template->param(
diff --git a/circ/circulation.pl b/circ/circulation.pl
index c34db54..1e19261 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -220,8 +220,8 @@ if ($borrowernumber) {
 
     # Warningdate is the date that the warning starts appearing
     my (  $today_year,   $today_month,   $today_day) = Today();
-    my ($warning_year, $warning_month, $warning_day) = split /-/, $borrower->{'dateexpiry'};
-    my (  $enrol_year,   $enrol_month,   $enrol_day) = split /-/, $borrower->{'dateenrolled'};
+    my ($warning_year, $warning_month, $warning_day) = split (/-/, $borrower->{'dateexpiry'});
+    my (  $enrol_year,   $enrol_month,   $enrol_day) = split (/-/, $borrower->{'dateenrolled'});
     # Renew day is calculated by adding the enrolment period to today
     my (  $renew_year,   $renew_month,   $renew_day);
     if ($enrol_year*$enrol_month*$enrol_day>0) {
@@ -622,10 +622,6 @@ if($lib_messages_loop){ $template->param(flagged => 1 ); }
 my $bor_messages_loop = GetMessages( $borrowernumber, 'B', $branch );
 if($bor_messages_loop){ $template->param(flagged => 1 ); }
 
-# Computes full borrower address
-my (undef, $roadttype_hashref) = &GetRoadTypes();
-my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
-
 my $fast_cataloging = 0;
     if (defined getframeworkinfo('FA')) {
     $fast_cataloging = 1 
@@ -644,11 +640,9 @@ $template->param(
     printername       => $printer,
     firstname         => $borrower->{'firstname'},
     surname           => $borrower->{'surname'},
-    dateexpiry        => format_date($newexpiry),
+    newexpiry        => format_date($newexpiry),
     expiry            => format_date($borrower->{'dateexpiry'}),
-    categorycode      => $borrower->{'categorycode'},
     categoryname      => $borrower->{description},
-    address           => $address,
     address2          => $borrower->{'address2'},
     email             => $borrower->{'email'},
     emailpro          => $borrower->{'emailpro'},
@@ -658,7 +652,6 @@ $template->param(
     zipcode           => $borrower->{'zipcode'},
     country           => $borrower->{'country'},
     phone             => $borrower->{'phone'} || $borrower->{'mobile'},
-    cardnumber        => $borrower->{'cardnumber'},
     amountold         => $amountold,
     barcode           => $barcode,
     stickyduedate     => $stickyduedate,
@@ -681,6 +674,8 @@ $template->param(
     fast_cataloging   => $fast_cataloging,
 );
 
+SetMemberInfosInTemplate($borrowernumber, $template);
+
 # save stickyduedate to session
 if ($stickyduedate) {
     $session->param( 'stickyduedate', $duedatespec );
diff --git a/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl b/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl
new file mode 100644
index 0000000..44cfcfa
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/0009-patron-attr-display-checkout.pl
@@ -0,0 +1,7 @@
+#! /usr/bin/perl
+use strict;
+use warnings;
+use C4::Context;
+my $dbh=C4::Context->dbh;
+$dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN `display_checkout` TINYINT(1) NOT NULL DEFAULT '0';");
+print "Upgrade done (Added a display_checkout field in borrower_attribute_types table)\n";
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index e3c6f42..ba22027 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -284,6 +284,7 @@ CREATE TABLE `borrower_attribute_types` (
   `password_allowed` tinyint(1) NOT NULL default 0,
   `staff_searchable` tinyint(1) NOT NULL default 0,
   `authorised_value_category` varchar(10) default NULL,
+  `display_checkout` tinyint(1) NOT NULL default 0,
   PRIMARY KEY  (`code`),
   KEY `auth_val_cat_idx` (`authorised_value_category`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
index 9c97db1..d4be5ae 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
@@ -1953,6 +1953,38 @@ ul.budget_hierarchy li:last-child:after {
 ul.budget_hierarchy li:first-child:after {
     content: "";
 }
+#cartmenulink img {
+	background-image : none;
+	display : inline;
+	padding : 3px 6px 0 0;
+}
+
+* html #cartmenulink {
+	border : 1px solid #336600;
+}
+
+* html #listsmenulink {
+	border : 1px solid #006699;
+}
+
+#collapsedaddress {
+    border: solid 1px #eee;
+    margin-right: 10px;
+    overflow: hidden;
+}
+#toggleaddress {
+    display: block;
+    padding: 2px 2px 2px 12px;
+    margin-right: 10px;
+    cursor: pointer;
+}
+.toggleaddress {
+    background: #eee url(../../img/more-right-arrow.gif) 0 50% no-repeat;
+}
+.toggleaddress2 {
+    background: #eee url(../../img/more-up-arrow.gif) 0 50% no-repeat;
+}
+
 .holdcount { font-size : 105%; line-height : 200%; }
 .holdcount a { border : 1px solid #a4bedd; background-color : #e4ecf5; font-weight : bold; -moz-border-radius: 4px; padding : .1em .4em; text-decoration : none; }
 .holdcount a:hover { background-color : #ebeff7; }
@@ -2048,4 +2080,5 @@ fieldset.rows+h3 {clear:both;padding-top:.5em;}
 	border : 1px solid #EEE;
 	padding : 0.3em 0.4em;
 }
-</style>
\ No newline at end of file
+</style>
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
index 129bd66..2e84f2c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
@@ -4,6 +4,19 @@
 <style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
 }</style>
 <![endif]-->
+<script type="text/javascript">
+$(document).ready(function()
+{
+  //hide the all of the element with class msg_body
+  $("#collapsedaddress").hide();
+  //toggle the componenet with class msg_body
+  $("#toggleaddress").click(function()
+  {
+    $("#collapsedaddress").slideToggle("normal");
+    $("#toggleaddress").toggleClass("toggleaddress2");
+  });
+});
+</script>
 <ul>
 [% IF ( patronimages ) %]
 [% IF ( picture ) %]
@@ -12,45 +25,64 @@
 <li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li>
 [% END %]
 [% END %]
-    <li>[% IF ( address ) %]
-            [% address %]
-    [% ELSE %]
-            <span class="empty">No address stored.</span>
-    [% END %]</li>
-    [% IF ( address2 ) %]
-        <li>[% address2 %]</li>
-    [% END %]<li> 
-    [% IF ( city ) %]
-            [% city %][% IF ( state ) %], [% state %][% END %]
-	    [% zipcode %][% IF ( country ) %], [% country %][% END %]
-    [% ELSE %]
-        <span class="empty">No city stored.</span>
-    [% END %]</li>
-    <li>[% IF ( phone ) %]
-        [% phone %]
-    [% ELSE %]
-        [% IF ( mobile ) %]
-            [% mobile %]
-        [% ELSE %]
-            [% IF ( phonepro ) %]
-                [% phonepro %]
-            [% ELSE %]
-                <span class="empty">No phone stored.</span>    
-            [% END %]
-        [% END %]
-    [% END %]</li>
-    [% IF ( email ) %]
-        <li class="email"> <a href="mailto:[% email %]" title="[% email %]">[% email %]</a></li>
-    [% ELSE %]
-        [% IF ( emailpro ) %]
-            <li class="email"> <a href="mailto:[% emailpro %]" title="[% emailpro %]">[% emailpro %]</a></li>
-        [% ELSE %]
-            <li> <span class="empty">No email stored.</span>    </li>
-        [% END %]
+    <li>[% categoryname %] ([% categorycode %])</li>
+    <li>[% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]</li>
+    [% FOREACH extendedattribute IN extendedattributes %]
+    	[% IF ( extendedattribute.display_checkout ) %]
+    		[% IF ( extendedattribute.value ) %]
+    			[% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]
+    		[% END %]
+    	[% END %]
     [% END %]
-    <li>Category: [% categoryname %] ([% categorycode %])</li>
-    <li>Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]</li>
-</ul></div>
+    <li>
+		<div id="collapsedaddress">
+			<p>
+		    [% IF ( address ) %]
+		            [% address %]
+		    [% ELSE %]
+		            <span class="empty">No address stored.</span>
+		    [% END %]
+		    [% IF ( address2 ) %]
+		        [% address2 %]
+		    [% END %]
+		    [% IF ( city ) %]
+		            [% city %]
+			    [% zipcode %]
+			    [% IF ( country ) %], [% country %][% END %]
+		    [% ELSE %]
+		        <span class="empty">No city stored.</span>
+		    [% END %]
+		    </p>
+		    <p>
+		    [% IF ( phone ) %]
+		        [% phone %]
+		    [% ELSE %]
+		        [% IF ( mobile ) %]
+		            [% mobile %]
+		        [% ELSE %]
+		            [% IF ( phonepro ) %]
+		                [% phonepro %]
+		            [% ELSE %]
+		                <span class="empty">No phone stored.</span>    
+		            [% END %]
+		        [% END %]
+		    [% END %]
+		    </p><p>
+		    [% IF ( email ) %]
+		        <a href="mailto:[% email %]" title="[% email %]">[% email %]</a>
+		    [% ELSE %]
+		        [% IF ( emailpro ) %]
+		            <a href="mailto:[% emailpro %]" title="[% emailpro %]">[% emailpro %]</a>
+		        [% ELSE %]
+		            <span class="empty">No email stored.</span>
+		        [% END %]
+		    [% END %]
+		    </p>
+		</div>
+		<a id="toggleaddress" class="toggleaddress">View/Hide address</a>
+    </li>
+</ul>
+</div>
 <div id="menu">
 <ul>
 	[% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check Out</a></li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
index 105d268..513722c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
@@ -122,6 +122,11 @@ function CheckAttributeTypeForm(f) {
             <input type="checkbox" id="staff_searchable" name="staff_searchable" [% staff_searchable_checked %] />
             <span>Check to make this attribute staff_searchable in the staff patron search.</span>
        </li>
+       <li><label for="display_checkout">Display in check-out: </label>
+            <input type="checkbox" id="display_checkout" name="display_checkout" [% display_checkout_checked %] />
+            <span>Check to show this attribute in member check-out.</span>
+       </li>
+       
         <li><label for="authorised_value_category">Authorized value category: </label>
             <select name="authorised_value_category" id="authorised_value_category">
                 <option value=""></option>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index d2f6405..b8bc626 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -226,7 +226,7 @@ function refocus(calendar) {
 </form>
 </div>
 
-[% IF ( dateexpiry ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry %]</div>[% END %]
+[% IF ( newexpiry ) %]<div class="dialog message">Patron's account has been renewed until [% newexpiry %]</div>[% END %]
 [% IF ( NEEDSCONFIRMATION ) %]
 <div class="yui-g">
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
index c02be49..2e60dff 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
@@ -80,7 +80,7 @@ function Dopop(link) {
 </div>
 [% END %]
 <!-- case of a mistake in transfer loop -->
-[% IF ( WrongTransfer ) %]<div class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %] or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1">Cancel Transfer</a></h3>
+[% IF ( WrongTransfer ) %]<div class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %]</h3>
 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
@@ -396,7 +396,7 @@ function Dopop(link) {
 [% IF ( riloop ) %]
     <h2>Checked-In items</h2>
     <table>
-	<tr><th>Due Date</th><th>Title</th>	<th>Author</th>	<th>Barcode</th><th>Shelving Location</th><th>Call Number</th><th>Type</th>	<th>Patron</th><th>Note</th></tr>
+	<tr><th>Due Date</th><th>Title</th>	<th>Author</th>	<th>Barcode</th><th>Call Number</th><th>Type</th>	<th>Patron</th><th>Note</th></tr>
 
         [% FOREACH riloo IN riloop %]
             <tr>
@@ -412,11 +412,10 @@ function Dopop(link) {
                     [% riloo.itemtitle |html %]</a></td>
 			<td>[% riloo.itemauthor %]</td>
             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
-            <td>[% riloo.location %]</td>
             <td>[% riloo.itemcallnumber %]</td>
             <td>[% riloo.itemtype %] [% riloo.ccode %]</td>
 			<td>[% IF ( riloo.duedate ) %]
-                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
+                <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.borrowernumber %]">
                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
                 </a>
             [% ELSE %]Not checked out[% END %]</td>
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 6287611..40bc3ab 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -179,7 +179,7 @@ function validate1(date) {
 
      [% UNLESS ( I ) %][% IF ( othernames ) %]&ldquo;[% othernames %]&rdquo;[% END %]
 
-<p class="address">[% streetnumber %]
+<p class="address">
         [% IF ( roaddetails ) %]
          [% roaddetails %],
         [% END %]
@@ -212,9 +212,7 @@ function validate1(date) {
     [% END %]
     <li><span class="label">Initials: </span>[% initials %]</li>
     <li><span class="label">Date of birth:</span>[% dateofbirth %]</li>
-    <li><span class="label">Gender:</span>
-    [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
-    </li>[% END %]
+    <li><span class="label">Sex:</span>[% sex %]</li>[% END %]
     [% IF ( printethnicityline ) %]
     <li><span class="label">Ethnicity:</span>[% ethnicity %]</li>
     <li><span class="label">Ethnicity notes: </span>[% ethnotes %]</li>
@@ -341,8 +339,8 @@ function validate1(date) {
     </li>[% END %]
     [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 %]</li>[% END %]
     [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 %]</li>[% END %]
-    <li><span class="label">Username: </span>[% userid %]</li>
-    <li><span class="label">Password: </span>
+    <li><span class="label">OPAC login: </span>[% userid %]</li>
+    <li><span class="label">OPAC password: </span>
     [% IF ( password ) %]
         *******
     [% ELSE %]
@@ -399,7 +397,7 @@ function validate1(date) {
 	<ul>
 		<li><a href="/cgi-bin/koha/members/moremember.pl#checkedout">[% issuecount %] Checkout(s)</a></li>
     [% IF ( relissuecount ) %]
-        <li><a href="/cgi-bin/koha/members/moremember.pl#relissues">Relatives' Checkouts</a></li>
+        <li><a href="/cgi-bin/koha/members/moremember.pl#relissues">Relatives issues</a></li>
     [% END %]
 		<li><a href="/cgi-bin/koha/members/moremember.pl#finesandcharges">Fines &amp; Charges</a></li>
 		<li>[% IF ( countreserv ) %]
@@ -495,13 +493,9 @@ function validate1(date) {
       [% IF ( issueloo.return_failed ) %]
             <td class="problem">Checkin Failed</td>
       [% ELSE %]
-        [% IF ( issueloo.norenew_reason_on_reserve ) %]
-            <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% issueloo.biblionumber %]">On Hold</a></td>
-        [% ELSE %]
             <td><input type="checkbox" name="barcodes[]"  value="[% issueloo.barcode %]" onclick="uncheck_sibling(this);" />
                 <input type="checkbox" name="all_barcodes[]" value="[% issueloo.barcode %]" checked="checked" style="display: none;" />
             </td>
-        [% END %]
       [% END %]
         </tr>
   [% END %]
@@ -524,17 +518,21 @@ function validate1(date) {
 
 [% IF ( relissuecount ) %]
 <div id="relissues">
+	<h2>Relatives issues</h2>
  <table id="relissuest">
     <thead>
 	<tr>
             <th scope="col">Due date</th>
             <th scope="col">Title</th>
+            <th scope="col">Collection</th>
+            <th scope="col">Stock number</th>
+            <th scope="col">Barcode</th>
             <th scope="col">Item Type</th>
             <th scope="col">Checked out on</th> 
-            <th scope="col">Call no</th>
+            <th scope="col">Borrower</th>
+	    <th scope="col">Call no</th>
             <th scope="col">Charge</th>
             <th scope="col">Price</th>
-            <th scope="col">Patron</th>
         </tr>
     </thead>
        <tbody>
@@ -553,13 +551,16 @@ function validate1(date) {
                                         <span class="dmg">[% relissueloo.itemdamaged %]</span>
                 [% END %]
 </td>
-            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relissueloo.biblionumber %]"><strong>[% relissueloo.title |html %]</strong></a>[% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relissueloo.biblionumber %]&amp;itemnumber=[% relissueloo.itemnumber %]#item[% relissueloo.itemnumber %]">[% relissueloo.barcode %]</a></td>
+            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relissueloo.biblionumber %]"><strong>[% relissueloo.title |html %]</strong></a>[% IF ( relissueloo.author ) %], by [% relissueloo.author %][% END %] [% IF ( relissueloo.publishercode ) %]; [% relissueloo.publishercode %] [% END %] [% IF ( relissueloo.publicationyear ) %], [% relissueloo.publicationyear %][% END %]</td>
+            <td>[% relissueloo.collection %]</td>
+            <td>[% relissueloo.stocknumber %]</td>
+            <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relissueloo.biblionumber %]&amp;itemnumber=[% relissueloo.itemnumber %]#item[% relissueloo.itemnumber %]">[% relissueloo.barcode %]</a></td>
 <td>[% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %]<img src="[% relissueloo.itemtype_image %]" alt="" />[% END %][% END %][% relissueloo.itemtype_description %]</td>
             <td>[% relissueloo.issuedate %]</td>
-        <td>[% relissueloo.itemcallnumber %]</td>
-        <td>[% relissueloo.charge %]</td>
-        <td>[% relissueloo.replacementprice %]</td>
-	    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% relissueloo.borrowernumber %]">[% relissueloo.borrowername %] ([% relissueloo.cardnumber %])</a></td>
+	    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% relissueloo.borrowernumber %]">[% relissueloo.borrowername %]</a></td>
+	    <td>[% relissueloo.itemcallnumber %]</td>
+            <td>[% relissueloo.charge %]</td>
+            <td>[% relissueloo.replacementprice %]</td>
         </tr>
   [% END %]
         </tbody>
@@ -609,15 +610,18 @@ function validate1(date) {
                     <option value="del">Yes</option>
                 </select>
                 <input type="hidden" name="biblionumber" value="[% reservloo.biblionumber %]" />
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                <input type="hidden" name="borrowernumber" value="[% reservloo.borrowernumber %]" />
             </td>
         </tr>
 		[% END %]</tbody>
     </table>
 
-        <fieldset class="action"><input type="submit" class="cancel" name="submit" value="Cancel Marked Requests" /></fieldset>
-    </form>
-    [% ELSE %]<p>Patron has nothing on hold.</p>[% END %]
+        <fieldset class="action">
+        <input type="submit" name="renew_checked" value="Renew or Return checked items" />
+        <input type="submit" id="renew_all" name="renew_all" value="Renew all" />
+        </fieldset>
+    [% ELSE %]<p>Patron has nothing checked out.</p>[% END %]
+</form>
 	</div>
 
 </div>
diff --git a/koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif b/koha-tmpl/intranet-tmpl/prog/img/more-right-arrow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1729fafa7cb9d8d01a37a4dc55558255f3619549
GIT binary patch
literal 81
zcmZ?wbhEHb<YwSyXkcV8PMi7v|9{1Qg3d*$i6yBi3gww484B*6z5xu1KUo+V7#JCJ
i7=QqzoPkNWr+?*X*#`|Nn^tuRww=^_*W%5{U=0A}+!)vZ

literal 0
HcmV?d00001

diff --git a/members/member.pl b/members/member.pl
index 2be45bc..724c996 100755
--- a/members/member.pl
+++ b/members/member.pl
@@ -115,6 +115,12 @@ if ($results) {
 	}
     $count = scalar(@$results);
 }
+
+if($count == 1){
+    print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=" . @$results[0]->{borrowernumber});
+    exit;
+}
+
 my @resultsdata;
 $to=($count>$to?$to:$count);
 my $index=$from;
diff --git a/members/moremember.pl b/members/moremember.pl
index b766f2f..e8e1d1c 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -146,7 +146,6 @@ foreach (qw(dateenrolled dateexpiry dateofbirth)) {
 		$data->{$_} = $userdate || '';
 		$template->param( $_ => $userdate );
 }
-$data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' );
 
 for (qw(debarred gonenoaddress lost borrowernotes)) {
 	 $data->{$_} and $template->param(flagged => 1) and last;
@@ -427,7 +426,8 @@ $template->param( picture => 1 ) if $picture;
 
 my $branch=C4::Context->userenv->{'branch'};
 
-$template->param(%$data);
+SetMemberInfosInTemplate($borrowernumber, $template);
+
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
     $template->param(ExtendedPatronAttributes => 1);
-- 
1.7.4.1



More information about the Koha-patches mailing list