Commit graph

4018 commits

Author SHA1 Message Date
Paul Poulain
a42e5e6d3e Merge remote-tracking branch 'origin/new/bug_5339' 2012-09-20 10:19:44 +02:00
Julian Maurice
766b267b15 Bug 5339: Unit tests for invoices related subroutines
These tests use DBD::Mock to check if SQL queries are correctly built.
Actually, we only check bound parameters.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 09:46:59 +02:00
Jared Camins-Esakov
65c0174e63 Bug 2060 follow-up: add support for UNIMARCAUTH
The staged MARC management script was not correctly informing
the decoder ring that we had UNIMARC authorities, and the decoder
ring was dutifully trying to turn the authority records into a
bibliographic box of cereal.
2012-09-19 17:16:23 +02:00
Jared Camins-Esakov
7ad5e203da Bug 2060: Update command line MARC import scripts
Expose authority import functionality to the command line import
scripts, and rename them from commit_biblios_file.pl and
stage_biblios_file.pl to commit_file.pl and stage_file.pl.

To test (note that these instructions assume you have a MARC21
installation and are using the provided sample file):
1. Find a file of authorities (a sample file with MARC21 authorities
   is attached to bug 7475) and download it to your server
2. Stage the file using the following command (replace <filename> with
   the name of the file you saved in step 1):
   > misc/stage_file.pl --file <filename> --authorities
3. Note the batch number the script assigns to your batch
4. Commit the records using the following command (replace <batchnumber>
   with the batch number you made note of in step 3):
   > misc/commit_file.pl --batch-number <batchnumber>
5. Index the authorities Zebraqueue (or wait)
6. Confirm that the new authorities appear.
7. Create a matching rule with the following settings:
   Code: AUTHTEST
   Description: Personal name main entry
   Match threshold: 999
   Record type: Authority record
   Search index: Heading-main
   Score: 1000
   Tag: 100
   Subfields: a
   Offset: 0
   Length: 0
   (note the ID of this matching rule)
8. Stage the authority file again, this time using the following
   command:
   > misc/stage_file.pl --file <filename> --authorities \
     --match <matchingrule>
7. Revert the import with the following command:
   > misc/commit_file.pl --batch-number <batchnumber> --revert
8. Index the authorities Zebraqueue (or wait)
9. Confirm that the records have been removed
10. Import an authority record with the Stage MARC/Manage staged MARC
    tools in exactly the way you would for a bibliographic record,
    but choose "Authority" instead of "Bibliographic" for the record
    type.

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>

Testing plan delivers as it should.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 11 September 2012
2012-09-19 17:16:18 +02:00
Jared Camins-Esakov
6e71b80ca3 Bug 7475: Teach matching rules to handle authorities
* Add the code necessary to handle authorities with matching rules and
  import batches.
* Update all the scripts that use the matcher and import batch code
  to use the new API.
* Add authority records to the matching rules interface in the staff
  client.

http://bugs.koha-community.org/show_bug.cgi?id=2060
Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 11 September 2012
2012-09-19 17:15:56 +02:00
Paul Poulain
be12aa9609 Merge remote-tracking branch 'origin/new/bug_6448' 2012-09-19 16:12:23 +02:00
Dobrica Pavlinusic
8f2dcc6741 Bug 6448 - carp on invalid barcode
This is consistent with implementation of other barcode types
which all carp instead of die on invalid barcodes.
2012-09-19 16:11:41 +02:00
881ee1b1a1 Bug 7401 - Shelving Location facet
This patch enables the shelving location facet as an
alternative to the branches fact in two situations:
A) SingleBranchMode is enabled
B) There is only one branch in the branches table

Test Plan:
1) Catalog multiple items with different shelving locations.
2) Test enable by enabling SingleBranchMode
3) Test enable by deleting all but one branch

