View | Details | Raw Unified | Return to bug 12446
Collapse All | Expand All

(-)a/C4/Utils/DataTables/Members.pm (-9 / +21 lines)
Lines 2-7 package C4::Utils::DataTables::Members; Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use C4::Context;
4
use C4::Context;
5
use C4::Members;
5
use C4::Utils::DataTables;
6
use C4::Utils::DataTables;
6
use Koha::DateUtils;
7
use Koha::DateUtils;
7
8
Lines 77-91 sub search { Link Here
77
        }
78
        }
78
    }
79
    }
79
80
80
    my $select = "SELECT
81
    $dbh = C4::Context->dbh;
81
        borrowers.borrowernumber, borrowers.surname, borrowers.firstname,
82
    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);
82
        borrowers.othernames,
83
    my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
83
        borrowers.flags,
84
    if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
84
        borrowers.streetnumber, borrowers.streettype, borrowers.address,
85
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces
85
        borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode,
86
        @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes);
86
        borrowers.country, cardnumber, borrowers.dateexpiry,
87
    }
87
        borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
88
    if( @guarantor_attributes ){
88
        borrowers.userid, borrowers.dateofbirth, borrowers.categorycode,
89
        foreach my $item (@guarantor_attributes) {
90
             if (! grep {$_ eq $item} @columns) {
91
                 push @columns, $item;
92
            }
93
        }
94
    };
95
    my $borrowers_columns = "";
96
    foreach my $item (@columns) {
97
        $borrowers_columns .= "borrowers." . $item . ", ";
98
    }
99
100
    my $select = "SELECT " . $borrowers_columns . "
89
        categories.description AS category_description, categories.category_type,
101
        categories.description AS category_description, categories.category_type,
90
        branches.branchname, borrowers.phone";
102
        branches.branchname, borrowers.phone";
91
    my $from = "FROM borrowers
103
    my $from = "FROM borrowers
