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 496-501 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
496
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
496
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
497
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
497
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
498
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
498
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
499
('PrefillGuaranteeField', 'phone|email|streetnumber|address|city|state|zipcode|country', NULL, 'Choose which guarantee fields are pre-filled from guarantor record', 'free'),
499
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
500
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
500
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
501
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
501
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
502
('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 122-127 Patrons: Link Here
122
               no: "Don't allow"
122
               no: "Don't allow"
123
         - images to be uploaded and shown for patrons on the staff client.
123
         - images to be uploaded and shown for patrons on the staff client.
124
     -
124
     -
125
         - "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:"
126
         - pref: PrefillGuaranteeField
127
           class: multi
128
         - (seperate columns with |)
129
     -
125
         - By default, show
130
         - By default, show
126
         - pref: PatronsPerPage
131
         - pref: PatronsPerPage
127
           class: integer
132
           class: integer
(-)a/members/memberentry.pl (-11 / +30 lines)
Lines 593-610 if (C4::Context->preference("IndependentBranches")) { Link Here
593
        }
593
        }
594
    }
594
    }
595
}
595
}
596
597
# Define the fields to be pre-filled in guarantee records
598
my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField");
599
my @prefill_fields=split(/\|/,$prefillguarantorfields);
600
596
if ($op eq 'add'){
601
if ($op eq 'add'){
597
    if ($guarantor_id) {
602
    if ($guarantor_id) {
598
        foreach (
603
        foreach (@prefill_fields) {
599
            qw(
604
            if ($_ eq 'altcontactfirstname') {
600
                streetnumber address streettype address2 zipcode country city state phone phonepro mobile
605
                $newdata{altcontactfirstname} = $guarantor->firstname;
601
                fax email emailpro branchcode
606
            } elsif ($_ eq 'altcontactsurname') {
602
                B_streetnumber B_streettype B_address B_address2
607
                $newdata{altcontactsurname} = $guarantor->surname;
603
                B_city B_state B_zipcode B_country B_email B_phone
608
            } elsif ($_ eq 'altcontactaddress1') {
604
            )
609
                $newdata{altcontactaddress1} = $guarantor->address;
605
          )
610
            } elsif ($_ eq 'altcontactaddress2') {
606
        {
611
                $newdata{altcontactaddress2} = $guarantor->address2;
607
            $newdata{$_} = $guarantor->$_;
612
            } elsif ($_ eq 'altcontactaddress3') {
613
                $newdata{altcontactaddress3} = $guarantor->city;
614
            } elsif ($_ eq 'altcontactstate') {
615
                $newdata{altcontactstate} = $guarantor->state;
616
            } elsif ($_ eq 'altcontactzipcode') {
617
                $newdata{altcontactzipcode} = $guarantor->zipcode;
618
            } elsif ($_ eq 'altcontactcountry') {
619
                $newdata{altcontactcountry} = $guarantor->country;
620
            } elsif ($_ eq 'altcontactphone') {
621
                $newdata{altcontactphone} = $guarantor->phone;
622
            } else {
623
                eval { $newdata{$_} = $guarantor->$_; };
624
                if ($@) {
625
                    push @errors, $@;
626
                }
627
            }
608
        }
628
        }
609
    }
629
    }
610
    $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);
630
    $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);
611
- 

Return to bug 22534