[Koha-patches] [PATCH] [SIGNED-OFF 2/7] Bug 5422: Separate state field for patron's addresses

Magnus Enger magnus at enger.priv.no
Thu Apr 7 11:41:31 CEST 2011


From: Katrin Fischer <Katrin.Fischer.83 at web.de>


Signed-off-by: Magnus Enger <magnus at enger.priv.no>
---
 C4/Auth_with_ldap.pm                               |  127 ++++++++++--------
 C4/SIP/ILS/Patron.pm                               |  137 ++++++++++----------
 .../en/modules/help/tools/import_borrowers.tmpl    |    4 +-
 .../prog/en/modules/members/memberentrygen.tmpl    |   38 +++++-
 .../prog/en/modules/members/moremember.tmpl        |    9 +-
 .../opac-tmpl/prog/en/modules/opac-userupdate.tmpl |   12 +-
 members/moremember.pl                              |    2 +-
 opac/opac-userupdate.pl                            |    2 +-
 8 files changed, 194 insertions(+), 137 deletions(-)

diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm
index b25697c..acbd923 100644
--- a/C4/Auth_with_ldap.pm
+++ b/C4/Auth_with_ldap.pm
@@ -308,62 +308,77 @@ C4::Auth - Authenticates Koha users
 	What are the required fields?  Well, in mysql you can check the database table "borrowers" like this:
 
 	mysql> show COLUMNS from borrowers;
