View | Details | Raw Unified | Return to bug 11879
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (+89 lines)
Lines 194-199 CREATE TABLE `biblioitems` ( -- information related to bibliographic records in Link Here
194
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
194
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
195
195
196
--
196
--
197
-- Table structure for table `borrowers`
198
--
199
200
DROP TABLE IF EXISTS `borrowers`;
201
CREATE TABLE `borrowers` ( -- this table includes information about your patrons/borrowers/members
202
  `borrowernumber` int(11) NOT NULL auto_increment, -- primary key, Koha assigned ID number for patrons/borrowers
203
  `cardnumber` varchar(16) default NULL, -- unique key, library assigned ID number for patrons/borrowers
204
  `surname` mediumtext NOT NULL, -- patron/borrower's last name (surname)
205
  `firstname` text, -- patron/borrower's first name
206
  `title` mediumtext, -- patron/borrower's title, for example: Mr. or Mrs.
207
  `othernames` mediumtext, -- any other names associated with the patron/borrower
208
  `initials` text, -- initials for your patron/borrower
209
  `streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's primary address
210
  `streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's primary address
211
  `address` mediumtext NOT NULL, -- the first address line for your patron/borrower's primary address
212
  `address2` text, -- the second address line for your patron/borrower's primary address
213
  `city` mediumtext NOT NULL, -- the city or town for your patron/borrower's primary address
214
  `state` text default NULL, -- the state or province for your patron/borrower's primary address
215
  `zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address
216
  `country` text, -- the country for your patron/borrower's primary address
217
  `email` mediumtext, -- the primary email address for your patron/borrower's primary address
218
  `phone` text, -- the primary phone number for your patron/borrower's primary address
219
  `mobile` varchar(50) default NULL, -- the other phone number for your patron/borrower's primary address
220
  `fax` mediumtext, -- the fax number for your patron/borrower's primary address
221
  `emailpro` text, -- the secondary email addres for your patron/borrower's primary address
222
  `phonepro` text, -- the secondary phone number for your patron/borrower's primary address
223
  `B_streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's alternate address
224
  `B_streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's alternate address
225
  `B_address` varchar(100) default NULL, -- the first address line for your patron/borrower's alternate address
226
  `B_address2` text default NULL, -- the second address line for your patron/borrower's alternate address
227
  `B_city` mediumtext, -- the city or town for your patron/borrower's alternate address
228
  `B_state` text default NULL, -- the state for your patron/borrower's alternate address
229
  `B_zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's alternate address
230
  `B_country` text, -- the country for your patron/borrower's alternate address
231
  `B_email` text, -- the patron/borrower's alternate email address
232
  `B_phone` mediumtext, -- the patron/borrower's alternate phone number
233
  `dateofbirth` date default NULL, -- the patron/borrower's date of birth (YYYY-MM-DD)
234
  `branchcode` varchar(10) NOT NULL default '', -- foreign key from the branches table, includes the code of the patron/borrower's home branch
235
  `categorycode` varchar(10) NOT NULL default '', -- foreign key from the categories table, includes the code of the patron category
236
  `dateenrolled` date default NULL, -- date the patron was added to Koha (YYYY-MM-DD)
237
  `dateexpiry` date default NULL, -- date the patron/borrower's card is set to expire (YYYY-MM-DD)
238
  `gonenoaddress` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address
239
  `lost` tinyint(1) default NULL, -- set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card
240
  `debarred` date default NULL, -- until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYY-MM-DD)
241
  `debarredcomment` VARCHAR(255) DEFAULT NULL, -- comment on the stop of the patron
242
  `contactname` mediumtext, -- used for children and profesionals to include surname or last name of guarentor or organization name
243
  `contactfirstname` text, -- used for children to include first name of guarentor
244
  `contacttitle` text, -- used for children to include title (Mr., Mrs., etc) of guarentor
245
  `guarantorid` int(11) default NULL, -- borrowernumber used for children or professionals to link them to guarentors or organizations
246
  `borrowernotes` mediumtext, -- a note on the patron/borrower's account that is only visible in the staff client
247
  `relationship` varchar(100) default NULL, -- used for children to include the relationship to their guarentor
248
  `sex` varchar(1) default NULL, -- patron/borrower's gender
249
  `password` varchar(60) default NULL, -- patron/borrower's encrypted password
250
  `flags` int(11) default NULL, -- will include a number associated with the staff member's permissions
251
  `userid` varchar(75) default NULL, -- patron/borrower's opac and/or staff client log in
252
  `opacnote` mediumtext, -- a note on the patron/borrower's account that is visible in the OPAC and staff client
253
  `contactnote` varchar(255) default NULL, -- a note related to the patron/borrower's alternate address
254
  `sort1` varchar(80) default NULL, -- a field that can be used for any information unique to the library
255
  `sort2` varchar(80) default NULL, -- a field that can be used for any information unique to the library
256
  `altcontactfirstname` varchar(255) default NULL, -- first name of alternate contact for the patron/borrower
257
  `altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
258
  `altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
259
  `altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
260
  `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
261
  `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
262
  `altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
263
  `altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
264
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
269
  `primary_contact_method` varchar(45) DEFAULT NULL, --  useful for reporting purposes
270
  UNIQUE KEY `cardnumber` (`cardnumber`),
271
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
272
  KEY `categorycode` (`categorycode`),
273
  KEY `branchcode` (`branchcode`),
274
  UNIQUE KEY `userid` (`userid`),
275
  KEY `guarantorid` (`guarantorid`),
276
  KEY `surname_idx` (`surname`(255)),
277
  KEY `firstname_idx` (`firstname`(255)),
278
  KEY `othernames_idx` (`othernames`(255)),
279
  KEY `sms_provider_id` (`sms_provider_id`),
280
  CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`),
