Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt
Owen Leonard 04dd98fa84 Bug 10552: make several sysprefs available to the OPAC login page
Several system preference variables are unavailable to the OPAC login
template because they are not explicitly enabled for that page. Instead
of adding them to Auth.pm using the old method this patch uses the new
system preference check syntax using the Koha TT plugin.

The following preferences are now checked using this syntax in
masthead.inc:

OpacAddMastheadLibraryPulldown
UseCourseReserves
reviewson
OpacShowRecentComments

In order for the call in masthead.inc to the new plugin to work on all
OPAC pages "[% USE Koha %]" must be added to any template which
includes it (most of them).

Also in this patch: A change to Auth.pm to enable correct display of the
LibraryName in the title of the OPAC login page.

To test, turn on the above system preferences and confirm that the
relevant links appear under the OPAC's main search bar on all pages
including the login page.

Confirm that the text specified in the LibraryName system preference is
shown as the title of the login page.

Confirm that course reserves and comments are displayed correctly on the
biblio detail page.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
I checked both prog and ccsr - all seems well and the links are appearing and disappearing in accordance with the appropriate sysprefs.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-22 14:54:15 +00:00

166 lines
7.3 KiB
Text

[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your messaging settings
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">//<![CDATA[
$(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");
}
});
});
//]]>
</script>
</head>
<body id="opac-messaging">
<div id="doc3" class="yui-t1">
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div id="yui-main">
<div class="yui-b"><div class="yui-g" id="usermessaging">
[% FOREACH BORROWER_INF IN BORROWER_INFO %]
<h3><a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]'s account</a> &#8674; Your messaging settings</h3>
[% END %]
<form action="/cgi-bin/koha/opac-messaging.pl" method="get" name="opacmessaging">
<input type="hidden" name="modify" value="yes" />
<fieldset class="rows">
[% IF ( settings_updated ) %]
<div class="dialog message"><h3>Settings updated</h3></div>
[% END %]
<table style="margin-right:1em;">
<tr><th>&nbsp;</th><th>Days in advance</th>[% IF ( SMSSendDriver ) %]<th>SMS</th>[% END %][% IF ( TalkingTechItivaPhone ) %]<th>Phone</th>[% END %]<th>Email</th><th>Digests only?</th><!-- <th>RSS</th> --><th>Do not notify</th></tr>
[% FOREACH messaging_preference IN messaging_preferences %]
<tr>
<td>[% IF ( messaging_preference.Item_Due ) %]Item due
[% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice
[% ELSIF ( messaging_preference.Upcoming_Events ) %]Upcoming events
[% ELSIF ( messaging_preference.Hold_Filled ) %]Hold filled
[% ELSIF ( messaging_preference.Item_Check_in ) %]Item check-in
[% ELSIF ( messaging_preference.Item_Checkout ) %]Item checkout
[% ELSE %]Unknown [% END %]</td>
[% IF ( messaging_preference.takes_days ) %]
<td><select name="[% messaging_preference.message_attribute_id %]-DAYS">
[% FOREACH select_day IN messaging_preference.select_days %]
[% IF ( select_day.selected ) %]<option value="[% select_day.day %]" selected="selected">[% select_day.day %]</option>
[% ELSE %]<option value="[% select_day.day %]">[% select_day.day %]</option>
[% END %]
[% END %]
</select>
</td>
[% ELSE %]
<td>-</td>
[% END %]
[% IF ( messaging_preference.transport_sms ) %]
[% IF ( SMSSendDriver ) %]
<td>
[% IF ( messaging_preference.transports_sms ) %]
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% ELSE %]
<input type="checkbox"
id="sms[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="sms" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% END %]
</td>
[% END %]
[% ELSE %]
<td>--</td>
[% END %]
[% IF ( TalkingTechItivaPhone ) %]
<td>
[% IF ( messaging_preference.transports_phone ) %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="phone" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% ELSE %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="phone" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% END %]
</td>
[% END %]
[% IF ( messaging_preference.transport_email ) %]
<td>
[% IF ( messaging_preference.transports_email ) %]
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% ELSE %]
<input type="checkbox"
id="email[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="email" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% END %]
</td>
[% ELSE %]
<td>-</td>
[% END %]
[% IF ( messaging_preference.has_digest ) %]
<td>
[% IF ( messaging_preference.digest ) %]
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% ELSE %]
<input type="checkbox"
id="digest[% messaging_preference.message_attribute_id %]"
value="[% messaging_preference.message_attribute_id %]"
name="digest" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
[% END %]
</td>
[% ELSE %]
<td>-</td>
[% END %]
<!-- [% IF ( messaging_preference.transport_rss ) %]
<td><input type="checkbox"
id="rss[% messaging_preference.message_attribute_id %]"
name="[% messaging_preference.message_attribute_id %]"
value="rss" [% messaging_preference.transport_rss %] onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" />
</td>
[% ELSE %]
<td>-</td>
[% END %] -->
<td><input type="checkbox" class="none" id="none[% messaging_preference.message_attribute_id %]" /></td>
</tr>
[% END %]
</table>
[% IF ( SMSSendDriver ) %]<ol><li><label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" /></li></ol>[% END %]
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit Changes" /> <a class="cancel" href="/cgi-bin/koha/opac-user.pl">Cancel</a>
</fieldset>
</form>
</div>
</div>
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>
[% INCLUDE 'opac-bottom.inc' %]