From e6e4395553a96e748f9560c1253360dc79b447cc Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 16 Oct 2007 16:02:31 -0500 Subject: [PATCH] patches for members and resultlists. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit -- Henri Damien LAURENT et Paul POULAIN Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) >From 616f0a385848b9a1fee7c76ff7b1f3be090ccb66 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 16 Oct 2007 15:20:45 +0200 Subject: [PATCH] Bug Fixing : userid was blanked out in partial edit. Adding some checks on branch presence for independant branches Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Members.pm | 3 --- C4/Search.pm | 9 ++++++++- .../prog/en/modules/catalogue/results.tmpl | 20 +++++++++++-------- koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl | 2 +- members/memberentry.pl | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index dd158d03fa..f426da4426 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -591,8 +591,6 @@ sub ModMember { $data{'dateofbirth'} = format_date_in_iso( $data{'dateofbirth'} ) if ($data{'dateofbirth'} ); $data{'dateexpiry'} = format_date_in_iso( $data{'dateexpiry'} ) if ($data{'dateexpiry'} ); $data{'dateenrolled'} = format_date_in_iso( $data{'dateenrolled'} ) if ($data{'dateenrolled'} ); -# warn Data::Dumper::Dumper(%data); - # warn "num user".$data{'borrowernumber'}; my $qborrower=$dbh->prepare("SHOW columns from borrowers"); $qborrower->execute; my %hashborrowerfields; @@ -601,7 +599,6 @@ sub ModMember { } my $query; my $sth; - $data{'userid'} = '' if ( $data{'password'} eq '' ); my @parameters; # test to know if u must update or not the borrower password diff --git a/C4/Search.pm b/C4/Search.pm index 3f07e2030e..49bc72a592 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -972,9 +972,13 @@ sub searchResults { $norequests = 1; if ( $item->{wthdrawn} ) { $wthdrawn_count++; + $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1; + $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{wthdrawn}=1; } elsif ( $item->{itemlost} ) { $itemlost_count++; + $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1; + $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{itemlost}=1; } unless ( $item->{notforloan}) { # OK, this one can be issued, so at least one can be reserved @@ -982,6 +986,7 @@ sub searchResults { } if ( ( $item->{onloan} ) && ( $item->{onloan} != '0000-00-00' ) ) { + $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{unavailable}=1; $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{onloancount} = 1; $items->{ $item->{'homebranch'}.'--'.$item->{'itemcallnumber'} }->{due_date} = $item->{due_date}; $onloan_count++; @@ -1009,8 +1014,10 @@ sub searchResults { count => $items->{$key}->{count}==1 ?"":$items->{$key}->{count}, itemcallnumber => $items->{$key}->{itemcallnumber}, location => $items->{$key}->{location}, - onloancount => $items->{$key}->{onloancount}, + onloancount => $items->{$key}->{onloancount}, due_date => $items->{$key}->{due_date}, + wthdrawn => $items->{$key}->{wthdrawn}, + lost => $items->{$key}->{itemlost}, }; push @items_loop, $this_item; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index 91a30ad7b4..525acedf7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -326,8 +326,14 @@ - + + + + + + + @@ -338,16 +344,14 @@ + , On loan until + , Withdrawn + , Lost + , On order ()
-
+ - - On loan (),
- Withdrawn (),
- Lost ()
- On order () -
diff --git a/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl index 9748cedc01..3bfa0fe85d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/opac-results.tmpl @@ -307,7 +307,7 @@ Error : -
+ "> diff --git a/members/memberentry.pl b/members/memberentry.pl index d87ffa46b3..72e0281296 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -143,7 +143,7 @@ if ( $guarantorid eq ''){ } } #builds default userid -if ( ($newdata{'userid'} eq '')){ +if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){ my $onefirstnameletter=substr($data{'firstname'},0,1); my $fivesurnameletter=substr($data{'surname'},0,9); $newdata{'userid'}=lc($onefirstnameletter.$fivesurnameletter); -- 2.39.5