281
  CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
282
  CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON UPDATE CASCADE ON DELETE SET NULL
283
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
284
285
--
197
-- Table structure for table `borrower_attribute_types`
286
-- Table structure for table `borrower_attribute_types`
198
--
287
--
199
288
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 8724-8729 if ( CheckVersion($DBversion) ) { Link Here
8724
    print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n";
8724
    print "Upgrade to $DBversion done (Bug 10402: Move bookseller contacts to separate table)\n";
8725
    SetVersion($DBversion);
8725
    SetVersion($DBversion);
8726
}
8726
}
8727
$DBversion = "XXX";
8728
if ( CheckVersion($DBversion) ) {
8729
    $dbh->do("ALTER TABLE `borrowers` ADD COLUMN `primary_contact_method` VARCHAR(45) NULL DEFAULT NULL;");
8730
    print "Upgrade to $DBversion done (Bug 11879: Add a new borrower field : main contact method)\n";
8731
    SetVersion($DBversion);
8732
}
8727
8733
8728
$DBversion = "3.17.00.017";
8734
$DBversion = "3.17.00.017";
8729
if ( CheckVersion($DBversion) ) {
8735
if ( CheckVersion($DBversion) ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-46 / +31 lines)
Lines 150-157 $(document).ready(function() { Link Here
150
150
151
                <form name="form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
151
                <form name="form" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off">
152
				<input type="hidden" name="nodouble" value="1" />
152
				<input type="hidden" name="nodouble" value="1" />
153
                <button type="submit" class="new"><i class="fa fa-plus"></i> Not a duplicate.
153
                <input class="new" type="submit" value="Not a duplicate. Save as new record" />
154
                Save as new record</button>
155
			</div>
154
			</div>
156
	[% END %]
155
	[% END %]
157
156
Lines 491-497 $(document).ready(function() { Link Here
491
490
492
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
491
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
493
  <fieldset class="rows" id="memberentry_contact">
492
  <fieldset class="rows" id="memberentry_contact">
494
    <legend id="contact_lgd">Contact</legend><ol>
493
    <legend id="contact_lgd">Contact</legend>
494
<ol>
495
        [% UNLESS nophone %]
495
        [% UNLESS nophone %]
496
      <li>
496
      <li>
497
      [% IF ( mandatoryphone ) %]
497
      [% IF ( mandatoryphone ) %]
Lines 566-625 $(document).ready(function() { Link Here
566
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
566
	  [% IF ( mandatoryfax ) %]<span class="required">Required</span>[% END %]
567
    </li>
567
    </li>
568
568
569
570
571
   [% END %]
569
   [% END %]
570
572
    <li>
571
    <li>
573
       <label for="primary_contact_method">Main Contact Method</label>
572
       <label for="primary_contact_method">Main Contact Method</label>
574
       <select id="primary_contact_method" name="primary_contact_method">
573
       <select id="primary_contact_method" name="primary_contact_method">
575
       <option value=""></option>
574
576
         [% FOREACH contactprincipalloo IN contactprincipalloop %]
575
            [% IF ( primary_contact_method == 'phone' ) %]
577
            [% IF ( contactprincipalloo.currentis_phone ) %]
576
                <option value="phone" selected="selected">Primary phone</option>
578
               [% IF ( primary_contact_method == 'phone' ) %]
577
            [% ELSE %]
579
                 <option value="phone" selected="selected">Primary phone</option>
578
                <option value="phone">Primary phone</option>
580
               [% ELSE %]
581
                 <option value="phone">Primary phone</option>
582
               [% END %]
583
            [% END %]
579
            [% END %]
584
            [% IF ( contactprincipalloo.currentis_phonepro ) %]
580
            [% IF ( primary_contact_method == 'phonepro' ) %]
585
               [% IF ( primary_contact_method == 'phonepro' ) %]
581
                <option value="phonepro" selected="selected">Secondary phone</option>
586
                 <option value="phonepro" selected="selected">Secondary phone</option>
582
            [% ELSE %]
587
               [% ELSE %]
583
                <option value="phonepro">Secondary phone</option>
588
                 <option value="phonepro">Secondary phone</option>
589
               [% END %]
590
            [% END %]
584
            [% END %]
591
            [% IF ( contactprincipalloo.currentis_mobile ) %]
585
            [% IF ( primary_contact_method == 'mobile' ) %]
592
               [% IF ( primary_contact_method == 'mobile' ) %]
586
                <option value="mobile" selected="selected">Other phone</option>
593
                 <option value="mobile" selected="selected">Other phone</option>
587
            [% ELSE %]
594
               [% ELSE %]
588
                <option value="mobile">Other phone</option>
595
                 <option value="mobile">Other phone</option>
596
               [% END %]
597
            [% END %]
589
            [% END %]
598
            [% IF ( contactprincipalloo.currentis_email ) %]
590
            [% IF ( primary_contact_method == 'email' ) %]
599
               [% IF ( primary_contact_method == 'email' ) %]
591
                <option value="email" selected="selected">Primary email</option>
600
                 <option value="email" selected="selected">Primary email</option>
592
            [% ELSE %]
601
               [% ELSE %]
593
                <option value="email">Primary email</option>
602
                 <option value="email">Primary email</option>
603
               [% END %]
604
            [% END %]
594
            [% END %]
605
            [% IF ( contactprincipalloo.currentis_emailpro ) %]
595
            [% IF ( primary_contact_method == 'emailpro' ) %]
606
               [% IF ( primary_contact_method == 'emailpro' ) %]
596
                <option value="emailpro" selected="selected">Secondary email</option>
607
                 <option value="emailpro" selected="selected">Secondary email</option>
597
            [% ELSE %]
608
               [% ELSE %]
598
                <option value="emailpro">Secondary email</option>
609
                 <option value="emailpro">Secondary email</option>
610
               [% END %]
611
            [% END %]
599
            [% END %]
612
            [% IF ( contactprincipalloo.currentis_fax ) %]
600
            [% IF ( primary_contact_method == 'fax' ) %]
613
               [% IF ( primary_contact_method == 'fax' ) %]
601
                <option value="fax" selected="selected">Fax</option>
614
                 <option value="fax" selected="selected">Fax</option>
602
            [% ELSE %]
615
               [% ELSE %]
603
                <option value="fax">Fax</option>
616
                 <option value="fax">Fax</option>
617
               [% END %]
618
            [% END %]
604
            [% END %]
619
         [% END %]
620
       </select>
605
       </select>
621
    </li>
606
    </li>
622
    </ol>
607
608
</ol>
623
609
624
  </fieldset>
610
  </fieldset>
625
[%END # hide fieldset %]
611
[%END # hide fieldset %]
626
- 

Return to bug 11879