Bugzilla – Attachment 102124 Details for
Bug 22534
Add ability to choose which fields are copied from guarantor to guarantee
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22534: Added syspref for defining what guarantee fields are pre filled
Bug-22534-Added-syspref-for-defining-what-guarante.patch (text/plain), 13.41 KB, created by
ByWater Sandboxes
on 2020-03-31 11:46:36 UTC
(
hide
)
Description:
Bug 22534: Added syspref for defining what guarantee fields are pre filled
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-03-31 11:46:36 UTC
Size:
13.41 KB
patch
obsolete
>From 9b49e8396310887631d58ec0d265f8b7fb2b8fed Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 23 Mar 2020 04:14:39 +0000 >Subject: [PATCH] Bug 22534: Added syspref for defining what guarantee fields > are pre filled > >Librarians should be able to define what sections in member entryfields in 'Main address', >'Contact' and 'Alternate contact' in member entry form for guarantee's are pre-filled from guarantor's record > >The 'Guarantor surname, 'Guarantor first name' and 'relationship' fields >in the 'Contact' section should not be filled from guarantor patron >record as those fields are intended for guarantor's without patron >records in Koha. > >Test plan: >1. On an adult patron's record (which has all fields filled out in the >'Main address', 'Contact' (Except for 'Guarantor surname', 'Guarantor >first name', and 'relationship'), 'Alternate address', and 'Alternate contact') select 'Add guarantee' > >2. Observe: > >* Fields in 'Main address' are all automatically pre-filled >from guarantor record > >* Fields in 'Contact' (except 'Guarantor surname', 'Guarantor firstname' >and 'relationship') are all automatically pre-filled from guarantor >record > >* Fields in 'Alternate address' (except for Contact note) are pre-filled from guarantor record > >* None of the fields in 'Alternate contact' are pre-filled from guarantor > >4. Apply patch > >5. Run database updates >cd installer/data/mysql >sudo koha-shell <instancename> >./updatedatabase.pl > >6. Restart plack: >sudo koha-plack --restart <instancename> > >7. Go to Administration > Global system preferences and search for the >new PrefillGuaranteeField system preference > >8. Observe this syspref contains checkboxes and the following are >selected by default: >Contact - Primary email >Contact - Primary phone >Main address - Address >Main address - City >Main address - Country >Main address - State >Main address - ZIP/Postal code >Main address - street number > >Please note: 'Contact - Guarantor surname', 'Contact - Guarantor first >name', Contact - relationship' are not in PrefillGuaranteeField syspref >as they are for non Koha patrons and so should not be pre-filled from a Koha >patron. > >9. Repeat step 1 and observe the following fields are prefilled from guarantor: >In Main address section - >streetnumber >address >city >state >zipcode/postal code >country > >In Contact section - >Primary phone >Primary email > >10. In the PrefillGuaranteeField syspref click '[Select all]' checkboxes > >11. Repeat step 1 and observe all fields in 'Main address', 'Contact' >(except Guarantor surname, Guarantor first name, and relationship), >Alternate address and Alterate contact are filled from guarantor record. > >i.e. The values in guarantor's 'Alternate address' fields fill the >guarantee's 'Alternate address' fields > >12. Change a few of the prefilled field values and 'Save' and observe your changes >have been saved in addition to the unaltered pre-filled values in other >fields > >13. Amend PrefillGuarantee field syspref to have no checkboxes selected > >14. Repeat step 1 and observe none of the fields in Main address, >Contact, Alternate address and Alternate contact are pre-filled > >15. Run tests: >sudo koha-shell <instancename> >prove xt >prove t > >Sponsored-by: Waitaki Distict Council, NZ > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.go.uk> >--- > ...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 > >diff --git a/installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.perl b/installer/data/mysql/atomicupdate/bug_22534-add_PreFillGuaranteeField_syspref.perl >new file mode 100644 >index 0000000000..da4ece4ef5 >--- /dev/null >+++ b/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"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 01ec32d118..f060d09019 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 13c2e70352..6990dfa62d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/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 >diff --git a/members/.nfs0000000000721f7f00000014 b/members/.nfs0000000000721f7f00000014 >new file mode 100644 >index 0000000000000000000000000000000000000000..adef40db269d55554721f73d5638f9c8216c5416 >GIT binary patch >literal 16384 >zcmeHOYm6jS6)q6a1wkV}2x8*doo2fy%xl5m+QSUfJ3BKwaUPv{?7A-6R(IX*u1t4T >zPd%n*XhzT&V~ipG5{)ssF2tyR@P}xk{xSxGnrKi%;y?T$L=$|)2MYL|Ten`_Gs_Aj >z#-u9wwyW>C=iGC@d+y`h>8(zjU0kM<V-p&lw`<z{ANk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g@o{8H6zAetD >zttK@%SwGk=h9G{f$gaBaRpxM^5#Id;KA{s+G*g+>T)#@G!E%FJ5sfvY{5ZT)4vbXv >zFlkeFIMMe?%eFh{h18BiFn(jJEwhS$Ii&EGjwBN~ytFwZ-_pWbOGnhOo_vdi9p7!z >zOxlSNbb}k?hl7F}1#$Y$=yVMyVh@)c@(Ty#=rl`<%5FNCbiT6YLuawrpCLw<P(7S! >zWsWQFD)Qx0Wp=5wzMdZ;JxVGoJDgR<-bc4F-6o%KWfT@v$0+DM50TJoO}br@QK{}# >z0t)!ziu)DQ8ozOQz(+5aR_o=Mp$cEQfCJ{TFucEys}2OD{2!)q$Jt0!JUZROJZWPx >z?ZcsCi4dsd%wuV#v>*Lum<{GZMhP2R5MDp2g`}7L^i@Kh3&VZOU4K)^o+^f8cMM$9 >zaZ4xCe#%Sk1Ra-aC=p293I|ij7!3F5_MBvo_R~%9QW2NzlW5^?rl+xq@EK(54H-E$ >zAG!G7j2<h>KQ5)zW#H}ye-}tl#<vN+KvWcl>G<&j|309x!Q_+XB$N!&z>;JS-pIf~ >zz;iD~r}<xb^K?Kc^*it?;l$NnM@YR|Yxv_8S4loecGLjz>Xz=<pxTuNFDATPdAL3s >zrNT@vc&jvZx0zl_a6^QZ1PfXsyqOL8XD4j)Y~WC}q*C7u3MYG|h8AS!dF_|h)FP%< >YU0I<p9B&9*In<6>>(jo>oFCEt1MHdu%>V!Z > >literal 0 >HcmV?d00001 > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ba47e1d3fa..66c32660a0 100755 >--- a/members/memberentry.pl >+++ b/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->$_; > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22534
:
101499
|
101501
|
101563
|
102097
|
102124
|
102126
|
102919