-		+------------------+--------------+------+-----+---------+----------------+
-		| Field            | Type         | Null | Key | Default | Extra          |
-		+------------------+--------------+------+-----+---------+----------------+
-		| borrowernumber   | int(11)      | NO   | PRI | NULL    | auto_increment | 
-		| cardnumber       | varchar(16)  | YES  | UNI | NULL    |                | 
-		| surname          | mediumtext   | NO   |     |         |                | 
-		| firstname        | text         | YES  |     | NULL    |                | 
-		| title            | mediumtext   | YES  |     | NULL    |                | 
-		| othernames       | mediumtext   | YES  |     | NULL    |                | 
-		| initials         | text         | YES  |     | NULL    |                | 
-		| streetnumber     | varchar(10)  | YES  |     | NULL    |                | 
-		| streettype       | varchar(50)  | YES  |     | NULL    |                | 
-		| address          | mediumtext   | NO   |     |         |                | 
-		| address2         | text         | YES  |     | NULL    |                | 
-		| city             | mediumtext   | NO   |     |         |                | 
-		| zipcode          | varchar(25)  | YES  |     | NULL    |                | 
-		| email            | mediumtext   | YES  |     | NULL    |                | 
-		| phone            | text         | YES  |     | NULL    |                | 
-		| mobile           | varchar(50)  | YES  |     | NULL    |                | 
-		| fax              | mediumtext   | YES  |     | NULL    |                | 
-		| emailpro         | text         | YES  |     | NULL    |                | 
-		| phonepro         | text         | YES  |     | NULL    |                | 
-		| B_streetnumber   | varchar(10)  | YES  |     | NULL    |                | 
-		| B_streettype     | varchar(50)  | YES  |     | NULL    |                | 
-		| B_address        | varchar(100) | YES  |     | NULL    |                | 
-		| B_city           | mediumtext   | YES  |     | NULL    |                | 
-		| B_zipcode        | varchar(25)  | YES  |     | NULL    |                | 
-		| B_email          | text         | YES  |     | NULL    |                | 
-		| B_phone          | mediumtext   | YES  |     | NULL    |                | 
-		| dateofbirth      | date         | YES  |     | NULL    |                | 
-		| branchcode       | varchar(10)  | NO   | MUL |         |                | 
-		| categorycode     | varchar(10)  | NO   | MUL |         |                | 
-		| dateenrolled     | date         | YES  |     | NULL    |                | 
-		| dateexpiry       | date         | YES  |     | NULL    |                | 
-		| gonenoaddress    | tinyint(1)   | YES  |     | NULL    |                | 
-		| lost             | tinyint(1)   | YES  |     | NULL    |                | 
-		| debarred         | tinyint(1)   | YES  |     | NULL    |                | 
-		| contactname      | mediumtext   | YES  |     | NULL    |                | 
-		| contactfirstname | text         | YES  |     | NULL    |                | 
-		| contacttitle     | text         | YES  |     | NULL    |                | 
-		| guarantorid      | int(11)      | YES  |     | NULL    |                | 
-		| borrowernotes    | mediumtext   | YES  |     | NULL    |                | 
-		| relationship     | varchar(100) | YES  |     | NULL    |                | 
-		| ethnicity        | varchar(50)  | YES  |     | NULL    |                | 
-		| ethnotes         | varchar(255) | YES  |     | NULL    |                | 
-		| sex              | varchar(1)   | YES  |     | NULL    |                | 
-		| password         | varchar(30)  | YES  |     | NULL    |                | 
-		| flags            | int(11)      | YES  |     | NULL    |                | 
-		| userid           | varchar(30)  | YES  | MUL | NULL    |                |  # UNIQUE in next release.
-		| opacnote         | mediumtext   | YES  |     | NULL    |                | 
-		| contactnote      | varchar(255) | YES  |     | NULL    |                | 
-		| sort1            | varchar(80)  | YES  |     | NULL    |                | 
-		| sort2            | varchar(80)  | YES  |     | NULL    |                | 
-		+------------------+--------------+------+-----+---------+----------------+
-		50 rows in set (0.01 sec)
-	
+		+---------------------+--------------+------+-----+---------+----------------+
+		| Field               | Type         | Null | Key | Default | Extra          |
+		+---------------------+--------------+------+-----+---------+----------------+
+		| borrowernumber      | int(11)      | NO   | PRI | NULL    | auto_increment |
+		| cardnumber          | varchar(16)  | YES  | UNI | NULL    |                |
+		| surname             | mediumtext   | NO   |     | NULL    |                |
+		| firstname           | text         | YES  |     | NULL    |                |
+		| title               | mediumtext   | YES  |     | NULL    |                |
+		| othernames          | mediumtext   | YES  |     | NULL    |                |
+		| initials            | text         | YES  |     | NULL    |                |
+		| streetnumber        | varchar(10)  | YES  |     | NULL    |                |
+		| streettype          | varchar(50)  | YES  |     | NULL    |                |
+		| address             | mediumtext   | NO   |     | NULL    |                |
+		| address2            | text         | YES  |     | NULL    |                |
+		| city                | mediumtext   | NO   |     | NULL    |                |
+		| state               | mediumtext   | YES  |     | NULL    |                |
+		| zipcode             | varchar(25)  | YES  |     | NULL    |                |
+		| country             | text         | YES  |     | NULL    |                |
+		| email               | mediumtext   | YES  |     | NULL    |                |
+		| phone               | text         | YES  |     | NULL    |                |
+		| mobile              | varchar(50)  | YES  |     | NULL    |                |
+		| fax                 | mediumtext   | YES  |     | NULL    |                |
+		| emailpro            | text         | YES  |     | NULL    |                |
+		| phonepro            | text         | YES  |     | NULL    |                |
+		| B_streetnumber      | varchar(10)  | YES  |     | NULL    |                |
+		| B_streettype        | varchar(50)  | YES  |     | NULL    |                |
+		| B_address           | varchar(100) | YES  |     | NULL    |                |
+		| B_address2          | text         | YES  |     | NULL    |                |
+		| B_city              | mediumtext   | YES  |     | NULL    |                |
+		| B_state             | mediumtext   | YES  |     | NULL    |                |
+		| B_zipcode           | varchar(25)  | YES  |     | NULL    |                |
+		| B_country           | text         | YES  |     | NULL    |                |
+		| B_email             | text         | YES  |     | NULL    |                |
+		| B_phone             | mediumtext   | YES  |     | NULL    |                |
+		| dateofbirth         | date         | YES  |     | NULL    |                |
+		| branchcode          | varchar(10)  | NO   | MUL |         |                |
+		| categorycode        | varchar(10)  | NO   | MUL |         |                |
+		| dateenrolled        | date         | YES  |     | NULL    |                |
+		| dateexpiry          | date         | YES  |     | NULL    |                |
+		| gonenoaddress       | tinyint(1)   | YES  |     | NULL    |                |
+		| lost                | tinyint(1)   | YES  |     | NULL    |                |
+		| debarred            | tinyint(1)   | YES  |     | NULL    |                |
+		| contactname         | mediumtext   | YES  |     | NULL    |                |
+		| contactfirstname    | text         | YES  |     | NULL    |                |
+		| contacttitle        | text         | YES  |     | NULL    |                |
+		| guarantorid         | int(11)      | YES  | MUL | NULL    |                |
+		| borrowernotes       | mediumtext   | YES  |     | NULL    |                |
+		| relationship        | varchar(100) | YES  |     | NULL    |                |
+		| ethnicity           | varchar(50)  | YES  |     | NULL    |                |
+		| ethnotes            | varchar(255) | YES  |     | NULL    |                |
+		| sex                 | varchar(1)   | YES  |     | NULL    |                |
+		| password            | varchar(30)  | YES  |     | NULL    |                |
+		| flags               | int(11)      | YES  |     | NULL    |                |
+		| userid              | varchar(30)  | YES  | MUL | NULL    |                |
+		| opacnote            | mediumtext   | YES  |     | NULL    |                |
+		| contactnote         | varchar(255) | YES  |     | NULL    |                |
+		| sort1               | varchar(80)  | YES  |     | NULL    |                |
+		| sort2               | varchar(80)  | YES  |     | NULL    |                |
+		| altcontactfirstname | varchar(255) | YES  |     | NULL    |                |
+		| altcontactsurname   | varchar(255) | YES  |     | NULL    |                |
+		| altcontactaddress1  | varchar(255) | YES  |     | NULL    |                |
+		| altcontactaddress2  | varchar(255) | YES  |     | NULL    |                |
+		| altcontactaddress3  | varchar(255) | YES  |     | NULL    |                |
+		| altcontactstate     | mediumtext   | YES  |     | NULL    |                |
+		| altcontactzipcode   | varchar(50)  | YES  |     | NULL    |                |
+		| altcontactcountry   | text         | YES  |     | NULL    |                |
+		| altcontactphone     | varchar(50)  | YES  |     | NULL    |                |
+		| smsalertnumber      | varchar(50)  | YES  |     | NULL    |                |
+		| privacy             | int(11)      | NO   |     | 1       |                |
+		+---------------------+--------------+------+-----+---------+----------------+
+		66 rows in set (0.00 sec)
 		Where Null="NO", the field is required.
 
 =head1 KOHA_CONF and field mapping
diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm
index 3f4e136..2b0b443 100644
--- a/C4/SIP/ILS/Patron.pm
+++ b/C4/SIP/ILS/Patron.pm
@@ -389,72 +389,77 @@ __END__
   );
 
  From borrowers table:
- +---------------------+--------------+------+-----+
- | Field               | Type         | Null | Key |
- +---------------------+--------------+------+-----+
- | borrowernumber      | int(11)      | NO   | PRI |
- | cardnumber          | varchar(16)  | YES  | UNI |
- | surname             | mediumtext   | NO   |     |
- | firstname           | text         | YES  |     |
- | title               | mediumtext   | YES  |     |
- | othernames          | mediumtext   | YES  |     |
- | initials            | text         | YES  |     |
- | streetnumber        | varchar(10)  | YES  |     |
- | streettype          | varchar(50)  | YES  |     |
- | address             | mediumtext   | NO   |     |
- | address2            | text         | YES  |     |
- | city                | mediumtext   | NO   |     |
- | zipcode             | varchar(25)  | YES  |     |
- | country             | text         | YES  |     |
- | email               | mediumtext   | YES  |     |
- | phone               | text         | YES  |     |
- | mobile              | varchar(50)  | YES  |     |
- | fax                 | mediumtext   | YES  |     |
- | emailpro            | text         | YES  |     |
- | phonepro            | text         | YES  |     |
- | B_streetnumber      | varchar(10)  | YES  |     |
- | B_streettype        | varchar(50)  | YES  |     |
- | B_address           | varchar(100) | YES  |     |
- | B_address2          | text         | YES  |     |
- | B_city              | mediumtext   | YES  |     |
- | B_zipcode           | varchar(25)  | YES  |     |
- | B_country           | text         | YES  |     |
- | B_email             | text         | YES  |     |
- | B_phone             | mediumtext   | YES  |     |
- | dateofbirth         | date         | YES  |     |
- | branchcode          | varchar(10)  | NO   | MUL |
- | categorycode        | varchar(10)  | NO   | MUL |
- | dateenrolled        | date         | YES  |     |
- | dateexpiry          | date         | YES  |     |
- | gonenoaddress       | tinyint(1)   | YES  |     |
- | lost                | tinyint(1)   | YES  |     |
- | debarred            | tinyint(1)   | YES  |     |
- | contactname         | mediumtext   | YES  |     |
- | contactfirstname    | text         | YES  |     |
- | contacttitle        | text         | YES  |     |
- | guarantorid         | int(11)      | YES  |     |
- | borrowernotes       | mediumtext   | YES  |     |
- | relationship        | varchar(100) | YES  |     |
- | ethnicity           | varchar(50)  | YES  |     |
- | ethnotes            | varchar(255) | YES  |     |
- | sex                 | varchar(1)   | YES  |     |
- | password            | varchar(30)  | YES  |     |
- | flags               | int(11)      | YES  |     |
- | userid              | varchar(30)  | YES  | MUL |
- | opacnote            | mediumtext   | YES  |     |
- | contactnote         | varchar(255) | YES  |     |
- | sort1               | varchar(80)  | YES  |     |
- | sort2               | varchar(80)  | YES  |     |
- | altcontactfirstname | varchar(255) | YES  |     |
- | altcontactsurname   | varchar(255) | YES  |     |
- | altcontactaddress1  | varchar(255) | YES  |     |
- | altcontactaddress2  | varchar(255) | YES  |     |
- | altcontactaddress3  | varchar(255) | YES  |     |
- | altcontactzipcode   | varchar(50)  | YES  |     |
- | altcontactcountry   | text         | YES  |     |
- | altcontactphone     | varchar(50)  | YES  |     |
- | smsalertnumber      | varchar(50)  | YES  |     |
- +---------------------+--------------+------+-----+
++---------------------+--------------+------+-----+---------+----------------+
+| Field               | Type         | Null | Key | Default | Extra          |
++---------------------+--------------+------+-----+---------+----------------+
+| borrowernumber      | int(11)      | NO   | PRI | NULL    | auto_increment |
+| cardnumber          | varchar(16)  | YES  | UNI | NULL    |                |
+| surname             | mediumtext   | NO   |     | NULL    |                |
+| firstname           | text         | YES  |     | NULL    |                |
+| title               | mediumtext   | YES  |     | NULL    |                |
+| othernames          | mediumtext   | YES  |     | NULL    |                |
+| initials            | text         | YES  |     | NULL    |                |
+| streetnumber        | varchar(10)  | YES  |     | NULL    |                |
+| streettype          | varchar(50)  | YES  |     | NULL    |                |
+| address             | mediumtext   | NO   |     | NULL    |                |
+| address2            | text         | YES  |     | NULL    |                |
+| city                | mediumtext   | NO   |     | NULL    |                |
+| state               | mediumtext   | YES  |     | NULL    |                |
+| zipcode             | varchar(25)  | YES  |     | NULL    |                |
+| country             | text         | YES  |     | NULL    |                |
+| email               | mediumtext   | YES  |     | NULL    |                |
+| phone               | text         | YES  |     | NULL    |                |
+| mobile              | varchar(50)  | YES  |     | NULL    |                |
+| fax                 | mediumtext   | YES  |     | NULL    |                |
+| emailpro            | text         | YES  |     | NULL    |                |
+| phonepro            | text         | YES  |     | NULL    |                |
+| B_streetnumber      | varchar(10)  | YES  |     | NULL    |                |
+| B_streettype        | varchar(50)  | YES  |     | NULL    |                |
+| B_address           | varchar(100) | YES  |     | NULL    |                |
+| B_address2          | text         | YES  |     | NULL    |                |
+| B_city              | mediumtext   | YES  |     | NULL    |                |
+| B_state             | mediumtext   | YES  |     | NULL    |                |
+| B_zipcode           | varchar(25)  | YES  |     | NULL    |                |
+| B_country           | text         | YES  |     | NULL    |                |
+| B_email             | text         | YES  |     | NULL    |                |
+| B_phone             | mediumtext   | YES  |     | NULL    |                |
+| dateofbirth         | date         | YES  |     | NULL    |                |
+| branchcode          | varchar(10)  | NO   | MUL |         |                |
+| categorycode        | varchar(10)  | NO   | MUL |         |                |
+| dateenrolled        | date         | YES  |     | NULL    |                |
+| dateexpiry          | date         | YES  |     | NULL    |                |
+| gonenoaddress       | tinyint(1)   | YES  |     | NULL    |                |
+| lost                | tinyint(1)   | YES  |     | NULL    |                |
+| debarred            | tinyint(1)   | YES  |     | NULL    |                |
+| contactname         | mediumtext   | YES  |     | NULL    |                |
+| contactfirstname    | text         | YES  |     | NULL    |                |
+| contacttitle        | text         | YES  |     | NULL    |                |
+| guarantorid         | int(11)      | YES  | MUL | NULL    |                |
+| borrowernotes       | mediumtext   | YES  |     | NULL    |                |
+| relationship        | varchar(100) | YES  |     | NULL    |                |
+| ethnicity           | varchar(50)  | YES  |     | NULL    |                |
+| ethnotes            | varchar(255) | YES  |     | NULL    |                |
+| sex                 | varchar(1)   | YES  |     | NULL    |                |
+| password            | varchar(30)  | YES  |     | NULL    |                |
+| flags               | int(11)      | YES  |     | NULL    |                |
+| userid              | varchar(30)  | YES  | MUL | NULL    |                |
+| opacnote            | mediumtext   | YES  |     | NULL    |                |
+| contactnote         | varchar(255) | YES  |     | NULL    |                |
+| sort1               | varchar(80)  | YES  |     | NULL    |                |
+| sort2               | varchar(80)  | YES  |     | NULL    |                |
+| altcontactfirstname | varchar(255) | YES  |     | NULL    |                |
+| altcontactsurname   | varchar(255) | YES  |     | NULL    |                |
+| altcontactaddress1  | varchar(255) | YES  |     | NULL    |                |
+| altcontactaddress2  | varchar(255) | YES  |     | NULL    |                |
+| altcontactaddress3  | varchar(255) | YES  |     | NULL    |                |
+| altcontactstate     | mediumtext   | YES  |     | NULL    |                |
+| altcontactzipcode   | varchar(50)  | YES  |     | NULL    |                |
+| altcontactcountry   | text         | YES  |     | NULL    |                |
+| altcontactphone     | varchar(50)  | YES  |     | NULL    |                |
+| smsalertnumber      | varchar(50)  | YES  |     | NULL    |                |
+| privacy             | int(11)      | NO   |     | 1       |                |
++---------------------+--------------+------+-----+---------+----------------+
+
 
  From C4::Members
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tmpl
index c0b7f11..a27c8f0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/import_borrowers.tmpl
@@ -7,7 +7,7 @@
 			<ul>
 				<li>Format your file with the following fields
 				<ul>
