Commit graph

282 commits

Author SHA1 Message Date
1bf93a36db Facets (current) translatable via template
This patch allows to translate facets label with standart
templates / PO files. Facets are still hard coded in Koha.pm.
Template wait those hard coded facets: Topics, Places, Titles,
Autors and Libraries.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 07:26:31 -05:00
Galen Charlton
496b6c8ef4 bugfix - fix 'not' operator in NoZebra
Corrected bug that prevented the 'not' operator
from working consistently - i.e., a search of
'mice not men' would not always work.

Also added test cases for NoZebra, so far focusing on
NZanalyse and adding and deleting bibs.  A couple of
the test cases are currently known to fail and
therefore are marked TODO.  The tests in question
are to verify that rows in nozebra are removed if
no bib is linked to the relevant word.  However, it
looks like such rows are retained, just with
nozebra.biblionubmers set to ''.  Is there any
reason to keep these rows?

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-16 08:18:25 -05:00
Galen Charlton
c6d507f8a9 kohabug 2020 - fix infinite loop in NoZebra on Perl 5.10
When running Koha in NoZebra mode under Perl 5.10, a search
containing a operator (e.g., "mice and men") could cause
a bib search to enter into an infinite loop in NZanalyse.

This possibility arises from the fact that NZanalyse used
to use capture variables from regular expressions without
verifying whether the regular expressions actually matched.
It was compounded by the fact that NZanalyse is recursive;
however, because $1, $2, etc. are dynamically scoped,
*they are not automatically cleared when NZanalyse calls
itself*.

Consequently, if the search string contains a boolean
operator, it would be split into

left = mice
operator = and
right = men

Then NZanalyse would be called recursively on the search
string 'mice'.  However, because $1, $2, and $3 are not
automatically cleared when the function is called again,
and because they are not cleared if a match fails, the code
would fail to recognize that 'mice' is leaf, and would
call NZanalyse('mice') repeatedly, to the promotion of
warm server rooms.

The wrinkle in this is that because of a bug in Perl 5.8, a
failing matches can sometimes alter the capture variables, thus
avoiding the infinite recursion.  However,  this bug was fixed in
Perl 5.10, leading to the NZanalyse bug becoming evident.

The Perl bug is described at http://rt.perl.org/rt3/Public/Bug/Display.html?id=19049
and the fix http://public.activestate.com/cgi-bin/perlbrowse/p/29279.

The fix to the Koha code is to check whether each regexp
that uses capture variables matches or fails, then act
accordingly.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-16 08:18:24 -05:00
Galen Charlton
c1ae207d54 kohabug 1621 - add subtitle to main results and details pages
Including the subtitle in search results and OPAC and staff
details templates.  The subtitle is expected to be in the
MARC subfield that is mapped to the (now nonexistant) column
bibliosubtitle.subtitle.

This is a fairly hackish patch that is meant to be minimally
disruptive while allowing subtitles to be displayed for those
not using the experimental XSLT bib display feature.  It
does *not* cover all cases where you have a MARC
record and want to display its subtitle.

UNIMARC notes: at the moment, none of the fr-FR UNIMARC
frameworks appear to be map any subfields to bibliosubtitle.subtitle.
This could be changed, but caveat programmer: the UNIMARC 200$e
is repeatable (meaning that get_koha_field_from_marc will put in ' | '
between multiple subtitles) and one may want to also include the
200$d (parallel title).  A GetMarcSubtitle routine may be in order
if absolutely necessary.

This points to a long-term need to make display of MARC (and later, hopefully,
non-MARC) bib records more flexible - the XSLT feature is one approach;
there may be others.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:40:34 -05:00
Joshua Ferraro
d83a055504 Adding authorised value icons display in the search results
pages.
2008-04-30 21:07:29 -05:00
Andrew Moore
57b3b951c1 Bug 2047: adding images to arbitrary authorized values
I've refactored the subs I added in the previous commit so that they make a little
more sense and are in better places in the code base. I was really hoping to make use
of existing subs, but they all seemed so specific to particular uses.

The icons now show up on the OPAC item details page.

