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

(-)a/C4/Members/Attributes.pm (-1 / +16 lines)
Lines 34-40 BEGIN { Link Here
34
    @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes
34
    @EXPORT_OK = qw(GetBorrowerAttributes GetBorrowerAttributeValue CheckUniqueness SetBorrowerAttributes
35
                    DeleteBorrowerAttribute UpdateBorrowerAttribute
35
                    DeleteBorrowerAttribute UpdateBorrowerAttribute
36
                    extended_attributes_code_value_arrayref extended_attributes_merge
36
                    extended_attributes_code_value_arrayref extended_attributes_merge
37
                    SearchIdMatchingAttribute);
37
                    SearchIdMatchingAttribute get_guarantor_shared_attributes);
38
    %EXPORT_TAGS = ( all => \@EXPORT_OK );
38
    %EXPORT_TAGS = ( all => \@EXPORT_OK );
39
}
39
}
40
40
Lines 357-362 sub _sort_by_code { Link Here
357
    return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value};
357
    return $x->{code} cmp $y->{code} || $x->{value} cmp $y->{value};
358
}
358
}
359
359
360
=head2 get_guarantor_shared_attributes
361
362
    $guarantor_attributes = get_guarantor_attributes();
363
364
    returns an array reference containing attributes to be shared between guarantor and guarantee.
365
=cut
366
sub get_guarantor_shared_attributes{
367
    my @attributes    = qw( streetnumber address address2 city state zipcode country branchcode phone phonepro mobile email emailpro fax );
368
    if( my @additional = split(/\|/, C4::Context->preference("AdditionalGuarantorField")) ){
369
        $_ =~ s/(?:^\s+)|(?:\s+$)//g for (@additional); # Trim whitespaces
370
        @attributes = ( @attributes, @additional);
371
    }
372
    return \@attributes;
373
}
374
360
=head1 AUTHOR
375
=head1 AUTHOR
361
376
362
Koha Development Team <http://koha-community.org/>
377
Koha Development Team <http://koha-community.org/>
(-)a/C4/Utils/DataTables/Members.pm (-7 / +15 lines)
Lines 4-9 use Modern::Perl; Link Here
4
use C4::Branch qw/onlymine/;
4
use C4::Branch qw/onlymine/;
5
use C4::Context;
5
use C4::Context;
6
use C4::Members qw/GetMemberIssuesAndFines/;
6
use C4::Members qw/GetMemberIssuesAndFines/;
7
use C4::Members::Attributes qw/get_guarantor_shared_attributes/;
7
use C4::Utils::DataTables;
8
use C4::Utils::DataTables;
8
use Koha::DateUtils;
9
use Koha::DateUtils;
9
10
Lines 32-44 sub search { Link Here
32
    }
33
    }
33
34
34
    my $dbh = C4::Context->dbh;
35
    my $dbh = C4::Context->dbh;
35
    my $select = "SELECT
36
    my @columns = qw( borrowernumber surname firstname streetnumber streettype address address2 city state zipcode country cardnumber dateexpiry borrowernotes branchcode email userid dateofbirth categorycode );
36
        borrowers.borrowernumber, borrowers.surname, borrowers.firstname,
37
    if( my @guarantor_attributes = @{ get_guarantor_shared_attributes() }){
37
        borrowers.streetnumber, borrowers.streettype, borrowers.address,
38
        foreach my $item (@guarantor_attributes) {
38
        borrowers.address2, borrowers.city, borrowers.state, borrowers.zipcode,
39
             if (! grep {$_ eq $item} @columns) {
39
        borrowers.country, cardnumber, borrowers.dateexpiry,
40
                 push @columns, $item;
40
        borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
41
	     }
41
        borrowers.userid, borrowers.dateofbirth, borrowers.categorycode,
42
	}
43
    };
44
    my $borrowers_columns = "";
45
    foreach my $item (@columns) {
46
        $borrowers_columns .= "borrowers." . $item . ", ";
47
    }
48
49
    my $select = "SELECT " . $borrowers_columns . "
42
        categories.description AS category_description, categories.category_type,
50
        categories.description AS category_description, categories.category_type,
43
        branches.branchname";
51
        branches.branchname";
44
    my $from = "FROM borrowers