-					<li>'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_address2', 'B_city', 'B_zipcode', 'B_country', 'B_email', 'B_phone', 'dateofbirth', 'branchcode', 'categorycode', 'dateenrolled', 'dateexpiry', 'gonenoaddress', 'lost', 'debarred', 'contactname', 'contactfirstname', 'contacttitle', 'guarantorid', 'borrowernotes', 'relationship', 'ethnicity', 'ethnotes', 'sex', 'password', 'flags', 'userid', 'opacnote', 'contactnote', 'sort1', 'sort2', 'altcontactfirstname', 'altcontactsurname', 'altcontactaddress1', 'altcontactaddress2', 'altcontactaddress3', 'altcontactzipcode', 'altcontactcountry', 'altcontactphone', 'smsalertnumber', 'patron_attributes'
+					<li>'surname', 'firstname', 'title', 'othernames', 'initials', 'streetnumber', 'streettype', 'address', 'address2', 'city', 'state', 'zipcode', 'country', 'email', 'phone', 'mobile', 'fax', 'emailpro', 'phonepro', 'B_streetnumber', 'B_streettype', 'B_address', 'B_address2', 'B_city', 'B_state', 'B_zipcode', 'B_country', 'B_email', 'B_phone', 'dateofbirth', 'branchcode', 'categorycode', 'dateenrolled', 'dateexpiry', 'gonenoaddress', 'lost', 'debarred', 'contactname', 'contactfirstname', 'contacttitle', 'guarantorid', 'borrowernotes', 'relationship', 'ethnicity', 'ethnotes', 'sex', 'password', 'flags', 'userid', 'opacnote', 'contactnote', 'sort1', 'sort2', 'altcontactfirstname', 'altcontactsurname', 'altcontactaddress1', 'altcontactaddress2', 'altcontactaddress3', 'altcontactstate', 'altcontactzipcode', 'altcontactcountry', 'altcontactphone', 'smsalertnumber', 'patron_attributes'
 					<ul>
 						<li>
 					    <span style="background-color: #ffe599">
