Bugzilla – Attachment 106753 Details for
Bug 12446
Enable an adult to have a guarantor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12446: Enable an adult to have a guarantor
Bug-12446-Enable-an-adult-to-have-a-guarantor.patch (text/plain), 25.75 KB, created by
Maryse Simard
on 2020-07-09 18:17:29 UTC
(
hide
)
Description:
Bug 12446: Enable an adult to have a guarantor
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2020-07-09 18:17:29 UTC
Size:
25.75 KB
patch
obsolete
>From baa19d557d884c4811c9763f1508de86216e24fd Mon Sep 17 00:00:00 2001 >From: Roch D'Amour <roch.damour@inlibro.com> >Date: Wed, 28 Feb 2018 17:54:53 -0500 >Subject: [PATCH] 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> >--- > C4/Utils/DataTables/Members.pm | 30 +++++++++++++------ > admin/categories.pl | 3 ++ > .../data/mysql/atomicupdate/bug_12446.perl | 21 +++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/includes/members-toolbar.inc | 2 +- > .../prog/en/modules/admin/categories.tt | 15 ++++++++++ > .../en/modules/admin/preferences/patrons.pref | 5 ++++ > .../prog/en/modules/common/patron_search.tt | 7 +++-- > .../prog/en/modules/members/memberentrygen.tt | 2 +- > .../prog/en/modules/members/moremember.tt | 15 +++++++--- > .../members/tables/guarantor_search.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/members.js | 9 +++++- > members/memberentry.pl | 9 +++++- > members/moremember.pl | 13 ++++++++ > svc/members/search | 6 ++++ > 16 files changed, 120 insertions(+), 21 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_12446.perl > >diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm >index a718a9633e..5fb9b5150f 100644 >--- a/C4/Utils/DataTables/Members.pm >+++ b/C4/Utils/DataTables/Members.pm >@@ -2,6 +2,7 @@ package C4::Utils::DataTables::Members; > > use Modern::Perl; > use C4::Context; >+use C4::Members; > use C4::Utils::DataTables; > use Koha::DateUtils; > >@@ -77,15 +78,26 @@ sub search { > } > } > >- my $select = "SELECT >- borrowers.borrowernumber, borrowers.surname, borrowers.firstname, >- borrowers.othernames, >- borrowers.flags, >- 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 othernames flags streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode phone phonepro mobile fax email emailpro); >+ my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax ); >+ if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){ >+ $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces >+ @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes); >+ } >+ if( @guarantor_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, borrowers.phone"; > my $from = "FROM borrowers >diff --git a/admin/categories.pl b/admin/categories.pl >index f9144e7ced..92b75a0800 100755 >--- a/admin/categories.pl >+++ b/admin/categories.pl >@@ -95,6 +95,7 @@ elsif ( $op eq 'add_validate' ) { > my $reset_password = $input->param('reset_password'); > my $change_password = $input->param('change_password'); > my @branches = grep { $_ ne q{} } $input->multi_param('branches'); >+ my $canbeguarantee = $input->param('canbeguarantee'); > > $reset_password = undef if $reset_password eq -1; > $change_password = undef if $change_password eq -1; >@@ -124,6 +125,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); >@@ -152,6 +154,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.perl b/installer/data/mysql/atomicupdate/bug_12446.perl >new file mode 100644 >index 0000000000..9575afe186 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12446.perl >@@ -0,0 +1,21 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ ## ******** ## >+ ## SYSPREFS ## >+ ## ******** ## >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+ VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'); >+ }); >+ >+ ## ********* ## >+ ## STRUCTURE ## >+ ## ********* ## >+ if ( !column_exists( 'categories', 'canbeguarantee') ){ >+ $dbh->do("ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0' AFTER `checkprevcheckout`"); >+ $dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C'"); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 12446 - Enable an adult to have a guarantor)\n"; >+} >\ No newline at end of file >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 4f6a9c399d..fd49cda51a 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -325,6 +325,7 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr > `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'. > `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow, > `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC >+ `canbeguarantee` tinyint(1) NOT NULL default '0' > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d67a02b367..edc3bbf0d8 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -9,6 +9,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), > ('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'), >+('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'), > ('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'), > ('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'), > ('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'), >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 c9cbea57bf..c066e5bb6a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -11,7 +11,7 @@ > > [% IF CAN_user_borrowers_edit_borrowers %] > [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %] >- <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantor_id=[% patron.borrowernumber | html %]&category_type=C"><i class="fa fa-plus"></i> Add guarantee</a> >+ <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantor_id=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> Add guarantee</a> > [% END %] > <a id="changepassword" class="btn btn-default" href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | html %]"><i class="fa fa-lock"></i> Change password</a> > <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</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 77146a78db..d3d95deb96 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">Library limitations: </label> > <select id="branches" name="branches" multiple size="10"> > <option value="">All libraries</option> >@@ -363,6 +375,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> >@@ -422,6 +435,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> >@@ -526,6 +540,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 991de6668a..5498913c72 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 >@@ -280,6 +280,11 @@ Patrons: > yes: Allow > no: "Don't allow" > - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC. >+ - >+ - "These additional following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> will be transferred from guarantor to guarantee:" >+ - pref: AdditionalGuarantorField >+ class: multi >+ - (separate columns with |) > Privacy: > - > - Use the following URL >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 b78ec9bd31..9b628126b6 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 >@@ -225,7 +225,8 @@ > 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) ); > }); > > $("body").on("click",".patron_preview", function( e ){ >@@ -283,9 +284,9 @@ > 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, null, 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 9ff3b1a8e7..c698cfe1e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1581,7 +1581,7 @@ legend:hover { > > [% IF new_guarantors %] > [% FOREACH g IN new_guarantors %] >- select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' ); >+ select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' [% IF guarantor_attributes %], [% To.json( guarantor_attributes ) | $raw %][% END %] ); > [% END %] > [% END %] > >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 b4351f4afa..ef7afef746 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -262,15 +262,22 @@ > [% IF guarantees %] > <li> > <span class="label">Guarantees:</span> >- <ul> >+ <table> > [% FOREACH guarantee IN guarantees %] >+ <tr> > [% IF logged_in_user.can_see_patron_infos( guarantee ) %] >- <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li> >+ <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></td> >+ <td style='text-align:right'>[% guarantee.account.balance | html %]</td> > [% ELSE %] >- <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li> >+ <td>[% guarantee.firstname | html %] [% guarantee.surname | html %]</td> > [% END %] >+ </tr> > [% END %] >- </ul> >+ [% IF logged_in_user.can_see_patron_infos( guarantee ) %] >+ <td>Total</td> >+ <td style='text-align:right'>[% amounttot | html %]</td> >+ [% END %] >+ </table> > </li> > [% ELSIF guarantor_relationships.count > 0 OR ( patron.contactfirstname OR patron.contactname ) %] > <li> >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 38ec5aa9e0..20cfca2dbc 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 >@@ -18,7 +18,7 @@ > "dt_address": > "[% INCLUDE escape_address data=data %]", > "dt_action": >- "<a href=\"#\" class=\"btn btn-default btn-xs select_user\" data-borrowernumber=\"[% data.borrowernumber | html %]\">Select</a><input type=\"hidden\" id=\"borrower_data[% data.borrowernumber | html %]\" name=\"borrower_data[% data.borrowernumber | html %]\" value=\"[% To.json(data) | html %]\" />" >+ "<a href=\"#\" class=\"btn btn-default btn-xs select_user\" data-borrowernumber=\"[% data.borrowernumber | html %]\">Select</a><input type=\"hidden\" id=\"borrower_data[% data.borrowernumber | html %]\" name=\"borrower_data[% data.borrowernumber | html %]\" 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 1e102f1be7..6d18d6286b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -165,7 +165,7 @@ function update_category_code(category_code) { > $(mytables).find(" li[data-category_code='']").show(); > } > >-function select_user(borrowernumber, borrower, relationship) { >+function select_user(borrowernumber, borrower, relationship, attributes) { > let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length; > > if ( is_guarantor ) { >@@ -209,6 +209,13 @@ function select_user(borrowernumber, borrower, relationship) { > if ( relationship ) { > fieldset.find('.new_guarantor_relationship').val(relationship); > } >+ >+ for (var i = 0; i < parseInt(attributes.length, 10); i++) { >+ var attribute = attributes[i]; >+ if (borrower[attribute] != null){ >+ document.forms.entryform[attribute].value = borrower[attribute]; >+ } >+ } > } > > return 0; >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ec6c08c4c5..a67276e016 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -806,7 +806,14 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { > $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification")); > } > >-$template->param( "show_guarantor" => ( $category_type =~ /A|I|S|X/ ) ? 0 : 1 ); # associate with step to know where you are >+$template->param( "show_guarantor" => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are >+ >+my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax ); >+if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){ >+ $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces >+ @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes); >+} >+$template->param( "guarantor_attributes" => \@guarantor_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 93efa7a4b5..b05ee53ce7 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -115,6 +115,19 @@ $template->param( > > my $relatives_issues_count = > Koha::Checkouts->count({ borrowernumber => \@relatives }); >+my $count = scalar @guarantees; >+if ( $count ) { >+ $template->param( isguarantee => 1 ); >+ >+ my $totalmount = 0; >+ >+ foreach my $guarantee (@guarantees){ >+ $totalmount += $guarantee->account->balance; >+ >+ } >+ $template->param( guarantees => \@guarantees); >+ $template->param( amounttot => sprintf("%.2f",$totalmount)); >+} > > # Calculate and display patron's age > if ( !$patron->is_valid_age ) { >diff --git a/svc/members/search b/svc/members/search >index 76c5749f22..38a0a3ffef 100755 >--- a/svc/members/search >+++ b/svc/members/search >@@ -91,12 +91,18 @@ $results = C4::Utils::DataTables::Members::search( > } > ) unless $results; > >+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); >+} > $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'; >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12446
:
29278
|
36176
|
39744
|
42469
|
42470
|
42535
|
46277
|
46278
|
46327
|
46328
|
46345
|
46486
|
49793
|
50953
|
53534
|
53535
|
53536
|
53913
|
60929
|
60930
|
60934
|
63148
|
63149
|
63214
|
64793
|
64794
|
64828
|
72295
|
72883
|
77766
|
77767
|
77768
|
79343
|
79344
|
79345
|
79347
|
79348
|
85069
|
88364
|
88365
|
88366
|
88367
|
90389
|
90390
|
90391
|
90392
|
90470
|
90471
|
90472
|
90473
|
93388
|
93389
|
93390
|
93391
|
93392
|
93393
|
93394
|
95411
|
95853
|
95854
|
95855
|
95856
|
95857
|
95858
|
95859
|
95860
|
106753
|
106754
|
106755
|
106756
|
106757
|
107611
|
111052
|
111053
|
111317
|
111318
|
112102
|
112160
|
112161
|
112162
|
112163
|
113583
|
121925
|
121926
|
121927
|
121928
|
121929
|
122084
|
122085
|
122086
|
122087
|
122088
|
122089
|
122090
|
122091
|
122184
|
122185
|
122186
|
122187
|
130398
|
130399
|
130400
|
130401
|
130402
|
131965
|
131966
|
131967
|
131968
|
131969
|
133691
|
133952
|
133953
|
133954
|
133955
|
133956
|
133957
|
134930
|
134931
|
134932
|
134933
|
134934
|
134935
|
134936
|
135506
|
135507
|
135508
|
135509
|
135510
|
135511
|
135512
|
135519
|
135520
|
135521
|
135522
|
135523
|
135544
|
135545
|
142401
|
142408
|
142431
|
142432
|
142433
|
142434
|
142435
|
142436
|
142437
|
142438
|
142439