Based on initial patch by Ian Walls.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested cases 2) and 3) successfully in OPAC and staff client

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-19 14:25:04 +02:00
Paul Poulain
884c8a2b7c Merge remote-tracking branch 'origin/new/bug_7993' 2012-09-19 12:13:02 +02:00
Paul Poulain
6bc91ace59 Bug 7993 follow-up to fix POD DOC 2012-09-19 12:12:43 +02:00
Julian Maurice
bf803c521f Bug 5339: Invoices management improvement
- New pages:
  - invoices.pl: allow to search in invoices on several criteria
  - invoice.pl: permit to view and modify invoice details
    - shipment date
    - billing date
    - shipment cost and budget used for shipment cost

Invoice informations are now stored in their own sql table and aqorders
have a link to it

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-18 22:42:15 +02:00
Jonathan Druart
214fd0fbd1 Bug 5357: Adds a new page for searching subscriptions
Test plan:
- go on the serial module
- click on the 'Advanced search' link (right of subscriptions search in
the header)
- Search subscriptions (by ISSN, title, EAN, Publisher, Supplier and/or
  Branch)
- Check results are correct

Signed-off-by: Corinne HAYET <corinne.hayet@bulac.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 22:37:11 +02:00
Colin Campbell
537c746dc4 Bug 7751: Decrease Loans for Items in Demand for Holds
Rebase and merge based on Mark Gavillet's patch to reduce
the loan period given to items on renewal when they are
in high demand for holds

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-09-18 19:01:14 +02:00
Srdjan
42acfbf75b Bug 7993: Save reports with Group/Subgroup hierarchy
This should make saved reports more manageable.
Group/Subgroup hierarchy is stored in authorised_values,
categories REPORT_GROUP and REPORT_SUBGROUP, connected by
REPORT_SUBGROUP.lib_opac -> REPORT_GROUP.authorised_value

Database changes:
* authorised_values: expanded category to 16 chars
* created default set of REPORT_GROUP authorised values to match
  hardcoded report areas
* reports_dictionary: replaced area int with report_area text, converted
  values
* saved_sql: added report_area, report_group and report_subgroup;
  report_area is not currently used, saved for the record

C4/Reports/Guided.pm:
* Replaced Area numeric values with the mnemonic codes
* get_report_areas(): returns hardcoded areas list
* created get_report_areas(): returns full hierarchy (groups with belonging
  subgroups)
* save_report(): changed iterface, accepts fields hashref as input
* update_sql(): changed iterface, accepts id and fields hashref as input
* get_saved_reports():]
- join to authorised_values to pick group and subgroup name
- accept group and subgroup filter params
* get_saved_report():
- changed iterface, return record hashref
- join to authorised_values to pick group and subgroup name
* build_authorised_value_list(): new sub, moved code from
  reports/guided_reports.pl
* Updated interfaces in:
cronjobs/runreport.pl, svc/report, opac/svc/report: get_saved_report()
reports/dictionary.pl: get_report_areas()
reports/guided_reports.pl

reports/guided_reports_start.tt:
* Reports list:
- added group/subgroup filter
- display area/group/subgroup for the reports
* Create report wizard:
- carry area to the end
- select group and subgroup when saving the report; group defaults to area,
  useful when report groups match areas
* Update report and Create from SQL: added group/subgroup
* Amended reports/guided_reports.pl accordingly

Conflicts:

    C4/Reports/Guided.pm
    admin/authorised_values.pl
    installer/data/mysql/kohastructure.sql
    installer/data/mysql/updatedatabase.pl
    koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tmpl
    koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
    misc/cronjobs/runreport.pl
    reports/dictionary.pl
    reports/guided_reports.pl

Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 17:49:08 +02:00
Julian Maurice
b0ab204bfd Bug 8210: add links to authorities in normal mode headings
Cherry-picked from BibLibre's work on bug 5888:
opac-detail subject/author links improvements

Added a link to opac-authoritiesdetail.pl when possible.

