bug 3464: Takes columns country and B_country of table borrowers into account in...
authorSébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
Sun, 2 Aug 2009 05:50:08 +0000 (07:50 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Sun, 23 Aug 2009 22:19:20 +0000 (18:19 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
21 files changed:
C4/Members.pm
circ/circulation.pl
circ/ysearch.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
labels/pcard-member-search.pl
members/boraccount.pl
members/guarantor_search.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/member.pl
members/memberentry.pl
members/moremember.pl
members/pay.pl
members/readingrec.pl
misc/cronjobs/overdue_notices.pl
tools/import_borrowers.pl

index b2ce916..d82e5e4 100644 (file)
@@ -677,6 +677,7 @@ sub AddMember {
       . ",address="     . $dbh->quote( $data{'address'} )
       . ",address2="    . $dbh->quote( $data{'address2'} )
       . ",zipcode="     . $dbh->quote( $data{'zipcode'} )
+      . ",country="     . $dbh->quote( $data{'country'} )
       . ",city="        . $dbh->quote( $data{'city'} )
       . ",phone="       . $dbh->quote( $data{'phone'} )
       . ",email="       . $dbh->quote( $data{'email'} )
@@ -694,6 +695,7 @@ sub AddMember {
       . ",contactnote=" . $dbh->quote( $data{'contactnote'} )
       . ",B_address="   . $dbh->quote( $data{'B_address'} )
       . ",B_zipcode="   . $dbh->quote( $data{'B_zipcode'} )
+      . ",B_country="   . $dbh->quote( $data{'B_country'} )
       . ",B_city="      . $dbh->quote( $data{'B_city'} )
       . ",B_phone="     . $dbh->quote( $data{'B_phone'} )
       . ",B_email="     . $dbh->quote( $data{'B_email'} )
index 8dfdff0..6d79124 100755 (executable)
@@ -667,6 +667,7 @@ $template->param(
     borrowernotes     => $borrower->{'borrowernotes'},
     city              => $borrower->{'city'},
     zipcode              => $borrower->{'zipcode'},
+    country              => $borrower->{'country'},
     phone             => $borrower->{'phone'} || $borrower->{'mobile'},
     cardnumber        => $borrower->{'cardnumber'},
     amountold         => $amountold,
index 136ca76..c7a9b67 100755 (executable)
@@ -41,7 +41,7 @@ if ($auth_status ne "ok") {
 }
 
 my $dbh = C4::Context->dbh;
-my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode 
+my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country 
              FROM borrowers 
              WHERE surname LIKE ?
              OR firstname LIKE ?
@@ -55,6 +55,7 @@ while ( my $rec = $sth->fetchrow_hashref ) {
           $rec->{cardnumber} . "\t" .
           $rec->{address} . "\t" .
           $rec->{city} . "\t" .
-          $rec->{zip} .
+          $rec->{zip} . "\t" .
+          $rec->{country} .
           "\n";
 }
index 6c88037..67e7b39 100644 (file)
@@ -23,6 +23,7 @@
     <!-- TMPL_IF NAME="city" -->
             <!-- TMPL_VAR NAME="city" -->
            <!-- TMPL_VAR NAME="zipcode" -->
+           <!-- TMPL_IF NAME="country" -->, <!-- TMPL_VAR NAME="country" --><!-- /TMPL_IF -->
     <!-- TMPL_ELSE -->
         <span class="empty">No city stored.</span>
     <!-- /TMPL_IF --></li>
index ef2c0e1..5576350 100644 (file)
@@ -7,7 +7,7 @@
                        <ul>
                                <li>Format your file with the following fields
                                <ul>
-                                       <li>'cardnumber',    'surname',      'firstname',        'title',     'othernames',    'initials',     'streetnumber',     'streettype',     'address',       'address2',     'city',             'zipcode',     'email',         'phone',        'mobile',           'fax',     'emailpro',      'phonepro',     'B_streetnumber',   'B_streettype',     'B_address',     'B_city',       'B_zipcode',        'B_email',     'B_phone',       'dateofbirth',  'branchcode',       'categorycode',     'dateenrolled',  'dateexpiry',   'gonenoaddress',    'lost',     'debarred',      'contactname',  'contactfirstname', 'contacttitle',     'borrowernotes', 'relationship', 'ethnicity',        'ethnotes',     'sex',           'userid',       'opacnote',         'contactnote',     'password',      'sort1',        'sort2'
+                                       <li>'cardnumber',    'surname',      'firstname',        'title',     'othernames',    'initials',     'streetnumber',     'streettype',     'address',       'address2',     'city',             'zipcode',     'country',     'email',         'phone',        'mobile',           'fax',     'emailpro',      'phonepro',     'B_streetnumber',   'B_streettype',     'B_address',     'B_city',       'B_zipcode',        'B_country',        'B_email',     'B_phone',       'dateofbirth',  'branchcode',       'categorycode',     'dateenrolled',  'dateexpiry',   'gonenoaddress',    'lost',     'debarred',      'contactname',  'contactfirstname', 'contacttitle',     'borrowernotes', 'relationship', 'ethnicity',        'ethnotes',     'sex',           'userid',       'opacnote',         'contactnote',     'password',      'sort1',        'sort2'
                                        <ul>
                                                <li>
                                            <span style="background-color: #ffe599">
index 0873983..96b29ac 100644 (file)
@@ -75,7 +75,7 @@
     <!-- /TMPL_UNLESS -->
     <!-- /TMPL_IF -->
     <td><!-- TMPL_VAR NAME="cardnumber" --></td>
-    <td style="white-space: nowrap;"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></a> <br /> <!-- TMPL_VAR NAME="address" --><!-- TMPL_IF NAME="address2" --><br /><!-- TMPL_VAR NAME="address2" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="city" --><br /><!-- TMPL_VAR NAME=city --><!-- /TMPL_IF --><!-- TMPL_IF NAME="zipcode" -->  <!-- TMPL_VAR NAME="zipcode" --><!-- /TMPL_IF --></td>
+    <td style="white-space: nowrap;"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></a> <br /> <!-- TMPL_VAR NAME="address" --><!-- TMPL_IF NAME="address2" --><br /><!-- TMPL_VAR NAME="address2" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="city" --><br /><!-- TMPL_VAR NAME=city --><!-- /TMPL_IF --><!-- TMPL_IF NAME="zipcode" -->  <!-- TMPL_VAR NAME="zipcode" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="country" -->, <!-- TMPL_VAR NAME="country" --><!-- /TMPL_IF --></td>
     <td><!-- TMPL_VAR NAME="category_description" --> (<!-- TMPL_VAR name="category_type" -->)</td>
     <td><!-- TMPL_VAR NAME="branchcode" --></td>
     <td><!-- TMPL_VAR NAME="dateexpiry" --></td>
index f0b90a5..830b076 100644 (file)
       <input type="text" name="zipcode" id="zipcode" size="10" value="<!-- TMPL_VAR NAME="zipcode" -->" />
          <!-- TMPL_IF NAME="mandatoryzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
+    <li>
+      <label for="country">Country: </label>
+      <input type="text" name="country" id="country" value="<!-- TMPL_VAR NAME="country" -->" />
+    </li>
   
        </ol>
     </fieldset>
                                <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="<!-- TMPL_VAR NAME="B_zipcode" -->" />
          <!-- TMPL_IF NAME="mandatoryB_zipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
+           <li>
+               <label for="B_country">Country: </label>
+               <input type="text" name="B_country" id="B_country" value="<!-- TMPL_VAR NAME="B_country" -->" />
+           </li>
             <li>
                 <!-- TMPL_IF NAME="mandatoryB_phone" -->
                 <label for="B_phone" class="required">
index 1ff5cf1..b269a5c 100755 (executable)
@@ -113,6 +113,7 @@ for (my $i=($startfrom-1)*$resultsperpage; $i < $to; $i++){
        address2 => $results->[$i]{'address2'},
     city => $results->[$i]{'city'},
        zipcode => $results->[$i]{'zipcode'},
+       country => $results->[$i]{'country'},
     branchcode => $results->[$i]{'branchcode'},
     overdues => $od,
     issues => $issue,
index 6c7fe48..cfe40c1 100755 (executable)
@@ -123,6 +123,7 @@ $template->param(
     address2            => $data->{'address2'},
     city                => $data->{'city'},
     zipcode             => $data->{'zipcode'},
+    country             => $data->{'country'},
     phone               => $data->{'phone'},
     email               => $data->{'email'},
     branchcode          => $data->{'branchcode'},
index 881df94..4224da8 100755 (executable)
@@ -83,6 +83,7 @@ if ($member ne ''){
                address => $results->[$i]{'address'},
                city => $results->[$i]{'city'},
                zipcode => $results->[$i]{'zipcode'},
+               country => $results->[$i]{'country'},
                branchcode => $results->[$i]{'branchcode'},
                guarantorinfo =>$guarantorinfo,
                #op
index 5a7ec1d..c2b49bd 100755 (executable)
@@ -81,6 +81,7 @@ if ($add){
                    address2 => $data->{'address2'},
                    city => $data->{'city'},
                    zipcode => $data->{'zipcode'},
+                   country => $data->{'country'},
                    phone => $data->{'phone'},
                    email => $data->{'email'},
                    branchcode => $data->{'branchcode'},
index 4ad2067..a0b0832 100755 (executable)
@@ -98,6 +98,7 @@ if ($add){
                address2 => $data->{'address2'},
                city => $data->{'city'},
                zipcode => $data->{'zipcode'},
+               country => $data->{'country'},
                phone => $data->{'phone'},
                email => $data->{'email'},
                branchcode => $data->{'branchcode'},
index d2eea2f..b71d704 100755 (executable)
@@ -177,6 +177,7 @@ $template->param(
                address2 => $bor->{'address2'},
                city => $bor->{'city'},
                zipcode => $bor->{'zipcode'},
+               country => $bor->{'country'},
                phone => $bor->{'phone'},
                email => $bor->{'email'},
                branchcode => $bor->{'branchcode'},
index f18db80..696a436 100755 (executable)
@@ -100,6 +100,7 @@ $template->param( picture => 1 ) if $picture;
            address2 => $bor->{'address2'},
            city => $bor->{'city'},
            zipcode => $bor->{'zipcode'},
+           country => $bor->{'country'},
            phone => $bor->{'phone'},
            email => $bor->{'email'},
            branchcode => $bor->{'branchcode'},
index b43b30b..fcc6ee1 100755 (executable)
@@ -109,6 +109,7 @@ for (my $i=($startfrom-1)*$resultsperpage; $i < $to; $i++){
        address2 => $results->[$i]{'address2'},
     city => $results->[$i]{'city'},
        zipcode => $results->[$i]{'zipcode'},
+       country => $results->[$i]{'country'},
     branchcode => $results->[$i]{'branchcode'},
     overdues => $od,
     issues => $issue,
index c259dfd..c7beb7f 100755 (executable)
@@ -210,18 +210,19 @@ if ( defined($guarantorid) and
             $newdata{'contactname'}     = $guarantordata->{'surname'};
             $newdata{'contacttitle'}    = $guarantordata->{'title'};
                foreach (qw(streetnumber address streettype address2
-                        zipcode city phone phonepro mobile fax email emailpro branchcode)) {
+                        zipcode country city phone phonepro mobile fax email emailpro branchcode)) {
                        $newdata{$_} = $guarantordata->{$_};
                }
         }
     }
 }
 
-###############test to take the right zipcode and city name ##############
+###############test to take the right zipcode, country and city name ##############
 if (!defined($guarantorid) or $guarantorid eq '' or $guarantorid eq '0') {
     # set only if parameter was passed from the form
     $newdata{'city'}    = $input->param('city')    if defined($input->param('city'));
     $newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
+    $newdata{'country'} = $input->param('counry') if defined($input->param('country'));
 }
 
 #builds default userid
index d5040b6..67446d8 100755 (executable)
@@ -139,7 +139,7 @@ my $catcode;
 if ( $category_type eq 'C') {
        if ($data->{'guarantorid'} ne '0' ) {
        my $data2 = GetMember( $data->{'guarantorid'} ,'borrowernumber');
-       foreach (qw(address city B_address B_city phone mobile zipcode)) {
+       foreach (qw(address city B_address B_city phone mobile zipcode country B_country)) {
            $data->{$_} = $data2->{$_};
        }
    }
index 8b40369..f19f5b8 100755 (executable)
@@ -155,6 +155,7 @@ $template->param( picture => 1 ) if $picture;
        address2 => $data->{'address2'},
        city => $data->{'city'},
        zipcode => $data->{'zipcode'},
+       country => $data->{'country'},
        phone => $data->{'phone'},
        email => $data->{'email'},
        branchcode => $data->{'branchcode'},
index 6107ef4..7ffdfee 100755 (executable)
@@ -109,6 +109,7 @@ $template->param(
                                                address2 => $data->{'address2'},
                                            city => $data->{'city'},
                                                zipcode => $data->{'zipcode'},
+                                               country => $data->{'country'},
                                                phone => $data->{'phone'},
                                                email => $data->{'email'},
                                                branchcode => $data->{'branchcode'},
index 23ce459..831cdfc 100755 (executable)
@@ -290,7 +290,7 @@ if ( defined $csvfilename ) {
     } else {
         open $csv_fh, ">", $csvfilename or die "unable to open $csvfilename: $!";
     }
-    if ( $csv->combine(qw(name surname address1 address2 zipcode city email itemcount itemsinfo)) ) {
+    if ( $csv->combine(qw(name surname address1 address2 zipcode city country email itemcount itemsinfo)) ) {
         print $csv_fh $csv->string, "\n";
     } else {
         $verbose and warn 'combine failed on argument: ' . $csv->error_input;
@@ -340,7 +340,7 @@ END_SQL
             # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
 
             my $borrower_sql = <<'END_SQL';
-SELECT COUNT(*), issues.borrowernumber, firstname, surname, address, address2, city, zipcode, email, MIN(date_due) as longest_issue
+SELECT COUNT(*), issues.borrowernumber, firstname, surname, address, address2, city, zipcode, country, email, MIN(date_due) as longest_issue
 FROM   issues,borrowers,categories
 WHERE  issues.borrowernumber=borrowers.borrowernumber
 AND    borrowers.categorycode=categories.categorycode
index f987fa3..ebbff4f 100755 (executable)
@@ -22,9 +22,9 @@
 # File format
 #
 # cardnumber,surname,firstname,title,othernames,initials,streetnumber,streettype,
-# address line , address line 2, city, zipcode, email, phone, mobile, fax, work email, work phone,
+# address line , address line 2, city, zipcode, contry, email, phone, mobile, fax, work email, work phone,
 # alternate streetnumber, alternate streettype, alternate address line 1, alternate city,
-# alternate zipcode, alternate email, alternate phone, date of birth, branchcode,
+# alternate zipcode, alternate country, alternate email, alternate phone, date of birth, branchcode,
 # categorycode, enrollment date, expiry date, noaddress, lost, debarred, contact surname,
 # contact firstname, contact title, borrower notes, contact relationship, ethnicity, ethnicity notes
 # gender, username, opac note, contact note, password, sort one, sort two