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

(-)a/C4/Members/Attributes.pm (-1 / +18 lines)
Lines 32-38 BEGIN { Link Here
32
    @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes
32
    @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes
33
                    DeleteBorrowerAttribute UpdateBorrowerAttribute
33
                    DeleteBorrowerAttribute UpdateBorrowerAttribute
34
                    extended_attributes_code_value_arrayref extended_attributes_merge
34
                    extended_attributes_code_value_arrayref extended_attributes_merge
35
                    SearchIdMatchingAttribute);
35
                    SearchIdMatchingAttribute get_guarantor_shared_attributes);
36
    %EXPORT_TAGS = ( all => \@EXPORT_OK );
36
    %EXPORT_TAGS = ( all => \@EXPORT_OK );
37
}
37
}
38
38
Lines 365-370 sub _sort_by_code { Link Here
365
    return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value};
365
    return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value};
366
}
366
}
367
367
368
=head2 get_guarantor_shared_attributes
369
370
    $guarantor_attributes = get_guarantor_attributes();
371
372
    returns an array reference containing attributes to be shared between guarantor and guarantee.
373
374
=cut
375
376
sub get_guarantor_shared_attributes{
377
    my @attributes    = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
378
    if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
379
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces
380
        @attributes = ( @attributes, @additional);
381
    }
382
    return \@attributes;
383
}
384
368
=head1 AUTHOR
385
=head1 AUTHOR
369
386
370
Koha Development Team <http://koha-community.org/>
387
Koha Development Team <http://koha-community.org/>
(-)a/C4/Utils/DataTables/Members.pm (-7 / +25 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;
6
use C4::Members::Attributes qw/get_guarantor_shared_attributes/;
5
use C4::Utils::DataTables;
7
use C4::Utils::DataTables;
6
use Koha::DateUtils;
8
use Koha::DateUtils;
7
use C4::Members::Attributes qw(SearchIdMatchingAttribute );
9
use C4::Members::Attributes qw(SearchIdMatchingAttribute );
Lines 56-68 sub search { Link Here
56
        }
58
        }
57
    }
59
    }
58
60
59
    my $select = "SELECT
61
    # If branches are independent and user is not superlibrarian
60
        borrowers.borrowernumber, borrowers.surname, borrowers.firstname,
62
    # The search has to be only on the user branch
61
        borrowers.streetnumber, borrowers.streettype, borrowers.address,
63
    if ( C4::Context::only_my_library ) {
62
        borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode,
64
        my $userenv = C4::Context->userenv;
63
        borrowers.country, cardnumber, borrowers.dateexpiry,
65
        $branchcode = $userenv->{'branch'};
64
        borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
66
65
        borrowers.userid, borrowers.dateofbirth, borrowers.categorycode,
67
    }
68
69
    $dbh = C4::Context->dbh;
70
    my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode phone phonepro mobile fax email emailpro);
71
    if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){
72
        foreach my $item (@guarantor_attributes) {
73
             if (! grep {$_ eq $item} @columns) {
74
                 push @columns, $item;
75
            }
76
        }
77
    };
78
    my $borrowers_columns = "";
79
    foreach my $item (@columns) {
80
        $borrowers_columns .= "borrowers." . $item . ", ";
81
    }
82
83
    my $select = "SELECT " . $borrowers_columns . "
66
        categories.description AS category_description, categories.category_type,
84
        categories.description AS category_description, categories.category_type,
67
        branches.branchname, borrowers.phone";
85
        branches.branchname, borrowers.phone";
68
    my $from = "FROM borrowers
86
    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-EnableAdultGarantee.sql (+11 lines)
Line 0 Link Here
1
-- ******** --
2
-- SYSPREFS --
3
-- ******** --
4
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
5
VALUES ('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free');
6
7
-- ********* --
8
-- STRUCTURE --
9
-- ********* --
10
ALTER TABLE categories ADD COLUMN `canbeguarantee` tinyint(1) NOT NULL default '0';
11
UPDATE categories SET canbeguarantee = 1 WHERE category_type = 'P' OR category_type = 'C';
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 324-329 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
324
  `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'.
324
  `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
  `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow,
325
  `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow,
326
  `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC
326
  `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC
327
  `canbeguarantee` tinyint(1) NOT NULL default '0'
327
  PRIMARY KEY  (`categorycode`),
