[% USE Koha %]
+[% USE AdditionalContents %]
+[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
+[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
[% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %][% ELSE %]Koha online[% END %] catalog › Your messaging settings</title>
+<title>Your messaging settings › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'masthead.inc' %]
<div class="main">
- <nav aria-label="breadcrumb">
- <ul class="breadcrumb">
+ <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
+ <ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
- <li class="breadcrumb-item" aria-current="IsPatronPage">
- <a href="#">Your messaging settings</a>
+ <li class="breadcrumb-item active">
+ <a href="#" aria-current="page">Your messaging settings</a>
</li>
- </ul>
- </nav>
+ </ol>
+ </nav> <!-- /#breadcrumbs -->
<div class="container-fluid">
<div class="row">
[% IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %]
<div id="usermessaging" class="maincontent">
- <h3>Your messaging settings</h3>
+ <h1>Your messaging settings</h1>
[% IF ( settings_updated ) %]
- <div class="alert alert-success"><h4>Settings updated</h4></div>
+ <div class="alert alert-success"><p><strong>Settings updated</strong></p></div>
[% END %]
<form action="/cgi-bin/koha/opac-messaging.pl" method="post" name="opacmessaging">
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
<input type="hidden" name="modify" value="yes" />
<table class="table table-bordered table-condensed table-striped">
+ <caption class="sr-only">Your messaging settings</caption>
<thead>
<tr>
<th> </th>
<td>[% IF ( messaging_preference.Item_Due ) %]Item due
[% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice
[% ELSIF ( messaging_preference.Hold_Filled ) %]Hold filled
+ [% ELSIF ( messaging_preference.Hold_Reminder ) %]Hold reminder
[% ELSIF ( messaging_preference.Item_Check_in ) %]Item check-in
[% ELSIF ( messaging_preference.Item_Checkout ) %]
[% IF Koha.Preference( 'RenewalSendNotice' ) %]
[% END %]
[% ELSIF ( messaging_preference.Ill_ready ) %]Interlibrary loan ready
[% ELSIF ( messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable
+ [% ELSIF ( messaging_preference.Auto_Renewals ) %]Auto renewal
[% ELSE %]Unknown [% END %]</td>
[% IF ( messaging_preference.takes_days ) %]
<td><select class="input-mini" name="[% messaging_preference.message_attribute_id | html %]-DAYS">
[% IF ( messaging_preference.transport_sms ) %]
<td class="selectcol">
[% IF ( messaging_preference.transports_sms ) %]
- <input type="checkbox" id="sms[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="sms" checked="checked" />
+ <input type="checkbox" class="pmp_sms" id="sms[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="sms" checked="checked" />
[% ELSE %]
- <input type="checkbox" id="sms[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="sms" />
+ <input type="checkbox" class="pmp_sms" id="sms[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="sms" />
[% END %]
</td>
[% ELSE %]
<td class="selectcol">
[% IF ( messaging_preference.transports_phone ) %]
<input type="checkbox"
+ class="phone"
id="phone[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
- value="phone" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ value="phone" checked="checked" />
[% ELSE %]
<input type="checkbox"
+ class="phone"
id="phone[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
- value="phone" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ value="phone" />
[% END %]
</td>
[% ELSE %]
<td class="selectcol">
[% IF ( messaging_preference.transports_itiva ) %]
<input type="checkbox"
+ class="itiva"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
- value="itiva" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ value="itiva" checked="checked" />
[% ELSE %]
<input type="checkbox"
+ class="itiva"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
- value="itiva" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ value="itiva" />
[% END %]
</td>
[% ELSE %]
[% IF ( messaging_preference.transport_email ) %]
<td class="selectcol">
[% IF ( messaging_preference.transports_email ) %]
- <input type="checkbox" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ <input type="checkbox" class="pmp_email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" checked="checked" />
[% ELSE %]
- <input type="checkbox" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ <input type="checkbox" class="pmp_email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" />
[% END %]
</td>
[% ELSE %]
[% IF ( messaging_preference.has_digest ) %]
<td class="selectcol">
[% IF ( messaging_preference.digest ) %]
- <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" checked="checked" data-toggle="tooltip" title="You must select a digestible transport to select digests" />
[% ELSE %]
- <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+ <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" data-toggle="tooltip" title="You must select a digestible transport to select digests" />
[% END %]
</td>
[% ELSE %]
</form>
</div> <!-- / #usermessaging -->
[% ELSE %]
- <h4>You are not allowed to call this page directly</h4>
+ <p><strong>You are not allowed to call this page directly</strong></p>
[% END # /IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %]
</div> <!-- / .col-lg-10 -->
</div> <!-- / .row -->
[% BLOCK jsinclude %]
<script>
$(document).ready(function(){
- $(".none").click(function(){
- if($(this).attr("checked")){
- var rowid = $(this).attr("id");
- newid = Number(rowid.replace("none",""))
- $("#sms"+newid).removeAttr("checked");
- $("#email"+newid).removeAttr("checked");
- $("#digest"+newid).removeAttr("checked");
- $("#rss"+newid).removeAttr("checked");
+ $("#info_digests").tooltip();
+
+ function toggle_digest(id){
+ if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
+ $("#digest"+id).attr("disabled", false).tooltip('disable');
+ } else {
+ $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
}
+
+ }
+ // At load time, we want digest disabled if no digest using transport is enabled
+ $(".pmp_email").each(function(){
+ toggle_digest(Number($(this).attr("id").replace("email", "")));
});
- $("#info_digests").tooltip();
+
+ // If user clears all digest using transports for a notice, disable digest checkbox
+ $(".pmp_email").click(function(){
+ toggle_digest(Number($(this).attr("id").replace("email", "")));
+ });
+ $(".pmp_sms").click(function(){
+ toggle_digest(Number($(this).attr("id").replace("sms", "")));
+ });
+
});
function normalizeSMS(value){