TODO: The icons still don't show up in the OPAC search results page.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 20:10:43 -05:00
Joe Atzberger
caa8afd2cc C4::Search - just cleanup, 1 FIXME added
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:34 -05:00
Chris Nighswonger
743fbda69d More work on SimpleSearch
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:43 -05:00
Chris Nighswonger
d50ab5e6e8 Enabling SimpleSearch to return the total number of hits to caller
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:42 -05:00
Paul POULAIN
a201a8bd89 BUGFIX : highlighting term fixes
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-14 23:47:01 -05:00
Joshua Ferraro
32cfac05cf Fixing bug 2005: ISBN Search
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-09 05:46:03 -05:00
Joshua Ferraro
4d3519dffd Partial fixes to enable unapi for non-zebra and non-public-facing sru
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-08 19:48:55 -05:00
Joshua Ferraro
faa9a39694 adding famfamfam iconset, improving isbn for amazon content, etc.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-07 21:20:22 -05:00
Ryan Higgins
d48e0998d0 More cleanup of location & ccode authval handling.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-07 15:59:49 -05:00
Andrew Moore
883e3767fc Bug 1980: adding parameters to C4::Search::SimpleSearch to allow limiting the number of results returned.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-01 06:44:19 -05:00
Joshua Ferraro
556721e86a Experimental XSLT-based display of results and details pages To enable, create two new YesNo sysprefs: XSLTDetailsDisplay and XSLTResultsDisplay, and set them to ON. Feature to be expanded in a future version, this experimental code is for proof of concept only and doesn't introduce any changes if sysprefs are not created.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-21 21:49:04 -05:00
Joe Atzberger
45c007cc1e Search.pm - minor cleanup
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-16 08:40:39 -05:00
Joe Atzberger
600b47b08f C4::Search - vastly reduced calls to preference and repeatedly stepping through the same hashrefs to build keys
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-16 08:39:19 -05:00
Mason James
432f36ed07 wrapping regex in \Q$value\E to handle tricky strings eg: 'c++'
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-29 09:05:34 -06:00
Paul POULAIN
0e2b065219 NoZebra : removing . and : before indexing
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-19 20:27:36 -06:00
Paul POULAIN
e78f1f8bd2 BUGFIX NoZebra search (removal of adv zebra keyword bugguy)
This patch also add some if $DEBUG on warns

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-19 20:27:25 -06:00
Paul POULAIN
aeb0e1988b bugfixing scan index for UNIMARC
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-16 11:18:30 -06:00
Galen Charlton
70dccacee5 FRBR: configure PazPar2 during installation
Also added koha-pazpar2-ctl.sh to start and stop
PazPar2.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 16:35:18 -06:00
Galen Charlton
94f32e2873 FRBR: fixed paging through grouped results
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 16:35:17 -06:00
Galen Charlton
84233f4b6d FRBR: added OPAC search result grouping option
Because this feature is experimental, the syspref will
not be added to the list just yet.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 16:35:17 -06:00
Galen Charlton
35249f48e4 more experimental work on grouping with pazpar2
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 16:35:14 -06:00
Paul POULAIN
1262c3b341 switching home and holdingbranch (rewritten)
This is an improvement of a patch that has previously been rejected: I wanted to display holdingbranch, kados prefer homebranch
(and in fact it depends on the library choice...)
now, the library can choose, thanks to HomeOrHoldingBranch syspref.

Note that I have changed the description of the syspref to reflect this new use

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 06:05:54 -06:00
Galen Charlton
d92eb0373e experiment: use PazPar2 to group related works
The approach is to use PazPar2 to search just one
target, the biblio Zebra database.  The results
of each set are merged by PazPar2 to generate a
hitlist that combines related bibs together; as an
example, if a library has the first Harry Potter
book in three languages and an audiobook format,
the hitlist should ideally return one result
for the work that includes links to the individual
bibs.

The new module C4::Search::PazPar2 implements a
simple client for PazPar2's XML-over-HTTP API.  It is
designed to be generic, and thus may end up getting
moved out of Koha to become a stand-alone CPAN module.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-08 06:01:39 -06:00
Galen Charlton
ed6131ccbd quell warnings for SimpleSearch under 'use warnings'
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-08 05:48:55 -06:00
Henri-Damien LAURENT
f91a41970d Adding OpacHighlightedWords system preference
Disable or Enable the display of query terms in the biblio.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-25 16:52:15 -06:00
Joshua Ferraro
d205be1ba2 fix for bug 1736: Zebra searching, " " quotes cannot access second page when used
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 23:29:04 -06:00
Galen Charlton
6a903c85b9 removed extra 'my' that was causing a masking warning
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:25:47 -06:00
Galen Charlton
b7c35853f2 item rework: do not allow bulkedit to update items
This patch is meant to guarantee that a bulkedit
does not try to edit an item tag embedded in a MARC
biblio without updating the items feature.  It is
not a comprehensive fix of the bulkedit feature, which
currently does not appear to be functional and
needs some thought:

* The general search results is probably not the
  best place to put this feature -- it should
  probably be in tools.
* A bulk edit of something like items is desireable,
  but needs to be designed so that it respects
  business logic for circulation and acquisitions.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:23:47 -06:00
Joshua Ferraro
5c23369af2 Fixing Database Definitions for Statuses *PARTIAL*
Prior to this fix, the status fields had three 'off' values, NULL, "",
and 0. I've reduced it to two in the db, removing the option for NULL, and
setting the default value to 0, however, we need to verify that we don't ever
write out as "" as this needlessly complicates the indexing process,
critical for searching or limiting by status (e.g., availability). Also,
queries that attempt to write a NULL value to one of these fields will fail
(based on my tests).

