[Bug 12446] New: Enable an adult to have a guarantor
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Bug ID: 12446 Summary: Enable an adult to have a guarantor Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: new feature Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: simith.doliveira@inlibro.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Our sponsor require an adjustment to allow an adult to have a guarantor and some other modifications concerning. This Fix: - 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. Sponsor by: ville de victoriaville -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |philippe.blouin@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simith.doliveira@inlibro.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #1 from simith.doliveira@inlibro.com --- Created attachment 29278 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29278&action=edit 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; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Severity|new feature |enhancement -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Francois Charbonnier <francois.charbonnier@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |francois.charbonnier@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |simith.doliveira@inlibro.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #2 from Marc Véron <veron@veron.ch> --- Patch does not apply: CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29278|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36176 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36176&action=edit Bug 12446 - Enable an adult to have a guarantor -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |jonathan.druart@biblibre.co | |m --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Easy conflict, fixed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |nengard@gmail.com --- Comment #5 from Nicole C. Engard <nengard@gmail.com> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #6 from Kyle M Hall <kyle@bywatersolutions.com> --- 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
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Francois Charbonnier <francois.charbonnier@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion --- Comment #7 from Francois Charbonnier <francois.charbonnier@inlibro.com> --- 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? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #8 from Nicole C. Engard <nengard@gmail.com> --- Discussion from IRC: http://irc.koha-community.org/koha/2015-03-04#i_1645311 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Francois Charbonnier <francois.charbonnier@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |ASSIGNED --- Comment #9 from Francois Charbonnier <francois.charbonnier@inlibro.com> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Maxime Beaulieu <maxime.beaulieu@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maxime.beaulieu@inlibro.com Assignee|simith.doliveira@inlibro.co |maxime.beaulieu@inlibro.com |m | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Maxime Beaulieu <maxime.beaulieu@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Maxime Beaulieu <maxime.beaulieu@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36176|0 |1 is obsolete| | --- Comment #10 from Maxime Beaulieu <maxime.beaulieu@inlibro.com> --- Created attachment 39744 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39744&action=edit 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #11 from Marc Véron <veron@veron.ch> --- Wanted to test but patch does not apply. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 39744 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39744 bug 12446 - Enable adult patrons to have a guarantor Review of attachment 39744: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=12446&attachment=39744) ----------------------------------------------------------------- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Genevieve Plantin <genevieve.plantin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39744|0 |1 is obsolete| | --- Comment #13 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42469&action=edit 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #14 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42470 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42470&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #15 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42535 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42535&action=edit Bug 12446 - Displayed button Add guarantee in Details section The button Add guarantee wasn't in the toolbar section in Details. It is now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 jdemuth@roseville.ca.us <jdemuth@roseville.ca.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jdemuth@roseville.ca.us -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |aleishaamohia@hotmail.com --- Comment #16 from Aleisha Amohia <aleishaamohia@hotmail.com> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42469|0 |1 is obsolete| | --- Comment #17 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46277 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46277&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #42470|0 |1 is obsolete| | Attachment #42535|0 |1 is obsolete| | Attachment #46277|0 |1 is obsolete| | --- Comment #18 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46278 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46278&action=edit 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff CC| |remi.mayrand-provencher@inL | |ibro.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Bug 15407 is going to remove C4::Category, you should use Koha::Patron::Categories instead. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=15143 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46278|0 |1 is obsolete| | --- Comment #20 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46327 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46327&action=edit The C4::Category file was not even used! rebased to avoid eventual possible conflicts. 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46327|The C4::Category file was |bug 12446 - Enable adult description|not even used! rebased to |patrons to have a guarantor |avoid eventual possible | |conflicts. | --- Comment #21 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Comment on attachment 46327 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46327 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
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46327|0 |1 is obsolete| | --- Comment #22 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46328 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46328&action=edit 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #23 from Marc Véron <veron@veron.ch> --- 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) . -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46328|0 |1 is obsolete| | --- Comment #24 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46345 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46345&action=edit 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; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |liz@catalyst.net.nz --- Comment #25 from Liz Rea <liz@catalyst.net.nz> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Heather Braum <hbraum@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hbraum@nekls.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 --- Comment #26 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 46486 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46486&action=edit bug 12446 - Atomic update now sets canbeguarantee to 1 for categories of type C and P Same test plan applies. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12446 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org