[Koha-patches] [PATCH] Bug 7781: enhancements on main page

Adrien Saurat adrien.saurat at biblibre.com
Wed Mar 21 16:48:29 CET 2012


Creation of a new include and editing of the mainpage.tt to :
- move the different search boxes (checkout, checkin, search patron, search catalog)
 on top of page, the way it's done on other pages;
- display the Koha logo (deep pages display it but not the front page!)
- display the breadcrumb bar (even if it will contain only "Home")
- display a general title like "Welcome to Koha" (module pages have titles already)
- reorganise the links to modules (Cataloguing can move to the left side if the search boxes disappear)

Use of rights limitations was corrected too.
---
 .../intranet-tmpl/prog/en/includes/home-search.inc |   40 +++++
 .../intranet-tmpl/prog/en/modules/intranet-main.tt |  181 ++++++++++----------
 2 files changed, 131 insertions(+), 90 deletions(-)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc
new file mode 100644
index 0000000..514ec90
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc
@@ -0,0 +1,40 @@
+
+<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Main page Resident Search Box -->
+
+<div id="header_search">
+    [% INCLUDE 'patron-search-box.inc' %]
+[% IF ( CAN_user_circulate ) %]
+<div id="checkin_search" class="residentsearch" style="display:none;">
+    <p class="tip">Scan a barcode to check in:</p>
+    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
+        <input name="barcode" id="ret_barcode" size="40" accesskey="r" />
+        <input value="Submit" class="submit" type="submit" />
+    </form>
+</div>[% END %]
+[% IF ( CAN_user_borrowers ) %]
+<div id="patron_search" class="residentsearch">
+	<p class="tip">Enter patron card number or partial name:</p>
+	<form action="/cgi-bin/koha/members/member.pl" method="post">
+        <input name="member" id="searchmember" size="40" type="text""/>
+        <input value="Submit" class="submit" type="submit" />
+    </form>
+</div>[% END %]
+[% IF ( CAN_user_catalogue ) %]
+<div id="catalog_search" class="residentsearch" style="display:none;">
+    <p class="tip">Enter search keywords:</p>
+    <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
+        <input type="text" name="q" id="search-form" size="40" accesskey="q" />
+        <input type="submit" class="submit" value="Submit"/>
+    </form>
+</div>[% END %]
+
+<ul>
+    [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/circulation.pl#circ_search">Check Out</a></li>[% END %]
+    [% IF ( CAN_user_circulate ) %]<li><a href="/cgi-bin/koha/circ/returns.pl#checkin_search">Check In</a></li>[% END %]
+    [% IF ( CAN_user_borrowers ) %]<li><a href="/cgi-bin/koha/members/members-home.pl#patron_search">Search Patrons</a></li>[% END %]
+    [% IF ( CAN_user_catalogue ) %]<li><a href="/cgi-bin/koha/catalogue/search.pl#catalog_search">Search the Catalog</a></li>[% END %]
+</ul>   
+
+</div>
+
+<!-- End Main page Resident Search Box -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
index 12861f6..ee99952 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
@@ -5,124 +5,125 @@
 </head>
 <body>
 [% INCLUDE 'header.inc' %]
+[% INCLUDE 'home-search.inc' %]
+
+<div id="breadcrumbs">Home</div>
+
 [% IF ( koha_news_count ) %]<div id="doc3" class="yui-t3">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
 <div id="bd">
 [% IF ( koha_news_count ) %]<div id="yui-main"><div class="yui-b"><div class="yui-g">
 [% ELSE %]	<div class="yui-g">[% END %]
 
-	<div class="yui-u first">
-	[% IF ( CAN_user_circulate ) %]
-	<h3><a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a></h3>
-	<ul><li style="padding-bottom:.3em;">
-       <form method="post" action="/cgi-bin/koha/circ/circulation.pl">
-        <label for="navfindborrower">Check out to:</label>
-            <input accesskey="u" id="navfindborrower" name="findborrower" type="text" size="10" />
-            <input type="hidden" name="branch" value="[% branch %]" />
-            <input type="hidden" name="printer" value="[% printer %]" />
-            <input type="submit" class="submit" value="OK" />
-       </form>
-       </li>
-       <li style="padding-bottom:.3em;">
-       <form method="post" action="/cgi-bin/koha/circ/returns.pl">
-        <label for="barcode">Check in:</label>
-            <input accesskey="r" id="barcode" name="barcode" type="text" size="10" />
-            <input type="submit" class="submit" value="OK" />
-       </form></li>
+<h1>Welcome to Koha</h1>
 
-        <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfers</a></li></ul>
-	[% END %]
-	[% IF ( CAN_user_borrowers ) %]
-		<h3><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a></h3>
-		<ul>
-        <li><form action="/cgi-bin/koha/members/member.pl" method="post">
-           <label for="navmember">Search:&nbsp;</label>
-           <input id="navmember" type="text" size="10" name="member" />
-           <input type="submit" value="OK" class="submit" />
-            </form>
-        </li>
-    </ul>
-	[% END %]
-	[% IF ( CAN_user_catalogue ) %]
-                <h3><a href="/cgi-bin/koha/catalogue/search.pl">Search</a></h3>
-				<ul>
-                    <li>
-                        <form name="searchform" method="get" action="/cgi-bin/koha/catalogue/search.pl" id="searchform">
-                        <input type="hidden" name="idx" value="" />
-                        <label for="navkeyword">
-                            Search catalog:&nbsp;
-                        </label><input type="text" id="navkeyword" name="q" size="10" accesskey="q" />
-                        <input type="submit" value=" OK " class="submit" />
-                        </form>
-                     </li>
-				</ul>
-   [% END %]
-                <h3><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></h3>
-	</div>
-	
-	<div class="yui-u">
-    [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
-    <h3><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a></h3>
-	<ul>
-        <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl">Add MARC Record</a></li>
-    [% ELSE %]
-    [% IF ( CAN_user_editauthorities ) %]
-    <h3>Cataloging</h3>
+    <div class="yui-u first">
+    <!-- START - CIRCULATION -->
+    [% IF ( CAN_user_circulate ) %]
+    <h3><a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a></h3>
     <ul>
+        <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfers</a></li>
+    </ul>
     [% END %]
+    <!-- END - CIRCULATION -->
+
+    <!-- START - PATRONS -->
+    [% IF ( CAN_user_borrowers ) %]
+        <h3><a href="/cgi-bin/koha/members/members-home.pl">Patrons</a></h3>
     [% END %]
-    
-    [% IF ( CAN_user_editauthorities ) %]
-        <li><a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a></li>
+    <!-- END - PATRONS -->
+
+    <!-- START - ADVANCED SEARCH -->
+    [% IF ( CAN_user_catalogue ) %]
+        <h3><a href="/cgi-bin/koha/catalogue/search.pl">Advanced search</a></h3>
     [% END %]
-    </ul>
-    
+    <!-- END - ADVANCED SEARCH -->
     
+    <!-- START - LISTS -->
+    <h3><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></h3>
+    <!-- END - LISTS -->
+
+    <!-- START - CATALOGING -->
+    [% IF ( CAN_user_catalogue || CAN_user_editcatalogue || CAN_user_editauthorities ) %]
+        <h3><a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a></h3>
+        <ul>
+        [% IF ( CAN_user_catalogue || CAN_user_editcatalogue ) %]
+                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl">Add MARC Record</a></li>
+        [% END %]
+        [% IF ( CAN_user_editauthorities ) %]
+                <li><a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a></li>
+        [% END %]
+        </ul>
+    [% END %]
+    <!-- END - CATALOGING -->
+    </div>
+
+    <div class="yui-u">
+    <!-- START - SERIALS -->
     [% IF ( CAN_user_serials ) %]
-    <h3><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></h3>
+        <h3><a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a></h3>
+    [% END %]
+    [% IF ( CAN_user_acquisition ) %]
+        <h3><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></h3>
+        [% IF ( pendingsuggestions ) %]
+            <ul>
+                <li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/suggestion/suggestion.pl">[% pendingsuggestions %]</a></span></li>
+            </ul>
+        [% END %]
     [% END %]
-	[% IF ( CAN_user_acquisition ) %]
-	<h3><a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a></h3>
-    [% IF ( pendingsuggestions ) %]<ul><li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/suggestion/suggestion.pl">[% pendingsuggestions %]</a></span></li></ul>[% END %]
-	[% END %]
+    <!-- END - SERIALS -->
+
+    <!-- START - REPORTS -->
     [% IF ( CAN_user_reports ) %]
-    <h3><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></h3>
+        <h3><a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a></h3>
     [% END %]
+    <!-- END - REPORTS -->
+
+    <!-- START - ADMINISTRATION -->
     [% IF ( CAN_user_parameters ) %]
-    <h3><a href="/cgi-bin/koha/admin/admin-home.pl">Koha administration</a></h3>
-   	<ul>
-        <li><a href="/cgi-bin/koha/admin/preferences.pl">System preferences</a></li>
-    </ul>
-    [% END %]
+        <h3><a href="/cgi-bin/koha/admin/admin-home.pl">Koha administration</a></h3>
+        <ul>
+            <li><a href="/cgi-bin/koha/admin/preferences.pl">System preferences</a></li>
+        </ul>
+        [% END %]
     [% IF ( CAN_user_tools ) %] 
-    <h3><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></h3>
+        <h3><a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a></h3>
         [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) %]
             <ul>
-                [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) %]<li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">[% pendingcomments %]</a></span></li>[% END %]
-                [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]<li><a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/tags/review.pl">[% pendingtags %]</a></span></li>[% END %]
+                [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) %]
+                    <li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">[% pendingcomments %]</a></span></li>
+                [% END %]
+                [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]
+                    <li><a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>: <span class="holdcount"><a href="/cgi-bin/koha/tags/review.pl">[% pendingtags %]</a></span></li>
+                [% END %]
             </ul>
         [% END %]
     [% END %]
