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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 5-10 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
5
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
5
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
6
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
6
('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
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
7
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
8
('AdditionalGuarantorField','',NULL,'Additional fields name to be transfer from guarantor to guarantee.','free'),
8
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
9
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
9
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
10
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
10
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
11
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 110-116 function searchToHold(){ Link Here
110
110
111
    [% IF ( CAN_user_borrowers ) %]
111
    [% IF ( CAN_user_borrowers ) %]
112
        [% IF ( adultborrower AND activeBorrowerRelationship ) %]
112
        [% IF ( adultborrower AND activeBorrowerRelationship ) %]
113
            <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 child</a>
113
            <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 guarantiee</a>
114
        [% END %]
114
        [% END %]
115
        [% IF ( CAN_user_borrowers ) %]
115
        [% IF ( CAN_user_borrowers ) %]
116
            <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="icon-lock"></i> Change password</a>
116
            <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="icon-lock"></i> Change password</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+5 lines)
Lines 138-140 Patrons: Link Here
138
         - pref: CardnumberLength
138
         - pref: CardnumberLength
139
         - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')."
139
         - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')."
140
         - "If 'cardnumber' is included in the BorrowerMandatoryField list, the minimum length, if not specified here, defaults to one."
140
         - "If 'cardnumber' is included in the BorrowerMandatoryField list, the minimum length, if not specified here, defaults to one."
141
     -
142
         - "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:"
143
         - pref: AdditionalGuarantorField
144
           class: multi
145
         - (separate columns with |)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/guarantor_search.tt (-1 / +32 lines)
Lines 18-23 Link Here
18
            var zipcode       = $('#' + id + 'zipcode').text();
18
            var zipcode       = $('#' + id + 'zipcode').text();
19
            var country       = $('#' + id + 'country').text();
19
            var country       = $('#' + id + 'country').text();
20
            var branchcode    = $('#' + id + 'branchcode').text();
20
            var branchcode    = $('#' + id + 'branchcode').text();
21
            var phone         = $('#' + id + 'phone').text();
22
            var phonepro      = $('#' + id + 'phonepro').text();
23
            var mobile        = $('#' + id + 'mobile').text();
24
            var email         = $('#' + id + 'email').text();
25
            var emailpro      = $('#' + id + 'emailpro').text();
26
            var fax           = $('#' + id + 'fax').text();
27
28
            $('.' + id + 'extra_field').each(function() {
29
                var spanId = $(this).attr('id');
30
                spanId = spanId.replace(id,'');
31
                var spanElement = window.opener.document.getElementById(spanId);
32
                if (spanElement)
33
                window.opener.document.getElementById(spanId).value = $(this).text();
34
            });
21
35
22
            var $ = window.opener.$;
36
            var $ = window.opener.$;
23
            var form = $('#entryform').get(0);
37
            var form = $('#entryform').get(0);
Lines 48-53 Link Here
48
            form.zipcode.value = zipcode;
62
            form.zipcode.value = zipcode;
49
            form.country.value = country;
63
            form.country.value = country;
50
            form.branchcode.value = branchcode;
64
            form.branchcode.value = branchcode;
65
            form.phone.value = phone;
66
            form.phonepro.value = phonepro;
67
            form.mobile.value = mobile;
68
            form.email.value = email;
69
            form.emailpro.value = emailpro;
70
            form.fax.value = fax;
51
71
52
            form.guarantorsearch.value = 'Change';
72
            form.guarantorsearch.value = 'Change';
53
            self.close();
73
            self.close();
Lines 103-109 Link Here
103
                   <span id="[% borrowernumber %]zipcode">[% zipcode %]</span>
123
                   <span id="[% borrowernumber %]zipcode">[% zipcode %]</span>
104
                   <span id="[% borrowernumber %]country">[% country %]</span>
124
                   <span id="[% borrowernumber %]country">[% country %]</span>
105
                   <span id="[% borrowernumber %]branchcode">[% branchcode %]</span>
125
                   <span id="[% borrowernumber %]branchcode">[% branchcode %]</span>
106
                  </span>
126
                   <span id="[% borrowernumber %]phone">[% phone %]</span>
127
                   <span id="[% borrowernumber %]phonepro">[% phonepro %]</span>
128
                   <span id="[% borrowernumber %]mobile">[% mobile %]</span>
129
                   <span id="[% borrowernumber %]email">[% email %]</span>
130
                   <span id="[% borrowernumber %]emailpro">[% emailpro %]</span>
131
                   <span id="[% borrowernumber %]fax">[% fax %]</span>
132
133
                   [% FOREACH extrafield IN extrafields %]
134
                        <span class="[% borrowernumber %]extra_field" id="[% borrowernumber %][% extrafield.field %]">[% extrafield.value %]</span>
135
                   [% END %]
136
137
                   </span>
107
138
108
                    <form action="">
139
                    <form action="">
109
                        <input type="button" onclick="fillguarantor('[% borrowernumber %]'); return false;" value="Select"/>
140
                        <input type="button" onclick="fillguarantor('[% borrowernumber %]'); return false;" value="Select"/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-4 / +3 lines)
