[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
+[% PROCESS 'member-main-address-style.inc' %]
+[% PROCESS 'member-alt-address-style.inc' %]
+[% PROCESS 'member-alt-contact-style.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Patrons ›
<div class="main container-fluid">
<div class="row">
+ [% IF messages %]
+ [% FOR message IN messages %]
+ [% SWITCH message.error %]
+ [% CASE 'error_on_insert_patron' %]
+ <div class="dialog alert">Something went wrong when creating the patron. Check the logs.</div>
+ [% CASE 'error_on_update_patron' %]
+ <div class="dialog alert">Something went wrong when updating the patron. Check the logs.</div>
+ [% CASE %]Unhandled error: [% message.error | html %]
+ [% END %]
+ [% END %]
+ [% END %]
[% IF ( opadd ) %]
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
[% ELSE %]
[% IF show_guarantor || guarantor %]
[% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
- <span id="memberentry_guarantor_anchor">
+ <div id="memberentry_guarantor_anchor">
<fieldset id="memberentry_guarantor" class="rows">
- <legend>Guarantor information</legend>
+ <legend>Patron guarantor</legend>
- <span id="guarantor_relationships">
+ <div id="guarantor_relationships">
[% FOREACH r IN relationships %]
- <fieldset class="rows">
+ <fieldset>
<ol>
[% IF category_type == 'I' %]
<li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
- <span class="label">Organization #:</span> [% IF ( r.guarantor_id ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor_id | html %]</a>[% END %]
+ <span class="label">Organization:</span>
+ [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
</li>
-
<li>
- <label for="guarantor_surname">Organization name: </label>
- <span>[% r.guarantor.surname | html %]</span>
+ <span class="label">Relationship:</span>
+ <span>[% r.relationship | html %]</span>
</li>
[% ELSE %]
<li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
- <span class="label">Patron card number:</span>
- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% r.guarantor_id | uri %]" target="blank">[% r.guarantor.cardnumber | html %]</a>
+ <span class="label">Guarantor:</span>
+ [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
</li>
-
- [% IF r.guarantor.surname %]
- <li>
- <label for="guarantor_surname">Surname: </label>
- <span>[% r.guarantor.surname | html %]</span>
- </li>
- [% END %]
-
- [% IF r.guarantor.firstname %]
- <li>
- <label for="guarantor_firstname">First name: </label>
- <span>[% r.guarantor.firstname | html %]</span>
- </li>
- [% END %]
-
<li>
- <label for="relationship">Relationship: </label>
+ <span class="label">Relationship:</span>
<span>[% r.relationship | html %]</span>
</li>
</fieldset>
[% END # END relationships foreach %]
[% IF guarantor && (!relationships) %]
- <fieldset class="rows">
+ <fieldset class="guarantor">
<ol>
<li class="guarantor-details" data-borrowernumber="0">
- <span class="label">Patron card number:</span>
- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.cardnumber | html %]</a>
+ <span class="label">Guarantor:</span>
+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank">[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a>
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]"/>
</li>
<li>
- <label for="guarantor_surname">Surname: </label>
- <span class="new_guarantor_surname_text">[% guarantor.surname | html %]</span>
- </li>
-
- <li>
- <label for="guarantor_firstname">First name: </label>
- <span class="new_guarantor_firstname_text">[% guarantor.firstname | html %]</span>
- </li>
-
- <li>
- <label for="guarantor_relationship">Relationship: </label>
- <select class="new_guarantor_relationship" name="new_guarantor_relationship">
+ [% UNLESS empty_relationship_allowed %]
+ <label for="guarantor_relationship" class="required">Relationship: </label>
+ <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
+ [% ELSE %]
+ <label for="guarantor_relationship">Relationship: </label>
+ <select class="new_guarantor_relationship" name="new_guarantor_relationship">
+ [% END %]
+ <option value="" selected>Empty option</option>
[% FOREACH pr IN possible_relationships.split('\|') %]
- <option value="[% pr | html %]">[% pr | html %]</option>
+ [% IF pr != "" %]
+ <option value="[% pr | html %]">[% pr | html %]</option>
+ [% END %]
[% END %]
</select>
+ [% UNLESS empty_relationship_allowed %]
+ <span class="required">Required</span>
+ [% END %]
</li>
<li>
<label for="guarantor_cancel"> </label>
- <span><a href="#" class="guarantor_cancel">Remove</a></span>
+ <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash" aria-hidden="true"></i> Remove</a></span>
</li>
</ol>
</fieldset>
[% END %]
- </span> <!-- #/guarantor_relationships -->
+ </div> <!-- #/guarantor_relationships -->
- <fieldset class="rows guarantor" id="guarantor_template">
+ <fieldset class="guarantor" id="guarantor_template">
<ol>
<li class="guarantor-details" data-borrowernumber="0">
- <span class="label">Patron card number:</span>
- <span class="new_guarantor_id_text"></span>
+ <span class="label">Guarantor:</span>
+ <a class="new_guarantor_link" href="#" target="blank">
+ <span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span>
+ (<span class="new_guarantor_id_text"></span>)
+ </a>
<input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value=""/>
</li>
<li>
- <label for="guarantor_surname">Surname: </label>
- <span class="new_guarantor_surname_text"></span>
- </li>
-
- <li>
- <label for="guarantor_firstname">First name: </label>
- <span class="new_guarantor_firstname_text"></span>
- </li>
-
- <li>
- <label for="guarantor_relationship">Relationship: </label>
- <select class="new_guarantor_relationship" name="new_guarantor_relationship">
+ [% UNLESS empty_relationship_allowed %]
+ <label for="guarantor_relationship" class="required">Relationship: </label>
+ <select class="new_guarantor_relationship" name="new_guarantor_relationship" required="required">
+ [% ELSE %]
+ <label for="guarantor_relationship">Relationship: </label>
+ <select class="new_guarantor_relationship" name="new_guarantor_relationship">
+ [% END %]
+ <option value="" selected></option>
[% FOREACH pr IN possible_relationships.split('\|') %]
- <option value="[% pr | html %]">[% pr | html %]</option>
+ [% IF pr != "" %]
+ <option value="[% pr | html %]">[% pr | html %]</option>
+ [% END %]
[% END %]
</select>
+ [% UNLESS empty_relationship_allowed %]
+ <span class="required">Required</span>
+ [% END %]
</li>
<li>
<label for="guarantor_cancel"> </label>
- <span><a href="#" class="guarantor_cancel">Remove</a></span>
+ <span><a href="#" class="guarantor_cancel"><i class="fa fa-trash"></i> Remove</a></span>
</li>
</ol>
</fieldset>
[% END %]
</ol>
</fieldset> <!-- /#memberentry_guarantor -->
- </span> <!-- #/memberentry_guarantor_anchor -->
+ </div> <!-- #/memberentry_guarantor_anchor -->
+
+ [% UNLESS nocontactname && nocontactfirstname && norelationship %]
+ <fieldset class="rows" id="non_patron_guarantor">
+ <legend>Non-patron guarantor</legend>
+ <ol>
+ [% UNLESS nocontactname %]
+ <li>
+ [% IF ( mandatorycontactname ) %]
+ <label for="contactname" class="required">
+ [% ELSE %]
+ <label for="contactname">
+ [% END %]
+ Guarantor surname:
+ </label>
+ <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
+ [% IF ( mandatorycontactname ) %]
+ <span class="required">Required</span>
+ [% END %]
+ <div class="hint">Non-patron guarantor surname</div>
+ </li>
+ [% END # /UNLESS nocontactname %]
+
+ [% UNLESS nocontactfirstname %]
+ <li>
+ [% IF ( mandatorycontactfirstname ) %]
+ <label for="contactfirstname" class="required">
+ [% ELSE %]
+ <label for="contactfirstname">
+ [% END %]
+ Guarantor first name:
+ </label>
+ <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
+ [% IF ( mandatorycontactfirstname ) %]
+ <span class="required">Required</span>
+ [% END %]
+ <div class="hint">Non-patron guarantor first name</div>
+ </li>
+ [% END # /UNLESS noaltcontactfirstname %]
+
+ [% UNLESS norelationship %]
+ [% IF possible_relationships %]
+ <li>
+ <label for="relationship">Relationship: </label>
+ <select class="relationship" name="relationship">
+ <option value=""></option>
+ [% FOREACH pr IN possible_relationships.split('\|') %]
+ [% IF pr == relationship %]
+ <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
+ [% ELSE %]
+ <option value="[% pr | html %]">[% pr | html %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ [% END #/IF possible_relationships %]
+ [% END # /UNLESS norelationship %]
+ </ol>
+ </fieldset> <!-- /#non_patron_guarantor -->
+ [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %]
[% END # /IF show_guarantor || guarantor %]
[% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
- [% IF Koha.Preference( 'AddressFormat' ) %]
- [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
- [% ELSE %]
- [% INCLUDE 'member-main-address-style-us.inc' %]
- [% END %]
+ [% PROCESS 'main-address-style' %]
[% END # /UNLESS nostreet && nocity etc group%]
[% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
<fieldset class="rows" id="memberentry_contact">
<legend id="contact_lgd">Contact</legend>
<ol>
- [% UNLESS nocontactname %]
- <li>
- [% IF ( mandatorycontactname ) %]
- <label for="contactname" class="required">
- [% ELSE %]
- <label for="contactname">
- [% END %]
- Guarantor surname:
- </label>
- <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
- [% IF ( mandatorycontactname ) %]
- <span class="required">Required</span>
- [% END %]
- <div class="hint">Non-patron guarantor surname</div>
- </li>
- [% END # /UNLESS nocontactname %]
-
- [% UNLESS nocontactfirstname %]
- <li>
- [% IF ( mandatorycontactfirstname ) %]
- <label for="contactfirstname" class="required">
- [% ELSE %]
- <label for="contactfirstname">
- [% END %]
- Guarantor first name:
- </label>
- <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
- [% IF ( mandatorycontactfirstname ) %]
- <span class="required">Required</span>
- [% END %]
- <div class="hint">Non-patron guarantor first name</div>
- </li>
- [% END # /UNLESS noaltcontactfirstname %]
-
- [% UNLESS norelationship %]
- [% IF possible_relationships %]
- <li>
- <label for="relationship">Relationship: </label>
- <select class="relationship" name="relationship">
- <option value=""></option>
- [% FOREACH pr IN possible_relationships.split('\|') %]
- [% IF pr == relationship %]
- <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
- [% ELSE %]
- <option value="[% pr | html %]">[% pr | html %]</option>
- [% END %]
- [% END %]
- </select>
- </li>
- [% END #/IF possible_relationships %]
- [% END # /UNLESS norelationship %]
-
[% UNLESS nophone %]
<li>
[% IF ( mandatoryphone ) %]
[% IF ( step_6 ) %]
[% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
- [% IF Koha.Preference( 'AddressFormat' ) %]
- [% INCLUDE "member-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
- [% ELSE %]
- [% INCLUDE 'member-alt-address-style-us.inc' %]
- [% END %]
+ [% PROCESS 'alt-address-style' %]
[% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
[% END # /IF ( step_6 ) %]
[% IF ( step_2 ) %]
[% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
- [% IF Koha.Preference( 'AddressFormat' ) %]
- [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
- [% ELSE %]
- [% INCLUDE 'member-alt-contact-style-us.inc' %]
- [% END %]
+ [% PROCESS 'alt-contact-style' %]
[% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
[% END # /IF ( step_2 ) %]
[% END %]
[% FOREACH patron_attribute IN pa_loo.items %]
<li data-category_code="[% patron_attribute.category_code | html %]">
- <label for="[% patron_attribute.form_id | html %]">
- [% patron_attribute.description | html %]:
- </label>
+ [% IF patron_attribute.mandatory %]
+ <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
+ [% ELSE %]
+ <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
+ [% END %]
[% IF ( patron_attribute.use_dropdown ) %]
- <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
+ [% IF patron_attribute.mandatory %]
+ <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
+ [% ELSE %]
+ <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">
+ [% END %]
<option value=""></option>
[% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
[% IF auth_val_loo.authorised_value == patron_attribute.value %]
[% END %]
</select>
[% ELSE %]
+ [% IF patron_attribute.mandatory %]
+ <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">[% patron_attribute.value | html %]</textarea>
+ [% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
+ [% END %]
[% END # /IF ( patron_attribute.use_dropdown ) %]
<input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
<a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash"></i> Clear</a>
[% IF ( patron_attribute.repeatable ) %]
<a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
[% END %]
+ [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
</li>
[% END # /FOREACH patron_attribute %]
[% IF pa_loo.class %]</fieldset>[% END %]