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

(-)a/installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PrefillGuaranteeField', 'phone|email|streetnumber|address|city|state|zipcode|country', NULL, 'Choose which guarantee fields are pre-filled from guarantor record', 'free');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 500-505 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
500
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
500
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
501
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
501
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
502
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
502
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
503
('PrefillGuaranteeField', 'phone|email|streetnumber|address|city|state|zipcode|country', NULL, 'Choose which guarantee fields are pre-filled from guarantor record', 'free'),
503
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
504
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
504
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
505
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
505
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
506
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+5 lines)
Lines 140-145 Patrons: Link Here
140
               no: "Don't allow"
140
               no: "Don't allow"
141
         - images to be uploaded and shown for patrons on the staff client.
141
         - images to be uploaded and shown for patrons on the staff client.
142
     -
142
     -
143
         - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will be pre-filled in guarantee entry screen from guarantor redord:"
144
         - pref: PrefillGuaranteeField
145
           class: multi
146
         - (seperate columns with |)
147
     -
143
         - By default, show
148
         - By default, show
144
         - pref: PatronsPerPage
149
         - pref: PatronsPerPage
145
           class: integer
150
           class: integer
(-)a/members/memberentry.pl (-11 / +30 lines)
Lines 594-611 if (C4::Context->preference("IndependentBranches")) { Link Here
594
        }
594
        }
595
    }
595
    }
596
}
596
}
597
598
# Define the fields to be pre-filled in guarantee records
599
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
600
my @prefill_fields=split(/\|/,$prefillguarantorfields);
601
597
if ($op eq 'add'){
602
if ($op eq 'add'){
598
    if ($guarantor_id) {
603
    if ($guarantor_id) {
599
        foreach (
604
        foreach (@prefill_fields) {
600
            qw(
605
            if ($_ eq 'altcontactfirstname') {
601
                streetnumber address streettype address2 zipcode country city state phone phonepro mobile
606
                $newdata{altcontactfirstname} = $guarantor->firstname;
602
                fax email emailpro branchcode
607
            } elsif ($_ eq 'altcontactsurname') {
603
                B_streetnumber B_streettype B_address B_address2
608
                $newdata{altcontactsurname} = $guarantor->surname;
604
                B_city B_state B_zipcode B_country B_email B_phone
609
            } elsif ($_ eq 'altcontactaddress1') {
605
            )
610
                $newdata{altcontactaddress1} = $guarantor->address;
606
          )
611
            } elsif ($_ eq 'altcontactaddress2') {
607
        {
612
                $newdata{altcontactaddress2} = $guarantor->address2;
608
            $newdata{$_} = $guarantor->$_;
613
            } elsif ($_ eq 'altcontactaddress3') {
614
                $newdata{altcontactaddress3} = $guarantor->city;
615
            } elsif ($_ eq 'altcontactstate') {
616
                $newdata{altcontactstate} = $guarantor->state;
617
            } elsif ($_ eq 'altcontactzipcode') {
618
                $newdata{altcontactzipcode} = $guarantor->zipcode;
619
            } elsif ($_ eq 'altcontactcountry') {
620
                $newdata{altcontactcountry} = $guarantor->country;
621
            } elsif ($_ eq 'altcontactphone') {
622
                $newdata{altcontactphone} = $guarantor->phone;
623
            } else {
624
                eval { $newdata{$_} = $guarantor->$_; };
625
                if ($@) {
626
                    push @errors, $@;
627
                }
628
            }
609
        }
629
        }
610
    }
630
    }
611
    $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1);
631
    $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1);
612
- 

Return to bug 22534