Only affects 'Normal view'. Does not affect XSLT display.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 17:39:41 +02:00
Jared Camins-Esakov
4feb6a4736 Bug 8211: Add exploded search options
When working with hierarchical subject headings, it is sometimes helpful
to do a search for all records with a specific subject, plus
broader/narrower/related subjects. This patch adds support for these
"exploded" subject searches to Koha.

To test:
1) Make sure you have a bunch of hierarchical subjects. I created
   geographical subjects for "Arizona," "United States," and "Phoenix,"
   and linked them together using 551s, and made sure I had a half
   dozen records linking to each (but not all to all three).
2) Do a search for su-br:Arizona (or choose "Subject and broader terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "United States"
3) Do a search for su-na:Arizona (or choose "Subject and narrower terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona" and the
   records with the subject "Phoenix"
4) Do a search for su-rl:Arizona (or choose "Subject and related terms"
   on the advanced search screen with "more options" displayed), and
   check that you get the records with the subject "Arizona," the
   records with the subject "United States," and the records with the
   subject "Phoenix"
5) Ensure that other searches still work (keyword, subject, ccl,
   whatever)
6) Sign off

Technical details:
This patch adds a shim in front of C4::Search::buildQuery in order to
preprocess the query and call the _handle_exploding_search callback.
This shim will allow us to gradually offload query parsing to a new
query parser module.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 15:20:48 +02:00
Paul Poulain
401d9e4479 Merge remote-tracking branch 'origin/new/bug_6151' 2012-09-18 15:14:32 +02:00
Paul Poulain
c7eadd8b62 Bug 6151 follow-up fix POD
Fixing POD, problem detected by jenkins (thanks jenkins !)
2012-09-18 15:14:00 +02:00
Frédérick
f913ebe49f Bug 8597: Add system preferences to configure the mobile view.
This patch adds the following system preferences:
* OpacMainUserBlockMobile - alternate content for the MainUserBlock for
  mobile
* OPACMobileUserCSS - custom CSS for mobile views only
* OpacShowFiltersPulldownMobile - whether or not to show the index
  dropdown on the mobile view
* OpacShowLibrariesPulldownMobile - whether or not to show the library
  dropdown on the mobile view

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-09-18 13:42:18 +02:00
Jonathan Druart
82dc7b55a8 Bug 4321: clean C4::Biblio::GetBiblio and uses
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 12:11:54 +02:00
Fridolyn SOMERS
6f09397a21 Bug 8275: xml parsing error when the webservice GetPatronInfo/show_loans is called
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 11:27:05 +02:00
Paul Poulain
b08cf71f53 Bug 8336 follow-up, tabs to space 2012-09-18 11:23:42 +02:00
Colin Campbell
c5d1d9b623 Bug 8336 Support Sip Renewal Transaction
Renewals were being rejected for incorrect reasons
Checking was being done against the wrong object
Add more informative messages on failure
Correctly set due_date for renewal response
Avoid crashing the SIPServer because it handles RenewAll
incorrectly

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 11:22:03 +02:00
Ian Walls
850b4eeab9 Bug 6151: Add AllowReturnToBranch system preference
In order to solve the issue of IndependantBranches being incompatible with HomeOrHoldingBranchReturn,
this patch changes the mechanism by which the question "can I return this material here?" is answered.  Before,
the conditions were "if IndependantBranches is on, and this branch isn't HomeOrHoldingBranchReturn for the item,
then no, otherwise yes".  Now, the question is answered by consulting CanBookBeReturned (new subroutine)

New system preference:  AllowReturnToBranch
Possible values:
  - anywhere (default for new installs, and for existing systems with IndependantBranches turned off)
  - homebranch
  - holdingbranch (which is also the issuing branch in all normal circumstances)
  - homeorholdingbranch (default for existing systems with IndependantBranches turned on)

