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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 324-330 Patrons: Link Here
324
         - "Guarantors can be the following of those they guarantee:"
324
         - "Guarantors can be the following of those they guarantee:"
325
         - pref: borrowerRelationship
325
         - pref: borrowerRelationship
326
           class: multi
326
           class: multi
327
         - (input multiple choices separated by |). Leave empty to deactivate.
327
         - (input multiple choices separated by |).
328
     -
328
     -
329
         - "When adding a guarantee to a guarantor patron fill the following fields in the guarantee's member entry form from the guarantors record:"
329
         - "When adding a guarantee to a guarantor patron fill the following fields in the guarantee's member entry form from the guarantors record:"
330
         - pref: PrefillGuaranteeField
330
         - pref: PrefillGuaranteeField
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-21 / +29 lines)
Lines 507-515 legend:hover { Link Here
507
                                                                <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
507
                                                                <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
508
                                                            </li>
508
                                                            </li>
509
509
510
                                                            [% IF possible_relationships %]
510
                                                            [% UNLESS norelationship %]
511
                                                                <li>
511
                                                                <li>
512
                                                                    [% UNLESS empty_relationship_allowed %]
512
                                                                    [% IF mandatoryrelationship %]
513
                                                                        <label for="guarantor_relationship" class="required">Relationship: </label>
513
                                                                        <label for="guarantor_relationship" class="required">Relationship: </label>
514
                                                                        <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
514
                                                                        <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
515
                                                                    [% ELSE %]
515
                                                                    [% ELSE %]
Lines 523-529 legend:hover { Link Here
523
                                                                            [% END %]
523
                                                                            [% END %]
524
                                                                        [% END %]
524
                                                                        [% END %]
525
                                                                    </select>
525
                                                                    </select>
526
                                                                    [% UNLESS empty_relationship_allowed %]
526
                                                                    [% UNLESS mandatoryrelationship %]
527
                                                                        <span class="required">Required</span>
527
                                                                        <span class="required">Required</span>
528
                                                                    [% END %]
528
                                                                    [% END %]
529
                                                                </li>
529
                                                                </li>
Lines 551-559 legend:hover { Link Here
551
                                                        <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
551
                                                        <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
552
                                                    </li>
552
                                                    </li>
553
553
554
                                                    [% IF possible_relationships %]
554
                                                    [% UNLESS norelationship %]
555
                                                        <li>
555
                                                        <li>
556
                                                            [% UNLESS empty_relationship_allowed %]
556
                                                            [% IF mandatoryrelationship %]
557
                                                                <label for="guarantor_relationship" class="required">Relationship: </label>
557
                                                                <label for="guarantor_relationship" class="required">Relationship: </label>
558
                                                                <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
558
                                                                <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
559
                                                            [% ELSE %]
559
                                                            [% ELSE %]
Lines 567-573 legend:hover { Link Here
567
                                                                    [% END %]
567
                                                                    [% END %]
568
                                                                [% END %]
568
                                                                [% END %]
569
                                                            </select>
569
                                                            </select>
570
                                                            [% UNLESS empty_relationship_allowed %]
570
                                                            [% IF mandatoryrelationship %]
571
                                                                <span class="required">Required</span>
571
                                                                <span class="required">Required</span>
572
                                                            [% END %]
572
                                                            [% END %]
573
                                                        </li>
573
                                                        </li>
Lines 664-684 legend:hover { Link Here
664
                                                [% END # /UNLESS noaltcontactfirstname %]
664
                                                [% END # /UNLESS noaltcontactfirstname %]
665
665
666
                                                [% UNLESS norelationship %]
666
                                                [% UNLESS norelationship %]
667
                                                    [% IF possible_relationships %]
667
                                                    <li>
668
                                                        <li>
668
                                                        [% IF mandatoryrelationship %]
669
                                                            <label for="relationship" class="required">Relationship: </label>
670
                                                            <select class="relationship" name="relationship" required="required">
671
                                                        [% ELSE %]
669
                                                            <label for="relationship">Relationship: </label>
672
                                                            <label for="relationship">Relationship: </label>
670
                                                            <select class="relationship" name="relationship">
673
                                                            <select class="relationship" name="relationship">
671
                                                                <option value=""></option>
674
                                                        [% END %]
672
                                                                [% FOREACH pr IN possible_relationships.split('\|') %]
675
                                                            <option value=""></option>
673
                                                                    [% IF pr == borrower_data.relationship %]
676
                                                            [% FOREACH pr IN possible_relationships.split('\|') %]
674
                                                                        <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
677
                                                                [% IF pr == borrower_data.relationship %]
675
                                                                    [% ELSE %]
678
                                                                    <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
676
                                                                        <option value="[% pr | html %]">[% pr | html %]</option>
679
                                                                [% ELSE %]
677
                                                                    [% END %]
680
                                                                    <option value="[% pr | html %]">[% pr | html %]</option>
678
                                                                [% END %]
681
                                                                [% END %]
679
                                                            </select>
682
                                                            [% END %]
680
                                                        </li>
683
                                                        </select>
681
                                                    [% END #/IF possible_relationships %]
684
                                                        [% IF mandatoryrelationship %]
685
                                                            <span class="required">Required</span>
686
                                                        [% END %]
687
                                                    </li>
682
                                                [% END # /UNLESS norelationship %]
688
                                                [% END # /UNLESS norelationship %]
683
                                            </ol>
689
                                            </ol>
684
                                        </fieldset> <!-- /#non_patron_guarantor -->
690
                                        </fieldset> <!-- /#non_patron_guarantor -->
Lines 1943-1951 legend:hover { Link Here
1943
                           new_field.appendTo("#quick_add_list");
1949
                           new_field.appendTo("#quick_add_list");
1944
                       } else {
1950
                       } else {
1945
                           let orig_input_id = orig_li.children("input,textarea,select").attr("id");
1951
                           let orig_input_id = orig_li.children("input,textarea,select").attr("id");
1946
                           let new_field = orig_li.clone();
1952
                           if ( orig_input_id ) {
1947
                           new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
1953
                               let new_field = orig_li.clone();
1948
                           new_field.appendTo("#quick_add_list");
1954
                               new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
1955
                               new_field.appendTo("#quick_add_list");
1956
                           }
1949
                           [% UNLESS mandatorypassword %]
1957
                           [% UNLESS mandatorypassword %]
1950
                                 if( input_label == 'password' ){
1958
                                 if( input_label == 'password' ){
1951
                                     let orig_p2 = $("#entryform label[for='password2']").parent();
1959
                                     let orig_p2 = $("#entryform label[for='password2']").parent();
(-)a/members/memberentry.pl (-6 lines)
Lines 101-111 my @messages; Link Here
101
## Deal with guarantor stuff
101
## Deal with guarantor stuff
102
$template->param( relationships => $patron->guarantor_relationships ) if $patron;
102
$template->param( relationships => $patron->guarantor_relationships ) if $patron;
103
103
104
my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1;
105
@relations = ('') unless @relations;
106
my $empty_relationship_allowed = grep {$_ eq ""} @relations;
107
$template->param( empty_relationship_allowed => $empty_relationship_allowed );
108
109
my $guarantor_id = $input->param('guarantor_id');
104
my $guarantor_id = $input->param('guarantor_id');
110
my $guarantor = undef;
105
my $guarantor = undef;
111
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id;
106
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id;
112
- 

Return to bug 30987