328
  PRIMARY KEY  (`categorycode`),
328
  UNIQUE KEY `categorycode` (`categorycode`)
329
  UNIQUE KEY `categorycode` (`categorycode`)
329
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
330
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 8-13 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
8
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
8
('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
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
9
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
10
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
10
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
11
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
11
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
12
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
12
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
13
('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'),
13
('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'),
14
('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 12-18 Link Here
12
12
13
    [% IF CAN_user_borrowers_edit_borrowers %]
13
    [% IF CAN_user_borrowers_edit_borrowers %]
14
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
14
        [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %]
15
            <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>
15
            <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>
16
        [% END %]
16
        [% END %]
17
        <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="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>
18
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;categorycode=[% patron.categorycode | html %]"><i class="fa fa-copy"></i> Duplicate</a>
18
        <a id="duplicate" class="btn btn-default" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;categorycode=[% patron.categorycode | 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 233-238 Patrons: Link Here
233
               no: Allow all permitted users
233
               no: Allow all permitted users
234
         - "to access/change superlibrarian privileges."
234
         - "to access/change superlibrarian privileges."
235
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
235
         - "<br><strong>NOTE:</strong> A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
236
     -
237
         - "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:"
238
         - pref: AdditionalGuarantorField
239
           class: multi
240
         - (separate columns with |)
236
241
237
    Privacy:
242
    Privacy:
238
     -
243
     -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (-3 / +4 lines)
Lines 220-226 Link Here
220
                e.preventDefault();
220
                e.preventDefault();
221
                var borrowernumber = $(this).data("borrowernumber");
221
                var borrowernumber = $(this).data("borrowernumber");
222
                var borrower_data = $("#borrower_data"+borrowernumber).val();
222
                var borrower_data = $("#borrower_data"+borrowernumber).val();
223
                select_user( borrowernumber, JSON.parse(borrower_data) );
223
                var guarantor_attributes = $("#guarantor_attributes").val();
224
                select_user( borrowernumber, JSON.parse(borrower_data), JSON.parse(guarantor_attributes) );
224
            });
225
            });
225
226
226
            $("body").on("click",".patron_preview", function( e ){
227
            $("body").on("click",".patron_preview", function( e ){
Lines 278-286 Link Here
278
                wait_for_opener();
279
                wait_for_opener();
279
            }
280
            }
280
        [% ELSIF selection_type == 'select' %]
281
        [% ELSIF selection_type == 'select' %]
281
            function select_user(borrowernumber, data) {
282
            function select_user(borrowernumber, data, attributes) {
282
                var p = window.opener;
283
                var p = window.opener;
283
                p.select_user(borrowernumber, data);
284
                p.select_user(borrowernumber, data, attributes);
284
                window.close();
285
                window.close();
285
            }
286
            }
286
        [% END %]
287
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1 / +1 lines)
Lines 1246-1252 Link Here
1246
            [% END %]
1246
            [% END %]
1247
1247
1248
            [% IF guarantor %]
1248
            [% IF guarantor %]
1249
                select_user( '[% guarantor.borrowernumber | html %]', [% To.json( guarantor.unblessed ) | $raw %] );
1249
                select_user( '[% guarantor.borrowernumber | html %]', [% To.json( guarantor.unblessed ) | $raw %], [% To.json( guarantor_attributes ) | $raw %] );
1250
            [% END %]
1250
            [% END %]
1251
1251
1252
            $("#cn_max").hide();
1252
            $("#cn_max").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +11 lines)
Lines 260-274 Link Here
260
                                        [% IF guarantees %]
260
                                        [% IF guarantees %]
261
                                            <li>
261
                                            <li>
262
                                                <span class="label">Guarantees:</span>
262
                                                <span class="label">Guarantees:</span>
263
                                                <ul>
263
                                                <table>
264
                                                    [% FOREACH guarantee IN guarantees %]
264
                                                    [% FOREACH guarantee IN guarantees %]
265
                                                    <tr>
