Bug 7636 - error when trying to email cart when opacuserlogin set to don't allow
authorOwen Leonard <oleonard@myacpl.org>
Thu, 1 Mar 2012 20:06:25 +0000 (15:06 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 13 Mar 2012 13:54:32 +0000 (14:54 +0100)
This patch hides the "send cart" link if the opacuserlogin
preference is set to disallow. Other similar changes included:

- hide the "send list" link
- hide the "your lists" tab
- hide the "log in to create your own lists" link
- hide the "recent comments" link

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tested with opacuserlogin set to both "Allow" and "Don't allow." With
opacuserlogin set to "Allow," the links showed up, and with opacuserlogin
set to "Don't allow," the links did not.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt

index cfcf977..ef94cd1 100644 (file)
 <a href="/cgi-bin/koha/opac-search.pl">Advanced Search</a>
 [% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by Hierarchy</a>[% END %]
 [% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by author or subject</a>[% END %]
-[% IF ( OpacShowRecentComments ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent Comments</a>[% END %]
+[% IF ( opacuserlogin && reviewson && OpacShowRecentComments ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent Comments</a>[% END %]
 [% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag Cloud</a>[% END %]
 [% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject Cloud</a>[% END %]
 [% IF ( OpacTopissue ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most Popular</a>[% END %]
index a229521..fff80cd 100644 (file)
@@ -124,7 +124,7 @@ function tagAdded() {
 <div id="toolbar">
 <ul>
        <li>[% IF ( verbose ) %]<a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief Display</a>[% ELSE %]<a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More Details</a>[% END %]</li>
-       <li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>
+       [% IF ( opacuserlogin ) %]<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>[% END %]
        <li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
        <li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
        <li><a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and Close</a></li>
index bf44771..1f20687 100644 (file)
@@ -205,7 +205,7 @@ $(function() {
 
                       <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfid=[% shelfnumber %]" class="download tag_hides" onclick="open(CGIBIN+'opac-downloadshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false;">Download List</a>
 
-<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send tag_hides" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send List</a></span>
+[% IF ( opacuserlogin ) %]<span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber %]" class="send tag_hides" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=[% shelfnumber %]','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send List</a></span>[% END %]
 
 <a class="print tag_hides" href="opac-shelves.pl" onclick="print(); return false;">Print List</a>
 
@@ -350,7 +350,7 @@ $(function() {
                   </div>
                   [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
                 [% ELSE %]
-                  <div class="dialog message">This List is empty.  You can add to your lists from the results of any <a href="opac-main.pl">search</a>!</div>
+                  <div class="dialog message">This List is empty.  [% IF ( opacuserlogin ) %]You can add to your lists from the results of any <a href="opac-main.pl">search</a>![% END %]</div>
               [% END %]<!-- /itemsloop -->
             [% END %]<!-- /viewshelf -->
 
@@ -408,11 +408,13 @@ $(function() {
                 [% UNLESS ( shelves ) %]
                   <h2>Lists</h2>
                   <ul class="link-tabs">
+                  [% IF ( opacuserlogin ) %]
                   [% IF ( showprivateshelves ) %]
                     <li id="privateshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
                   [% ELSE %]
                     <li id="privateshelves_tab" class="off"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">Your private lists</a></li>
                   [% END %]
+                  [% END %]
                   [% IF ( showpublicshelves ) %]
                     <li id="publicshelves_tab" class="on"><a href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">Public lists</a></li>
                   [% ELSE %]
@@ -481,7 +483,7 @@ $(function() {
                     [% END %]<!-- /shelveslooppriv -->
                   [% END %]<!-- /showprivateshelves -->
                   [% ELSE %]<!-- /loggedinusername -->
-                      <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
+                      [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>[% END %]
                   [% END %]<!-- /loggedinusername -->
 
                   
@@ -495,7 +497,7 @@ $(function() {
                   [% IF ( loggedinusername ) %]
                  <div id="toolbar"> <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a></div>
                   [% ELSE %]
-                  <div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>
+                  [% IF ( opacuserlogin ) %]<div><a href="/cgi-bin/koha/opac-user.pl">Log in</a> to create new Lists.</div>[% END %]
                   [% END %]
                   [% IF ( shelvesloop ) %]
                       <table>