New subroutine:  CanBookBeReturned
Input:  $item hash (from GetItems), and $branchcode
Output: 0 or 1 to indicate "allowed" or not, and an optional message if not allowed.  Message is the 'correct' branchcode
to return the material to

To Test:
1.  Install patch and new syspref
2.  Check that default value of the preference:
    - if IndependantBranches was OFF at install time, should be 'anywhere'
    - if IndependantBranches was ON at install time, should be 'homeorholdingbranch'

Case:  'anywhere'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should be successful
3.  Checkout a Library A book at Library B.  Return to A should be successful
4.  Repeat step 3 with Library B and Library C

Case: 'homebranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to Library A should be successful
4.  Repeat step 3 with Library B and Library C.  Both should FAIL (returning message to return at A)

Case: 'holdingbranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to A should FAIL (returning message to return at B)
4.  Repeat step 3 with Library B. Return should be successful
5.  Repeat step 3 with Library C. Return should FAIL (returning message to return at B)

Case: 'homeorholdingbranch'
1.  Checkout a Library A book at Library A.  Return at Library A should be successful
2.  Repeat step 1, returning to Library B.  Return should FAIL (returning message to return at A)
3.  Checkout a Library A book at Library B.  Return to A should be successful
4.  Repeat step 3 with Library B. Return should be successful
5.  Repeat step 3 with Library C. Return should FAIL (returning message to return at A)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-17 19:17:41 +02:00
Fridolyn SOMERS
4792d78c19 Bug 7690: hidelostitems not working in Normal Display
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by toggling both the hidelostitems preference and the
OpacHiddenItems preference. Both work as expected in the normal
search results display.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-17 18:39:08 +02:00
Jonathan Druart
cf97a72abf Bug 4491: FIX buildQuery if called with an empty limit
if @limit=('') buildQuery failed

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
All searches that I tried (keyword, indexed, CCL, with limits, without,
etc.) worked fine. There are warnings about uninitialized variables in
the OPAC, but they exist on master as well and therefore should not
block these patches.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-17 18:19:49 +02:00
Stéphane Delaune
a8b168dc63 Bug 7671 : add a real primary key accountlines_id in accountlines
Signed-off-by: Stéphane Delaune <stephane.delaune@biblibre.com>
Signed-off-by: Marc Veron <veron@veron.ch>

NOTE: After applying the patch I got following errors in members/pay.pl:
Global symbol "$writeoff_sth" requires explicit package name
Global symbol "$add_writeoff_sth" requires explicit package name

Added to lines at the begin of members/pay.pl:
our $writeoff_sth;
our $add_writeoff_sth;

Now the patch worked as expected.

However I am not quite sure if signing off is OK in this situation.

Marc

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-15 07:31:58 +02:00
wajasu
40f9914e60 Bug 8378 - <fine> syntax not working on overdues anymore
Bug 8378 - <fine> syntax broken NFC and charset utf8

NFC normalize enqueued letters and add content-type charset=utf-8

This prevents utf8 codes from causing mysql to truncate the 'content'
from the point of certain codes, when stored in the message_queue table.
This was happenning with the currency symbol generated by
Locale::Currency:Format currency_format routine. NFC normalization
was only done on the attachment content with its content-type
containing "text", as in text/plain.

For emails AND attachments, the charset="utf-8" was added to the
content-type so mail clients would correctly iterate the utf8 codes,
thus preventing mobijake.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Ran through test plan before and after applying patch. Verified
that fine syntax does not work pre-patch and does work post-patch
for both direct emails and emails to the KohaAdminEmailAddress.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-14 17:52:25 +02:00
6f431883f8 Bug 4173 - Statuses not appearing in the OPAC
For the authorised values LOST and DAMAGED, if an OPAC description
is defined for the given value, display that description in the OPAC
rather than the generic description.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-09-14 16:37:16 +02:00
Paul Poulain
f22d9e1337 Bug 8743 follow-up, throw a more explanatory error message
When testing bug 8743, I discovered a missing index in my authority file.
The error message was
"CCL parsing error (10014) Unknown qualifier ZOOM"