@@ -28,4 +28,4 @@ TIP: If your passwords are already encrypted, talk to your systems administrator
 			<li>Click 'Import'</li>
 			<li>You will be brought to a confirmation screen.</li>
 		</ul>
-	</div>	<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
+	</div>	<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
index 4ecc0cb..e47668d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
@@ -403,7 +403,7 @@
       <!--TMPL_ELSE-->
         <label for="city">
       <!-- /TMPL_IF-->
-      City, State: </label>
+      City: </label>
         
         <input type="text" id="city" name="city" size="20" value="<!-- TMPL_VAR NAME="city" -->" />
         <!-- TMPL_IF NAME="city_cgipopup" -->or <strong>choose</strong>
@@ -422,6 +422,16 @@
 	  <!-- TMPL_IF NAME="mandatorycity" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li> 
+      <!-- TMPL_IF NAME="mandatorystate" -->
+        <label for="state" class="required">
+      <!--TMPL_ELSE-->
+        <label for="state">
+      <!-- /TMPL_IF-->
+      State: </label>
+      <input type="text" name="state" id="state" size="20" value="<!-- TMPL_VAR NAME="state" -->" />
+	  <!-- TMPL_IF NAME="mandatorystate" --><span class="required">Required</span><!-- /TMPL_IF -->
+    </li>
+    <li> 
       <!-- TMPL_IF NAME="mandatoryzipcode" -->
         <label for="zipcode" class="required">
       <!--TMPL_ELSE-->
