Description
simith.doliveira
2014-06-18 15:01:41 UTC
Created attachment 29278 [details] [review] 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; Patch does not apply: CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Created attachment 36176 [details] [review] Bug 12446 - Enable an adult to have a guarantor Easy conflict, fixed. While the code works, this is a problem for many libraries. I think this should be an on/off switch on the patron category administration page. That way some categories can have it and others won't. If it's there for all patrons it will be requested that we hide it for all but children and that can't be done easily. Nicole I completely agree. This should be an optional feature implemented at the patron category level. Otherwise this makes an irreversible change to Koha. Many librarians complain that the patron form is too long already. We cannot hide this for adults without also hiding it for children, thus it must be implemented as an optional feature. The most sensible way to do this would be to add a switch at the patron category level that enables the ability to set a guarantor for a given patron type. (In reply to Nicole C. Engard from comment #5) > While the code works, this is a problem for many libraries. I think this > should be an on/off switch on the patron category administration page. That > way some categories can have it and others won't. If it's there for all > patrons it will be requested that we hide it for all but children and that > can't be done easily. > > Nicole Hi Nicole, Hi Kyle, I do not agree since it fixes an issue in Koha. Koha already allows librarian to linked adult cards together. But once the cards are linked together, if the guarantee is an adult, the patron edit page doesn't display the "Guarantor information". So you can't edit the link. If you want to, you have to change the patron category to a child type, edit it and then put back the correct patron category. To me, it's a feature that needed to be fixed. I agree there is a need to be able to hide parts of the patron edit page but I think it should be part of a different feature. If we add the ability to control the display of the edit patron page, we should be able to do it for every part of the page. What do you think? Discussion from IRC: http://irc.koha-community.org/koha/2015-03-04#i_1645311 Thanks nicole! We just talked about this with Nicole and Kyle. We agreeded on this : * On the patron category page, there will be a new button : "display the edit garantor information box" : yes | no * by default, we will have "yes" for child and professional categories * if yes, we will display the edit guarantor box on the patron edit page Created attachment 39744 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased Simith's patch. This includes all the features from the previous patch. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". I Apply the patch II Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Wanted to test but patch does not apply. Comment on attachment 39744 [details] [review] bug 12446 - Enable adult patrons to have a guarantor Review of attachment 39744 [details] [review]: ----------------------------------------------------------------- I just skimmed the patches. The linking guarantor to a specific category code is bad. I like the notion of a canbeguaranteed code field. Some code changes aren't obvious to me. ::: C4/Utils/DataTables/Members.pm @@ +38,5 @@ > + @columns = grep { ! $seen{ $_ }++ } ( @columns, @guarantor_attributes ); > + }; > + $_ = "borrowers.".$dbh->quote_identifier($_) for (@columns); > + > + my $select = "SELECT ${ \join(',', @columns) }, This code is horrible to read! ::: installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql @@ +9,5 @@ > +-- ********* -- > +ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0'; > + > +-- Set defaults for new column > +UPDATE categories set canbeguarantee = 1 WHERE category_type IN ('C', 'P'); \ No newline at end of file Default behaviour should NOT activate new functionality. ::: installer/data/mysql/sysprefs.sql @@ +481,4 @@ > ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), > +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), Why was , added at the end? ::: koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ +148,4 @@ > > [% IF ( CAN_user_borrowers ) %] > [% IF ( adultborrower AND activeBorrowerRelationship ) %] > + <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C"><i class="icon-plus"></i> Add guarantiee</a> Is that spelt correctly? ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ +25,5 @@ > $("#branches option:first").attr("selected", "selected"); > } > + $("#category_type").change(function(){ > + var selected = $(this).val(); > + $("#canbeguarantee").val( (selected == 'C' || selected == 'P') ? "1" : "0" ); Hardcoded category codes is a bad thing. Is there a better way to do this? ::: members/memberentry.pl @@ +251,4 @@ > } > > #recover all data from guarantor address phone ,fax... > +if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) { Why remove the space? @@ -259,5 @@ > if ( $op eq 'add' ) { > 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)) { Why were these removed? ::: members/moremember.pl @@ +204,2 @@ > if ($category_type eq 'C'){ > $template->param('C' => 1); Is this used anymore in the template file? I saw you removed one C condition. Created attachment 42469 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased Simith's patch. This includes all the features from the previous patch. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Created attachment 42470 [details] [review] Bug 12446 - Clean code according to Comment 12 For the first recommendation, I tried to be more explicit, I don't know if you would prefer it because it is slower. For the second point, I've got rid of the UPDATE line so we don't activate a new functionnality. For the third point, I was told that the coma was there in case of new addition. Fourth, I corrected the mistake. For the fifth recommendation, I tried to separate the hardcode categories, but it is simple for the display (it only changes a the choice in the select for yes, but the user can still change it aftewards). However, I modified it so, if someone wants to add a new category to be displayed as guarantee by default, he only has to add the category code in the array instead of writting another select == 'new category'. For the sixth point, I replaced the space. Lastly, I deleted these lines because, as you said it, it wasn't used. Created attachment 42535 [details] [review] Bug 12446 - Displayed button Add guarantee in Details section The button Add guarantee wasn't in the toolbar section in Details. It is now. Applying: bug 12446 - Enable adult patrons to have a guarantor /home/vagrant/kohaclone/.git/rebase-apply/patch:456: trailing whitespace. #recover all data from guarantor address phone ,fax... /home/vagrant/kohaclone/.git/rebase-apply/patch:468: trailing whitespace. B_city B_state B_zipcode B_country B_email B_phone)) { fatal: sha1 information is lacking or useless (C4/Utils/DataTables/Members.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 bug 12446 - Enable adult patrons to have a guarantor Created attachment 46277 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Please enter the commit message for your changes. Lines starting Created attachment 46278 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Bug 15407 is going to remove C4::Category, you should use Koha::Patron::Categories instead. Created attachment 46327 [details] [review] bug 12446 - Enable adult patrons to have a guarantor bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Comment on attachment 46327 [details] [review] bug 12446 - Enable adult patrons to have a guarantor >From 7020394e74d993f645d8b1b7bf98649a00c1f837 Mon Sep 17 00:00:00 2001 >From: remi <remi.mayrand-provencher@inLibro.com> >Date: Wed, 6 Jan 2016 08:46:27 -0500 >Subject: [PATCH] bug 12446 - Enable adult patrons to have a guarantor > >The C4::Category file was not even used! rebased to avoid eventual possible conflicts. > >I have rebased every patch. >This includes all the features from the previous patches. > >On the patron category page, there is a new field to specify whether patrons can be guarantee or not. >The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". > >1) Apply the patch >2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. >3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) >4) See below to test various scenarios > >- Enable an adult to have a guarantor: >0.0) Create or edit a patron category of type 'A'. >0.1) Set the "Can be guarantee" field to "Yes" and save. >1) Select an adult patron -> details tab; >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; >--- > C4/Members/Attributes.pm | 17 +++++++++++++- > C4/Utils/DataTables/Members.pm | 22 ++++++++++++------ > Koha/Schema/Result/Category.pm | 8 +++++++ > admin/categories.pl | 3 +++ > .../atomicupdate/bug_12446-EnableAdultGarantee.sql | 10 ++++++++ > installer/data/mysql/kohastructure.sql | 3 ++- > installer/data/mysql/sysprefs.sql | 4 +++- > .../prog/en/includes/members-toolbar.inc | 2 +- > .../prog/en/modules/admin/categories.tt | 15 ++++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 5 ++++ > .../prog/en/modules/members/memberentrygen.tt | 18 +++++---------- > .../prog/en/modules/members/moremember.tt | 17 +++++++++++--- > members/memberentry.pl | 17 ++++++++++---- > members/moremember.pl | 27 +++++++++++----------- > 14 files changed, 125 insertions(+), 43 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql > >diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm >index b25a813..b2b0762 100644 >--- a/C4/Members/Attributes.pm >+++ b/C4/Members/Attributes.pm >@@ -34,7 +34,7 @@ BEGIN { > @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes > DeleteBorrowerAttribute UpdateBorrowerAttribute > extended_attributes_code_value_arrayref extended_attributes_merge >- SearchIdMatchingAttribute); >+ SearchIdMatchingAttribute get_guarantor_shared_attributes); > %EXPORT_TAGS = ( all => \@EXPORT_OK ); > } > >@@ -357,6 +357,21 @@ sub _sort_by_code { > return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value}; > } > >+=head2 get_guarantor_shared_attributes >+ >+ $guarantor_attributes = get_guarantor_attributes(); >+ >+ returns an array reference containing attributes to be shared between guarantor and guarantee. >+=cut >+sub get_guarantor_shared_attributes{ >+ my @attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax ); >+ if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){ >+ $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces >+ @attributes = ( @attributes, @additional); >+ } >+ return \@attributes; >+} >+ > =head1 AUTHOR > > Koha Development Team <http://koha-community.org/> >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 1ebecd7..49fd1fc 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -4,6 +4,7 @@ use Modern::Perl; > use C4::Branch qw/onlymine/; > use C4::Context; > use C4::Members qw/GetMemberIssuesAndFines/; >+use C4::Members::Attributes qw/get_guarantor_shared_attributes/; > use C4::Utils::DataTables; > use Koha::DateUtils; > >@@ -32,13 +33,20 @@ sub search { > } > > my $dbh = C4::Context->dbh; >- my $select = "SELECT >- borrowers.borrowernumber, borrowers.surname, borrowers.firstname, >- borrowers.streetnumber, borrowers.streettype, borrowers.address, >- borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode, >- borrowers.country, cardnumber, borrowers.dateexpiry, >- borrowers.borrowernotes, borrowers.branchcode, borrowers.email, >- borrowers.userid, borrowers.dateofbirth, borrowers.categorycode, >+ my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode ); >+ if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){ >+ foreach my $item (@guarantor_attributes) { >+ if (! grep {$_ eq $item} @columns) { >+ push @columns, $item; >+ } >+ } >+ }; >+ my $borrowers_columns = ""; >+ foreach my $item (@columns) { >+ $borrowers_columns .= "borrowers." . $item . ", "; >+ } >+ >+ my $select = "SELECT " . $borrowers_columns . " > categories.description AS category_description, categories.category_type, > branches.branchname"; > my $from = "FROM borrowers >diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm >index 4926587..e5a40a9 100644 >--- a/Koha/Schema/Result/Category.pm >+++ b/Koha/Schema/Result/Category.pm >@@ -109,6 +109,12 @@ __PACKAGE__->table("categories"); > default_value: -1 > is_nullable: 0 > >+=head2 canbeguarantee >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ > =head2 default_privacy > > data_type: 'enum' >@@ -154,6 +160,8 @@ __PACKAGE__->add_columns( > default_value => -1, > is_nullable => 0, > }, >+ "canbeguarantee", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0}, > "default_privacy", > { > data_type => "enum", >diff --git a/admin/categories.pl b/admin/categories.pl >index 1370b58..593886c 100755 >--- a/admin/categories.pl >+++ b/admin/categories.pl >@@ -91,6 +91,7 @@ elsif ( $op eq 'add_validate' ) { > my $category_type = $input->param('category_type'); > my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions'); > my $default_privacy = $input->param('default_privacy'); >+ my $canbeguarantee = $input->param('canbeguarantee'); > my @branches = grep { $_ ne q{} } $input->param('branches'); > > my $is_a_modif = $input->param("is_a_modif"); >@@ -112,6 +113,7 @@ elsif ( $op eq 'add_validate' ) { > $category->hidelostitems($hidelostitems); > $category->overduenoticerequired($overduenoticerequired); > $category->category_type($category_type); >+ $category->canbeguarantee($canbeguarantee); > $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions); > $category->default_privacy($default_privacy); > eval { >@@ -137,6 +139,7 @@ elsif ( $op eq 'add_validate' ) { > hidelostitems => $hidelostitems, > overduenoticerequired => $overduenoticerequired, > category_type => $category_type, >+ canbeguarantee => $canbeguarantee, > BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions, > default_privacy => $default_privacy, > }); >diff --git a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql b/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql >new file mode 100644 >index 0000000..55c2b78 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql >@@ -0,0 +1,10 @@ >+-- ******** -- >+-- SYSPREFS -- >+-- ******** -- >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'); >+ >+-- ********* -- >+-- STRUCTURE -- >+-- ********* -- >+ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0'; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 02725fd..1302be2 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -488,7 +488,8 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr > `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) > `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) > `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions >- `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category >+ `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category, >+ `canbeguarantee` tinyint(1) NOT NULL default '0' > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index aa53139..fdfe94c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -6,6 +6,8 @@ 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'), > ('AddressFormat','us','','Choose format to display postal addresses', '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'), >@@ -517,5 +519,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), >-('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') >+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), > ; >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 641bbad..7cc0c0e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -146,7 +146,7 @@ function searchToHold(){ > > [% IF ( CAN_user_borrowers ) %] > [% IF ( adultborrower AND activeBorrowerRelationship ) %] >- <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]"><i class="fa fa-plus"></i> Add child</a> >+ <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C"><i class="icon-plus"></i> Add guarantee</a> > [% END %] > [% IF ( CAN_user_borrowers ) %] > <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="fa fa-lock"></i> Change password</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index d4d0130..4112d44 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -238,6 +238,18 @@ > </select> > <span class="required">Required</span> > </li> >+ <li> >+ <label for="canbeguarantee">Can be guarantee</label> >+ <select name="canbeguarantee" id="canbeguarantee"> >+ [% IF category.canbeguarantee %] >+ <option value="1" selected>Yes</option> >+ <option value="0">No</option> >+ [% ELSE %] >+ <option value="1">Yes</option> >+ <option value="0" selected>No</option> >+ [% END %] >+ <select> >+ </li> > <li><label for="branches">Branches limitation: </label> > <select id="branches" name="branches" multiple size="10"> > <option value="">All branches</option> >@@ -345,6 +357,7 @@ > <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr> > <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr> > <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr> >+ <tr><th scope="row">Can be guarantee</th><td>[% IF category.canbeguarantee %]Yes[% ELSE %]No[% END %]</td></tr> > <tr> > <th scope="row">Default privacy: </th> > <td> >@@ -401,6 +414,7 @@ > <th scope="col">Messaging</th> > [% END %] > <th scope="col">Branches limitations</th> >+ <th scope="col">Can be guarantee</th> > <th scope="col">Default privacy</th> > <th scope="col"> </th> > <th scope="col"> </th> >@@ -478,6 +492,7 @@ > No limitation > [% END %] > </td> >+ <td>[% IF category.canbeguarantee %] Yes [% ELSE %] no [% END %]</td> > <td> > [% SWITCH category.default_privacy %] > [% CASE 'default' %] >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 ee64970..0b80c92 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 >@@ -159,6 +159,11 @@ Patrons: > yes: Do > no: "Don't" > - charge a fee when a patron changes to a category with an enrollment fee. >+ - >+ - "These additional following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will be transferred from guarantor to guarantee:" >+ - pref: AdditionalGuarantorField >+ class: multi >+ - (separate columns with |) > "Norwegian patron database": > - > - pref: NorwegianPatronDBEnable >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 e646890..dac1483 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -131,14 +131,9 @@ > .val(borrower.firstname) > .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden'; > >- form.streetnumber.value = borrower.streetnumber; >- form.address.value = borrower.address; >- form.address2.value = borrower.address2; >- form.city.value = borrower.city; >- form.state.value = borrower.state; >- form.zipcode.value = borrower.zipcode; >- form.country.value = borrower.country; >- form.branchcode.value = borrower.branchcode; >+ [% FOREACH field IN guarantor_attributes %] >+ $(form.[% field %]).val(borrower.[% field %]); >+ [% END %] > > form.guarantorsearch.value = _("Change"); > >@@ -435,7 +430,6 @@ > [% END %] > </li> > [% ELSE %] >- [% IF ( C ) %] > [% IF ( guarantorid ) %] > <li id="contact-details"> > [% ELSE %] >@@ -453,9 +447,8 @@ > <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" /> > [% END %] > </li> >- [% END %] >- [% UNLESS nocontactfirstname %] >- <li> >+ [% UNLESS nocontactfirstname %] >+<li> > <label for="contactfirstname">First name: </label> > [% IF ( guarantorid ) %] > <span>[% contactfirstname %]</span> >@@ -1025,6 +1018,7 @@ > <li data-category_code="[% patron_attribute.category_code %]"> > <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label> > <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" /> >+ <input type="hidden" id="[% patron_attribute.form_id %]_desc" name="[% patron_attribute.form_id %]_desc" value="[% patron_attribute.description |html %]" /> > [% IF ( patron_attribute.use_dropdown ) %] > <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]"> > <option value=""></option> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 57bd588..c961653 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -232,13 +232,24 @@ function validate1(date) { > </li>[% END %][% END %] > [% IF ( isguarantee ) %] > [% IF ( guaranteeloop ) %] >- <li><span class="label">Guarantees:</span><ul>[% FOREACH guaranteeloo IN guaranteeloop %]<li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber %]">[% guaranteeloo.name %] </a></li>[% END %]</ul></li> >+ <li><span class="label">Guarantees:</span> >+ <table>[% FOREACH guaranteeloo IN guaranteeloop %] >+ <tr> >+ <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber %]">[% guaranteeloo.name %]</a></td> >+ <td style='text-align:right'>[% guaranteeloo.finesguarantee %] $</td> >+ </tr>[% END %] >+ <tr> >+ <td>Total</td> >+ <td style='text-align:right'>[% amounttot %] $</td> >+ </tr> >+ </table> >+ </li> > [% END %] >- [% ELSE %] >+ [% END %] > [% IF ( guarantorborrowernumber ) %] > <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %] [% END %]</a></li> > [% END %] >- [% END %] >+ > </ol> > </div> > <div class="action"> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ae54383..fa2f009 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -39,6 +39,7 @@ use C4::Log; > use C4::Letters; > use C4::Branch; # GetBranches > use C4::Form::MessagingPreferences; >+use C4::Category; > use Koha::Borrower::Debarments; > use Koha::DateUtils; > use Email::Valid; >@@ -232,8 +233,9 @@ if ( ( $op eq 'insert' ) and !$nodouble ) { > } > } > >- #recover all data from guarantor address phone ,fax... >-if ( $guarantorid ) { >+#recover all data from guarantor address phone ,fax... >+if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) { >+ > if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) { > $category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C'; > $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'}; >@@ -245,8 +247,14 @@ if ( $guarantorid ) { > 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)) { >- $newdata{$_} = $guarantordata->{$_}; >+ $newdata{$_} = $guarantordata->{$_}; > } >+ my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField"); >+ my @field_add=split(/\|/,$additionalGuarantorField); >+ my $guarantordata=GetMember(borrowernumber => $guarantorid); >+ foreach (@field_add) { >+ $newdata{$_} = $guarantordata->{$_}; >+ } > } > } > } >@@ -674,7 +682,8 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { > $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification")); > } > >-$template->param( "showguarantor" => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are >+$template->param( "showguarantor" => $categorycode ? C4::Category->get($categorycode)->{'canbeguarantee'} : 1); # associate with step to know where you are >+$template->param( "guarantor_attributes" => C4::Members::Attributes::get_guarantor_shared_attributes() ); > $debug and warn "memberentry step: $step"; > $template->param(%data); > $template->param( "step_$step" => 1) if $step; # associate with step to know where u are >diff --git a/members/moremember.pl b/members/moremember.pl >index 482f2a2..80a3170 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -171,33 +171,34 @@ if ( $count ) { > # the array, which is probably better done as a foreach loop. > # > my @guaranteedata; >+ my $amount; >+ my $totalmount = 0; >+ > for ( my $i = 0 ; $i < $count ; $i++ ) { >+ my ($amount,$accts,undef) = GetMemberAccountRecords($guarantees->[$i]->{'borrowernumber'}); > push(@guaranteedata, > { > borrowernumber => $guarantees->[$i]->{'borrowernumber'}, > cardnumber => $guarantees->[$i]->{'cardnumber'}, >+ finesguarantee => sprintf("%.2f",$amount), > name => $guarantees->[$i]->{'firstname'} . " " > . $guarantees->[$i]->{'surname'} > } > ); >+ $totalmount += $amount; > } > $template->param( guaranteeloop => \@guaranteedata ); >+ $template->param( amounttot => sprintf("%.2f",$totalmount)); > } >-else { >- if ($data->{'guarantorid'}){ >- my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'}); >- $template->param(guarantor => 1); >- foreach (qw(borrowernumber cardnumber firstname surname)) { >- $template->param("guarantor$_" => $guarantor->{$_}); >- } >+( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' ); >+ >+if ($data->{'guarantorid'}){ >+ my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'}); >+ $template->param(guarantor => 1); >+ foreach (qw(borrowernumber cardnumber firstname surname)) { >+ $template->param("guarantor$_" => $guarantor->{$_}); > } >- if ($category_type eq 'C'){ >- $template->param('C' => 1); >- } > } >- >-$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' ); >- > my %bor; > $bor{'borrowernumber'} = $borrowernumber; > >-- >1.9.1 Created attachment 46328 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; One small issue: I have Euro set as active currency, but the table with the Guarantee's fines show the $ sign. BTW there is a bug pending regarding the display of curreny signs and formats (Bug 4078) . Created attachment 46345 [details] [review] bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Hi, I don't see that the atomic update is setting the field for existing categories, with this patch on and the atomic update run, all of the categories (including C and P) are all set to 0 in the database after the update. Cheers, Liz Created attachment 46486 [details] [review] bug 12446 - Atomic update now sets canbeguarantee to 1 for categories of type C and P Same test plan applies. Lots of work done on this - would be nice to see a sign off! But a little note from me: While I don't want to complicate things here even more, please consider splitting patches up a bit more in the future. From the initial description this could be 3-4 separate features: - 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; - Transfer guarantor's alternate contact to the guarantee while creating. This would make the features more visible in bugzilla, but also in the release notes. As right now - the bug title doesn't really describe all that this patch tries to achieve! ... also small feature patches tend to move quicker! Sorry, I get many conflicts while applying the patches. Created attachment 49793 [details] [review] Bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Sorry, I get: Undefined subroutine &main::GetGuarantees called at /usr/share/kohaclone/members/moremember.pl line 180. I think it is related to Bug 15656 Bug 15656 - Move the guarantor/guarantees code to Koha::Patron (Pushed to aster) Created attachment 50953 [details] [review] Bug 12446 - Enable adult patrons to have a guarantor I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Sorry, this doesn't apply again. Any patch which touches memberentrygen.tt is really hard to keep up to date! Created attachment 53534 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Created attachment 53535 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Created attachment 53536 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Comment on attachment 53536 [details] [review] Bug 12446 - Enable an adult to have a guarantor Review of attachment 53536 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/kohastructure.sql @@ -318,5 @@ > `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) > `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) > `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions > - `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category > - `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'. Where did this go? ::: installer/data/mysql/sysprefs.sql @@ +544,4 @@ > ('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), > +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), No to the comma! ::: koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc @@ +8,4 @@ > <label for="B_streetnumber"> > [% END %] > Street Number: </label> > + <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" /> Potential cut and paste error. Nice catch. ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ +1019,4 @@ > <li data-category_code="[% patron_attribute.category_code %]"> > <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label> > <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" /> > + <input type="hidden" id="[% patron_attribute.form_id %]_desc" name="[% patron_attribute.form_id %]_desc" value="[% patron_attribute.description |html %]" /> If you have the code, why the description? ::: koha-tmpl/intranet-tmpl/prog/js/members.js @@ -357,5 @@ > - "bottom": "3%", > - "position": "fixed", > - "right": "1%", > - "width": "150px", > - } ); Why did you cut this? ::: members/memberentry.pl @@ +236,5 @@ > } > } > > +#recover all data from guarantor address phone ,fax... > +if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) { Why did you add category type? Should not any patron be able to be a guarantor for another? If there is a guarantorid, that should be enough, right? Created attachment 53913 [details] [review] Bug 12446 - QA Follow-up - Added missing icon on add gurantee - Removed category restriction when adding new guarentee - Put back some deleted entries while fixing merging conflicts. - Fixed some typing errors. Does this feature make it inaccurate to label the "Relatives' checkouts" tab as such? "Guarantees' checkouts" perhaps? That's an easy change, but is this a requirement? I think it would be more precise, but maybe some would not like this new "unpersonnal phrasing" ? An easy fix, just let us know if required to reach Signed Off :) Wanted to test but patch does no longer apply. Maybe rebasing is a good occasion to address Comment #39 as well ( "Guarantees' checkouts" instead of "Relatives' checkouts" tab). (In reply to Owen Leonard from comment #39) > Does this feature make it inaccurate to label the "Relatives' checkouts" tab > as such? "Guarantees' checkouts" perhaps? I think we us the term colloquially but I've not problem switching our language to guarantees to be technically correct :) I think we should do that on a separate bug since it affects other parts of Koha not in the purview of this bug patch. Created attachment 60929 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Created attachment 60930 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Created attachment 60934 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; QA test tool complains: FAIL C4/Members/Attributes.pm FAIL pod in file C4/Members/Attributes.pm Apparent command =cut not preceded by blank line *** ERROR: FAIL C4/Utils/DataTables/Members.pm FAIL forbidden patterns forbidden pattern: tab char (line 58) forbidden pattern: tab char (line 59) FAIL valid Can't continue after import errors "GetMemberIssuesAndFines" is not exported by the C4::Members module FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt FAIL forbidden patterns forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 20) FAIL members/moremember.pl FAIL forbidden patterns forbidden pattern: tab char (line 221) also the patch does not apply cleanly Created attachment 63148 [details] [review] Remove wrong importation in DataTables/Members.pm Created attachment 63149 [details] [review] Remove wrong importation in DataTables/Members.pm https://bugs.koha-community.org/show_bug.cgi?id=12446 Signed-off-by: paudet <paudet@inlibro.com> Created attachment 63214 [details] [review] ID change for jQuery listener In modules/common/patron_search.tt, jQuery was listenning for #borrower_data but should have listen for #guarantor_data. Comment on attachment 63214 [details] [review] ID change for jQuery listener Review of attachment 63214 [details] [review]: ----------------------------------------------------------------- Philippe, Please do not add unnecessary changes to your patches: blank lines, indentation changes, trailing spaces should only be fixed when you are modifying these lines. ::: koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt @@ +112,4 @@ > $("body").on("click",".select_user",function(e){ > e.preventDefault(); > var borrowernumber = $(this).data("borrowernumber"); > + var borrower_data = $("#guarantor_data"+borrowernumber).val(); You should not modify existing code without thinking about side-effects. Assume that existing code is useful and used by other scripts :) For instance with this change you break admin/add_user_search.pl when called to set the owner of a fund (from admin/aqbudgets.tt). Aware of bug 14570? Created attachment 64793 [details] [review] Cam 722: Permet a n'importe quelle categorie d'avoir un garant (bz12446) Il s'agit du code du bz 12446 collapse en un commit. Created attachment 64794 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; I corrected my old mistake (hope it doesn't affect the rest of the code :)) and rebase it. Now the patch apply. Comment on attachment 64793 [details] [review] Cam 722: Permet a n'importe quelle categorie d'avoir un garant (bz12446) >From 0ca1ba90904daea5fac5285799b38f8dfb0b6265 Mon Sep 17 00:00:00 2001 >From: Paudet <philippe.audet-fortin@inlibro.com> >Date: Tue, 4 Jul 2017 16:41:04 -0400 >Subject: [PATCH] Cam 722: Permet a n'importe quelle categorie d'avoir un > garant (bz12446) > >Il s'agit du code du bz 12446 collapse en un commit. >--- > C4/Members/Attributes.pm | 19 ++++++++++++- > C4/Utils/DataTables/Members.pm | 24 +++++++++++----- > Koha/Schema/Result/Category.pm | 8 ++++++ > admin/categories.pl | 3 ++ > .../atomicupdate/bug_12446-EnableAdultGarantee.sql | 11 ++++++++ > installer/data/mysql/kohastructure.sql | 3 +- > installer/data/mysql/sysprefs.sql | 4 ++- > .../prog/en/modules/admin/categories.tt | 15 ++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 5 ++++ > .../prog/en/modules/common/patron_search.tt | 7 +++-- > .../prog/en/modules/members/memberentrygen.tt | 6 ++-- > .../prog/en/modules/members/moremember.tt | 30 ++++++++++++-------- > .../en/modules/members/tables/guarantor_search.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/members.js | 18 ++++-------- > members/memberentry.pl | 20 +++++++------ > members/moremember.pl | 33 ++++++++++++++++++++-- > svc/members/search | 2 ++ > 17 files changed, 156 insertions(+), 54 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql > >diff --git a/C4/Members/Attributes.pm b/C4/Members/Attributes.pm >index ab43a7c..2f3bd49 100644 >--- a/C4/Members/Attributes.pm >+++ b/C4/Members/Attributes.pm >@@ -32,7 +32,7 @@ BEGIN { > @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes > DeleteBorrowerAttribute UpdateBorrowerAttribute > extended_attributes_code_value_arrayref extended_attributes_merge >- SearchIdMatchingAttribute); >+ SearchIdMatchingAttribute get_guarantor_shared_attributes); > %EXPORT_TAGS = ( all => \@EXPORT_OK ); > } > >@@ -383,6 +383,23 @@ sub _sort_by_code { > return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value}; > } > >+=head2 get_guarantor_shared_attributes >+ >+ $guarantor_attributes = get_guarantor_attributes(); >+ >+ returns an array reference containing attributes to be shared between guarantor and guarantee. >+ >+=cut >+ >+sub get_guarantor_shared_attributes{ >+ my @attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax ); >+ if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){ >+ $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces >+ @attributes = ( @attributes, @additional); >+ } >+ return \@attributes; >+} >+ > =head1 AUTHOR > > Koha Development Team <http://koha-community.org/> >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index 302eaff..846bcb3 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -2,6 +2,8 @@ package C4::Utils::DataTables::Members; > > use Modern::Perl; > use C4::Context; >+use C4::Members; >+use C4::Members::Attributes qw/get_guarantor_shared_attributes/; > use C4::Utils::DataTables; > use Koha::DateUtils; > >@@ -47,13 +49,21 @@ sub search { > > } > >- my $select = "SELECT >- borrowers.borrowernumber, borrowers.surname, borrowers.firstname, >- borrowers.streetnumber, borrowers.streettype, borrowers.address, >- borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode, >- borrowers.country, cardnumber, borrowers.dateexpiry, >- borrowers.borrowernotes, borrowers.branchcode, borrowers.email, >- borrowers.userid, borrowers.dateofbirth, borrowers.categorycode, >+ $dbh = C4::Context->dbh; >+ my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode ); >+ if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){ >+ foreach my $item (@guarantor_attributes) { >+ if (! grep {$_ eq $item} @columns) { >+ push @columns, $item; >+ } >+ } >+ }; >+ my $borrowers_columns = ""; >+ foreach my $item (@columns) { >+ $borrowers_columns .= "borrowers." . $item . ", "; >+ } >+ >+ my $select = "SELECT " . $borrowers_columns . " > categories.description AS category_description, categories.category_type, > branches.branchname"; > my $from = "FROM borrowers >diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm >index fc26a7d..f655fd9 100644 >--- a/Koha/Schema/Result/Category.pm >+++ b/Koha/Schema/Result/Category.pm >@@ -109,6 +109,12 @@ __PACKAGE__->table("categories"); > default_value: -1 > is_nullable: 0 > >+=head2 canbeguarantee >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ > =head2 default_privacy > > data_type: 'enum' >@@ -161,6 +167,8 @@ __PACKAGE__->add_columns( > default_value => -1, > is_nullable => 0, > }, >+ "canbeguarantee", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0}, > "default_privacy", > { > data_type => "enum", >diff --git a/admin/categories.pl b/admin/categories.pl >index 358ef7d..dbaaf48 100755 >--- a/admin/categories.pl >+++ b/admin/categories.pl >@@ -93,6 +93,7 @@ elsif ( $op eq 'add_validate' ) { > my $checkPrevCheckout = $input->param('checkprevcheckout'); > my $default_privacy = $input->param('default_privacy'); > my @branches = grep { $_ ne q{} } $input->multi_param('branches'); >+ my $canbeguarantee = $input->param('canbeguarantee'); > > my $is_a_modif = $input->param("is_a_modif"); > >@@ -119,6 +120,7 @@ elsif ( $op eq 'add_validate' ) { > $category->hidelostitems($hidelostitems); > $category->overduenoticerequired($overduenoticerequired); > $category->category_type($category_type); >+ $category->canbeguarantee($canbeguarantee); > $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions); > $category->checkprevcheckout($checkPrevCheckout); > $category->default_privacy($default_privacy); >@@ -145,6 +147,7 @@ elsif ( $op eq 'add_validate' ) { > hidelostitems => $hidelostitems, > overduenoticerequired => $overduenoticerequired, > category_type => $category_type, >+ canbeguarantee => $canbeguarantee, > BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions, > checkprevcheckout => $checkPrevCheckout, > default_privacy => $default_privacy, >diff --git a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql b/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql >new file mode 100644 >index 0000000..56462a7 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql >@@ -0,0 +1,11 @@ >+-- ******** -- >+-- SYSPREFS -- >+-- ******** -- >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'); >+ >+-- ********* -- >+-- STRUCTURE -- >+-- ********* -- >+ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0'; >+UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C'; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e9c60aa..7e3bc48 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -331,8 +331,9 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr > `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) > `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) > `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions >- `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category >+ `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category, > `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'. >+ `canbeguarantee` tinyint(1) NOT NULL default '0' > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 0bd8cac..27173df 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -6,7 +6,9 @@ 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'), >-('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'), >+('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'), >+('AddressFormat','us','','Choose format to display postal addresses', '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'), > ('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index e33b36f..b115aa4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -151,6 +151,18 @@ > </select> > <span class="required">Required</span> > </li> >+ <li> >+ <label for="canbeguarantee">Can be guarantee</label> >+ <select name="canbeguarantee" id="canbeguarantee"> >+ [% IF category.canbeguarantee %] >+ <option value="1" selected>Yes</option> >+ <option value="0">No</option> >+ [% ELSE %] >+ <option value="1">Yes</option> >+ <option value="0" selected>No</option> >+ [% END %] >+ <select> >+ </li> > <li><label for="branches">Branches limitation: </label> > <select id="branches" name="branches" multiple size="10"> > <option value="">All branches</option> >@@ -299,6 +311,7 @@ > </td> > </tr> > [% END %] >+ <tr><th scope="row">Can be guarantee</th><td>[% IF category.canbeguarantee %]Yes[% ELSE %]No[% END %]</td></tr> > <tr> > <th scope="row">Default privacy: </th> > <td> >@@ -358,6 +371,7 @@ > [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %] > <th scope="col">Check previous checkout?</th> > [% END %] >+ <th scope="col">Can be guarantee</th> > <th scope="col">Default privacy</th> > <th scope="col">Actions</th> > </tr> >@@ -462,6 +476,7 @@ > [% END %] > </td> > [% END %] >+ <td>[% IF category.canbeguarantee %] Yes [% ELSE %] no [% END %]</td> > <td> > [% SWITCH category.default_privacy %] > [% CASE 'default' %] >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 ac4946d..fe0c78a 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 >@@ -190,7 +190,12 @@ Patrons: > yes: Do > no: "Don't" > - track last patron activity. >+ - > - Everytime a patron will connect, the borrowers.lastseen will be updated with the current time. >+ - "These additional following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will be transferred from guarantor to guarantee:" >+ - pref: AdditionalGuarantorField >+ class: multi >+ - (separate columns with |) > "Norwegian patron database": > - > - pref: NorwegianPatronDBEnable >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >index 9fe6473..ab0d15e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt >@@ -113,7 +113,8 @@ $(document).ready(function(){ > e.preventDefault(); > var borrowernumber = $(this).data("borrowernumber"); > var borrower_data = $("#borrower_data"+borrowernumber).val(); >- select_user( borrowernumber, JSON.parse(borrower_data) ); >+ var guarantor_attributes = $("#guarantor_attributes").val(); >+ select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) ); > }); > > }); >@@ -160,9 +161,9 @@ function filterByFirstLetterSurname(letter) { > wait_for_opener(); > } > [% ELSIF selection_type == 'select' %] >- function select_user(borrowernumber, data) { >+ function select_user(borrowernumber, data, attributes) { > var p = window.opener; >- p.select_user(borrowernumber, data); >+ p.select_user(borrowernumber, data, attributes); > window.close(); > } > [% 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 7f6f734..710d9ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -407,7 +407,6 @@ $(document).ready(function() { > [% END %] > </li> > [% ELSE %] >- [% IF ( C ) %] > [% IF ( guarantorid ) %] > <li id="contact-details"> > [% ELSE %] >@@ -425,9 +424,8 @@ $(document).ready(function() { > <input name="contactname" id="contactname" type="text" size="20" value="[% contactname | html %]" /> > [% END %] > </li> >- [% END %] >- [% UNLESS nocontactfirstname %] >- <li> >+ [% UNLESS nocontactfirstname %] >+<li> > <label for="contactfirstname">First name: </label> > [% IF ( guarantorid ) %] > <span>[% contactfirstname %]</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 6e5308f..c106093 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -222,8 +222,7 @@ function validate1(date) { > [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])</h3> > <div class="yui-u first"> > <div id="patron-information" style="padding : .5em;"> >- >- [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames | html %]”[% END %] >+ [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames %]”[% END %] > > <div class = "address"> > [% IF Koha.Preference( 'AddressFormat' ) %] >@@ -254,16 +253,23 @@ function validate1(date) { > [% IF ( sex ) %]<li><span class="label">Gender:</span> > [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %] > </li>[% END %][% END %] >- [% IF guarantees %] >- <li> >- <span class="label">Guarantees:</span> >- <ul> >- [% FOREACH guarantee IN guarantees %] >- <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li> >- [% END %] >- </ul> >- </li> >- [% ELSIF guarantor %] >+ [% IF ( isguarantee ) %] >+ [% IF ( guaranteeloop ) %] >+ <li><span class="label">Guarantees:</span> >+ <table>[% FOREACH guaranteeloo IN guaranteeloop %] >+ <tr> >+ <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber %]">[% guaranteeloo.name %]</a></td> >+ <td style='text-align:right'>[% guaranteeloo.finesguarantee %]</td> >+ </tr>[% END %] >+ <tr> >+ <td>Total</td> >+ <td style='text-align:right'>[% amounttot %]</td> >+ </tr> >+ </table> >+ </li> >+ [% END %] >+ [% END %] >+ [% IF ( isguarantor ) %] > <li> > <span class="label">Guarantor:</span> > [% IF guarantor.borrowernumber %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >index f1bb9a1..5817391 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt >@@ -17,7 +17,7 @@ > "dt_address": > "[% INCLUDE escape_address data=data %]", > "dt_action": >- "<a href=\"#\" class=\"btn btn-default btn-xs select_user\" data-borrowernumber=\"[% data.borrowernumber %]\">Select</a><input type=\"hidden\" id=\"borrower_data[% data.borrowernumber %]\" name=\"borrower_data[% data.borrowernumber %]\" value=\"[% To.json(data) | html %]\" />" >+ "<a href=\"#\" class=\"btn btn-mini select_user\" data-borrowernumber=\"[% data.borrowernumber %]\">Select</a><input type=\"hidden\" id=\"borrower_data[% data.borrowernumber %]\" name=\"guarantor_data\" value=\"[% To.json(data) | html %]\" /><input type=\"hidden\" id=\"guarantor_attributes\" name=\"guarantor_attributes\" value=\"[% To.json(attributes) | html %]\" />" > }[% UNLESS loop.last %],[% END %] > [% END %] > ] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 28853b2..c476469 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -183,7 +183,7 @@ function update_category_code(category_code) { > $(mytables).find(" li[data-category_code='']").show(); > } > >-function select_user(borrowernumber, borrower) { >+function select_user(borrowernumber, borrower, attributes) { > var form = $('#entryform').get(0); > if (form.guarantorid.value) { > $("#contact-details, #quick_add_form #contact-details").find('a').remove(); >@@ -206,14 +206,11 @@ function select_user(borrowernumber, borrower) { > .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden'; > $("#quick_add_form #contactfirstname").val(borrower.firstname).before('<span>'+borrower.firstname+'</span.').attr({type:"hidden"}); > >- form.streetnumber.value = borrower.streetnumber; >- form.address.value = borrower.address; >- form.address2.value = borrower.address2; >- form.city.value = borrower.city; >- form.state.value = borrower.state; >- form.zipcode.value = borrower.zipcode; >- form.country.value = borrower.country; >- form.branchcode.value = borrower.branchcode; >+ form.guarantorsearch.value = LABEL_CHANGE; >+ for (var i = 0; i < attributes.length; i++) { >+ var attribute = attributes[i]; >+ document.forms.entryform[attribute].value = borrower[attribute]; >+ } > > $("#quick_add_form #streetnumber").val(borrower.streetnumber); > $("#quick_add_form #address").val(borrower.address); >@@ -224,9 +221,6 @@ function select_user(borrowernumber, borrower) { > $("#quick_add_form #country").val(borrower.country); > $("#quick_add_form select[name='branchcode']").val(borrower.branchcode); > >- form.guarantorsearch.value = LABEL_CHANGE; >- $("#quick_add_form #guarantorsearch").val(LABEL_CHANGE); >- > return 0; > } > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 2ffea5d..eef8554 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -240,21 +240,21 @@ if ( ( $op eq 'insert' ) and !$nodouble ) { > } > } > >- #recover all data from guarantor address phone ,fax... >-if ( $guarantorid ) { >+#recover all data from guarantor address phone ,fax... >+if ( $guarantorid) { >+ > if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) { > $category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C'; > $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'}; > $newdata{'contactfirstname'}= $guarantordata->{'firstname'}; > $newdata{'contactname'} = $guarantordata->{'surname'}; > $newdata{'contacttitle'} = $guarantordata->{'title'}; >+ > if ( $op eq 'add' ) { >- 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)) { >- $newdata{$_} = $guarantordata->{$_}; >- } >+ my @attributes = @{C4::Members::Attributes::get_guarantor_shared_attributes()}; >+ foreach my $attribute (@attributes) { >+ $newdata{$attribute} = $guarantordata->{$attribute}; >+ } > } > } > } >@@ -720,7 +720,9 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { > $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification")); > } > >-$template->param( "showguarantor" => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are >+$template->param( "showguarantor" => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are >+ >+$template->param( "guarantor_attributes" => C4::Members::Attributes::get_guarantor_shared_attributes() ); > $debug and warn "memberentry step: $step"; > $template->param(%data); > $template->param( "step_$step" => 1) if $step; # associate with step to know where u are >diff --git a/members/moremember.pl b/members/moremember.pl >index 0649dcf..1767a5c 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -177,7 +177,6 @@ if ( $category_type eq 'C') { > > my @relatives; > if ( my $guarantor = $patron->guarantor ) { >- $template->param( guarantor => $guarantor ); > push @relatives, $guarantor->borrowernumber; > push @relatives, $_->borrowernumber for $patron->siblings; > } elsif ( $patron->contactname || $patron->contactfirstname ) { >@@ -189,15 +188,43 @@ if ( my $guarantor = $patron->guarantor ) { > ); > } else { > my @guarantees = $patron->guarantees; >- $template->param( guarantees => \@guarantees ); > push @relatives, $_->borrowernumber for @guarantees; > } > > my $relatives_issues_count = > Koha::Database->new()->schema()->resultset('Issue') > ->count( { borrowernumber => \@relatives } ); >+my @guarantees = $patron->guarantees; >+my $count = scalar @guarantees; >+if ( $count ) { >+ $template->param( isguarantee => 1 ); >+ >+ my @guaranteedata; >+ my $amount; >+ my $totalmount = 0; >+ >+ foreach my $guarantee (@guarantees){ >+ my ($amount,$accts,undef) = GetMemberAccountRecords($guarantee->borrowernumber); >+ push(@guaranteedata, >+ { >+ borrowernumber => $guarantee->borrowernumber, >+ cardnumber => $guarantee->cardnumber, >+ finesguarantee => sprintf("%.2f",$amount), >+ name => $guarantee->firstname . " " >+ . $guarantee->surname >+ } >+ ); >+ $totalmount += $amount; >+ } >+ $template->param( guaranteeloop => \@guaranteedata ); >+ $template->param( amounttot => sprintf("%.2f",$totalmount)); >+} >+( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' ); > >-$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' ); >+if (my $guarantor = $patron->guarantor){ >+ $template->param(isguarantor => 1); >+ $template->param(guarantor => $guarantor); >+} > > my %bor; > $bor{'borrowernumber'} = $borrowernumber; >diff --git a/svc/members/search b/svc/members/search >index 4f798ab..cdebc80 100755 >--- a/svc/members/search >+++ b/svc/members/search >@@ -108,12 +108,14 @@ if ($has_permission) { > $results->{iTotalDisplayRecords} = scalar( @patrons_with_permission ); > } > >+my @attributes = C4::Members::Attributes::get_guarantor_shared_attributes(); > $template->param( > sEcho => $sEcho, > iTotalRecords => $results->{iTotalRecords}, > iTotalDisplayRecords => $results->{iTotalDisplayRecords}, > aaData => $results->{patrons}, > selection_type => $selection_type, >+ attributes => @attributes > ); > > output_with_http_headers $input, $cookie, $template->output, 'json'; >-- >1.9.1 Created attachment 64828 [details] [review] Bug 12446 - Added a missing comma in kohastructure.sql Sorry, patch no longer applies :( Bug 12446 - Enable an adult to have a guarantor 64794 - Bug 12446 - Enable an adult to have a guarantor 64828 - Bug 12446 - Added a missing comma in kohastructure.sql Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 12446 - Enable an adult to have a guarantor Using index info to reconstruct a base tree... M installer/data/mysql/kohastructure.sql M installer/data/mysql/sysprefs.sql M koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc M koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref M koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt M koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt M koha-tmpl/intranet-tmpl/prog/js/members.js M members/memberentry.pl M members/moremember.pl M svc/members/search Falling back to patching base and 3-way merge... Auto-merging svc/members/search Auto-merging members/moremember.pl Auto-merging members/memberentry.pl CONFLICT (content): Merge conflict in members/memberentry.pl Auto-merging koha-tmpl/intranet-tmpl/prog/js/members.js Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc Auto-merging installer/data/mysql/sysprefs.sql Auto-merging installer/data/mysql/kohastructure.sql error: Failed to merge in the changes. Patch failed at 0001 Bug 12446 - Enable an adult to have a guarantor The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-12446---Enable-an-adult-to-have-a-guarantor-iB_HiD.patch Created attachment 72295 [details] [review] Bug 12446 - Enable an adult to have a guarantor I have rebased the patch and corrected some bugs. It should work now :) Here's the test plan: 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Thanks for testing :) Patch tested with a sandbox, by delaye <stephane.delaye@biblibre.com> Created attachment 72883 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Signed-off-by: delaye <stephane.delaye@biblibre.com> Comment on attachment 72883 [details] [review] Bug 12446 - Enable an adult to have a guarantor Review of attachment 72883 [details] [review]: ----------------------------------------------------------------- Hi Roch, I've done some initial review, but I am not quite happy with this as is. The biggest problem I see is that it does much more than the bug title advertises. The flag on patron categories and the new preference to decide which patron fields to copy should have been at least 2 bugs. There is also changes to the display like displaying the account balance (which should probably use Price TT?). Please consider splitting the bug when working on it again. 1) QA script: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt FAIL forbidden patterns forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 20) 2) Spinter review: ::: installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql @@ +6,5 @@ > + > +-- ********* -- > +-- STRUCTURE -- > +-- ********* -- > +ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0'; Please use AFTER to declare where the column should be added to match with the kohastructure statement. Because depending on when this is pushed, it might lead to a different database structure between new and old installations otherwise. ::: installer/data/mysql/kohastructure.sql @@ +303,4 @@ > `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) > `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) > `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions > + `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category, This change is not necessary, no comma needed after the comment. ::: installer/data/mysql/sysprefs.sql @@ +6,5 @@ > ('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'), Change to AddPatronLists seems misplaced here. ::: koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc @@ +8,4 @@ > <label for="streetnumber"> > [% END %] > Street number: </label> > + <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" /> Why only changes to the ...style-us and not the other templates? ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ +154,3 @@ > [% IF logged_in_user.can_see_patron_infos( guarantee ) %] > + <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></td> > + <td style='text-align:right'>[% guarantee.account.balance %]</td> What has this to do with making it possible for adults to be guarantors? ;) ::: members/moremember.pl @@ +209,5 @@ > + } > + $template->param( guarantees => @guarantees); > + $template->param( amounttot => sprintf("%.2f",$totalmount)); > +} > +( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' ); If we set it on the patron category, why check here for I and A? *** Bug 9305 has been marked as a duplicate of this bug. *** Created attachment 77766 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Signed-off-by: delaye <stephane.delaye@biblibre.com> Created attachment 77767 [details] [review] Bug 12446: Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Signed-off-by: delaye <stephane.delaye@biblibre.com> Created attachment 77768 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally New patch to fix, in part, some problems raised by QA. > Why only changes to the ...style-us and not the other templates? If I look at it chronologically, this patch was first submitted at a time when no {de,fr} templates existed. Commits for these templates came in 2015 and 2017, and I couldn't say when they were added to the master. It's no excuse for not reworking the patch, if that's what QA needs, but at least there's a rationale: it was rebased over and over without extending what had been done. > What has this to do with making it possible for adults to be guarantors? ;) That looks like a prime candidate for an optional patch, I concede. But some of the 'extra' developments in this patch were naturally asked by our clients when we offered linking adults to adults. I do think there are merits to keeping these functionalities together (though perhaps not as far as keeping the example you quoted). > If we set it on the patron category, why check here for I and A? Indeed, it's information easily retrievable from the $patron object already sent to the template. Worst of all, it's not even used by any template linked to moremember.pl :/ I feel like that echoes my previous comment about it being an old cookie: it has been rebased many times to quickly offer something to test, but at the cost of not being rewritten everytime to leverage new functions/variables/developments. Created attachment 79343 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Created attachment 79344 [details] [review] Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Signed-off-by: delaye <stephane.delaye@biblibre.com> Created attachment 79345 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Created attachment 79347 [details] [review] Bug 12446 - Enable an adult to have a guarantor Bug 12446 - Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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; Signed-off-by: delaye <stephane.delaye@biblibre.com> Created attachment 79348 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally > > Why only changes to the ...style-us and not the other templates? > > If I look at it chronologically, this patch was first submitted at a time > when no {de,fr} templates existed. Commits for these templates came in 2015 > and 2017, and I couldn't say when they were added to the master. It's no > excuse for not reworking the patch, if that's what QA needs, but at least > there's a rationale: it was rebased over and over without extending what had > been done. I see the follow-up doesn't contain changes to the other address format files still, could you please check? > > What has this to do with making it possible for adults to be guarantors? ;) > > That looks like a prime candidate for an optional patch, I concede. But some > of the 'extra' developments in this patch were naturally asked by our > clients when we offered linking adults to adults. I do think there are > merits to keeping these functionalities together (though perhaps not as far > as keeping the example you quoted). I understand that it happens, my main point is documentation. By slipping in features into bugs without documenting them at least in the commit message, they often get lost and end up undocumented, especially when they don't fit the bugs description which is often all people look at in release notes. I hope to see this signed off soon! I took a quick look at the revised code and I'm afraid it still looks like some additional cleanup is required. 1) C4::Utils::Datatables::Members::search seems to duplicate code which has been modified in the interim. 2) Not sure how 'AddPatronLists' syspref comes into this? 3) I also agree this would be significantly simpler to SO and QA if it were split into two bugs. Created attachment 85069 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Created attachment 88364 [details] [review] Bug 12446: Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 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; Created attachment 88365 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Created attachment 88366 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Created attachment 88367 [details] [review] Bug 12446: (QA follow-up) QA tests fixing, cleaning code This patch does 3 things : - Remove old code in C4/Utils/DataTables/Members.pm. - Fix the AdditionalGuarantorField dead link for the borrowers table schema. - Remove unused variables so QA tests pass. (In reply to Martin Renvoize from comment #73) > I took a quick look at the revised code and I'm afraid it still looks like > some additional cleanup is required. > > 1) C4::Utils::Datatables::Members::search seems to duplicate code which has > been modified in the interim. > 2) Not sure how 'AddPatronLists' syspref comes into this? > 3) I also agree this would be significantly simpler to SO and QA if it were > split into two bugs. 1) I added a new patch which removes the duplicated code. 2) AddPatronLists doesn't come into this. If it has been added, it has been removed in the next patch. *** Bug 6922 has been marked as a duplicate of this bug. *** Created attachment 90389 [details] [review] Bug 12446: Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 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; Created attachment 90390 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Created attachment 90391 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Created attachment 90392 [details] [review] Bug 12446: (QA follow-up) QA tests fixing, cleaning code This patch does 3 things : - Remove old code in C4/Utils/DataTables/Members.pm. - Fix the AdditionalGuarantorField dead link for the borrowers table schema. - Remove unused variables so QA tests pass. I rebased the patches against master. Ready to be tested. Created attachment 90470 [details] [review] Bug 12446: Enable an adult to have a guarantor Concflicts has been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenerios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional mostly to set it by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 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; Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 90471 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 90472 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 90473 [details] [review] Bug 12446: (QA follow-up) QA tests fixing, cleaning code This patch does 3 things : - Remove old code in C4/Utils/DataTables/Members.pm. - Fix the AdditionalGuarantorField dead link for the borrowers table schema. - Remove unused variables so QA tests pass. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> I am sorry, but there are a lot of conflicts now with this patch. With bug 14570 pushed, this might need to be reworked. Created attachment 93388 [details] [review] Bug 12446: Enable an adult to have a guarantor Conflicts have been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenarios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional it should have been set by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 guarantee: 0) Select an adult patron; 1) Insert all information; 2) Click Add guarantee bouton; 3) Validate 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) Validate 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) Validate Garantor information/Main address/Contact fieldsets filled; 8) Validate Garantor additional alternate address/contact filled; - Transfer guarantor's alternate address/contact to the guarantee while adding a guarantee: 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 guarantee bouton; 6) Validate Garantor information/Main address/Contact fieldsets filled; 7) Validate Garantor additional alternate address/contact filled; Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 93389 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 93390 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 93391 [details] [review] Bug 12446: (QA follow-up) QA tests fixing, cleaning code This patch does 3 things : - Remove old code in C4/Utils/DataTables/Members.pm. - Fix the AdditionalGuarantorField dead link for the borrowers table schema. - Remove unused variables so QA tests pass. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 93392 [details] [review] Bug 12446: Schema update Category.pm Created attachment 93393 [details] [review] Bug 12446: (follow-up) Remove mandatory transfered values With the new system preference AdditionalGuarantorField, one can add data to be transfered to the guarantee, but cannot remove default ones. This patch renames the syspref to GuarantorFields and set hardcoded default values as the preference's default. To test: 1. After database update, check that the default value for the syspref GuarantorFields contains these columns: streetnumber|address|address2|city|state|zipcode|country| branchcode|phonepro|mobile|email|emailpro|fax 2. Set the value as empty 3. Try adding a guarantor to a patron (from the guarantor's page or the guarantee's): no values should be imported. 4. Check that it still works with different values for the preference. Created attachment 93394 [details] [review] Bug 12446: (follow-up) Code cleaning Some variable name change, put database update in a perl file, remove unused code and other small fixes. I rebased the patches. The code has changed a lot with bug 14570, please retest. I've also made some fixes and changed the new system preference AdditionalGuarantorField to GuarantorFields. This way, the system can be set so no information is transfered to the guarantee while adding a guarantor. The test plan for this change is in the patch's commit message. This will need to update the cleanup routine introduced in bug 17168. Created attachment 95411 [details] [review] Bug 12446: (follow-up) Update for Bug 17168 Created attachment 95853 [details] [review] Bug 12446: Enable an adult to have a guarantor Conflicts have been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenarios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update SQL script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional it should have been set by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 guarantee: 0) Select an adult patron; 1) Insert all information; 2) Click Add guarantee bouton; 3) Validate 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) Validate 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) Validate Garantor information/Main address/Contact fieldsets filled; 8) Validate Garantor additional alternate address/contact filled; - Transfer guarantor's alternate address/contact to the guarantee while adding a guarantee: 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 guarantee bouton; 6) Validate Garantor information/Main address/Contact fieldsets filled; 7) Validate Garantor additional alternate address/contact filled; Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 95854 [details] [review] Bug 12446: (QA follow-up) Cleaning, and fixing, old code carried accidentally Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 95855 [details] [review] Bug 12446: (follow-up) Show all guarantees on the guarantor detail page Only one guarantee is shown on the guarantor detail page. The guarantees list should be passed to the template as a ref. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 95856 [details] [review] Bug 12446: (QA follow-up) QA tests fixing, cleaning code This patch does 3 things : - Remove old code in C4/Utils/DataTables/Members.pm. - Fix the AdditionalGuarantorField dead link for the borrowers table schema. - Remove unused variables so QA tests pass. Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 95857 [details] [review] Bug 12446: Schema update Category.pm Created attachment 95858 [details] [review] Bug 12446: (follow-up) Remove mandatory transfered values With the new system preference AdditionalGuarantorField, one can add data to be transfered to the guarantee, but cannot remove default ones. This patch renames the syspref to GuarantorFields and set hardcoded default values as the preference's default. To test: 1. After database update, check that the default value for the syspref GuarantorFields contains these columns: streetnumber|address|address2|city|state|zipcode|country| branchcode|phonepro|mobile|email|emailpro|fax 2. Set the value as empty 3. Try adding a guarantor to a patron (from the guarantor's page or the guarantee's): no values should be imported. 4. Check that it still works with different values for the preference. Created attachment 95859 [details] [review] Bug 12446: (follow-up) Code cleaning Some variable name change, put database update in a perl file, remove unused code and other small fixes. Created attachment 95860 [details] [review] Bug 12446: (follow-up) Update for Bug 17168 Rebased the patches against current master. Hi Maryse, small failure in the QA script: 1) QA script FAIL installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql FAIL git manipulation The file has been added and deleted in the same patchset FAIL installer/data/mysql/kohastructure.sql OK boolean_vs_tinyint OK charset_collate OK git manipulation FAIL tinyint_has_boolean_flag The new column categories.canbeguarantee is using TINYINT(1) as type but is not defined as boolean in the schema file (Koha/Schema/Result/Category.pm), see the SQL12 coding guideline The first could be fixed by squashing the patches in question, but should only be done if they got the same author/tester lines. 2) Quick code review Looks good so far, will continue testing with the follow-ups (switch back to signed-off) Note: I feel that GuarantorFields and "Shows guarantees' fines in the guarantor's page" should have been separate features/bugs - they add even more code to check and work through and make this this harder to test and harder to advertise/document. The bug title/description is actually not what this patch does, but is what will show up in release notes. - Too late now I guess, but I think it's part of the reason this has not been moving as fast as hoped for. :( Too late for 20.05 now.. it would be great to see some concerted effort on this near the beginning of the 20.11 cycle.. I agree with Katrin, this bug would have been much clearer as a set of dependant bugs.. easier to test and qa and better for advertising in the release notes. Huntsville-Madison County is also interested in this bug. Some of it we got in 19.11 (fines) but the info transfer at creation and the ability for Adult patrons to be guarantees would be very helpful. Thanks, Marti Fuerst Created attachment 106753 [details] [review] Bug 12446: Enable an adult to have a guarantor Conflicts have been fixed. Also attributes in system preference : AdditionalGuarantorField are now displayed correctly in all scenarios. I have rebased every patch. This includes all the features from the previous patches. Removed the dollar signs and stopped using C4::Category On the patron category page, there is a new field to specify whether patrons can be guarantee or not. The atomic update script adds this new field and sets it to true for categories of type "C" and "P". 1) Apply the patch 2) Run updatedatabase.pl to add AdditionalGuarantorField to preferences and canbeguarantee to categories. 3) Go to patron category administration, edit a category and change the value of Can Be Guarantee to yes (for Child and Professional it should have been set by default) 4) See below to test various scenarios - Enable an adult to have a guarantor: 0.0) Create or edit a patron category of type 'A'. 0.1) Set the "Can be guarantee" field to "Yes" and save. 1) Select an adult patron -> details tab; 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 guarantee: 0) Select an adult patron; 1) Insert all information; 2) Click Add guarantee bouton; 3) Validate 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) Validate 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) Validate Garantor information/Main address/Contact fieldsets filled; 8) Validate Garantor additional alternate address/contact filled; - Transfer guarantor's alternate address/contact to the guarantee while adding a guarantee: 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 guarantee bouton; 6) Validate Garantor information/Main address/Contact fieldsets filled; 7) Validate Garantor additional alternate address/contact filled; Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Created attachment 106754 [details] [review] Bug 12446: (follow-up) Remove mandatory transfered values With the new system preference AdditionalGuarantorField, one can add data to be transfered to the guarantee, but cannot remove default ones. This patch renames the syspref to GuarantorFields and set hardcoded default values as the preference's default. To test: 1. After database update, check that the default value for the syspref GuarantorFields contains these columns: streetnumber|address|address2|city|state|zipcode|country| branchcode|phonepro|mobile|email|emailpro|fax 2. Set the value as empty 3. Try adding a guarantor to a patron (from the guarantor's page or the guarantee's): no values should be imported. 4. Check that it still works with different values for the preference. Created attachment 106755 [details] [review] Bug 12446: (follow-up) Code cleaning Some variable name change, remove unused code and other small fixes. Created attachment 106756 [details] [review] Bug 12446: Schema update Category.pm Created attachment 106757 [details] [review] Bug 12446: (follow-up) Update for Bug 17168 I rebased the patches and merged the ones which were signed-off. By adding the atomic update changes to it, it took care of the first qa script error. For the second error, I directly altered the schema update patch to correct it. The status has been set back to signed off, as requested. Hi Maryse, I am no expert on the guarantor features, mostly because we work with academic libraries that have no children and the limitation on the relationships at the moment. So I am interested in this one, but still learning how it all fits together. 1) Conflict of system preferences? Current Koha has the PrefillGuaranteeField system preference that appears to achieve the same as GuarantorFields added by this patch set. Can you please check and explain if there is a difference in behaviour? Please adjust the commit message with the test plan (either remove or update the pref name) 2) Not only adults I believe this patch goes even further than the initial description: it will enable patron categories from all category types to be able to act as guarantees (not only adults). So it will allow arbitrary relationships? We should adjust the bug title, if I am right about this. Maybe "Ability to allow guarantor relationship for all patron category types" ? 3) Children can be guarantors? This seems to be the case before your patch set: Searching for a guarantor doesn't seem to have any limits. You can use child patrons as guarantor. No change required - just noting as this might be worth discussing separately. 4) Guarantees fines display I am not quite happy with the table used for display, I think it doesn't work very well with the rest of the page. We also often get asked to hide anything fine related for libraries not using fines. It would be nice if the information only showed up when there are actually fines. We should at least add an id and maybe some classes. Attaching a screenshot later. 1) is the blocker here - please check! Created attachment 107611 [details]
Unintentionally blue screenshot of the new fines display for guarantees
Hm another question: can you explain the changes to the various patron/member search related files? Created attachment 111052 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Created attachment 111053 [details] [review] Bug 12446: Schema update Category.pm It has been said a few times before that this would have been better splitted into different bugs. I agree with that and feel that now is a good time to do so, considering the changes which have to be done anyway because of the new PrefillGuaranteeField preference. Therefore this patch has been splitted into 3 different bugs. This one has been renamed to "Ability to allow guarantor relationship for all patron category types", as proposed, to better reflect what it does. 1) I wasn't aware of the new PrefillGuaranteeField preference, but it does indeed replace GuarantorFields. However, this patch also introduced a new use of the preference to transfer informations from guarantor to guarantee not only when creating a new guarantee, but also when adding a new guarantor relationship to an existing patron. This part of the patch has been moved to a new bug (Bug 26597). > Hm another question: can you explain the changes to the various > patron/member search related files? The changes to search files are for this part of the patch. 4) I've decided to make a few changes to the way the fines are displayed, following the advice mentionned here. However, since I was splitting this already, I've moved these corrections to a new bug (Bug 26598). Finally, since this is a big change in the content of the bug, I merged all patches and set it back to need signoff. Hi Maryse, thx a lot for reworking and splitting these patches. I hope they will hit the QA queue soon. Created attachment 111317 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Created attachment 111318 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> If I use the "Add guarantee" button, I can create a guarantee of any patron type, regardless of "can be guarantee" setting for that patron category. It makes sense to filter the patron category pulldown to remove categories that cannot be guarantees. Can you add that? Created attachment 112102 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Created attachment 112160 [details] [review] Bug 26751: Fix fatal exception if only one repo defined This patch fixes this nasty problem with how XML is parsed: if more than one entry is found, repo => [] is generated. If only one, repo => {}. To test: 1. Have more than one entries in the plugins_repo entry: <plugin_repos> <repo> <name>ByWater Solutions</name> <org_name>bywatersolutions</org_name> <service>github</service> </repo> <repo> <name>Theke Solutions</name> <org_name>thekesolutions</org_name> <service>github</service> </repo> <repo> <name>PTFS Europe</name> <org_name>ptfs-europe</org_name> <service>github</service> </repo> </plugin_repos> 2. Search for plugins => SUCCESS: Searching works! 3. Leave only one entry 4. Restart all to refresh things 5. Try searching for plugins => FAIL: Fatal error 6. Apply this patch 7. Repeat 5 => SUCCESS: It doesn't explode anymore! 8. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 112161 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 112162 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 112163 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Please retest, there is something wrong here. "Add guarantee" button and I get: """ Cannot add patron There are no patron categories defined. Please add a patron category. """ It's coming from the default value in DB, why did you default to 0? I think it should default to 1. Also, Maryse, a quick note: the DBIC schema should be in a separate patch, but if you have specific change to add to the file (like here the is_boolean flag), it should be on another patch as well. I will take care of it for this time. (In reply to Jonathan Druart from comment #135) > It's coming from the default value in DB, why did you default to 0? I think > it should default to 1. I think defaulting to 1 would be logical, but that would also be a change in system behaviour, since previously only patron categories C and P could be guaranteed it seems. Maybe it's a case where the default should be 1, but we set it to 0 for non-C and non-P patrons when doing a database update... (In reply to David Cook from comment #137) > (In reply to Jonathan Druart from comment #135) > > It's coming from the default value in DB, why did you default to 0? I think > > it should default to 1. > > I think defaulting to 1 would be logical, but that would also be a change in > system behaviour, since previously only patron categories C and P could be > guaranteed it seems. > > Maybe it's a case where the default should be 1, but we set it to 0 for > non-C and non-P patrons when doing a database update... But that's exactly what this patch does: $dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C'"); Jonathan, do you have neither P nor C categories maybe? Maybe we should hide the option then intead. Note: with the normal sample data that should be working. (In reply to Katrin Fischer from comment #138) > (In reply to David Cook from comment #137) > > (In reply to Jonathan Druart from comment #135) > > > It's coming from the default value in DB, why did you default to 0? I think > > > it should default to 1. > > > > I think defaulting to 1 would be logical, but that would also be a change in > > system behaviour, since previously only patron categories C and P could be > > guaranteed it seems. > > > > Maybe it's a case where the default should be 1, but we set it to 0 for > > non-C and non-P patrons when doing a database update... > > But that's exactly what this patch does: > $dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' > OR category_type = 'C'"); > No, that does the opposite of what I describe. I'm saying that the schema default should be 1 but then there should be a update patch to do the following: $dbh->do("UPDATE categories SET canbeguarantee = 0 WHERE category_type NOT IN ('P','C'); It's a subtle but significant difference. Hm ok, other way aorund. But I think the more common case is that you'd want 0 not 1 (no guarantors as default) - so I am not sure why we should change the default on the table? (In reply to Katrin Fischer from comment #140) > Hm ok, other way aorund. But I think the more common case is that you'd want > 0 not 1 (no guarantors as default) - so I am not sure why we should change > the default on the table? Ah that's an interesting perspective. I hadn't thought of that. I was thinking how for new installs we would want to allow guarantors by default. That said, we actually only have 1 out of 100 libraries who have adults guaranteeing other adults. Yeah I withdraw my earlier remarks. I think it's probably fine the way it is now then. (In reply to Katrin Fischer from comment #138) > (In reply to David Cook from comment #137) > > (In reply to Jonathan Druart from comment #135) > > > It's coming from the default value in DB, why did you default to 0? I think > > > it should default to 1. > > > > I think defaulting to 1 would be logical, but that would also be a change in > > system behaviour, since previously only patron categories C and P could be > > guaranteed it seems. > > > > Maybe it's a case where the default should be 1, but we set it to 0 for > > non-C and non-P patrons when doing a database update... > > But that's exactly what this patch does: > $dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' > OR category_type = 'C'"); > > Jonathan, do you have neither P nor C categories maybe? Maybe we should hide > the option then intead. > > Note: with the normal sample data that should be working. On a new install (reset_all so sample data): /cgi-bin/koha/members/moremember.pl?borrowernumber=5 With the patch: Click "Add guarantee" and get "Cannot add patron There are no patron categories defined. Please add a patron category." Without the patch, on master: Click "Add guarantee" and get the "add patron form" /members/memberentry.pl?op=add&guarantor_id=5&category_type=C Created attachment 113583 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. I decided to keep the default value in the database as 0 because I feel this would be the most common case. Instead, what I did was add "canbeguarantee" values in the sample data used for fresh installs. This, plus the database update, should make sure patron categories of type 'C' and 'P' can be guarantees by default for both new and updated installs. As for the "Add guarantee" button displaying the "There are no patron categories defined." error, this is due to the last patch wich limit categories to the ones which can be guarantees. It seems normal to me that adding a guarantee would fail if no patron categories can be used. If this is not ok, what we could do would be to either hide the button if there is no categories available or use a more specific error message in that particular case. Release notes needed, please provide them ASAP. Added release notes, updating to "patch doesn't apply" Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 12446: Ability to allow guarantor relationship for all patron category types Using index info to reconstruct a base tree... M Koha/Patron.pm M installer/data/mysql/kohastructure.sql M koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc M koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt M members/memberentry.pl M t/db_dependent/Patrons.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Patrons.t CONFLICT (content): Merge conflict in t/db_dependent/Patrons.t Auto-merging members/memberentry.pl Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc Auto-merging installer/data/mysql/kohastructure.sql CONFLICT (content): Merge conflict in installer/data/mysql/kohastructure.sql Auto-merging Koha/Patron.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 12446: Ability to allow guarantor relationship for all patron category types The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-12446-Ability-to-allow-guarantor-relationship--LvEbgJ.patch Created attachment 121925 [details] Bug 28204: Compiled CSS Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 121926 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 121927 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 121928 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 121929 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. I rebased the patches, ready to be tested. Tests fail 8-(.. root@kohadevbox:koha(bz12446)$ prove t/db_dependent/Patrons.t t/db_dependent/Patrons.t .. 1/18 # Looks like you planned 26 tests but ran 20. t/db_dependent/Patrons.t .. 18/18 # Failed test 'Update patron categories' # at t/db_dependent/Patrons.t line 215. Can't call method "borrowernumber" on an undefined value at t/db_dependent/Patrons.t line 207. # Looks like your test exited with 11 just after 18. t/db_dependent/Patrons.t .. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 1/18 subtests Test Summary Report ------------------- t/db_dependent/Patrons.t (Wstat: 2816 Tests: 18 Failed: 1) Failed test: 18 Non-zero exit status: 11 Created attachment 122084 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122085 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122086 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122087 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Created attachment 122088 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122089 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122090 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 122091 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> I rebased the patches, tests are succesful now, ready to be tested. Created attachment 122184 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 122185 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 122186 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 122187 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130398 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130399 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130400 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130401 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130402 [details] Bug 12446: Adult can now have guarantors This patch allows adult patrons to have guarantors. It adds the field "Can be guarantee" to patron categories, so it becomes possible for any category type to have a guarantor. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" gor the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. Created attachment 131965 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 131966 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 131967 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 131968 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 131969 [details] [review] Bug 12446: Any patron categories can have guarantors Rebase of previous patches This patch allows adult patrons to have guarantors. It adds the field "Can be guarantee" to patron categories, so it becomes possible for any category type to have a guarantor. NOTE: Attachment "Bug 12446: Adult can now have guarantors" created a sha1 error. I marked it as obsolete and put it's content into a new commit. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" gor the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass Your schema update patch has some merge markers in it and causes Koha to explode when I try to reset_all after applying the patch to my testing docker. I tried to apply the patch and it seems to apply cleanly. I do not have any merge markers when I apply the patch. Did you make sure that your environment is up to date? This seems to be working well. There's just one issue raised by the QA tool: FAIL members/memberentry.pl FAIL critic # Variables::ProhibitUnusedVariables: Got 1 violation(s). Created attachment 133691 [details] [review] Bug 12446: Fixing QA tool's tests This patch fixes tests that fails by the QA test tool. I removed the debug variable, since it is not used. I also got a few spelling check errors when I ran the QA test tool. I corrected them too. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" on the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass 17) Run the QA test tool. All tests should say OK Created attachment 133952 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 133953 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 133954 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 133955 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 133956 [details] [review] Bug 12446: Any patron categories can have guarantors Rebase of previous patches This patch allows adult patrons to have guarantors. It adds the field "Can be guarantee" to patron categories, so it becomes possible for any category type to have a guarantor. NOTE: Attachment "Bug 12446: Adult can now have guarantors" created a sha1 error. I marked it as obsolete and put it's content into a new commit. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" gor the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 133957 [details] [review] Bug 12446: Fixing QA tool's tests This patch fixes tests that fails by the QA test tool. I removed the debug variable, since it is not used. I also got a few spelling check errors when I ran the QA test tool. I corrected them too. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" on the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass 17) Run the QA test tool. All tests should say OK Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134930 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134931 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134932 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134933 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134934 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134935 [details] [review] Bug 12446: Any patron categories can have guarantors Rebase of previous patches This patch allows adult patrons to have guarantors. It adds the field "Can be guarantee" to patron categories, so it becomes possible for any category type to have a guarantor. NOTE: Attachment "Bug 12446: Adult can now have guarantors" created a sha1 error. I marked it as obsolete and put it's content into a new commit. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" gor the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 134936 [details] [review] Bug 12446: Fixing QA tool's tests This patch fixes tests that fails by the QA test tool. I removed the debug variable, since it is not used. I also got a few spelling check errors when I ran the QA test tool. I corrected them too. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" on the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass 17) Run the QA test tool. All tests should say OK Signed-off-by: Owen Leonard <oleonard@myacpl.org> Rebased Can you please review the whole patch set carefully to make it ready for QA? It took me 3 min to catch trivial errors: * merge marker +<<<<<<< HEAD * installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql has been removed, this patch set reintroduce it * in members/memberentry.pl there are 2 calls to search_with_library_limits * still memberentry.pl You are adding yet another fetch of the patron category: Koha::Patron::Categories->find It's fetched several times already in the same script * t/db_dependent/Patrons.t l.206: extra spaces Created attachment 135506 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135507 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135508 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135509 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135510 [details] [review] Bug 12446: Any patron categories can have guarantors Rebase of previous patches This patch allows adult patrons to have guarantors. It adds the field "Can be guarantee" to patron categories, so it becomes possible for any category type to have a guarantor. NOTE: Attachment "Bug 12446: Adult can now have guarantors" created a sha1 error. I marked it as obsolete and put it's content into a new commit. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" gor the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135511 [details] [review] Bug 12446: Fixing QA tool's tests This patch fixes tests that fails by the QA test tool. I removed the debug variable, since it is not used. I also got a few spelling check errors when I ran the QA test tool. I corrected them too. To test: 1) Create an Adult AND Child category in Administration/Patron categories 2) Create a child AND adult patron. 3) Go in your child patron's page. 4) Click on "Edit". 5) Notice that you can add a guarantor with "Add guarantor" button. 6) Go in your adult patron's page. 7) Click on "Edit". 8) Notice that there is no "Add guarantor" button. Therefore, you can't add a guarantor for this patron. 9) Apply patch and run updatedatabase.pl 10) Go in Administration/Patron categories and edit one of them. 12) Notice that you can see the new "Can be guarantee" field. 13) Set "Yes" on the "Can be guarantee" field for your Child AND Adult category. 14) Repeat steps 6 to 7. 15) Notice that your adult patron can now add guarantors with the "Add guarantor" button. 16) prove t/db_dependent/Patrons.t => All tests should still pass 17) Run the QA test tool. All tests should say OK Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 135512 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> (In reply to Jonathan Druart from comment #196) > Can you please review the whole patch set carefully to make it ready for QA? > > It took me 3 min to catch trivial errors: > * merge marker > +<<<<<<< HEAD > > * installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql > has been removed, this patch set reintroduce it > > * in members/memberentry.pl there are 2 calls to search_with_library_limits > > * still memberentry.pl > You are adding yet another fetch of the patron category: > Koha::Patron::Categories->find > It's fetched several times already in the same script > > * t/db_dependent/Patrons.t l.206: extra spaces Fixed mentioned errors except "Koha::Patron::Categories->find". It would require a new variable near the beginning of the script (after "my $categorycode ...") that stores "Koha::Patron::Categories->find($categorycode)" and would also require changing every place where the script uses it for consistency. I don't know if it's a good idea to do it here. Maybe a separate bug? > Bug 12446: Schema update Category.pm
Please note that you must provide the specific change (is_boolean part) in a separate patch.
The workflow is:
* run `dbic`
* commit with "DBIC changes" (this patch won't be pushed by the RM, they will regenerate it themselves)
* Edit the schema files and add what you need below the "DO NOT MODIFY" line
* commit (ideally with "DBIC specific" or similar)
(In reply to Shi Yao Wang from comment #204) > (In reply to Jonathan Druart from comment #196) > > Can you please review the whole patch set carefully to make it ready for QA? > > > > It took me 3 min to catch trivial errors: > > * merge marker > > +<<<<<<< HEAD > > > > * installer/data/mysql/nb-NO/2-Valgfritt/patron_categories.sql > > has been removed, this patch set reintroduce it > > > > * in members/memberentry.pl there are 2 calls to search_with_library_limits > > > > * still memberentry.pl > > You are adding yet another fetch of the patron category: > > Koha::Patron::Categories->find > > It's fetched several times already in the same script > > > > * t/db_dependent/Patrons.t l.206: extra spaces > > Fixed mentioned errors except "Koha::Patron::Categories->find". It would > require a new variable near the beginning of the script (after "my > $categorycode ...") that stores > "Koha::Patron::Categories->find($categorycode)" and would also require > changing every place where the script uses it for consistency. I don't know > if it's a good idea to do it here. Maybe a separate bug? Agreed, please open it. Created attachment 135519 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 135520 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 135521 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 135522 [details] [review] Bug 12446: Fix typos Signed-off-by: Owen Leonard <oleonard@myacpl.org> JD Amended patch: squashed and edited commit message Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 135523 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (In reply to Jonathan Druart from comment #206) > (In reply to Shi Yao Wang from comment #204) > > Fixed mentioned errors except "Koha::Patron::Categories->find". It would > > require a new variable near the beginning of the script (after "my > > $categorycode ...") that stores > > "Koha::Patron::Categories->find($categorycode)" and would also require > > changing every place where the script uses it for consistency. I don't know > > if it's a good idea to do it here. Maybe a separate bug? > > Agreed, please open it. Done, see bug 30874 Created attachment 135544 [details] [review] Bug 12446: Remove can_be_guarentee is_boolean to put it back in another patch Created attachment 135545 [details] [review] Bug 12446: DBIC specific add_columns canbeguarantee New column canbeguarantee (In reply to Jonathan Druart from comment #205) > > Bug 12446: Schema update Category.pm > > Please note that you must provide the specific change (is_boolean part) in a > separate patch. > The workflow is: > * run `dbic` > * commit with "DBIC changes" (this patch won't be pushed by the RM, they > will regenerate it themselves) > * Edit the schema files and add what you need below the "DO NOT MODIFY" line > * commit (ideally with "DBIC specific" or similar) I put 2 new patches to have the is_boolean part in a separate patch. Pushed to master for 22.11. Nice work everyone, thanks! Nice new feature but it will not be backported to 22.05.x Created attachment 142401 [details] [review] Bug 31417: Update and reference cat-menu.inc This patch reinstates the cat-menu.inc include and references it from the various 'tools' that are closely tied to cataloging. We use the new cataloging home page submission as a reference for which options should appear in the menu. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 142408 [details] [review] Bug 12446: DBIC specific add_columns canbeguarantee New column canbeguarantee Created attachment 142431 [details] [review] Bug 12446: Remove can_be_guarentee is_boolean to put it back in another patch This patch resolve merge conflit and add the instantiation of the variable "my $categories" that was missing in memberentry.pl. Created attachment 142432 [details] [review] Bug 12446: Ability to allow guarantor relationship for all patron category types This adds a new field "Can be guarantee" to patron categories so it becomes possible for any category type to have a guarantor. To test: 1) Have a patron category of type 'Adult' and one of type 'Child' 2) Confirm, by searching for the "Patron guarantor" fieldset in the edit/create form, that: => a patron of the first category can't have a guarantor => a patron from the second category can 3) Apply patch and run updatedatabase.pl 4) Edit the categories and note the new "Can be guarantee" field 5) It should have been set to "yes" for the "Child" and to "no" for the "Adult" 5) Repeat step 2. It should behave in the same way. 6) Edit the "Can be guarantee" for any of the category and check that the fieldset only appears when "Can be guarantee" is set to "yes" 7) prove t/db_dependent/Patrons.t => tests should still pass Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 142433 [details] [review] Bug 12446: Schema update Category.pm Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 142434 [details] [review] Bug 12446: Limit available categories when using "Add guarantee" button Test plan: 1) Have some patron categories that can and cannot be guarantee 2) Visit a patron's account and click the "Add guarantee" button 3) In the "category" dropdown, note that all categories are available 4) Apply this patch 5) Repeat step 2 and 3; the dropdown now only contains the categories for which "can be guarantee" is set to "Yes". Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 142435 [details] [review] Bug 12446: Fix typos Signed-off-by: Owen Leonard <oleonard@myacpl.org> JD Amended patch: squashed and edited commit message Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 142436 [details] [review] Bug 12446: Add canbeguarantee value to patron categories sample data This patch changes sample data so patron categories of type 'C' or 'P' can be guarantees by default. Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: Salman Ali <salman.ali@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 142437 [details] [review] Bug 12446: Remove can_be_guarentee is_boolean to put it back in another patch Created attachment 142438 [details] [review] Bug 12446: DBIC specific add_columns canbeguarantee New column canbeguarantee Created attachment 142439 [details] [review] Bug 12446: Merge conflit resolve and add missing var This patch resolve merge conflit and add the instantiation of the variable "my $categories" that was missing in memberentry.pl. Hi Geraud, what are you trying to do? This bug and the originally attached patches have already been pushed to master a while ago and the feature will be part of the 22.11 release in November. Any additional changes or follow-ups should now go on separate new bugs. You can indicate the relationship using the depends on/blocks or see also fields. |