(-)a/admin/categories.pl (+3 lines)
Lines 95-100 elsif ( $op eq 'add_validate' ) { Link Here
95
    my $reset_password = $input->param('reset_password');
95
    my $reset_password = $input->param('reset_password');
96
    my $change_password = $input->param('change_password');
96
    my $change_password = $input->param('change_password');
97
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
97
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
98
    my $canbeguarantee = $input->param('canbeguarantee');
98
99
99
    $reset_password = undef if $reset_password eq -1;
100
    $reset_password = undef if $reset_password eq -1;
100
    $change_password = undef if $change_password eq -1;
101
    $change_password = undef if $change_password eq -1;
Lines 124-129 elsif ( $op eq 'add_validate' ) { Link Here
124
        $category->hidelostitems($hidelostitems);
125
        $category->hidelostitems($hidelostitems);
125
        $category->overduenoticerequired($overduenoticerequired);
126
        $category->overduenoticerequired($overduenoticerequired);
126
        $category->category_type($category_type);
127
        $category->category_type($category_type);
128
        $category->canbeguarantee($canbeguarantee);
127
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
129
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
128
        $category->checkprevcheckout($checkPrevCheckout);
130
        $category->checkprevcheckout($checkPrevCheckout);
129
        $category->default_privacy($default_privacy);
131
        $category->default_privacy($default_privacy);
Lines 152-157 elsif ( $op eq 'add_validate' ) { Link Here
152
            hidelostitems => $hidelostitems,
154
            hidelostitems => $hidelostitems,
153
            overduenoticerequired => $overduenoticerequired,
155
            overduenoticerequired => $overduenoticerequired,
154
            category_type => $category_type,
156
            category_type => $category_type,
157
            canbeguarantee => $canbeguarantee,
155
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
158
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
156
            checkprevcheckout => $checkPrevCheckout,
159
            checkprevcheckout => $checkPrevCheckout,
157
            default_privacy => $default_privacy,
160
            default_privacy => $default_privacy,
(-)a/installer/data/mysql/atomicupdate/bug_12446.perl (+21 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    ## ******** ##
4
    ## SYSPREFS ##
5
    ## ******** ##
6
    $dbh->do(q{
7
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
8
        VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free');
9
    });
10
11
    ## ********* ##
12
    ## STRUCTURE ##
13
    ## ********* ##
14
    if ( !column_exists( 'categories', 'canbeguarantee') ){
15
        $dbh->do("ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0' AFTER `checkprevcheckout`");
16
        $dbh->do("UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C'");
17
    }
18
19
    SetVersion( $DBversion );
20
    print "Upgrade to $DBversion done (Bug 12446 - Enable an adult to have a guarantor)\n";
21
}
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 325-330 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
325
  `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'.
325
  `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'.
326
  `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow,
326
  `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow,
327
  `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC
327
  `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC
328
  `canbeguarantee` tinyint(1) NOT NULL default '0'
328
  PRIMARY KEY  (`categorycode`),
329
  PRIMARY KEY  (`categorycode`),
329
  UNIQUE KEY `categorycode` (`categorycode`)
330
  UNIQUE KEY `categorycode` (`categorycode`)
330
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
331
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 9-14 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
9
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
9
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
10
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
10
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
11
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
11
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
12
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
12
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
13
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
13
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
14
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
14
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
15
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 11-17 Link Here
11
11
12
    [% IF CAN_user_borrowers_edit_borrowers %]
12
    [% IF CAN_user_borrowers_edit_borrowers %]
13
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
13
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
14
            <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantor_id=[% patron.borrowernumber | html %]&amp;category_type=C"><i class="fa fa-plus"></i> Add guarantee</a>
14
            <a id="addchild" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantor_id=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> Add guarantee</a>
15
        [% END %]
15
        [% END %]
16
        <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>
16
        <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>
17
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</a>
17
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-copy"></i> Duplicate</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+15 lines)
Lines 151-156 Link Here
151
                    </select>
151
                    </select>
152
                    <span class="required">Required</span>
152
                    <span class="required">Required</span>
153
                </li>
153
                </li>
154
                <li>
155
                    <label for="canbeguarantee">Can be guarantee</label>
156
                    <select name="canbeguarantee" id="canbeguarantee">
157
                        [% IF category.canbeguarantee %]
158
                            <option value="1" selected>Yes</option>
159
                            <option value="0">No</option>
160
                        [% ELSE %]
161
                            <option value="1">Yes</option>
162
                            <option value="0" selected>No</option>
163
                        [% END %]
164
                    <select>
165
                </li>
154
                <li><label for="branches">Library limitations: </label>
166
                <li><label for="branches">Library limitations: </label>
155
                    <select id="branches" name="branches" multiple size="10">
167
                    <select id="branches" name="branches" multiple size="10">
156
                        <option value="">All libraries</option>
168
                        <option value="">All libraries</option>
Lines 363-368 Link Here
363
                      </td>
375
                      </td>
364
                  </tr>
376
                  </tr>
365
                [% END %]
377
                [% END %]
378
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.canbeguarantee %]Yes[% ELSE %]No[% END %]</td></tr>
366
                <tr>
379
                <tr>
367
                    <th scope="row">Default privacy: </th>
380
                    <th scope="row">Default privacy: </th>
368
                    <td>
381
                    <td>
Lines 422-427 Link Here
422
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
435
                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
423
                    <th scope="col">Check previous checkout?</th>
436
                    <th scope="col">Check previous checkout?</th>
424
                    [% END %]
437
                    [% END %]
438
                    <th scope="col">Can be guarantee</th>
425
                    <th scope="col">Default privacy</th>
439
                    <th scope="col">Default privacy</th>
426
                    <th scope="col">Actions</th>
440
                    <th scope="col">Actions</th>
427
                </tr>
441
                </tr>
Lines 526-531 Link Here
526
                              [% END %]
540
                              [% END %]
527
                          </td>
541
                          </td>
528
                        [% END %]
542
                        [% END %]
543
                        <td>[% IF category.canbeguarantee %] Yes [% ELSE %] no [% END %]</td>
529
                        <td>
544
                        <td>
530
                            [% SWITCH category.default_privacy %]
545
                            [% SWITCH category.default_privacy %]
531
                            [% CASE 'default' %]
546
                            [% CASE 'default' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+5 lines)
Lines 280-285 Patrons: Link Here
280
               yes: Allow
280
               yes: Allow
281
               no: "Don't allow"
281
               no: "Don't allow"
282
         - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC.
282
         - staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC.
283
     -
284
         - "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:"
285
         - pref: AdditionalGuarantorField
286
           class: multi
287
         - (separate columns with |)
283
    Privacy:
288
    Privacy:
284
     -
289
     -
285
         - Use the following URL
290
         - Use the following URL
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (-3 / +4 lines)
Lines 225-231 Link Here
225
                e.preventDefault();
225
                e.preventDefault();
226
                var borrowernumber = $(this).data("borrowernumber");
226
                var borrowernumber = $(this).data("borrowernumber");
227
                var borrower_data = $("#borrower_data"+borrowernumber).val();
227
                var borrower_data = $("#borrower_data"+borrowernumber).val();
228
                select_user( borrowernumber, JSON.parse(borrower_data) );
228
                var guarantor_attributes = $("#guarantor_attributes").val();
229
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
229
            });