52
    my $from = "FROM borrowers
(-)a/Koha/Schema/Result/Category.pm (+8 lines)
Lines 109-114 __PACKAGE__->table("categories"); Link Here
109
  default_value: -1
109
  default_value: -1
110
  is_nullable: 0
110
  is_nullable: 0
111
111
112
=head2 canbeguarantee
113
114
  data_type: 'tinyint'
115
  default_value: 0
116
  is_nullable: 0
117
112
=head2 default_privacy
118
=head2 default_privacy
113
119
114
  data_type: 'enum'
120
  data_type: 'enum'
Lines 154-159 __PACKAGE__->add_columns( Link Here
154
    default_value => -1,
160
    default_value => -1,
155
    is_nullable   => 0,
161
    is_nullable   => 0,
156
  },
162
  },
163
  "canbeguarantee",
164
  { data_type => "tinyint", default_value => 0, is_nullable => 0},
157
  "default_privacy",
165
  "default_privacy",
158
  {
166
  {
159
    data_type => "enum",
167
    data_type => "enum",
(-)a/admin/categories.pl (+3 lines)
Lines 91-96 elsif ( $op eq 'add_validate' ) { Link Here
91
    my $category_type = $input->param('category_type');
91
    my $category_type = $input->param('category_type');
92
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
92
    my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
93
    my $default_privacy = $input->param('default_privacy');
93
    my $default_privacy = $input->param('default_privacy');
94
    my $canbeguarantee = $input->param('canbeguarantee');
94
    my @branches = grep { $_ ne q{} } $input->param('branches');
95
    my @branches = grep { $_ ne q{} } $input->param('branches');
95
96
96
    my $is_a_modif = $input->param("is_a_modif");
97
    my $is_a_modif = $input->param("is_a_modif");
Lines 112-117 elsif ( $op eq 'add_validate' ) { Link Here
112
        $category->hidelostitems($hidelostitems);
113
        $category->hidelostitems($hidelostitems);
113
        $category->overduenoticerequired($overduenoticerequired);
114
        $category->overduenoticerequired($overduenoticerequired);
114
        $category->category_type($category_type);
115
        $category->category_type($category_type);
116
        $category->canbeguarantee($canbeguarantee);
115
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
117
        $category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
116
        $category->default_privacy($default_privacy);
118
        $category->default_privacy($default_privacy);
117
        eval {
119
        eval {
Lines 137-142 elsif ( $op eq 'add_validate' ) { Link Here
137
            hidelostitems => $hidelostitems,
139
            hidelostitems => $hidelostitems,
138
            overduenoticerequired => $overduenoticerequired,
140
            overduenoticerequired => $overduenoticerequired,
139
            category_type => $category_type,
141
            category_type => $category_type,
142
            canbeguarantee => $canbeguarantee,
140
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
143
            BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
141
            default_privacy => $default_privacy,
144
            default_privacy => $default_privacy,
142
        });
145
        });
(-)a/installer/data/mysql/atomicupdate/bug_12446-EnableAdultGarantee.sql (+10 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';
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 488-494 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
488
  `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no)
488
  `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no)
489
  `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
489
  `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
490
  `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
490
  `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
491
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
491
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category,
492
  `canbeguarantee` tinyint(1) NOT NULL default '0'
492
  PRIMARY KEY  (`categorycode`),
493
  PRIMARY KEY  (`categorycode`),
493
  UNIQUE KEY `categorycode` (`categorycode`)
494
  UNIQUE KEY `categorycode` (`categorycode`)
494
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
495
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 6-11 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
6
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
6
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
7
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
7
('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
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
8
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
9
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
10
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
9
('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
11
('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
10
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
12
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
11
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
13
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
Lines 517-521 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
517
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
519
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
518
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
520
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
519
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
521
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
520
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
522
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
521
;
523
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 146-152 function searchToHold(){ Link Here
146
146
147
    [% IF ( CAN_user_borrowers ) %]
147
    [% IF ( CAN_user_borrowers ) %]
148
        [% IF ( adultborrower AND activeBorrowerRelationship ) %]
148
        [% IF ( adultborrower AND activeBorrowerRelationship ) %]
149
            <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]"><i class="fa fa-plus"></i> Add child</a>
149
            <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]&amp;category_type=C"><i class="icon-plus"></i> Add guarantee</a>
150
        [% END %]
150
        [% END %]
151
        [% IF ( CAN_user_borrowers ) %]
151
        [% IF ( CAN_user_borrowers ) %]
152
            <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>
152
            <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>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+15 lines)
Lines 238-243 Link Here
238
                    </select>
238
                    </select>
239
                    <span class="required">Required</span>
239
                    <span class="required">Required</span>
240
                </li>
240
                </li>
241
                <li>
242
                    <label for="canbeguarantee">Can be guarantee</label>
243
                    <select name="canbeguarantee" id="canbeguarantee">
244
                        [% IF category.canbeguarantee %]
245
                            <option value="1" selected>Yes</option>
246
                            <option value="0">No</option>
247
                        [% ELSE %]
248
                            <option value="1">Yes</option>
249
                            <option value="0" selected>No</option>
250
                        [% END %]
251
                    <select>
252
                </li>
241
                <li><label for="branches">Branches limitation: </label>
253
                <li><label for="branches">Branches limitation: </label>
242
                    <select id="branches" name="branches" multiple size="10">
254
                    <select id="branches" name="branches" multiple size="10">
243
                        <option value="">All branches</option>
255
                        <option value="">All branches</option>
Lines 345-350 Link Here
345
                <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
357
                <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
346
                <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
358
                <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
347
                <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
359
                <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
360
                <tr><th scope="row">Can be guarantee</th><td>[% IF category.canbeguarantee %]Yes[% ELSE %]No[% END %]</td></tr>
348
                <tr>
361
                <tr>
349
                    <th scope="row">Default privacy: </th>
362
                    <th scope="row">Default privacy: </th>
350
                    <td>
363
                    <td>
Lines 401-406 Link Here
401
                    <th scope="col">Messaging</th>
414
                    <th scope="col">Messaging</th>
402
                    [% END %]
415
                    [% END %]
403
                    <th scope="col">Branches limitations</th>
416
                    <th scope="col">Branches limitations</th>
417
                    <th scope="col">Can be guarantee</th>
404
                    <th scope="col">Default privacy</th>
418
                    <th scope="col">Default privacy</th>
405
                    <th scope="col">&nbsp; </th>
419
                    <th scope="col">&nbsp; </th>
406
                    <th scope="col">&nbsp; </th>
420
                    <th scope="col">&nbsp; </th>
Lines 478-483 Link Here
478
                                No limitation
492
                                No limitation
479
                            [% END %]
493
                            [% END %]
480
                        </td>
494
                        </td>
495
                        <td>[% IF category.canbeguarantee %] Yes [% ELSE %] no [% END %]</td>
481
                        <td>
496
                        <td>
482
                            [% SWITCH category.default_privacy %]
497
                            [% SWITCH category.default_privacy %]
483
                            [% CASE 'default' %]
498
                            [% CASE 'default' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+5 lines)
Lines 159-164 Patrons: Link Here
159
               yes: Do
159
               yes: Do
160
               no: "Don't"
160
               no: "Don't"
161
         - charge a fee when a patron changes to a category with an enrollment fee.
161
         - charge a fee when a patron changes to a category with an enrollment fee.
162
     -
163
         - "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:"
164
         - pref: AdditionalGuarantorField
165
           class: multi
166
         - (separate columns with |)
162
    "Norwegian patron database":
167
    "Norwegian patron database":
163
     -
168
     -
164
         - pref: NorwegianPatronDBEnable
169
         - pref: NorwegianPatronDBEnable
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-12 / +6 lines)
Lines 131-144 Link Here
131
            .val(borrower.firstname)
131
            .val(borrower.firstname)
132
            .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden';
132
            .before('<span>' + borrower.firstname + '</span>').get(0).type = 'hidden';
133
133
134
        form.streetnumber.value = borrower.streetnumber;
134
        [% FOREACH field IN guarantor_attributes %]
135
        form.address.value = borrower.address;
135
            $(form.[% field %]).val(borrower.[% field %]);
136
        form.address2.value = borrower.address2;
136
        [% END %]
137
        form.city.value = borrower.city;
138
        form.state.value = borrower.state;
139
        form.zipcode.value = borrower.zipcode;
140
        form.country.value = borrower.country;
141
        form.branchcode.value = borrower.branchcode;
142
137
143
        form.guarantorsearch.value = _("Change");
138
        form.guarantorsearch.value = _("Change");
144
139
Lines 435-441 Link Here
435
	            [% END %]
430
	            [% END %]
436
	        </li>
431
	        </li>
437
[% ELSE %]
432
[% ELSE %]
438
 [% IF ( C ) %]
439
 [% IF ( guarantorid ) %]
433
 [% IF ( guarantorid ) %]
440
 <li id="contact-details">
434
 <li id="contact-details">
441
 [% ELSE %]
435
 [% ELSE %]
Lines 453-461 Link Here
453
        <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
447
        <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" />
454
     [% END %]
448
     [% END %]
455
 </li>
449
 </li>
456
        [% END %]
450
     [% UNLESS nocontactfirstname %]
457
        [% UNLESS nocontactfirstname %]
451
<li>
458
 <li>
459
     <label for="contactfirstname">First name: </label>
452
     <label for="contactfirstname">First name: </label>
460
     [% IF ( guarantorid ) %]
453
     [% IF ( guarantorid ) %]
461
     <span>[% contactfirstname %]</span>
454
     <span>[% contactfirstname %]</span>
Lines 1025-1030 Link Here
1025
                <li data-category_code="[% patron_attribute.category_code %]">
1018
                <li data-category_code="[% patron_attribute.category_code %]">
1026
                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1019
                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1027
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1020
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1021
                        <input type="hidden" id="[% patron_attribute.form_id %]_desc" name="[% patron_attribute.form_id %]_desc" value="[% patron_attribute.description |html %]" />
1028
                        [% IF ( patron_attribute.use_dropdown ) %]
1022
                        [% IF ( patron_attribute.use_dropdown ) %]
1029
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1023
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1030
                                <option value=""></option>
1024
                                <option value=""></option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-3 / +14 lines)
Lines 232-244 function validate1(date) { Link Here
232
    </li>[% END %][% END %]
232
    </li>[% END %][% END %]
233
    [% IF ( isguarantee ) %]
233
    [% IF ( isguarantee ) %]
234
        [% IF ( guaranteeloop ) %]
234
        [% IF ( guaranteeloop ) %]
235
            <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>
235
            <li><span class="label">Guarantees:</span>
236
                <table>[% FOREACH guaranteeloo IN guaranteeloop %]
237
                <tr>
238
                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber %]">[% guaranteeloo.name %]</a></td>
239
                    <td style='text-align:right'>[% guaranteeloo.finesguarantee %] $</td>
240
                </tr>[% END %]
241
                <tr>
242
                    <td>Total</td>
243
                    <td style='text-align:right'>[% amounttot %] $</td>
244
                </tr>
245
                </table>
246
            </li>
236
        [% END %]
247
        [% END %]
237
    [% ELSE %]
248
    [% END %]
238
        [% IF ( guarantorborrowernumber ) %]
249
        [% IF ( guarantorborrowernumber ) %]
239
            <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %] [% END %]</a></li>
250
            <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %] [% END %]</a></li>
