Koha/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
Owen Leonard a4e804fceb Bug 9917 - Routing list tab on patron account should depend on syspref/permission
The routing list tab displays on patron pages even if the RoutingSerials
preference is OFF. Display of the tab should be conditional on that pref
being turned on.

This patch adds a check for the RoutingSerials preference to the menu
include files and amends the affected scripts to make the variable
available on the pages where those includes are used.

To test, view the following pages with RoutingSerials both on and off.
The routing list tab should be shown and hidden accordingly:

- Circulation
- Patron details
- Patron fines
- Pay fines
- Pay amount/selected (click from the Pay fines page)
- Create manual invoice
- Create manual credit
- Patron circulation history
- Patron modification log
- Patron notices
- Patron routing lists
- Patron statistics
- Patron files
- Patron permissions
- Set patron password
- "Can't delete patron" page (try to delete a patron with checkouts).

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Touches a lot of files, but only a tiny change in each, works well.
Could perhaps be set in C4/Auth instead, but that's no reason not to
sign off

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-31 08:52:35 -04:00

84 lines
5 KiB
Text

[%# duplicates circ-menu.inc but assumes all borrower attributes are in a borrower variable rather than
in the global namespace %]
[% IF borrower %]
<div class="patroninfo"><h5>[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])</h5>
<!--[if IE 6]>
<style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
}</style>
<![endif]-->
<ul>
[% IF ( patronimages ) %]
[% IF borrower.has_picture %]
<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% borrower.cardnumber %]" id="patronimage" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li>
[% ELSE %]
<li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li>
[% END %]
[% END %]
[% IF ( borrower.address or borrower.address2 ) %]
[% IF ( borrower.address ) %]
<li>[% borrower.address %]</li>
[% END %]
[% IF ( borrower.address2 ) %]
<li>[% borrower.address2 %]</li>
[% END %]
[% ELSE %]
<li><span class="empty" id="noaddressstored">No address stored.</span></li>
[% END %]
<li>
[% IF borrower.city %]
[% borrower.city %][% IF borrower.state %], [% borrower.state %][% END %]
[% borrower.zipcode %][% IF ( borrower.country ) %], [% borrower.country %][% END %]
[% ELSE %]
<span class="empty" id="nocitystored">No city stored.</span>
[% END %]</li>
<li>[% IF borrower.phone %]
[% borrower.phone %]
[% ELSE %]
[% IF borrower.mobile %]
[% borrower.mobile %]
[% ELSE %]
[% IF borrower.phonepro %]
[% borrower.phonepro %]
[% ELSE %]
<span class="empty" id="nophonestored">No phone stored.</span>
[% END %]
[% END %]
[% END %]</li>
[% IF borrower.email %]
<li class="email"> <a href="mailto:[% borrower.email %]" title="[% borrower.email %]">[% borrower.email %]</a></li>
[% ELSE %]
[% IF borrower.emailpro %]
<li class="email"> <a href="mailto:[% borrower.emailpro %]" title="[% borrower.emailpro %]">[% borrower.emailpro %]</a></li>
[% ELSE %]
<li> <span class="empty">No email stored.</span> </li>
[% END %]
[% END %]
[% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN borrower.extendedattributes %]
[% IF ( extendedattribute.display_checkout ) %]
[% IF ( extendedattribute.value ) %]
<li>[% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]</li>
[% END %]
[% END %]
[% END %][% END %]
<li>Category: [% borrower.description %] ([% borrower.categorycode %])</li>
<li>Home library: [% IF ( borrower.branchname ) %][% borrower.branchname %][% ELSE %][% borrower.branch %][% END %]</li>
</ul></div>
<div id="menu">
<ul>
[% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrower.borrowernumber %]">Check out</a></li>
[% IF ( CAN_user_borrowers ) %]
[% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">Details</a></li>
[% END %]
[% IF ( CAN_user_updatecharges ) %]
[% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Fines</a></li>
[% END %]
[% IF ( RoutingSerials ) %][% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% borrowernumber %]">Routing lists</a></li>[% END %]
[% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation history</a></li>[% END %]
[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrower.borrowernumber %]&amp;src=circ">Modification log</a></li>[% END %]
[% IF ( EnhancedMessagingPreferences ) %]
[% END %]
[% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
[% IF ( statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% borrowernumber %]">Statistics</a></li>
</ul></div>
[% END %]