@@ -545,11 +555,21 @@
 				<!--TMPL_ELSE-->
 					<label for="B_city">
 				<!-- /TMPL_IF-->
-				City, State: </label>
+				City: </label>
 				<input type="text" id="B_city" name="B_city" size="20" value="<!-- TMPL_VAR NAME="B_city" -->" />
 	  <!-- TMPL_IF NAME="mandatoryB_city" --><span class="required">Required</span><!-- /TMPL_IF -->
 			</li>
 			<li>
+				<!-- TMPL_IF NAME="mandatoryB_state" -->
+					<label for="B_state" class="required" >
+				<!--TMPL_ELSE-->
+					<label for="B_state">
+				<!-- /TMPL_IF-->
+				State: </label>
+				<input type="text" id="B_state" name="B_state" size="20" value="<!-- TMPL_VAR NAME="B_state" -->" />
+	  <!-- TMPL_IF NAME="mandatoryB_state" --><span class="required">Required</span><!-- /TMPL_IF -->
+			</li>
+			<li>
 				<!-- TMPL_IF NAME="mandatoryB_zipcode" -->
 					<label for="B_zipcode" class="required">
 				<!--TMPL_ELSE-->
@@ -650,11 +670,21 @@
 				<!-- TMPL_ELSE -->
 				<label for="altcontactaddress3">
 				<!-- /TMPL_IF -->
-				City, State:</label>
-				<input type="text" name="altcontactaddress3" id="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="40" />
+				City:</label>
+				<input type="text" name="altcontactaddress3" id="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="20" />
 				<!-- TMPL_IF NAME="mandatoryaltcontactaddress3" --><span class="required">Required</span><!-- /TMPL_IF -->
 			</li>
 			<li>
+			    <!-- TMPL_IF NAME="mandatoryaltcontactstate" -->
+				<label for="altcontactstate" class="required">
+				<!-- TMPL_ELSE -->
+				<label for="altcontactstate">
+				<!-- /TMPL_IF -->
+				State:</label>
+				<input type="text" name="altcontactstate" id="altcontactstate" value="<!-- TMPL_VAR NAME="altcontactstate" -->" size="20" />
+				<!-- TMPL_IF NAME="mandatoryaltcontactstate" --><span class="required">Required</span><!-- /TMPL_IF -->
+			</li>
+			<li>
 			    <!-- TMPL_IF NAME="mandatoryaltcontactzipcode" -->
 				<label for="altcontactzipcode" class="required">
 				<!-- TMPL_ELSE -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