240
        [% END %]
251
        [% END %]
241
    [% END %]
252
242
</ol>
253
</ol>
243
</div>
254
</div>
244
      <div class="action">
255
      <div class="action">
(-)a/members/memberentry.pl (-4 / +13 lines)
Lines 39-44 use C4::Log; Link Here
39
use C4::Letters;
39
use C4::Letters;
40
use C4::Branch; # GetBranches
40
use C4::Branch; # GetBranches
41
use C4::Form::MessagingPreferences;
41
use C4::Form::MessagingPreferences;
42
use C4::Category;
42
use Koha::Borrower::Debarments;
43
use Koha::Borrower::Debarments;
43
use Koha::DateUtils;
44
use Koha::DateUtils;
44
use Email::Valid;
45
use Email::Valid;
Lines 232-239 if ( ( $op eq 'insert' ) and !$nodouble ) { Link Here
232
    }
233
    }
233
}
234
}
234
235
235
  #recover all data from guarantor address phone ,fax... 
236
#recover all data from guarantor address phone ,fax...
236
if ( $guarantorid ) {
237
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) {
238
237
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
239
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
238
        $category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C';
240
        $category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C';
239
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
241
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
Lines 245-252 if ( $guarantorid ) { Link Here
245
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
247
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
246
                        B_streetnumber B_streettype B_address B_address2
248
                        B_streetnumber B_streettype B_address B_address2
247
                        B_city B_state B_zipcode B_country B_email B_phone)) {
249
                        B_city B_state B_zipcode B_country B_email B_phone)) {
248
		        $newdata{$_} = $guarantordata->{$_};
250
                        $newdata{$_} = $guarantordata->{$_};
249
	        }