which is not very helpfull because it does not show the query that was made.
This patch add the query itself after the zebra error
2012-09-14 15:59:50 +02:00
Jared Camins-Esakov
ffc6730552 Bug 8743: ZOOM error when merging authority change to biblios
The merge fails and the following errors appear in the log:
[Sun Sep 02 23:38:10 2012] [error] [client 75.149.175.233] ZOOM error 25
"Specified element set name not valid for specified database" (addinfo:
"F") from diag-set 'Bib-1', referer:
http://****/cgi-bin/koha/authorities/authorities.pl?authid=3010
[Sun Sep 02 23:38:11 2012] [error] [client 75.149.175.233] Premature end of
script headers: authorities.pl, referer:
http://****/cgi-bin/koha/authorities/authorities.pl?authid=3010

Test plan:
1) Set dontmerge to "Do"
2) Find an authority that is linked to a bib record.
3) Edit the main entry of the authority.
4) Save the authority record.
5) Notice that you got a nasty error and the bib record was not updated.
6) Apply patch.
7) Edit the main entry of the authority again (you can just set it back
   to what it was to start with).
8) Save authority record.
9) Notice that there was no error, and the bib record was updated.
10) Sign off.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-14 15:46:19 +02:00
Jared Camins-Esakov
8a718d6c9b Bug 8447: Make sure we have enough subfields for broader_headings
Thanks to wajasu for providing the debugging information, as I cannot
seem to duplicate the problem, even seeing where it could come from.

Fix corrects cases where upon save, a software error complaing about
indicators being wrong as a side effect of a poorly autogenerated
biblio/authority record.

Behvior with this fix causes existing bilio data to to be preserved
while linking to the authority via subtag 9.

Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-14 14:56:48 +02:00
Fridolyn SOMERS
2ca3663687 Bug 8071: link between bib and authorities with the authid
Do not automatically populate $9 in bibliographic headings when the
$9 is set in the authorized heading field of the authority record.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-14 13:29:14 +02:00
Adrien Saurat
0acebb8fc6 Bug 8719: Private lists always sorted by title
Virtualshelves:
The private lists were sorted by title, even when author or date was selected.
This patch corrects this behaviour.

Signed-off-by: Marc Veron <veron@veron.ch>

With this patch lists sort as expected.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-14 11:30:29 +02:00
Colin Campbell
ef7ebc4ed4 Bug 8017 reduce manipulation of GetAllIssues return
GetAllIssues can produce large lists
For performance purposes:
Dont loop over the list without cause
Dont do expensive processing in the loop
Dont needlessly copy the array
Do display formatting in the template
Dont extract the barcode list unless we are producing it
Reduce db calls by using the data to hand

Make the table in the template a bit more readable
where everything was stuffed into one line

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 18:51:45 +02:00
Kyle M Hall
e9dc807b32 Bug 4118 - Add Collection Code to Statistics Table
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-09-13 18:42:46 +02:00
Julian Maurice
d4cda293b4 Bug 7583: Cancel a receipt
In acqui/parcel.pl, there is now the possibility to cancel a receipt.
In "Already received" table, just click on "Cancel receipt" and the
order line will go back to pending orders.
If it was a partial receipt, order line is merged to its 'parent' line.
Attached items are modified so that they become attached to the merged
order line.
If AcqCreateItem is 'receiving', attached items are deleted.
If an order line was first partially received, and then completed. You
must cancel the 'parent' order line before cancelling the 'child'.

Signed-off-by: Marc Veron <veron@veron.ch>

The patch behaves like expected, and the feature is really helpfull.

Just a tiny remark about the following message:

-------------
Cannot cancel receipt. Possible reasons :
You are trying to cancel the receipt of an order line whose parent order line is already received. Cancel this parent order line and retry.
-------------

