Bugzilla – Attachment 15558 Details for
Bug 8845
Add ability search patrons by date of birth
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug-8845---Add-ability-search-patrons-by-date-of-b.patch (text/plain), 4.87 KB, created by
Kyle M Hall (khall)
on 2013-02-19 17:32:19 UTC
(
hide
)
Description:
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-02-19 17:32:19 UTC
Size:
4.87 KB
patch
obsolete
>From 63ee43aee7a1afba3f851cfa7cd7ba230b333d0a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 2 Oct 2012 10:01:11 -0400 >Subject: [PATCH] Bug 8845 - Add ability search patrons by date of birth - Add tooltip > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Works with all date formats >--- > Koha/Template/Plugin/Koha.pm | 49 ++++++++++++++++++++ > .../prog/en/includes/doc-head-close.inc | 1 + > .../prog/en/includes/patron-search.inc | 24 ++++++++++ > 3 files changed, 74 insertions(+), 0 deletions(-) > create mode 100644 Koha/Template/Plugin/Koha.pm > >diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm >new file mode 100644 >index 0000000..a992961 >--- /dev/null >+++ b/Koha/Template/Plugin/Koha.pm >@@ -0,0 +1,49 @@ >+package Koha::Template::Plugin::Koha; >+ >+# Copyright ByWater Solutions 2013 >+ >+# 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 2 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., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Template::Plugin; >+use base qw( Template::Plugin ); >+ >+use C4::Koha; >+use C4::Context; >+ >+=pod >+ >+This plugin contains various Koha replated Template Toolkit functions >+to help streamline Koha and to move logic from the Perl code into the >+Templates when it makes sense to do so. >+ >+To use, first, include the line '[% USE Koha %]' at the top >+of the template to enable the plugin. >+ >+For example: [% IF Koha.Preference( 'MyPreference ) == 'SettingA' %] >+removes the necessity of setting a template variable in Perl code for >+each and every system preference, even if no evaluation of the setting >+is necessary. >+ >+=cut >+ >+sub Preference { >+ my ( $self, $pref ) = @_; >+ return C4::Context->preference( $pref ); >+} >+ >+1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index 6fcba72..7deaabf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -14,6 +14,7 @@ > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.hotkeys.min.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.highlight-3.js"></script> >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.qtip.js"></script> > <script type="text/javascript" src="[% interface %]/lib/bootstrap/bootstrap.min.js"></script> > > [% IF ( login ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index 965cd4c..d366f81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -1,3 +1,4 @@ >+[% USE Koha %] > <div class="gradient"> > <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box --> > <div id="header_search"> >@@ -19,6 +20,29 @@ > <option value='streettype,address,address2,city,state,zipcode,country'>Street Address</option> > <option value='dateofbirth'>Date of birth</option> > </select> >+ <script type="text/javascript"> >+ [% SET dateformat = Koha.Preference('dateformat') %] >+ $("#searchfields").change(function() { >+ if ( $(this).val() == 'dateofbirth' ) { >+ [% IF dateformat == 'us' %] >+ [% SET format = 'MM/DD/YYYY' %] >+ [% ELSIF dateformat == 'iso' %] >+ [% SET format = 'YYYY-MM-DD' %] >+ [% ELSIF dateformat == 'metric' %] >+ [% SET format = 'DD/MM/YYYY' %] >+ [% END %] >+ >+ $('#searchmember').qtip({ >+ content: 'Dates of birth should be entered in the format "[% format %]"', >+ style: { >+ tip: 'topLeft' >+ } >+ }) >+ } else { >+ $('#searchmember').qtip('destroy'); >+ } >+ }); >+ </script> > > <label for="searchtype">Search type:</label> > <select name="searchtype" id="searchtype"> >-- >1.7.2.5
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 8845
:
12601
|
12608
|
12639
|
14293
|
14367
|
14368
|
14392
|
14393
|
15556
|
15557
|
15558
|
18437
|
18438
|
18439
|
18508
|
18509
|
18510
|
18511