251
	        }
252
            my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
253
            my @field_add=split(/\|/,$additionalGuarantorField);
254
            my $guarantordata=GetMember(borrowernumber => $guarantorid);
255
            foreach (@field_add) {
256
                $newdata{$_} = $guarantordata->{$_};
257
            }
250
        }
258
        }
251
    }
259
    }
252
}
260
}
Lines 674-680 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
674
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
682
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
675
}
683
}
676
684
677
$template->param( "showguarantor"  => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are
685
$template->param( "showguarantor"  => $categorycode ? C4::Category->get($categorycode)->{'canbeguarantee'} : 1); # associate with step to know where you are
686
$template->param( "guarantor_attributes" => C4::Members::Attributes::get_guarantor_shared_attributes() );
678
$debug and warn "memberentry step: $step";
687
$debug and warn "memberentry step: $step";
679
$template->param(%data);
688
$template->param(%data);
680
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
689
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
(-)a/members/moremember.pl (-14 / +14 lines)
Lines 171-203 if ( $count ) { Link Here
171
    # the array, which is probably better done as a foreach loop.
171
    # the array, which is probably better done as a foreach loop.
172
    #
172
    #
173
    my @guaranteedata;
173
    my @guaranteedata;
174
    my $amount;
175
    my $totalmount = 0;
176
174
    for ( my $i = 0 ; $i < $count ; $i++ ) {
177
    for ( my $i = 0 ; $i < $count ; $i++ ) {
178
        my ($amount,$accts,undef) = GetMemberAccountRecords($guarantees->[$i]->{'borrowernumber'});
175
        push(@guaranteedata,
179
        push(@guaranteedata,
176
            {
180
            {
177
                borrowernumber => $guarantees->[$i]->{'borrowernumber'},
181
                borrowernumber => $guarantees->[$i]->{'borrowernumber'},
178
                cardnumber     => $guarantees->[$i]->{'cardnumber'},
182
                cardnumber     => $guarantees->[$i]->{'cardnumber'},
183
                finesguarantee => sprintf("%.2f",$amount),
179
                name           => $guarantees->[$i]->{'firstname'} . " "
184
                name           => $guarantees->[$i]->{'firstname'} . " "
180
                                . $guarantees->[$i]->{'surname'}
185
                                . $guarantees->[$i]->{'surname'}
181
            }
186
            }
182
        );
187
        );
188
        $totalmount += $amount;
183
    }
189
    }
184
    $template->param( guaranteeloop => \@guaranteedata );
190
    $template->param( guaranteeloop => \@guaranteedata );
191
    $template->param( amounttot => sprintf("%.2f",$totalmount));
185
}
192
}
186
else {
193
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
187
    if ($data->{'guarantorid'}){
194
188
	    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
195
if ($data->{'guarantorid'}){
189
		$template->param(guarantor => 1);
196
    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
190
		foreach (qw(borrowernumber cardnumber firstname surname)) {        
197
    $template->param(guarantor => 1);
191
			  $template->param("guarantor$_" => $guarantor->{$_});
198
    foreach (qw(borrowernumber cardnumber firstname surname)) {
192
        }
199
          $template->param("guarantor$_" => $guarantor->{$_});
193
    }
200
    }
194
	if ($category_type eq 'C'){
195
		$template->param('C' => 1);
196
	}
197
}
201
}
198
199
$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' );
200
201
my %bor;
202
my %bor;
202
$bor{'borrowernumber'} = $borrowernumber;
203
$bor{'borrowernumber'} = $borrowernumber;
203
204
204
- 

Return to bug 12446