@@ -, +, @@ - Circulation search header autocomplete - Overdues patron attribute authorized value filter (must have patron attributes enabled, and a patron attribute defined which uses authorized values. - Authorities search plugin. Edit a MARC record and use an authorities plugin link to do a search for authority records. --- authorities/ysearch.pl | 20 +- circ/ypattrodue-attr-search-authvalue.pl | 13 +- circ/ysearch.pl | 37 ++- .../intranet-tmpl/prog/en/css/staff-global.css | 22 ++- .../prog/en/includes/auth-finder-search.inc | 134 +++++--- .../prog/en/includes/budgets-admin-search.inc | 73 +---- .../intranet-tmpl/prog/en/includes/cat-search.inc | 71 +---- .../prog/en/includes/cities-admin-search.inc | 69 +---- .../prog/en/includes/contracts-admin-search.inc | 68 +---- .../prog/en/includes/doc-head-close.inc | 2 + .../prog/en/includes/patron-search-box.inc | 65 ++--- .../prog/en/includes/patron-search.inc | 69 +---- .../prog/en/includes/roadtype-admin-search.inc | 70 +---- .../prog/en/includes/suggestions-add-search.inc | 70 +---- .../prog/en/includes/z3950-admin-search.inc | 71 +---- .../jquery/images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../jquery/images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../jquery/images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../jquery/images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../jquery/images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../jquery/images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../jquery/images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../lib/jquery/images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../lib/jquery/images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../lib/jquery/images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../lib/jquery/images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../lib/jquery/images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes .../intranet-tmpl/prog/en/lib/jquery/jquery-ui.css | 339 ++++++++++++++++++++ .../intranet-tmpl/prog/en/lib/jquery/jquery-ui.js | 49 +++ .../intranet-tmpl/prog/en/lib/jquery/jquery.js | 23 +-- .../intranet-tmpl/prog/en/modules/circ/overdue.tt | 102 +++---- koha-tmpl/intranet-tmpl/prog/img/loading-small.gif | Bin 0 -> 1849 bytes 33 files changed, 639 insertions(+), 728 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_222222_256x240.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_2e83ff_256x240.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_454545_256x240.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/images/ui-icons_cd0a0a_256x240.png create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.css create mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.js create mode 100644 koha-tmpl/intranet-tmpl/prog/img/loading-small.gif --- a/authorities/ysearch.pl +++ a/authorities/ysearch.pl @@ -3,6 +3,7 @@ # This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) # Copyright 2011 BibLibre +# Parts copyright 2012 Athens County Public Libraries # # This file is part of Koha. # @@ -43,7 +44,7 @@ if ( $auth_status ne "ok" ) { exit 0; } - my $searchstr = $query->param('query'); + my $searchstr = $query->param('term'); my $searchtype = $query->param('querytype'); my @value; given ($searchtype) { @@ -62,10 +63,17 @@ if ( $auth_status ne "ok" ) { my $startfrom = 0; my ( $results, $total ) = SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value, $startfrom * $resultsperpage, $resultsperpage, $authtypecode, $orderby ); + +print "["; +my $i = 0; foreach (@$results) { - my ($value) = $_->{'summary'}; - # Removes new lines - $value =~ s/
/ /g; - $value =~ s/\n//g; - print nsb_clean($value) . "\n"; + if($i > 0){ print ","; } + my ($value) = $_->{'summary'}; + # Removes new lines + $value =~ s/
/ /g; + $value =~ s/\n//g; + $value = "{\"summary\":\"" . $value . "\"" . "}"; + print nsb_clean($value) . "\n"; + $i++; } +print "]"; --- a/circ/ypattrodue-attr-search-authvalue.pl +++ a/circ/ypattrodue-attr-search-authvalue.pl @@ -2,6 +2,7 @@ # This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) +# Parts copyright 2012 Athens County Public Libraries # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the @@ -25,7 +26,7 @@ use C4::Auth qw/check_cookie_auth/; use C4::Debug; my $input = new CGI; -my $query = $input->param('query'); +my $query = $input->param('term'); my $attrcode = $input->path_info || ''; $attrcode =~ s|^/||; @@ -45,8 +46,14 @@ my $sql = qq(SELECT authorised_value, lib description AND v.lib like ?); my $sth = $dbh->prepare($sql); $sth->execute( $attrcode, "$query%" ); + +print "["; +my $i = 0; while ( my $rec = $sth->fetchrow_hashref ) { print STDERR ">> attrcode=$attrcode match '$query' ==> $rec->{description} ($rec->{authorised_value})\n" if $debug; - print "$rec->{description}\t$rec->{authorised_value}\n"; + print "{\"description\":\"" . $rec->{description} . "\",\"" . + "authorised_value\":\"" . $rec->{authorised_value} . "\"" . + "}"; + $i++; } - +print "]"; --- a/circ/ysearch.pl +++ a/circ/ysearch.pl @@ -3,6 +3,7 @@ # This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) # Copyright 2007 Tamil s.a.r.l. +# Parts copyright 2010-2012 Athens County Public Libraries # # This file is part of Koha. # @@ -32,7 +33,7 @@ use C4::Members; use C4::Auth qw/check_cookie_auth/; my $input = new CGI; -my $query = $input->param('query'); +my $query = $input->param('term'); binmode STDOUT, ":encoding(UTF-8)"; print $input->header(-type => 'text/plain', -charset => 'UTF-8'); @@ -42,11 +43,29 @@ if ($auth_status ne "ok") { exit 0; } -print map $_->{surname} . ", " . $_->{firstname} . "\t" . - $_->{cardnumber} . "\t" . - $_->{address} . "\t" . - $_->{city} . "\t" . - $_->{zipcode} . "\t" . - $_->{country} . - "\n", - @{ Search($query, [qw(surname firstname cardnumber)], [10], [qw(surname firstname cardnumber address city zipcode country)]) }; +my $dbh = C4::Context->dbh; +my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country + FROM borrowers + WHERE surname LIKE ? + OR firstname LIKE ? + OR cardnumber LIKE ? + ORDER BY surname, firstname + LIMIT 10); +my $sth = $dbh->prepare( $sql ); +$sth->execute("$query%", "$query%", "$query%"); + +print "["; +my $i = 0; +while ( my $rec = $sth->fetchrow_hashref ) { + if($i > 0){ print ","; } + print "{\"surname\":\"" . $rec->{surname} . "\",\"" . + "firstname\":\"".$rec->{firstname} . "\",\"" . + "cardnumber\":\"".$rec->{cardnumber} . "\",\"" . + "address\":\"".$rec->{address} . "\",\"" . + "city\":\"".$rec->{city} . "\",\"" . + "zipcode\":\"".$rec->{zipcode} . "\",\"" . + "country\":\"".$rec->{country} . "\"" . + "}"; + $i++; +} +print "]"; --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2157,7 +2157,11 @@ div.pager { padding : .3em .5em .3em .5em; margin : .4em 0; } -div.pager img { +div.pager img {+/* jQuery UI Autocomplete */ ++ul.ui-autocomplete li { list-style-type: none; font-size : inherit; } ++ul.ui-autocomplete { -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,.3); -moz-box-shadow: 2px 2px 2px rgba(0,0,0,.3); box-shadow: 2px 2px 2px rgba(0,0,0,.3); } ++input.ui-autocomplete-input.active { background: transparent url("../../img/loading-small.gif") right center no-repeat; } + vertical-align : middle; } div.pager img.last { @@ -2197,3 +2201,19 @@ div#acqui_order_supplierlist > div.supplier > span.action { div#acqui_order_supplierlist > div.supplier > div.baskets { margin-top: 0.5em; } + +/* jQuery UI Autocomplete */ +ul.ui-autocomplete li { + list-style-type: none; + font-size : inherit; +} + +ul.ui-autocomplete { + -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,.3); + -moz-box-shadow: 2px 2px 2px rgba(0,0,0,.3); + box-shadow: 2px 2px 2px rgba(0,0,0,.3); +} + +.ui-autocomplete-loading { + background: #FFF url("../../img/loading-small.gif") right center no-repeat; +} --- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc @@ -1,64 +1,90 @@ --- a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc @@ -1,49 +1,5 @@

[% LibraryName %]

-[% IF ( CAN_user_circulate ) %][% IF ( CircAutocompl ) %] [% END %][% END %] + +[% INCLUDE 'patron-search-box.inc' %] + [% IF ( CAN_user_catalogue ) %]