Lines 383-389 Link Here
383
	            [% END %]
383
	            [% END %]
384
	        </li>
384
	        </li>
385
[% ELSE %]
385
[% ELSE %]
386
 [% IF ( C ) %]
387
 [% IF ( guarantorid ) %]
386
 [% IF ( guarantorid ) %]
388
 <li id="contact-details">
387
 <li id="contact-details">
389
 [% ELSE %]
388
 [% ELSE %]
Lines 401-409 Link Here
401
        <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" class="[% focusAction %]" />
400
        <input name="contactname" id="contactname" type="text" size="20" value="[% contactname %]" class="[% focusAction %]" />
402
     [% END %]
401
     [% END %]
403
 </li>
402
 </li>
404
        [% END %]
403
     [% UNLESS nocontactfirstname %]
405
        [% UNLESS nocontactfirstname %]
404
<li>
406
 <li>
407
     <label for="contactfirstname">First name: </label>
405
     <label for="contactfirstname">First name: </label>
408
     [% IF ( guarantorid ) %]
406
     [% IF ( guarantorid ) %]
409
     <span>[% contactfirstname %]</span>
407
     <span>[% contactfirstname %]</span>
Lines 1275-1280 Link Here
1275
                <li data-category_code="[% patron_attribute.category_code %]">
1273
                <li data-category_code="[% patron_attribute.category_code %]">
1276
                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1274
                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1277
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1275
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1276
                        <input type="hidden" id="[% patron_attribute.form_id %]_desc" name="[% patron_attribute.form_id %]_desc" value="[% patron_attribute.description |html %]" />
1278
                        [% IF ( patron_attribute.use_dropdown ) %]
1277
                        [% IF ( patron_attribute.use_dropdown ) %]
1279
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1278
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1280
                                <option value=""></option>
1279
                                <option value=""></option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-3 / +14 lines)
Lines 249-261 function validate1(date) { Link Here
249
    [% END %]
249
    [% END %]
250
    [% IF ( isguarantee ) %]
250
    [% IF ( isguarantee ) %]
251
        [% IF ( guaranteeloop ) %]
251
        [% IF ( guaranteeloop ) %]
252
            <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>
252
            <li><span class="label">Guarantees:</span>
253
                <table>[% FOREACH guaranteeloo IN guaranteeloop %]
254
                <tr>
255
                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber %]">[% guaranteeloo.name %]</a></td>
256
                    <td style='text-align:right'>[% guaranteeloo.finesguarantee %] $</td>
257
                </tr>[% END %]
258
                <tr>
259
                    <td>Total</td>
260
                    <td style='text-align:right'>[% amounttot %] $</td>
261
                </tr>
262
                </table>
263
            </li>
253
        [% END %]
264
        [% END %]
254
    [% ELSE %]
265
    [% END %]
255
        [% IF ( guarantorborrowernumber ) %]