This patch includes the following changes:

* Updated the database definition for notforloan, damaged, itemlost, and
wthdrawn in kohastructure.sql to forbid NULL and default to 0; MySQL
can't forbid other values (such as empty ""), so this has to be handled
at the application layer and REQUIRES further patching.

* Fixed the 'limit by availability' query node in Search.pm to use a
much less confusing definition of 'available'

* Added code to set values to 0 where they are NULL or empty ( "" ) for
notforloan, damaged, itemlost or wthdrawn in both the MARC and the items
table:

  * Biblio.pm -> AddBiblioAndItems
  * catalogue/updateitem.pl
  * SEE NOTE BELOW, REQUIRES UPDATE TO THE REST OF KOHA'S ITEM MGT!

* Removed code in bulkmarcimport.pl that sets notforloan status depending
  on item-level or bib-level itemtype -- that flag is designed to be set
  only to override the notforloan setting for the item's (or bib's,
  depending on the syspref) assigned itemtype (it doesn't need to override
  to 'for loan', only to 'not for loan').

  added $dbh->do("truncate zebraqueue"); when operation is 'delete'

* I updated some notes in catalogue/updateitem.pl as to why ModItem can't be
used -- we don't have _a_ place where we can change the item and marc :/

  I've tested the following:

  bulkmarcimport.pl..........................MARC/items OK
  Staged Records Import......................NOT OK
  updateitem.pl (via moredetail.pl)..........MARC/items OK
  circulation.pl.............................NOT OK
  returns.pl.................................NOT OK
  addbiblio.pl...............................NOT OK
  additem.pl.................................NOT OK

Basically, there isn't a single place to apply this patch that will
update both item data and MARC data in one place ... a future patch
needs to address this issue.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:23:04 -06:00
Joshua Ferraro
05290bb1b5 Improving searchhighlightblob, similar to Paul's patch:
1. doesn't remove author_nospan, and <span>s around bib fields for
display, perhaps they should just get a separate style?

2. using subfields now

3. improved ability to highlight small words (3 chars and less)

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 01:39:13 -06:00
Henri-Damien LAURENT
ee252ad5af NZSearch debugging
Adding NZoperatorAND NZoperatorOR NZoperatorNOT
Using NZOperatorAND NOT in NZanalyse
Some problem solved.

Please test.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 00:48:26 -06:00
Joshua Ferraro
07349a7c2f fix to enable separate imageurls for item-level itypes
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-30 17:00:55 -06:00
Joshua Ferraro
c70df80694 Search.pm Bugfixing
Getting Search.pm air tight ... cleaned up some local variables
that were declared global

fix to asynchronous federated searching lost since dev_week, immediate
use is authority search

template fixes to item-level itemtypes and bib-level itemtypes

temp workaround to javascript problems preventing item edits

fix to installer

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-28 08:32:24 -06:00
Joshua Ferraro
1a7a650ea2 improve embedded documentation and perldoc
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-28 08:32:15 -06:00
Paul POULAIN
d46958af51 replacing SHELF_LOC by LOC, as decided with kados on the chat
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-26 14:33:02 -06:00
Paul POULAIN
a553ea88b1 fix to handle notforloan authorised values (we now handle wthdrawn, itemlost, damaged AND notforloan fields)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-26 14:32:59 -06:00
Joshua Ferraro
8903f62102 fix for bug 1688
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-23 15:01:06 -06:00
Joshua Ferraro
d17f7e8ab0 expandtab, retab, tabstop=4
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-23 15:00:57 -06:00
Joshua Ferraro
1647ab1874 Revert "Merging hdl's Search.pm changes"
This reverts commit 51ec728f7b.

That commit basically reverted 95% of the status handling I'd done
last week ...

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-23 14:50:37 -06:00
Joshua Ferraro
dcb3858ffd Several important commits:
* adding zebra daemons for managing server and queue processes
  * improvements to the README.debian file
  * Fixes to Search.pm since last series of commits broke zebra-based
    searching (again)
  * moving some files to new misc/bin and misc/cronjobs

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-22 18:26:39 -06:00
Chris Nighswonger
51ec728f7b Merging hdl's Search.pm changes
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-21 19:47:37 -06:00
Chris Nighswonger
da9fdead92 Rolling back changes made to NZ search elements
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-21 11:11:58 -06:00
Joshua Ferraro
1dc6baabcc fixing zebra searching after recent commits 2007-12-20 21:45:55 -06:00
Chris Nighswonger
adab2825dc Initial fix for NoZebra advanced search problems when searching with no query and only limits (ie. itemtype)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-20 19:21:30 -06:00
Henri-Damien LAURENT
065870272b BUG Fixing : NoZebra search
Bug fixing search on alphanumeral string such as EN0 couldnot work.
Bug fixing AND would be too much restrictive on results (required count of occurence of search criteria to be the same).

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-20 18:38:44 -06:00