230
            });
230
231
231
            $("body").on("click",".patron_preview", function( e ){
232
            $("body").on("click",".patron_preview", function( e ){
Lines 283-291 Link Here
283
                wait_for_opener();
284
                wait_for_opener();
284
            }
285
            }
285
        [% ELSIF selection_type == 'select' %]
286
        [% ELSIF selection_type == 'select' %]
286
            function select_user(borrowernumber, data) {
287
            function select_user(borrowernumber, data, attributes) {
287
                var p = window.opener;
288
                var p = window.opener;
288
                p.select_user(borrowernumber, data);
289
                p.select_user(borrowernumber, data, null, attributes);
289
                window.close();
290
                window.close();
290
            }
291
            }
291
        [% END %]
292
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1 / +1 lines)
Lines 1581-1587 legend:hover { Link Here
1581
1581
1582
            [% IF new_guarantors %]
1582
            [% IF new_guarantors %]
1583
                [% FOREACH g IN new_guarantors %]
1583
                [% FOREACH g IN new_guarantors %]
1584
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1584
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' [% IF guarantor_attributes %], [% To.json( guarantor_attributes ) | $raw %][% END %] );
1585
                [% END %]
1585
                [% END %]
1586
            [% END %]
1586
            [% END %]
1587
1587
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +11 lines)
Lines 262-276 Link Here
262
                                        [% IF guarantees %]
262
                                        [% IF guarantees %]
263
                                            <li>
263
                                            <li>
264
                                                <span class="label">Guarantees:</span>
264
                                                <span class="label">Guarantees:</span>
265
                                                <ul>
265
                                                <table>
266
                                                    [% FOREACH guarantee IN guarantees %]
266
                                                    [% FOREACH guarantee IN guarantees %]
267
                                                    <tr>
267
                                                        [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
268
                                                        [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
268
                                                            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
269
                                                            <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></td>
270
                                                            <td style='text-align:right'>[% guarantee.account.balance | html %]</td>
269
                                                        [% ELSE %]
271
                                                        [% ELSE %]
270
                                                            <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
272
                                                            <td>[% guarantee.firstname | html %] [% guarantee.surname | html %]</td>
271
                                                        [% END %]
273
                                                        [% END %]
274
                                                    </tr>
272
                                                    [% END %]
275
                                                    [% END %]
273
                                                </ul>
276
                                                    [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
277
                                                       <td>Total</td>
278
                                                       <td style='text-align:right'>[% amounttot | html %]</td>
279
                                                    [% END %]
280
                                                </table>
274
                                            </li>
281
                                            </li>
275
                                        [% ELSIF guarantor_relationships.count > 0 OR ( patron.contactfirstname OR patron.contactname ) %]
282
                                        [% ELSIF guarantor_relationships.count > 0 OR ( patron.contactfirstname OR patron.contactname ) %]
276
                                                <li>
283
                                                <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt (-1 / +1 lines)
Lines 18-24 Link Here
18
                "dt_address":
18
                "dt_address":
19
                    "[% INCLUDE escape_address data=data %]",
19
                    "[% INCLUDE escape_address data=data %]",
20
                "dt_action":
20
                "dt_action":
21
                    "<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 %]\" />"
21
                    "<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 %]\" />"
22
            }[% UNLESS loop.last %],[% END %]
22
            }[% UNLESS loop.last %],[% END %]
23
        [% END %]
23
        [% END %]
24
    ]
24
    ]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-1 / +8 lines)