266
        [% IF ( guarantorborrowernumber ) %]
256
            <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %], [% guarantorfirstname %]</a></li>
267
            <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorborrowernumber %]">[% guarantorsurname %], [% guarantorfirstname %]</a></li>
257
        [% END %]
268
        [% END %]
258
    [% END %]
269
259
</ol>
270
</ol>
260
</div>
271
</div>
261
      <div class="action">
272
      <div class="action">
(-)a/members/guarantor_search.pl (-2 / +21 lines)
Lines 67-72 if ( $member ne '' ) { Link Here
67
    $count = $results ? @$results : 0;
67
    $count = $results ? @$results : 0;
68
68
69
    for ( my $i = 0 ; $i < $count ; $i++ ) {
69
    for ( my $i = 0 ; $i < $count ; $i++ ) {
70
        my @rowextrafields = ();
70
        my %row = (
71
        my %row = (
71
            count          => $i + 1,
72
            count          => $i + 1,
72
            borrowernumber => $results->[$i]{'borrowernumber'},
73
            borrowernumber => $results->[$i]{'borrowernumber'},
Lines 83-91 if ( $member ne '' ) { Link Here
83
            country        => $results->[$i]{'country'},
84
            country        => $results->[$i]{'country'},
84
            branchcode     => $results->[$i]{'branchcode'},
85
            branchcode     => $results->[$i]{'branchcode'},
85
            dateofbirth    => format_date( $results->[$i]{'dateofbirth'} ),
86
            dateofbirth    => format_date( $results->[$i]{'dateofbirth'} ),
86
            borrowernotes  => $results->[$i]{'borrowernotes'}
87
            borrowernotes  => $results->[$i]{'borrowernotes'},
88
            phone          => $results->[$i]{'phone'},
89
            phonepro       => $results->[$i]{'phonepro'},
90
            mobile         => $results->[$i]{'mobile'},
91
            email          => $results->[$i]{'email'},
92
            emailpro       => $results->[$i]{'emailpro'},
93
            fax            => $results->[$i]{'fax'}
87
        );
94
        );
88
95
96
97
        my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
98
        my @field_add=split(/\|/,$additionalGuarantorField);
99
        foreach (@field_add) {
100
            my $fieldrow_ref = {};
101
            $fieldrow_ref -> {'field'} = $_;
102
            $fieldrow_ref -> {'value'} = $results->[$i]{$_};
103
            push( @rowextrafields, $fieldrow_ref );
104
        }
105
106
        $row{extrafields} = \@rowextrafields;
107
89
        push( @resultsdata, \%row );
108
        push( @resultsdata, \%row );
90
    }
109
    }
91
}
110
}
Lines 94-100 $template->param( Link Here
94
    member        => $member,
113
    member        => $member,
95
    numresults    => $count,
114
    numresults    => $count,
96
    category_type => $category_type,
115
    category_type => $category_type,
97
    resultsloop   => \@resultsdata
116
    resultsloop   => \@resultsdata,
98
);
117
);
99
118
100
output_html_with_http_headers $input, $cookie, $template->output;
119
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/members/memberentry.pl (-5 / +9 lines)
Lines 248-254 if ( ( $op eq 'insert' ) and !$nodouble ) { Link Here
248
}
248
}
249
249
250
  #recover all data from guarantor address phone ,fax... 
250
  #recover all data from guarantor address phone ,fax... 
