Bugzilla – Attachment 47704 Details for
Bug 15749
Add library menu to OPAC header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add branch selector to the opac header
Add-branch-selector-to-the-opac-header.patch (text/plain), 5.42 KB, created by
Chad Billman
on 2016-02-05 15:53:57 UTC
(
hide
)
Description:
Add branch selector to the opac header
Filename:
MIME Type:
Creator:
Chad Billman
Created:
2016-02-05 15:53:57 UTC
Size:
5.42 KB
patch
obsolete
>From dcd27b81211e46941094ee3781ebf77fe0215822 Mon Sep 17 00:00:00 2001 >From: Chad Billman <chad@pennmanor.net> >Date: Thu, 21 Jan 2016 11:23:51 -0500 >Subject: [PATCH] Add branch selector to the opac header > >Display a dropdown to select a branch on the opac. Used to limit the >searches to a branch with out requiring a login or advanced filters. > >QA Followup from kyle@bywatersolutions.com > >* Change "Buildings" to "Libraries", add span with class for easy changing >* Fix use of tabs >* Update license version >* Add "Clear selection" option >* Remove use of TT markup inside HTML tags > >https://bugs.koha-community.org/show_bug.cgi?id=15749 >--- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 37 +++++++++++++++++++ > opac/opac-setbranch.pl | 41 ++++++++++++++++++++++ > 2 files changed, 78 insertions(+) > create mode 100755 opac/opac-setbranch.pl > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 949ccf3..329ba41 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -76,6 +76,43 @@ > </ul> <!-- / .dropdown-menu --> > </li> <!-- / .dropdown --> > [% END # / IF virtualshelves %] >+ >+ [% IF Koha.Preference('SearchMyLibraryFirst') %] >+ <li class="divider-vertical set-search-first-library"></li> >+ <li class="dropdown set-search-first-library"> >+ <a id="listmenu" class="dropdown-toggle" role="button" data-toggle="dropdown" href="#"</a> >+ <i class="icon-home icon-white"></i> >+ <span class="listslabel"> >+ [% IF ( mylibraryfirst ) %] >+ [% FOREACH BranchesLoo IN BranchesLoop %] >+ [% IF (BranchesLoo.selected) %] >+ [% BranchesLoo.branchname %] >+ [% END %] >+ [% END %] >+ [% ELSE %] >+ <span id="set-library-label-default">Libraries</span> >+ [% END %] >+ </span> >+ <b class="caret"></b> >+ </a> >+ >+ <ul class="dropdown-menu" role="menu"> >+ [% FOREACH BranchesLoo IN BranchesLoop %] >+ [% IF (BranchesLoo.selected) %]<li class="active" role="presentation">[% ELSE %]<li role="presentation">[% END %] >+ <a role="menuitem" tabindex="-1" href="/cgi-bin/koha/opac-setbranch.pl?newbranch=[% BranchesLoo.value %]"> >+ [% BranchesLoo.branchname %] >+ </a> >+ </li> >+ [% END %] >+ <li role="presentation"> >+ <a role="menuitem" tabindex="-1" href="/cgi-bin/koha/opac-setbranch.pl" class="set-search-first-library-clear"> >+ <i class="icon-remove-circle"></i> Clear selection >+ </a> >+ </ul> >+ </li> >+ [% END %] >+ >+ > </ul> <!-- / .nav --> > [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %] > [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %] >diff --git a/opac/opac-setbranch.pl b/opac/opac-setbranch.pl >new file mode 100755 >index 0000000..13b73b5 >--- /dev/null >+++ b/opac/opac-setbranch.pl >@@ -0,0 +1,41 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along with >+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, >+# Suite 330, Boston, MA 02111-1307 USA >+ >+use Modern::Perl; >+ >+use CGI; >+use C4::Auth qw/:DEFAULT get_session/; >+ >+my $input = new CGI; >+ >+my $cookie =~ m/CGISESSID=(\w*);.*/; >+my $sessionID = $1; >+my $session = get_session($sessionID); >+ >+if ( $input->param('newbranch') ) { >+ $session->param( 'mylibraryfirst', $input->param('newbranch') ); >+ $session->param( 'branch', $input->param('newbranch') ); >+} >+else { >+ $session->param( 'mylibraryfirst', undef ); >+ $session->param( 'branch', undef ); >+} >+ >+$session->flush; >+ >+print $input->redirect('/cgi-bin/koha/opac-main.pl'); >+ >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15749
: 47704 |
47714