265
                                                        [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
266
                                                        [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
266
                                                            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
267
                                                            <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber | uri %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></td>
268
                                                            <td style='text-align:right'>[% guarantee.account.balance %]</td>
267
                                                        [% ELSE %]
269
                                                        [% ELSE %]
268
                                                            <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
270
                                                            <td>[% guarantee.firstname | html %] [% guarantee.surname | html %]</td>
269
                                                        [% END %]
271
                                                        [% END %]
272
                                                    </tr>
270
                                                    [% END %]
273
                                                    [% END %]
271
                                                </ul>
274
                                                    [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
275
                                                       <td>Total</td>
276
                                                       <td style='text-align:right'>[% amounttot %]</td>
277
                                                    [% END %]
278
                                                </table>
272
                                            </li>
279
                                            </li>
273
                                        [% ELSIF guarantor_relationships.count > 0 %]
280
                                        [% ELSIF guarantor_relationships.count > 0 %]
274
                                                <li>
281
                                                <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) {
168
function select_user(borrowernumber, borrower, attributes) {
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
169
    let is_guarantor = $(`.guarantor-details[data-borrowernumber=${borrower.borrowernumber}]`).length;
170
    console.log("LEN: "  + is_guarantor );
170
    console.log("LEN: "  + is_guarantor );
171
171
Lines 207-212 function select_user(borrowernumber, borrower) { Link Here
207
207
208
        $('#guarantor_relationships').append( fieldset );
208
        $('#guarantor_relationships').append( fieldset );
209
        fieldset.show();
209
        fieldset.show();
210
211
        for (var i = 0; i < parseInt(attributes.length, 10); i++) {
212
            var attribute = attributes[i];
213
            if (borrower[attribute] != null){
214
                document.forms.entryform[attribute].value = borrower[attribute];
215
            }
216
        }
210
    }
217
    }
211
218
212
    return 0;
219
    return 0;
(-)a/members/memberentry.pl (-1 / +3 lines)
Lines 757-763 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
757
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
757
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
758
}
758
}
759
759
760
$template->param( "show_guarantor" => ( $category_type =~ /A|I|S|X/ ) ? 0 : 1 ); # associate with step to know where you are
760
$template->param( "show_guarantor"  => $categorycode ? Koha::Patron::Categories->find($categorycode)->canbeguarantee : 1); # associate with step to know where you are
761
762
$template->param( "guarantor_attributes" => C4::Members::Attributes::get_guarantor_shared_attributes() );
761
$debug and warn "memberentry step: $step";
763
$debug and warn "memberentry step: $step";
762
$template->param(%data);
764
$template->param(%data);
763
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
765
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
(-)a/members/moremember.pl (+16 lines)
Lines 116-121 $template->param( Link Here
116
116
117
my $relatives_issues_count =
117
my $relatives_issues_count =
118
    Koha::Checkouts->count({ borrowernumber => \@relatives });
118
    Koha::Checkouts->count({ borrowernumber => \@relatives });
119
my $count = scalar @guarantees;
120
if ( $count ) {
121
    $template->param( isguarantee => 1 );
122
123
    my @guaranteedata;
124
    my $amount;
125
    my $totalmount = 0;
126
127
    foreach my $guarantee (@guarantees){
128
129
        $totalmount += $guarantee->account->balance;
130
131
    }
132
    $template->param( guarantees => @guarantees);
133
    $template->param( amounttot => sprintf("%.2f",$totalmount));
134
}
119
135
120
# Calculate and display patron's age
136
# Calculate and display patron's age
121
if ( !$patron->is_valid_age ) {
137
if ( !$patron->is_valid_age ) {
(-)a/svc/members/search (-1 / +2 lines)
Lines 109-120 if ($has_permission) { Link Here
109
    $results->{iTotalDisplayRecords} = scalar( @patrons_with_permission );
109
    $results->{iTotalDisplayRecords} = scalar( @patrons_with_permission );
110
}
110
}
111
111
112
my @attributes = C4::Members::Attributes::get_guarantor_shared_attributes();
112
$template->param(
113
$template->param(
113
    sEcho => $sEcho,
114
    sEcho => $sEcho,
114
    iTotalRecords => $results->{iTotalRecords},
115
    iTotalRecords => $results->{iTotalRecords},
115
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
116
    iTotalDisplayRecords => $results->{iTotalDisplayRecords},
116
    aaData => $results->{patrons},
117
    aaData => $results->{patrons},
117
    selection_type => $selection_type,
118
    selection_type => $selection_type,
119
    attributes => @attributes
118
);
120
);
119
121
120
output_with_http_headers $input, $cookie, $template->output, 'json';
122
output_with_http_headers $input, $cookie, $template->output, 'json';
121
- 

Return to bug 12446