251
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
251
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) {
252
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
252
    if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
253
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
253
        $guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
254
        $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
254
        $newdata{'contactfirstname'}= $guarantordata->{'firstname'};
Lines 256-266 if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) { Link Here
256
        $newdata{'contacttitle'}    = $guarantordata->{'title'};
256
        $newdata{'contacttitle'}    = $guarantordata->{'title'};
257
        if ( $op eq 'add' ) {
257
        if ( $op eq 'add' ) {
258
	        foreach (qw(streetnumber address streettype address2
258
	        foreach (qw(streetnumber address streettype address2
259
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode
259
                        zipcode country city state phone phonepro mobile fax email emailpro branchcode)) {
260
                        B_streetnumber B_streettype B_address B_address2
261
                        B_city B_state B_zipcode B_country B_email B_phone)) {
262
		        $newdata{$_} = $guarantordata->{$_};
260
		        $newdata{$_} = $guarantordata->{$_};
263
	        }
261
	        }
262
            my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
263
            my @field_add=split(/\|/,$additionalGuarantorField);
264
            my $guarantordata=GetMember(borrowernumber => $guarantorid);
265
            foreach (@field_add) {
266
                $newdata{$_} = $guarantordata->{$_};
267
            }
264
        }
268
        }
265
    }
269
    }
266
}
270
}
Lines 666-672 if (C4::Context->preference('EnhancedMessagingPreferences')) { Link Here
666
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
670
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
667
}
671
}
668
672
669
$template->param( "showguarantor"  => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are
673
$template->param( "showguarantor"  => ($category_type=~/I|S|X/) ? 0 : 1); # associate with step to know where you are
670
$debug and warn "memberentry step: $step";
674
$debug and warn "memberentry step: $step";
671
$template->param(%data);
675
$template->param(%data);
672
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
676
$template->param( "step_$step"  => 1) if $step;	# associate with step to know where u are
(-)a/members/moremember.pl (-9 / +14 lines)
Lines 180-211 if ( $category_type eq 'A' || $category_type eq 'I') { Link Here
180
    #
180
    #
181
    my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
181
    my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
182
    my @guaranteedata;
182
    my @guaranteedata;
183
    my $amount;
184
    my $totalmount = 0;
185
183
    for ( my $i = 0 ; $i < $count ; $i++ ) {
186
    for ( my $i = 0 ; $i < $count ; $i++ ) {
187
        my ($amount,$accts,undef) = GetMemberAccountRecords($guarantees->[$i]->{'borrowernumber'});
184
        push(@guaranteedata,
188
        push(@guaranteedata,
185
            {
189
            {
186
                borrowernumber => $guarantees->[$i]->{'borrowernumber'},
190
                borrowernumber => $guarantees->[$i]->{'borrowernumber'},
187
                cardnumber     => $guarantees->[$i]->{'cardnumber'},
191
                cardnumber     => $guarantees->[$i]->{'cardnumber'},
192
                finesguarantee => sprintf("%.2f",$amount),
188
                name           => $guarantees->[$i]->{'firstname'} . " "
193
                name           => $guarantees->[$i]->{'firstname'} . " "
189
                                . $guarantees->[$i]->{'surname'}
194
                                . $guarantees->[$i]->{'surname'}
190
            }
195
            }
191
        );
196
        );
197
        $totalmount += $amount;
192
    }
198
    }
193
    $template->param( guaranteeloop => \@guaranteedata );
199
    $template->param( guaranteeloop => \@guaranteedata );
200
    $template->param( amounttot => sprintf("%.2f",$totalmount));
194
    ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
201
    ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
195
}
202
}
196
else {
203
else {
197
    if ($data->{'guarantorid'}){
198
	    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
199
		$template->param(guarantor => 1);
200
		foreach (qw(borrowernumber cardnumber firstname surname)) {        
201
			  $template->param("guarantor$_" => $guarantor->{$_});
202
        }
203
    }
204
	if ($category_type eq 'C'){
204
	if ($category_type eq 'C'){
205
		$template->param('C' => 1);
205
		$template->param('C' => 1);
206
	}
206
	}
207
}
207
}
208
208
if ($data->{'guarantorid'}){
209
    my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
210
    $template->param(guarantor => 1);
211
    foreach (qw(borrowernumber cardnumber firstname surname)) {
212
          $template->param("guarantor$_" => $guarantor->{$_});
213
    }
214
}
209
my %bor;
215
my %bor;
210
$bor{'borrowernumber'} = $borrowernumber;
216
$bor{'borrowernumber'} = $borrowernumber;
211
217
212
- 

Return to bug 12446