@@ -, +, @@ are pre filled --- ...ug_22534-add_PreFillGuaranteeField_syspref.perl | 7 ++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/patrons.pref | 36 +++++++++++++++++++++ members/.nfs0000000000721f7f00000014 | Bin 0 -> 16384 bytes members/memberentry.pl | 15 ++++----- 5 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.perl create mode 100644 members/.nfs0000000000721f7f00000014 --- a/installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.perl +++ a/installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PrefillGuaranteeField', 'phone,email,streetnumber,address,city,state,zipcode,country', NULL, 'Prefill these fields in guarantee member entry form from guarantor patron record', 'Multiple') }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -499,6 +499,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('PayPalSandboxMode', '1', NULL , 'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.', 'YesNo'), ('PayPalSignature', '', NULL , 'Your PayPal API signature', 'Free'), ('PayPalUser', '', NULL , 'Your PayPal API username ( email address )', 'Free'), +('PrefillGuaranteeField', 'phone,email,streetnumber,address,city,state,zipcode,country', NULL, 'Prefill these fields in guarantee member entry form from guarantor patron record', 'Multiple'), ('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'), ('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'), ('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 +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -140,6 +140,42 @@ Patrons: no: "Don't allow" - images to be uploaded and shown for patrons on the staff client. - + - "When adding a guarantee to a guarantor patron fill the following fields in the guarantee's member entry form from the guarantors record:" + - pref: PrefillGuaranteeField + multiple: + B_address: "Alternate address - Address" + B_address2: "Alternate address - Address 2" + B_city: "Alternate address - City" + contactnote: "Alternate address - Contact note" + B_country: "Alternate address - Country" + B_email: "Alternate address - Email" + B_phone: "Alternate address - Phone" + B_state: "Alternate address - State" + B_streetnumber: "Alternate address - Street number" + B_zipcode: "Alternate address - ZIP/Postal code" + altcontactaddress1: "Alternate contact: Address" + altcontactaddress2: "Alternate contact: Address 2" + altcontactaddress3: "Alternate contact: City" + altcontactcountry: "Alternate contact: Country" + altcontactfirstname: "Alternate contact: First name" + altcontactphone: "Alternate contact: Phone" + altcontactstate: "Alternate contact: State" + altcontactsurname: "Alternate contact: Surname" + altcontactzipcode: "Alternate contact: ZIP/Postal code" + fax: "Contact - Fax" + mobile: "Contact - Other phone" + email: "Contact - Primary email" + phone: "Contact - Primary phone" + emailpro: "Contact - Secondary email" + phonepro: "Contact - Secondary phone" + address: "Main address - Address" + address2: "Main address - Address 2" + city: "Main address - City" + country: "Main address - Country" + state: "Main address - State" + zipcode: "Main address - ZIP/Postal code" + streetnumber: "Main address - street number" + - - By default, show - pref: PatronsPerPage class: integer --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -594,17 +594,14 @@ if (C4::Context->preference("IndependentBranches")) { } } } + +# Define the fields to be pre-filled in guarantee records +my $prefillguarantorfields=C4::Context->preference("PrefillGuaranteeField"); +my @prefill_fields=split(/\,/,$prefillguarantorfields); + if ($op eq 'add'){ if ($guarantor_id) { - foreach ( - qw( - streetnumber address streettype address2 zipcode country city state phone phonepro mobile - fax email emailpro branchcode - B_streetnumber B_streettype B_address B_address2 - B_city B_state B_zipcode B_country B_email B_phone - ) - ) - { + foreach (@prefill_fields) { $newdata{$_} = $guarantor->$_; } } --