Lines 165-171 function update_category_code(category_code) { Link Here
165
    $(mytables).find(" li[data-category_code='']").show();
165
    $(mytables).find(" li[data-category_code='']").show();
166
}
166
}
167
167
168
function select_user(borrowernumber, borrower, relationship) {
168
function select_user(borrowernumber, borrower, relationship, attributes) {
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
170
170
171
    if ( is_guarantor ) {
171
    if ( is_guarantor ) {
Lines 209-214 function select_user(borrowernumber, borrower, relationship) { Link Here
209
        if ( relationship ) {
209
        if ( relationship ) {
210
            fieldset.find('.new_guarantor_relationship').val(relationship);
210
            fieldset.find('.new_guarantor_relationship').val(relationship);
211
        }
211
        }
212
213
        for (var i = 0; i < parseInt(attributes.length, 10); i++) {
214
            var attribute = attributes[i];
215
            if (borrower[attribute] != null){
216
                document.forms.entryform[attribute].value = borrower[attribute];
217
            }
218
        }
212
    }
219
    }
213
220
214
    return 0;
221
    return 0;
(-)a/members/memberentry.pl (-1 / +8 lines)
Lines 806-812 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
806
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
806
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
807
}
807
}
808
808
809
$template->param( "show_guarantor" => ( $category_type =~ /A|I|S|X/ ) ? 0 : 1 ); # associate with step to know where you are
809
$template->param( "show_guarantor"  => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are
810
811
my @guarantor_attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
812
if( my @additional_guarantor_attributes = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
813
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional_guarantor_attributes); # Trim whitespaces
814
    @guarantor_attributes = ( @guarantor_attributes, @additional_guarantor_attributes);
815
}
816
$template->param( "guarantor_attributes" => \@guarantor_attributes );
810
$debug and warn "memberentry step: $step";
817
$debug and warn "memberentry step: $step";
811
$template->param(%data);
818
$template->param(%data);
812
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
819
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
(-)a/members/moremember.pl (+13 lines)
Lines 115-120 $template->param( Link Here
115
115
116
my $relatives_issues_count =
116
my $relatives_issues_count =
117
    Koha::Checkouts->count({ borrowernumber => \@relatives });
117
    Koha::Checkouts->count({ borrowernumber => \@relatives });
118
my $count = scalar @guarantees;
119
if ( $count ) {
120
    $template->param( isguarantee => 1 );
121
122
    my $totalmount = 0;
123
124
    foreach my $guarantee (@guarantees){
125
        $totalmount += $guarantee->account->balance;
126
127
    }
128
    $template->param( guarantees => \@guarantees);
129
    $template->param( amounttot => sprintf("%.2f",$totalmount));
130
}
118
131
119
# Calculate and display patron's age
132
# Calculate and display patron's age
120
if ( !$patron->is_valid_age ) {
133
if ( !$patron->is_valid_age ) {
(-)a/svc/members/search (-1 / +6 lines)
Lines 91-102 $results = C4::Utils::DataTables::Members::search( Link Here
91
    }
91
    }
92
) unless $results;
92
) unless $results;
93
93
94
my @attributes = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
95
if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
96
    $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces
97
    @attributes = ( @attributes, @additional);
98
}
94
$template->param(
99
$template->param(
95
    sEcho => $sEcho,
100
    sEcho => $sEcho,
96
    iTotalRecords => $results->{iTotalRecords},
101
    iTotalRecords => $results->{iTotalRecords},
97
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
102
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
98
    aaData => $results->{patrons},
103
    aaData => $results->{patrons},
99
    selection_type => $selection_type,
104
    selection_type => $selection_type,
105
    attributes => \@attributes
100
);
106
);
101
107
102
output_with_http_headers $input, $cookie, $template->output, 'json';
108
output_with_http_headers $input, $cookie, $template->output, 'json';
103
- 

Return to bug 12446