index 030c78a..665c736 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
@@ -174,7 +174,8 @@ function validate1(date) {
         <!-- /TMPL_IF -->
         <!-- TMPL_VAR NAME="address" --><br />
         <!-- TMPL_IF NAME="address2" --><!-- TMPL_VAR NAME="address2"--><br /><!-- /TMPL_IF -->
-    	<!-- TMPL_IF NAME="city" --><!-- TMPL_VAR NAME="city" --><!-- /TMPL_IF -->
+    	<!-- TMPL_IF NAME="city" --><!-- TMPL_VAR NAME="city" --><!-- /TMPL_IF --> 
+    	<!-- TMPL_IF NAME="state" --><!-- TMPL_VAR NAME="state" --><!-- /TMPL_IF -->
     	<!-- TMPL_IF NAME="zipcode" --><!-- TMPL_VAR NAME="zipcode" --><br /><!-- /TMPL_IF -->
 	<!-- TMPL_IF NAME="country" --><!-- TMPL_VAR NAME="country" --><!-- /TMPL_IF --></p>
 		    
@@ -342,7 +343,8 @@ function validate1(date) {
     <!-- TMPL_UNLESS NAME="I"--><!-- TMPL_UNLESS NAME="C"-->
     <div class="rows">  <ol><li><span class="label">Address: </span><!-- TMPL_VAR NAME="B_address" --></li>
       <li><span class="label">Address 2: </span><!-- TMPL_VAR NAME="B_address2" --></li>
-      <li><span class="label">City, State: </span><!-- TMPL_VAR NAME="B_city" --></li>
+      <li><span class="label">City: </span><!-- TMPL_VAR NAME="B_city" --></li>
+      <!-- TMPL_IF NAME="B_state"--><li><span class="label">State: </span><!-- TMPL_VAR NAME="B_state" --></li><!-- /TMPL_IF -->
       <li><span class="label">Zip/Postal Code: </span><!-- TMPL_VAR NAME="B_zipcode" --></li>
       <li><span class="label">Country: </span><!-- TMPL_VAR NAME="B_country" --></li>
       <!-- TMPL_IF NAME="B_phone"--><li><span class="label">Phone: </span><!-- TMPL_VAR NAME="B_phone" --></li><!-- /TMPL_IF -->
@@ -364,7 +366,8 @@ function validate1(date) {
     <li><span class="label">First name: </span><!-- TMPL_VAR NAME="altcontactfirstname" --></li>    
     <li><span class="label">Address: </span><!-- TMPL_VAR NAME="altcontactaddress1" --></li>
     <li><span class="label">Address 2: </span><!-- TMPL_VAR NAME="altcontactaddress2" --></li>
-	<li><span class="label">City, State: </span><!-- TMPL_VAR NAME="altcontactaddress3" --></li>
+	<li><span class="label">City: </span><!-- TMPL_VAR NAME="altcontactaddress3" --></li>
+	 <!-- TMPL_IF NAME="altcontactstate"--><li><span class="label">State: </span><!-- TMPL_VAR NAME="altcontactstate" --></li><!-- /TMPL_IF -->
 	<li><span class="label">Zip/Postal Code: </span><!-- TMPL_VAR NAME="altcontactzipcode" --></li>
 	<li><span class="label">Country: </span><!-- TMPL_VAR NAME="altcontactcountry" --></li>
     <li><span class="label">Phone: </span><!-- TMPL_VAR NAME="altcontactphone" --></li></ol></div>
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
index 73f5c21..67e0538 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
@@ -30,7 +30,8 @@
 	<input id="streetnumber" size ="7" type="text" value="<!-- TMPL_VAR name="streetnumber" -->"  name="streetnumber" /> 
 	<input type="text" name="address" value="<!-- TMPL_VAR NAME="address" -->" id="address" />
 	<input type="text" name="address2" value="<!-- TMPL_VAR NAME="address2" -->" id="address2" /></li>
-<li><label for="city">City, State:</label> <input id="city" type="text" value="<!-- TMPL_VAR name="city" -->"  name="city" /></li>
+<li><label for="city">City:</label> <input id="city" type="text" value="<!-- TMPL_VAR name="city" -->"  name="city" /></li>
+<li><label for="state">State:</label> <input id="state" type="text" value="<!-- TMPL_VAR name="state" -->"  name="state" /></li>
 <li><label for="zipcode">Zip Code: </label><input type="text" id="zipcode" value="<!-- TMPL_VAR NAME="zipcode" -->" name="zipcode" /></li>
 <li><label for="country">Country: </label><input type="text" id="country" value="<!-- TMPL_VAR NAME="country" -->" name="country" /></li>
 <li><label for="phone">Home Phone:</label> <input id="phone" type="text" value="<!-- TMPL_VAR name="phone" -->"  name="phone" /></li>
@@ -54,7 +55,8 @@
     <input id="B_address2" type="text" value="<!-- TMPL_VAR name="B_address2" -->"  name="B_address2" />
 </li>
 
-<li><label for="B_city">City, State:</label> <input id="B_city" type="text" value="<!-- TMPL_VAR name="B_city" -->"  name="B_city" /></li>
+<li><label for="B_city">City:</label> <input id="B_city" type="text" value="<!-- TMPL_VAR name="B_city" -->"  name="B_city" /></li>
+<li><label for="B_state">State:</label> <input id="B_state" type="text" value="<!-- TMPL_VAR name="B_state" -->"  name="B_state" /></li>
 <li><label for="B_zipcode">Zip Code:</label> <input type="text" id="B_zipcode" value="<!-- TMPL_VAR NAME="B_zipcode" -->" name="B_zipcode" /></li>
 <li><label for="B_country">Country:</label> <input type="text" id="B_country" value="<!-- TMPL_VAR NAME="B_country" -->" name="B_country" /></li>
 <li><label for="B_phone">Phone:</label> <input type="text" id="B_phone" value="<!-- TMPL_VAR NAME="B_phone" -->" name="B_phone" /></li>
@@ -107,7 +109,8 @@
 <li><span class="label">Other Name:</span> <!-- TMPL_VAR NAME="othernames" --></li>
 <li><span class="label">Address:</span> <!-- TMPL_VAR NAME="streetnumber" --> <!-- TMPL_VAR NAME="address" --></li>
 <li><span class="label">&nbsp;</span><!-- TMPL_VAR NAME="address2" --></li>
-<li><span class="label">City, State:</span>  <!-- TMPL_VAR name="city" --></li>
+<li><span class="label">City:</span>  <!-- TMPL_VAR name="city" --></li>
+<li><span class="label">State:</span>  <!-- TMPL_VAR name="state" --></li>
 <li><span class="label">Zip Code:</span>  <!-- TMPL_VAR NAME="zipcode" --></li>
 <li><span class="label">Country:</span>  <!-- TMPL_VAR NAME="country" --></li>
 <li><span class="label">Home Phone:</span>  <!-- TMPL_VAR name="phone" --></li>
@@ -137,7 +140,8 @@
 <ol>
 <li><span class="label">Alternate Address:</span> <!--TMPL_VAR NAME="B_streetnumber"--> <!-- TMPL_VAR name="B_address" --> </li>
 <li><span class="label">&nbsp;</span><!-- TMPL_VAR NAME="B_address2" --></li>
-<li><span class="label">City, State:</span> <!-- TMPL_VAR name="B_city" --></li>
+<li><span class="label">City:</span> <!-- TMPL_VAR name="B_city" --></li>
+<li><span class="label">State:</span> <!-- TMPL_VAR name="B_state" --></li>
 <li><span class="label">Zip Code:</span> <!-- TMPL_VAR NAME="B_zipcode" --></li>
 <li><span class="label">Country:</span> <!-- TMPL_VAR NAME="B_country" --></li>
 <li><span class="label">Phone:</span> <!-- TMPL_VAR NAME="B_phone" --></li>
diff --git a/members/moremember.pl b/members/moremember.pl
index beec293..19961c7 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -156,7 +156,7 @@ my $catcode;
 if ( $category_type eq 'C') {
 	if ($data->{'guarantorid'} ne '0' ) {
     	my $data2 = GetMember( 'borrowernumber' => $data->{'guarantorid'} );
-    	foreach (qw(address city B_address B_city phone mobile zipcode country B_country)) {
+    	foreach (qw(address address2 city state B_address B_address2 B_city B_state phone mobile zipcode B_zipcode country B_country)) {
     	    $data->{$_} = $data2->{$_};
     	}
    }
diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl
index ab2e15d..d814dd0 100755
--- a/opac/opac-userupdate.pl
+++ b/opac/opac-userupdate.pl
@@ -53,7 +53,7 @@ my $lib = GetBranchDetail($borr->{'branchcode'});
 # handle the new information....
 # collect the form values and send an email.
 my @fields = (
-    'surname','firstname','othernames','streetnumber','address','address2','city','zipcode','country','phone','mobile','fax','phonepro', 'emailaddress','emailpro','B_streetnumber','B_address','B_address2','B_city','B_zipcode','B_country','B_phone','B_email','dateofbirth','sex'
+    'surname','firstname','othernames','streetnumber','address','address2','city','state','zipcode','country','phone','mobile','fax','phonepro', 'emailaddress','emailpro','B_streetnumber','B_address','B_address2','B_city','B_state','B_zipcode','B_country','B_phone','B_email','dateofbirth','sex'
 );
 my $update;
 my $updateemailaddress = $lib->{'branchemail'};
-- 
1.7.1



More information about the Koha-patches mailing list