Maybe it would be good
- to explain a little bit more why it happend and re-word the message for non technical people (not everybody understands 'parent' the same way)

- prevent the situation to happen (e.g. forbid order lines to be deleted if they are already received) - but that would be in the scope of an other bug, I think.

I think such things could be fixed in the future during the ongoing work for Acquisitions module. Signing off.
2012-09-13 18:29:20 +02:00
Jonathan Druart
0f3f61e756 Bug 7986: Export issues for patron
In the circulation page, you can now export (as csv or iso2709) a list
of items which are currently checked out by a borrower.

3 export types:
- iso2709 with items: Export the items list in iso2709 format with item
  informations.
- iso2709 without items: Export the items list in iso2709 format without
  item informations.
- CSV: Export the items list based on a csv profil.

2 new system preferences:
- DontExportFields: a list of fields not to be export
- CsvProfileForExport: The Csv profile name used for the csv export

Test plan:
- Fill the CsvProfileForExport syspref
- go on the borrower circulation page containing checkouts
- Select one or more items and export them to the 3 different formats.
- check if the result file is what you expected

- Test there is no regression with the export authority
- Test there is no regression using tools/export.pl with the command
  line interface

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 17:58:30 +02:00
Colin Campbell
223bf0099f Bug 8761 Dont inadvertantly use slices
Assignment to a single element slice is better written
as a scalar - This generates a compile time warning as it
can lead to odd behaviour see perldiag for details
This corrects some cases which were added in a recent
commit

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 17:56:38 +02:00
Jared Camins-Esakov
4f043f3f77 Bug 3462: Links in authorities should be hyperlinks
Make see also links in both the OPAC and authority module search results
into hyperlinks and not just textual strings.

To test:
1. Do a search for an authority that will bring up a heading with a
   see also reference in the staff client and the OPAC.
2. Confirm that the see also references listed in the search results
   are now hyperlinks, which work.

Also quiets an unnecessary warning about an uninitialized value.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased 26 July 2012

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 1 August 2012

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 6 August 2012

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 11 September 2012

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely and is a great improvement.

Tests:
- Checked links for existing and non existing "see alsos" give correct
  search results
- Verified links show up for all "see alsos" in a result list
- Verified links are properly linked with the correct names
- Checked logs don't show errors

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 16:53:50 +02:00
Jared Camins-Esakov
bc05b5d163 Bug 7417: Include see from references in bibliographic searches
This patch adds the Koha::Indexer::RecordNormalizer and
Koha::Indexer::MARC::RecordNormalizer::EmbedSeeFromHeadings packages
to enable the inclusion of alternate forms of headings in bibliographic
searches. When the new syspref IncludeSeeFromInSearches is turned on
(default is off) rebuild_zebra.pl will insert see from headings from
authority records into bibliographic records when indexing, so that a
search on an obsolete term will turn up relevant records.

To test:
1) Enable IncludeSeeFromInSearches
2) Add a heading that has an alternate form to a record (for example,
   "Cooking" has the alternate form "Cookery," if you have authority
   records from LC)
3) Index the zebraqueue (or reindex if you haven't indexed your system
   yet)
4) Confirm that if you search for "Cookery" you get the record you
   just modified

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 5 August 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on master 11 September 2012

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Also checked:
- Verified database update works correctly
- Checked system preference and its description
- Checked staff/opac detail pages with feature on/off
- Checked staff/opac search facets
- Downloaded and tested records in various formats
- Tried different searches for 'see from' entries of authorities
- Ran all unit tests

No problems found.
2012-09-13 14:19:28 +02:00
Jared Camins-Esakov
f9980f6b31 Bug 8649: Add unit test for C4::Search
This patch adds a unit test for C4::Search in t/db_dependent. In order
to test the functioning of the Zebra search, this patch actually includes
an entire Zebra sandbox, and pre-indexed files, which are stored in
t/db_dependent/data (the configuration files are generated on the fly).

