Fix for bug 1666
authorChris Cormack <crc@liblime.com>
Thu, 27 Dec 2007 19:52:03 +0000 (13:52 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 27 Dec 2007 23:21:35 +0000 (17:21 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Members.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
members/memberentry.pl

index 9c60562..2843d51 100644 (file)
@@ -1505,7 +1505,8 @@ sub GetCities {
 #test to know if the table contain some records if no the function return nothing
     my $id = @id;
     $sth->finish;
-    if ( $id eq 0 ) {
+    if ( $id == 1 ) {
+               # all we have is the one blank row
         return ();
     }
     else {
@@ -1689,8 +1690,14 @@ Looks up the different title . Returns array  with all borrowers title
 sub GetTitles {
     my @borrowerTitle = split /,|\|/,C4::Context->preference('BorrowersTitles');
     unshift( @borrowerTitle, "" );
-    return ( \@borrowerTitle);
-    }
+       my $count=@borrowerTitle;
+       if ($count == 1){
+               return ();
+       }
+       else {
+               return ( \@borrowerTitle);
+       }
+}
 
 
 
index 758e85d..2d5630c 100644 (file)
@@ -130,6 +130,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
                <legend><!--TMPL_IF Name="I"-->Organisation <!--TMPL_ELSE-->Patron <!--/TMPL_IF-->identity</legend>
                <ol>
                <!-- TMPL_UNLESS name="I" -->
+               <!-- TMPL_IF NAME="title_cgipopup" -->
             <li>
             <!-- TMPL_IF NAME="mandatorytitle" -->
                 <label for="btitle" class="required">
@@ -140,6 +141,7 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
             <!-- TMPL_VAR NAME="borrotitlepopup" -->
             <!-- TMPL_IF NAME="mandatorytitle" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
+               <!-- /TMPL_IF -->
         <!-- /TMPL_UNLESS -->
                <li>
                <!-- TMPL_IF NAME="mandatorysurname" -->
index a9a593c..c2ac533 100755 (executable)
@@ -322,6 +322,9 @@ if ($select_city eq '' ){
 }
 my($cityid);
 ($cityid,$name_city)=GetCities();
+if ($cityid) {
+       warn "hey hey waht the?";
+       }
 $template->param( city_cgipopup => 1) if ($cityid );
 my $citypopup = CGI::popup_menu(-name=>'select_city',
         -id => 'select_city',
@@ -345,6 +348,7 @@ my $roadpopup = CGI::popup_menu(-name=>'streettype',
 my $default_borrowertitle;
 $default_borrowertitle=$data{'title'} ;
 my($borrowertitle)=GetTitles();
+$template->param( title_cgipopup => 1) if ($borrowertitle);
 my $borrotitlepopup = CGI::popup_menu(-name=>'title',
         -id => 'btitle',
         -values=>$borrowertitle,