From bb4fda0053c6d28f4c86bf5a868e1c389e90dc8a Mon Sep 17 00:00:00 2001 From: simith Date: Thu, 26 Jun 2014 09:36:00 -0400 Subject: [PATCH] Bug 12446 - Enable an adult to have a guarantor This fix fulfil all needs : - Enable an adult to have a guarantor; - Shows guarantees' fines in the guarantor's page; - Transfer some guarantor's information to the guarantee while creating a new patron or adding a guarantiee; - Transfer guarantor's alternate address/contact to the guarantee while creating a new patron or adding a guarantiee. Modified: installer/data/mysql/sysprefs.sql - AdditionalGuarantorField preference koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc - Change button label "Add child" to "Add guarantiee" koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref - AdditionalGuarantorField preference koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt - Add guarantor information in add/modify Adultes page koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt - Add guarantor information in add/modify Adultes page koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt - Add guarantees' fines in the guarantor's page. members/guarantor_search.pl members/memberentry.pl members/moremember.pl - fine calculation Testing: I Apply the patch II Run updatedatabase.pl to add AdditionalGuarantorField to preference. - Enable an adult to have a guarantor: 0) Select an adult patron -> details tab; 1) Validade "Add guarantiee" button; 2) Click edit button; 3) validate "guarantor information" fieldset; - Shows guarantees' fines in the guarantor's page: 4) Click Set to patron button and select a guarantor; 5) Generate a fine; 6) Select guarantor patron -> details tab; 7) Validate guarantee's fine information. - Transfer some guarantor's information to the guarantee while adding a guarantiee: 0) Select an adult patron; 1) Insert all information; 2) Click Add guarantiee bouton; 3) Validade Garantor information/Main address/Contact fieldsets filled; - Transfer some guarantor's information to the guarantee while creating a new patron 0) Select an adult patron; 1) Insert all information; 2) Add a new adult patron; 3) Click "Set to patron" button; 4) Select the adult patron from 0); 5) Validade Garantor information/Main address/Contact fieldsets filled; - Transfer some guarantor's information to the guarantee while adding a guarantiee: 0) Select an adult patron; 1) Insert all information; 2) Click Add guarantiee bouton; 3) Validade Garantor information/Main address/Contact fieldsets filled; - Transfer guarantor's alternate address/contact to the guarantee while creating a new patron: 0) Search AdditionalGuarantorField preference; 1) Insert some additional database columns from alternate address/contact to be transferred from guarantor; 2) Select an adult patron; 3) Insert all information; 4) Add a new adult patron; 5) Click "Set to patron" button; 6) Select the adult patron from 0); 7) Validade Garantor information/Main address/Contact fieldsets filled; 8) Validade Garantor additional alternate address/contact filled; - Transfer guarantor's alternate address/contact to the guarantee while adding a guarantiee: 0) Search AdditionalGuarantorField preference; 1) Insert some additional database columns from alternate address/contact to be transferred from guarantor; 3) Select an adult patron; 4) Insert all information; 5) Click Add guarantiee bouton; 6) Validade Garantor information/Main address/Contact fieldsets filled; 7) Validade Garantor additional alternate address/contact filled; --- installer/data/mysql/sysprefs.sql | 1 + .../prog/en/includes/members-toolbar.inc | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 5 ++++ .../prog/en/modules/members/guarantor_search.tt | 33 +++++++++++++++++++++- .../prog/en/modules/members/memberentrygen.tt | 7 ++--- .../prog/en/modules/members/moremember.tt | 17 +++++++++-- members/guarantor_search.pl | 23 +++++++++++++-- members/memberentry.pl | 14 +++++---- members/moremember.pl | 22 +++++++++------ 9 files changed, 100 insertions(+), 24 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 5e4ce7c..e246328 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -5,6 +5,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'), ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'), ('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'), +('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'), ('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'), ('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'), ('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option. Example: eng|fre|ita','Textarea'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index caa2fbf..a290ac6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -110,7 +110,7 @@ function searchToHold(){ [% IF ( CAN_user_borrowers ) %] [% IF ( adultborrower AND activeBorrowerRelationship ) %] - Add child + Add guarantiee [% END %] [% IF ( CAN_user_borrowers ) %] Change password 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 2469431..addb76e 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 @@ -138,3 +138,8 @@ Patrons: - pref: CardnumberLength - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')." - "If 'cardnumber' is included in the BorrowerMandatoryField list, the minimum length, if not specified here, defaults to one." + - + - "These additional following database columns will be transferred from guarantor to guarantee:" + - pref: AdditionalGuarantorField + class: multi + - (separate columns with |) \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt index 1e43405..2381101 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt @@ -18,6 +18,20 @@ var zipcode = $('#' + id + 'zipcode').text(); var country = $('#' + id + 'country').text(); var branchcode = $('#' + id + 'branchcode').text(); + var phone = $('#' + id + 'phone').text(); + var phonepro = $('#' + id + 'phonepro').text(); + var mobile = $('#' + id + 'mobile').text(); + var email = $('#' + id + 'email').text(); + var emailpro = $('#' + id + 'emailpro').text(); + var fax = $('#' + id + 'fax').text(); + + $('.' + id + 'extra_field').each(function() { + var spanId = $(this).attr('id'); + spanId = spanId.replace(id,''); + var spanElement = window.opener.document.getElementById(spanId); + if (spanElement) + window.opener.document.getElementById(spanId).value = $(this).text(); + }); var $ = window.opener.$; var form = $('#entryform').get(0); @@ -48,6 +62,12 @@ form.zipcode.value = zipcode; form.country.value = country; form.branchcode.value = branchcode; + form.phone.value = phone; + form.phonepro.value = phonepro; + form.mobile.value = mobile; + form.email.value = email; + form.emailpro.value = emailpro; + form.fax.value = fax; form.guarantorsearch.value = 'Change'; self.close(); @@ -103,7 +123,18 @@ [% zipcode %] [% country %] [% branchcode %] - + [% phone %] + [% phonepro %] + [% mobile %] + [% email %] + [% emailpro %] + [% fax %] + + [% FOREACH extrafield IN extrafields %] + [% extrafield.value %] + [% END %] + +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 430543e..39991df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -383,7 +383,6 @@ [% END %] [% ELSE %] - [% IF ( C ) %] [% IF ( guarantorid ) %]
  • [% ELSE %] @@ -401,9 +400,8 @@ [% END %]
  • - [% END %] - [% UNLESS nocontactfirstname %] -
  • + [% UNLESS nocontactfirstname %] +
  • [% IF ( guarantorid ) %] [% contactfirstname %] @@ -1275,6 +1273,7 @@
  • + [% IF ( patron_attribute.use_dropdown ) %]