This test depends on Test::Warn, Test::MockModule, and DBD::Mock.

To test:
1) Run the test. There should be no failures, and no warnings.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: wajasu <matted-34813@mypacks.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-09-13 11:55:39 +02:00
Jared Camins-Esakov
8471158160 Bug 8209: "Did you mean?" from authorities
One of the ideas behind authority records is that users who search for
one term should have related terms (according to the authority file)
suggested to them. At the moment, Koha doesn't do that. Adding an
authority searching step to regular searches and displaying any
suggestions in a "Did you mean" bar at the top of the results would be
very useful.

This commit adds a Koha::SuggestionEngine class which is in charge of
getting suggestions from individual suggestion engine plugins, which
much be in the Koha::SuggestionEngine::Plugin::* namespace, and extend
Koha::SuggestionEngine::Base. Suggestions are loaded asynchronously
using AJAX, and a link to a page with suggestions is provided for users
with Javascript turned off.

The AuthorityFile suggestion engine plugin looks up the specified search
terms in the authority file and then suggests searches for records using
matching authorities.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased 2 August 2012 and incorporated QA feedback

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Test plan:
- Verified database update added system preference correctly,
  pref defaults to OFF
- Verified search results and detail pages in OPAC and staff
  still worked the same as before
  * for no results
  * with results
- Activated system preference and tested various searches
  * Searches from simple search
  * Searches from advanced search
  * Search links in records
- Deactivated Javascript - verified fallback works correctly

Notes:

- Suggested terms can include autorities with no linked records.
- When combining more than one search option using advanced search
  this results in "no suggestions" more often. Feature works best
  from simple search.

Overall great feature making use of authorities in a user friendly way!

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 2012-09-10
Signed-off-by: wajasu <matted-34813@mypacks.net>
2012-09-13 11:34:28 +02:00
Paul Poulain
374b6f4b9f Merge remote-tracking branch 'origin/new/bug_8251' 2012-09-12 16:45:05 +02:00
Colin Campbell
32e3f9eace Bug 8251 Do not try to debar patrons if returns are not overdue
If a period of suspension is configured in the issuing rules
a calculation to debar the patron was called on all returns
It should be limited to overdue returns

Renamed _FixFineDaysOnReturn subroutine to _debar_user_on_return
which is more descriptive of its purpose
Removed some unnecessary or duplicated processing
Changed visibility of $today so it didnt need
calculating twice
Removed declaration of a datedue variable that is
never used

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 16:43:57 +02:00
Srdjan
86c2c4626d bug_5911: Transport Cost Matrix
Create transport_cost table,  added UseTransportCostMatrix syspref.
transport_cost table contains branch to branch transfer
costs. These are used for filling inter-branch hold transfers.

Moved GetHoldsQueueItems() from .pl to HoldsQueue.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-12 14:49:25 +02:00
Paul Poulain
8449b14dcb Revert "Bug 8089: Use Koha::Cache for all caching"
This reverts commit 215abc8024.

The 3 patches for bug 8089 have been reverted, because they break
jenkins & Koha.
A follow-up has been provided, but it does not solve the problem on my
test server, it just changes the error message.

After a discussion with jared, Dobrica should work on another patch, so
the best option is to revert.
2012-09-12 14:12:41 +02:00
Paul Poulain
04881d9265 Revert "Bug 8089: Cache sysprefs using Koha::Cache"
This reverts commit 499f44fa1d.
2012-09-12 13:45:51 +02:00
Paul Poulain
1d1615f918 Revert "Bug 8089: Correct cache timeout to 1000"
This reverts commit eefeef0c1f.
2012-09-12 13:45:40 +02:00
Jared Camins-Esakov
eefeef0c1f Bug 8089: Correct cache timeout to 1000
There was a typo in the original patch for bug 8089 which set the cache
timeout on getAllLanguages to 10000. Correct it to 1000.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-07 16:28:33 +02:00