@@ -, +, @@ add forms --- .../en/modules/admin/preferences/patrons.pref | 2 +- .../prog/en/modules/members/memberentrygen.tt | 50 +++++++++++-------- members/memberentry.pl | 5 -- 3 files changed, 30 insertions(+), 27 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -328,7 +328,7 @@ Patrons: - "Guarantors can be the following of those they guarantee:" - pref: borrowerRelationship class: multi - - (input multiple choices separated by |). Leave empty to deactivate. + - (input multiple choices separated by |). - - "When adding a guarantee to a guarantor, whether it's from the guarantor's form or the guarantee's form, fill the following fields in the guarantee's member entry form from the guarantors record:" - pref: PrefillGuaranteeField --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -508,9 +508,9 @@ legend:hover { - [% IF possible_relationships %] + [% UNLESS norelationship %]
  • - [% UNLESS empty_relationship_allowed %] + [% IF mandatoryrelationship %] - [% UNLESS empty_relationship_allowed %] + [% UNLESS mandatoryrelationship %] Required [% END %]
  • @@ -552,9 +552,9 @@ legend:hover { - [% IF possible_relationships %] + [% UNLESS norelationship %]
  • - [% UNLESS empty_relationship_allowed %] + [% IF mandatoryrelationship %] - [% UNLESS empty_relationship_allowed %] + [% IF mandatoryrelationship %] Required [% END %]
  • @@ -665,21 +665,27 @@ legend:hover { [% END # /UNLESS noaltcontactfirstname %] [% UNLESS norelationship %] - [% IF possible_relationships %] -
  • +
  • + [% IF mandatoryrelationship %] + + - - [% FOREACH pr IN possible_relationships.split('\|') %] - [% IF pr == borrower_data.relationship %] - - [% ELSE %] - - [% END %] + [% END %] + + [% FOREACH pr IN possible_relationships.split('\|') %] + [% IF pr == borrower_data.relationship %] + + [% ELSE %] + [% END %] - -
  • - [% END #/IF possible_relationships %] + [% END %] + + [% IF mandatoryrelationship %] + Required + [% END %] + [% END # /UNLESS norelationship %] @@ -1943,9 +1949,11 @@ legend:hover { new_field.appendTo("#quick_add_list"); } else { let orig_input_id = orig_li.children("input,textarea,select").attr("id"); - let new_field = orig_li.clone(); - new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add"); - new_field.appendTo("#quick_add_list"); + if ( orig_input_id ) { + let new_field = orig_li.clone(); + new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add"); + new_field.appendTo("#quick_add_list"); + } [% UNLESS mandatorypassword %] if( input_label == 'password' ){ let orig_p2 = $("#entryform label[for='password2']").parent(); --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -100,11 +100,6 @@ my @messages; ## Deal with guarantor stuff $template->param( relationships => $patron->guarantor_relationships ) if $patron; -my @relations = split /\|/, C4::Context->preference('borrowerRelationship'), -1; -@relations = ('') unless @relations; -my $empty_relationship_allowed = grep {$_ eq ""} @relations; -$template->param( empty_relationship_allowed => $empty_relationship_allowed ); - my $guarantor_id = $input->param('guarantor_id'); my $guarantor = undef; $guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; --