+    <!-- END - ADMINISTRATION -->
+
+    <!-- START - ABOUT -->
     <h3><a href="/cgi-bin/koha/about.pl">About Koha</a></h3>
-	</div>
-	</div>
-		[% IF ( IntranetmainUserblock ) %]<div id="mainuserblock" class="yui-g">
-			[% IntranetmainUserblock %]
-			</div>[% ELSE %]&nbsp;
-		[% END %]
-[% IF ( koha_news_count ) %]
-	</div><!-- /yui-bd -->
-	</div><!-- /yui-main -->
-	<div class="yui-b">
-		<div id="koha-news">
+    <!-- END - ABOUT -->
+    </div>
+    </div>
+        [% IF ( IntranetmainUserblock ) %]
+            <div id="mainuserblock" class="yui-g">
+            [% IntranetmainUserblock %]
+            </div>[% ELSE %]&nbsp;
+        [% END %]
+    [% IF ( koha_news_count ) %]
+    </div><!-- /yui-bd -->
+    </div><!-- /yui-main -->
+    <div class="yui-b">
+        <div id="koha-news">
             <h3>News</h3>
             [% FOREACH koha_new IN koha_news %]
                     <div class="newsitem" id="news[% koha_new.idnew %]"><h4>[% koha_new.title %]</h4>
-					 <p>[% koha_new.new %]</p>
-					<p class="newsfooter"> Posted on [% koha_new.newdate %] [% IF ( CAN_user_tools ) %]
+                     <p>[% koha_new.new %]</p>
+                    <p class="newsfooter"> Posted on [% koha_new.newdate %] [% IF ( CAN_user_tools ) %]
     <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&amp;id=[% koha_new.idnew %]">Edit</a> | <a href="/cgi-bin/koha/tools/koha-news.pl?op=del&amp;ids=[% koha_new.idnew %]">Delete</a> | <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form">New</a>[% END %]</p></div>
             [% END %]
-		</div><!-- /koha-news -->
-	</div>
+        </div><!-- /koha-news -->
+    </div>
 [% END %]
 
 </div>
-- 
1.7.4.1



More information about the Koha-patches mailing list