Big bugfix for bug 1631
authorChris Cormack <crc@liblime.com>
Thu, 27 Dec 2007 00:35:13 +0000 (18:35 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 27 Dec 2007 00:40:28 +0000 (18:40 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Members.pm
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
kohaversion.pl

index c9ebc8b..9c60562 100644 (file)
@@ -717,7 +717,14 @@ sub AddMember {
       . ",lost="               . $dbh->quote( $data{'lost'} )
       . ",debarred="   . $dbh->quote( $data{'debarred'} )
       . ",ethnicity="  . $dbh->quote( $data{'ethnicity'} )
-      . ",ethnotes="   . $dbh->quote( $data{'ethnotes'} ) ;
+      . ",ethnotes="   . $dbh->quote( $data{'ethnotes'} ) 
+         . ",altcontactsurname="       . $dbh->quote( $data{'altcontactsurname'} ) 
+         . ",altcontactfirstname="     . $dbh->quote( $data{'altcontactfirstname'} ) 
+         . ",altcontactaddress1="      . $dbh->quote( $data{'altcontactaddress1'} ) 
+         . ",altcontactaddress2="      . $dbh->quote( $data{'altcontactaddress2'} ) 
+         . ",altcontactaddress3="      . $dbh->quote( $data{'altcontactaddress3'} ) 
+         . ",altcontactzipcode="       . $dbh->quote( $data{'altcontactzipcode'} ) 
+         . ",altcontactphone="         . $dbh->quote( $data{'altcontactphone'} ) ;
        $debug and print STDERR "AddMember SQL: ($query)\n";
     my $sth = $dbh->prepare($query);
        #       print "Executing SQL: $query\n";
index e35ffe6..277ee7c 100644 (file)
@@ -477,6 +477,13 @@ CREATE TABLE `borrowers` (
   `contactnote` varchar(255) default NULL,
   `sort1` varchar(80) default NULL,
   `sort2` varchar(80) default NULL,
+  `altcontactfirstname` varchar(255) default NULL,
+  `altcontactsurname` varchar(255) default NULL,
+  `altcontactaddress1` varchar(255) default NULL,
+  `altcontactaddress2` varchar(255) default NULL,
+  `altcontactaddress3` varchar(255) default NULL,
+  `altcontactzipcode` varchar(50) default NULL,
+  `althcontactphone` varchar(50) default NULL,
   UNIQUE KEY `cardnumber` (`cardnumber`),
   PRIMARY KEY `borrowernumber` (`borrowernumber`),
   KEY `categorycode` (`categorycode`),
index fc61b4f..ca5a427 100755 (executable)
@@ -782,6 +782,19 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.00.00.037";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactfirstname` varchar(255)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactsurname` varchar(255)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress1` varchar(255)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress2` varchar(255)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactaddress3` varchar(255)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactzipcode` varchar(50)");
+       $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `altcontactphone` varchar(50)");
+    print "Upgrade to $DBversion done (Adding Alternative Contact Person information to borrowers table)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index d7ab91d..a3fe012 100644 (file)
@@ -452,6 +452,82 @@ patron <!-- TMPL_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" --><!-- /
             </li>
                        </ol>
                </fieldset>
+               <fieldset class="rows" id="memberentry_address">       
+                   <legend>Alternate Contact</legend><ol>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" -->
+                               <label for="altcontactfirstname" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactfirstname">
+                               <!-- /TMPL_IF -->
+                               Firstname:</label>
+                               <input type="text" name="altcontactfirstname" value="<!-- TMPL_VAR NAME="altcontactfirstname" -->">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactsurname" -->
+                               <label for="altcontactsurname" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactsurname">
+                               <!-- /TMPL_IF -->
+                               Surname:</label>
+                               <input type="text" name="altcontactsurname" value="<!-- TMPL_VAR NAME="altcontactsurname" -->">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactsurname" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactaddress1" -->
+                               <label for="altcontactaddress1" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactaddress1">
+                               <!-- /TMPL_IF -->
+                               Address line 1:</label>
+                               <input type="text" name="altcontactaddress1" value="<!-- TMPL_VAR NAME="altcontactaddress1" -->" size="40">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactaddress1" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactaddress2" -->
+                               <label for="altcontactaddress2" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactaddress2">
+                               <!-- /TMPL_IF -->
+                               Address line 2:</label>
+                               <input type="text" name="altcontactaddress2" value="<!-- TMPL_VAR NAME="altcontactaddress2" -->" size="40">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactaddress2" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactaddress3" -->
+                               <label for="altcontactaddress3" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactaddress3">
+                               <!-- /TMPL_IF -->
+                               City, State:</label>
+                               <input type="text" name="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="40">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactaddress3" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactzipcode" -->
+                               <label for="altcontactzipcode" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactzipcode">
+                               <!-- /TMPL_IF -->
+                               ZIP/Post code:</label>
+                               <input type="text" name="altcontactzipcode" value="<!-- TMPL_VAR NAME="altcontactzipcode" -->" size="5">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+                       <li>
+                           <!-- TMPL_IF NAME="mandatoryaltcontactphone" -->
+                               <label for="altcontactphone" class="required">
+                               <!-- TMPL_ELSE -->
+                               <label for "altcontactphone">
+                               <!-- /TMPL_IF -->
+                               Phone:</label>
+                               <input type="text" name="altcontactphone" value="<!-- TMPL_VAR NAME="altcontactphone" -->">
+                               <!-- TMPL_IF NAME="mandatoryaltcontactphone" --><span class="required">Required</span><!-- /TMPL_IF -->
+                       </li>
+            </ol>
+        </fieldset>
+
+
   <!-- TMPL_IF NAME="I" -->
        <!-- TMPL_IF NAME="memberofinstution" -->
        <fieldset class="rows" id="memberentry_organisation">
index cfc734a..1bfdc2e 100644 (file)
@@ -180,7 +180,18 @@ $(document).ready(function() {
     <li><span class="label">Email: </span><!-- TMPL_VAR NAME="email" --></li>
     <li><span class="label">Relationship: </span><!-- TMPL_VAR NAME="relationship" --></li></ol></div>
    <!-- /TMPL_IF -->
-</div><div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;step=2">Edit</a></div>
+</div>
+ <div id="patron-alternate-address" style="padding-top: 1em;">
+ <h3>Alternative Contact</h3>  
+   <div class="rows"> <ol><li><span class="label">Surname: </span><!-- TMPL_VAR NAME="altcontactsurname" --></li>
+    <li><span class="label">Firstname: </span><!-- TMPL_VAR NAME="altcontactfirstname" --></li>    
+    <li><span class="label">Address1: </span><!-- TMPL_VAR NAME="altcontactaddress1" --></li>
+    <li><span class="label">Address2: </span><!-- TMPL_VAR NAME="altcontactaddress2" --></li>
+       <li><span class="label">City,State: </span><!-- TMPL_VAR NAME="altcontactaddress3" --></li>
+       <li><span class="label">Zip/Post Code: </span><!-- TMPL_VAR NAME="altcontactzipcode" --></li>
+    <li><span class="label">Phone: </span><!-- TMPL_VAR NAME="altcontactphone" --></li></ol></div>
+</div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;step=2">Edit</a></div>
  
 </div>
 </div>
index ff94706..84dcd5b 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.036";
+    our $VERSION = "3.00.00.037";
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install