Commit graph

582 commits

Author SHA1 Message Date
Srdjan
12ff7355bb bug_7613: OCLC Connexion gateway
svc/import_bib:
* takes POST request with parameters in url and MARC XML as DATA
* pushes MARC XML to an impoort bach queue of type 'webservice'
* returns status and imported record XML
* is a drop-in replacement for svc/new_bib

misc/cronjobs/import_webservice_batch.pl:
* a cron job for processing impoort bach queues of type 'webservice'
* batches can also be processed through the UI

misc/bin/connexion_import_daemon.pl:
* a daemon that listens for OCLC Connexion requests and is compliant
  with OCLC Gateway spec
* takes request with MARC XML
* takes import batch params from a config file and forwards the lot to
  svc/import_bib
* returns status

ImportBatches:
* Added new import batch type of 'webservice'
* Changed interface to AddImportBatch() - now it takes a hashref
* Replaced batch_type = 'batch' with
  batch_type IN ( 'batch', 'webservice' ) in some SELECTs

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
2012-04-06 17:26:20 +02:00
Paul Poulain
2bc542789f Merge remote-tracking branch 'origin/new/bug_7284' 2012-04-04 18:18:26 +02:00
MJ Ray
9d65f66536 bug 7284: fix package build problem, move BEGIN into new
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-04-04 18:18:12 +02:00
Chris Cormack
ec23131ea1 Bug 5549 : Fixing the test to only run if the test data exists
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
test passes after the patch. Win.
2012-03-27 09:18:37 +02:00
Jared Camins-Esakov
5ffa8f2a6a Bug 7702: [SIGNED-OFF] MARC21 heading tests should not run under UNIMARC
Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is
UNIMARC.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
I set marcflavour = UNIMARC for testing this.
Before the patch, t/Heading_MARC21.t fails. After the patch it
succeeds.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 15:53:01 +02:00
Chris Cormack
0c40ff9f98 Merge remote-tracking branch 'kc/master' into merged_5549
Fixed conflicts

Conflicts:
	catalogue/moredetail.pl
	installer/data/mysql/updatedatabase.pl
	koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
2012-03-22 09:36:55 +13:00
dd3ebe9a6e Bug 7310: Updated VirtualShelves unit test
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
2012-03-21 16:47:05 +01:00
Jared Camins-Esakov
9f7e340f82 Bug 7724: Skip Linker test if Zebra isn't set up
One of the tests in t/db_dependent/Linker_FirstMatch.t ony works if Zebra is
running and authorities have been indexed. This was causing Jenkins agitas.
The test should be skipped if Zebra isn't running or authorities have not been
indexed at the time the test is run.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-20 11:21:10 +01:00
Colin Campbell
e012957186 Bug 5549 : Koha::Calendar::addDate should not loop on -1
Control variable of loop should be absolute value
to avoid looping when backtracking
2012-03-20 13:26:36 +13:00
Colin Campbell
7a8bed5576 Bug 5549 : Daily loans should be due at 23:59
This was failing in one patch through CalcDueDate
2012-03-20 13:25:41 +13:00
Colin Campbell
b946d16ec5 Bug 5549 : Format due dates in opac
Further change to ensure that where dates are formatted from the
db form the duedate loses the 23:59
2012-03-20 13:24:51 +13:00
Colin Campbell
372216b9c8 Bug 5549 : Don't confuse the users with an irrelevant time
If the book is due at 23:59 the due time is irrelevant
and potentially confusing to the user add a DateUtils
routine that strips that off the returned display date
2012-03-20 13:24:32 +13:00
Colin Campbell
e4abe486da Bug 5549 : move rollingloans.t to db_dependent tests
This still needs a followup to make the tests pass with sample data
2012-03-20 13:24:00 +13:00
Colin Campbell
0a2b32675f Bug 5549 : Koha::Calendar needs to accept scalar add_durations 2012-03-20 13:23:26 +13:00
Colin Campbell
40b907bc0b Bug 5549 : Make Koha::Calendar testable
Add a testing option
Add a script with tests
Some simplifications of the logic
2012-03-20 13:23:13 +13:00
Colin Campbell
8cc5b3452e Bug 5549 : DateUtils add subroutine format_sqldatetime
convenience method for a frequent use of the other
methods in the module
2012-03-20 12:35:40 +13:00
Colin Campbell
170508e7a0 Bug 5549 : DateUtils handling odd cases
Really we should not have them but they are in
existing code. They were not handled 100%
added appropriate tests
2012-03-20 12:28:22 +13:00
Colin Campbell
9b966c1571 Bug 5549 : Merge old and new DateUtils tests 2012-03-20 12:27:18 +13:00
Colin Campbell
a898a0f3fb Bug 5549 : Add Koha directory to testcritic 2012-03-20 12:25:16 +13:00
Colin Campbell
22139db49d Bug 5549 : Add Tests For Koha::DateUtils
Add testscript for DateUtils
Add a parameter to override system pref to output_pref not for
use in calling software (its superfluous) but to enable testing
of call with different settings
2012-03-20 12:24:37 +13:00
Colin Campbell
aa159edb37 Bug 5549 : Need a testscript for rolling loans
Note from Chris C:
This needs to be changed to work with the sample data, follow up to be
done
2012-03-20 12:22:22 +13:00
Colin Campbell
894a393950 Bug 5549 : Add DateUtils Module
Wraps DateTime object creation from a string
as a tool to enable move to dt objects for more
flexibility
2012-03-20 12:10:57 +13:00
59483744ae 7661 Followup for resolving moved Record test 2012-03-14 14:59:46 +01:00
Paul Poulain
befebb8a5c bug 7661: Moving C4::tests to unit tests 2012-03-13 18:07:54 +01:00
Srdjan Jankovic
a9ded4fa00 bug_7001: Issue and Reserve slips are notices.
Branches can have their own version of notices - added branchcode to
letter table.
Support html notices - added is_html to letter table.
Support for borrower attributes in templates.
GetPreparedletter() is the interface for compiling letters (notices).
Sysprefs for notice and slips stylesheets
Added TRANSFERSLIP to the letters

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-09 10:11:20 +01:00
Jared Camins-Esakov
5207699f98 signed off Bug 7284: Authority matching improvements
Squashed patch incorporating all previous patches (there is no functional
change compared to the previous version of this patch, this patch merely
squashes the original patch and follow-up, and rebases on latest master).

=== TL;DR VERSION ===
*** Installation ***
1. Run installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt1
and installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt2
2. Make sure you copy the following files from kohaclone to koha-dev:
etc/zeradb/authorities/etc/bib1.att,
etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml,
etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl,
etc/zebradb/marc_defs/marc21/authorities/koha-indexdefs-to-zebra.xsl, and
etc/zebradb/marc_defs/unimarc/authorities/record.abs
3. Run misc/migration_tools/rebuild_zebra.pl -a -r

*** New sysprefs ***
* AutoCreateAuthorities
* CatalogModuleRelink
* LinkerModule
* LinkerOptions
* LinkerRelink
* LinkerKeepStale

*** Important notes ***
You must have rebuild_zebra processing the zebraqueue for bibs when testing this
patch.

=== DESCRIPTION ===

*** Cataloging module ***
* Added an additional box to the authority finder plugin for "Heading match,"
  which consults not just the main entry but also See-from and See-also-from
  headings.

* With this patch, the automatic authority linking will actually work properly
  in the cataloging module. As Owen pointed out while testing the patch,
  though, longtime users of Koha will not be expecting that. In keeping with
  the principles of least surprise and maximum configurability, a new syspref,
  CatalogModuleRelink makes it possible to disable authority relinking in the
  cataloging module only (i.e. leaving it enabled for future runs of
  link_bibs_to_authorities.pl).  Note that though the default behavior matches
  the current behavior of Koha, it does not match the intended behavior.
  Libraries that want the intended behavior rather than the current behavior
  will need to adjust the CatalogModuleRelink syspref.

*** misc/link_bibs_to_authorities.pl ***
Added the following options to the misc/link_bibs_to_authorities.pl script:
--auth-limit        Only process those headings that match the authorities
                    matching the user-specified WHERE clause.
--bib-limit         Only process those bib records that match the
                    user-specified WHERE clause.
--commit            Commit the results to the database after every N records
                    are processed.
--link-report       Display a report of all the headings that were processed.

Converted misc/link_bibs_to_authorities.pl to use POD.

Added a detailed report of headings that linked, did not link, and linked
in a "fuzzy" fashion (the exact semantics of fuzzy are up to the individual
linker modules) during the run.

*** C4::Linker ***
Implemented new C4::Linker functionality to make it possible to easily add
custom authority linker algorithms. Currently available linker options are:
* Default: retains the current behavior of only creating links when there is
  an exact match to one and only one authority record; if the 'broader_headings'
  option is enabled, it will try to link to headings to authority records for
  broader headings by removing subfields from the end of the heading (NOTE:
  test the results before enabling broader_headings in a production system
  because its usefulness is very much dependent on individual sites' authority
  files)
* First Match: based on Default, creates a link to the *first* authority
  record that matches a given heading, even if there is more than one
  authority record that matches
* Last Match: based on Default, creates a link to the *last* authority
  record that matches a given heading, even if there is more than one record
  that matches

The API for linker modules is very simple. All modules should implement the
following two functions:
<get_link ($field)> - return the authid for the authority that should be
linked to the provided MARC::Field object, and a boolean to indicate whether
the match is "fuzzy" (the semantics of "fuzzy" are up to the individual plugin).
In order to handle authority limits, get_link should always end with:
    return $self->SUPER::_handle_auth_limit($authid), $fuzzy;

<flip_heading ($field)> - return a MARC::Field object with the heading flipped
to the preferred form. At present this routine is not used, and can be a stub.

Made the linking functionality use the SearchAuthorities in C4::AuthoritiesMarc
rather than SimpleSearch in C4::Search. Once C4::Search has been refactored,
SearchAuthorities should be rewritten to simply call into C4::Search. However,
at this time C4::Search cannot handle authority searching. Also fixed numerous
performance issues in SearchAuthorities and the Linker script:
* Correctly destroy ZOOM recordsets in SearchAuthorities when finished. If left
  undestroyed, efficiency appears to approach O(log n^n)
* Add an optional $skipmetadata flag to SearchAuthorities that can be used to
  avoid additional calls into Zebra when all that is wanted are authority
  records and not statistics about their use

*** New sysprefs ***
* AutoCreateAuthorities - When this and BiblioAddsAuthorities are both turned
  on, automatically create authority records for headings that don't have
  any authority link when cataloging. When BiblioAddsAuthorities is on and
  AutoCreateAuthorities is turned off, do not automatically generate authority
  records, but allow the user to enter headings that don't match an existing
  authority. When BiblioAddsAuthorities is off, this has no effect.
* CatalogModuleRelink - when turned on, the automatic linker will relink
  headings when a record is saved in the cataloging module when LinkerRelink
  is turned on, even if the headings were manually linked to a different
  authority by the cataloger. When turned off (the default), the automatic
  linker will not relink any headings that have already been linked when a
  record is saved.
* LinkerModule - Chooses which linker module to use for matching headings
  (current options are as described above in the section on linker options:
  "Default," "FirstMatch," and "LastMatch")
* LinkerOptions - A pipe-separated list of options to set for the authority
  linker (at the moment, the only option available is "broader_headings," which
  is described below)
* LinkerRelink - When turned on, the linker will confirm the links for headings
  that have previously been linked to an authority record when it runs. When
  turned off, any heading with an existing link will be ignored.
* LinkerKeepStale - When turned on, the linker will never *delete* a link to an
  authority record, though, depending on the value of LinkerRelink, it may
  change the link.

*** Other changes ***
* Cleaned up authorities code by removing unused functions and adding
  unimplemented functions and added some unit tests.

* This patch also modifies the authority indexing to remove trailing punctuation
  from Match indexes.

* Replace the old BiblioAddAuthorities subroutines with calls into the new
  C4::Linker routines.

* Add a simple implementation for C4::Heading::UNIMARC. (With thanks to F.
  Demians, 2011.01.09) Correct C4::Heading::UNIMARC class loading. Create
  biblio tag to authority types data structure at initialization rather than
  querying DB.

* Ran perltidy on all changed code.

*** Linker Options ***
Enter "broader_headings" in LinkerOptions. With this option, the linker will
try to match the following heading as follows:
=600  10$aCamins-Esakov, Jared$xCoin collections$vCatalogs$vEarly works to
1800.

First: Camins-Esakov, Jared--Coin collections--Catalogs--Early works to 1800
Next: Camins-Esakov, Jared--Coin collections--Catalogs
Next: Camins-Esakov, Jared--Coin collections
Next: Camins-Esakov, Jared (matches! if a previous attempt had matched, it
would not have tried this)

This is probably relevant only to MARC21 and LCSH, but could potentially be of
great use to libraries that make heavy use of floating subdivisions.

=== TESTING PLAN ===

Note: all of these tests require that you have some authority records,
preferably for headings that actually appear in your bibliographic data. At
least one authority record must contain a "see from" reference (remember which
one contains this, as you'll need it for some of the tests). The number shown
in the "Used in" column in the authority module is populated using Zebra
searches of the bibliographic database, so you *must* have
rebuild_zebra.pl -b -z [-x] running in cron, or manually run it after running
the linker.

*** Testing the Heading match in the cataloging plugin ***
1.  Create a new record, and open the cataloging plugin for an
    authority-controlled field.
2.  Search for an authority by entering the "see from" term in the Heading Match
    box
3.  Confirm that the appropriate heading shows up
4.  Search for an authority by entering the preferred heading into the Main
    entry or Main entry ($a only) box (i.e., repeat the procedure you usually
    use for cataloging, whatever that may be)
5.  Confirm that the appropriate heading shows up

*** Testing the cataloging interface ***
6.  Turn off BiblioAddsAuthorities
7.  Confirm that you cannot enter text directly in an authority-controlled field
8.  Confirm that if you search for a heading using the authority control plugin
    the heading is inserted (note, however, that this patch does not AND IS NOT
    INTENDED TO fix the bugs in the authority plugin with duplicate subfields;
    those are wholly out of scope- this check is for regressions)
9.  Turn on BiblioAddsAuthorities and AutoCreateAuthorities
10. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is automatically created, and the heading you
    entered linked
11. Confirm that if you enter a heading with only a subfield $a that fully
    *matches* an existing heading (i.e. the existing heading has only
    subfield $a populated), the authid for that heading is inserted into
    subfield $9
12. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
13. Turn on BiblioAddsAuthorities and turn off AutoCreateAuthorities
14. Confirm that you can enter text directly into an authority-controlled field,
    and if you enter a heading that doesn't currently have an authority record,
    an authority record stub is *not* created
15. Confirm that if you enter a heading with only a subfield $a that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
16. Confirm that if you enter a heading with multiple subfields that *matches*
    an existing heading, the authid for that heading is inserted into
    subfield $9
17. Create a record and link an authority record to an authorized field using
    the authority plugin.
18. Save the record. Ensure that the heading is linked to the appropriate
    authority.
19. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
20. Ensure that the heading remains linked to that same authority.
21. Change CatalogModuleRelink to "on."
22. Open the record. Use the authority plugin to link that heading to the
    same authority record you did earlier.
23. Save the record. Ensure that the heading is linked to the appropriate
    authority.
24. Open the record. Change the heading manually to something else, leaving
    the link. Save the record.
25. Ensure that the heading is no longer linked to the old authority record.

*** Testing link_bibs_to_authorities.pl ***
26. Set LinkerModule to "Default," turn on LinkerRelink and
    BiblioAddsAuthorities, and turn AutoCreateAuthorities and
    LinkerKeepStale off
27. Edit one bib record so that an authority controlled field that has already
    been linked (i.e. has data in $9) has a heading that does not match any
    authority record in your database
28. Run misc/link_bibs_to_authorities.pl --link-report --verbose --test (you may
    want to pipe the output into less or a file, as the result is quite a lot of
    information)
29. Look over the report to see if the headings that you have authority records
    for report being matched, that the heading you modified in step 2 is
    reported as "unlinked," and confirm that no changes were actually made to
    the database (to check this, look at the bib record you edited earlier, and
    check that the authid in the field you edited hasn't changed)
30. Run misc/link_bibs_to_authorities.pl --link-report --verbose (you may want
    to pipe the output into less or a file, as the result is quite a lot of
    information)
31. Check that the heading you modified has been unlinked
32. Change the modified heading back to whatever it was, but don't use the
    authority control plugin to populate $9
33. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
34. Confirm that the heading has been linked to the correct authority record
35. Turn LinkerKeepStale on
36. Change that heading to something else
37. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
38. Confirm that the $9 has not changed
39. Turn LinkerKeepStale off
40. Create two authorities with the same heading
41. Run misc/migration_tools/rebuild_zebra.pl -a -z
42. Enter that heading into the bibliographic record you are working with
43. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
44. Confirm that the heading has not been linked
45. Change LinkerModule to "FirstMatch"
46. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
47. Confirm that the heading has been linked to the first authority record it
    matches
48. Change LinkerModule to "LastMatch"
49. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --bib-limit="biblionumber=${BIB}" (replacing ${BIB} with the biblionumber
    of the record you've been editing)
50. Confirm that the heading has been linked to the second authority record it
    matches
51. Run misc/link_bibs_to_authorities.pl --link-report --verbose
    --auth-limit="authid=${AUTH}" (replacing ${AUTH} with an authid)
52. Confirm that only that heading is displayed in the report, and only those
    bibs with that heading have been changed

If all those things worked, good news! You're ready to sign off on the patch
for bug 7284.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master and squashed follow-up, 16 February 2012
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master, 21 February 2012

Signed-off-by: schuster <dschust1@gmail.com>
2012-03-07 17:34:11 +01:00
Katrin Fischer
a529262501 Bug 7576: Add ISSN to SearchForTitleIn preference
Adds a new placeholder {ISSN} to the system preference SearchForTitleIn.
For a record with multiple ISSNs only the first ISSN will be used.

Addition: Makes a small change to GetMarcControlnumber so that it checks for
NORMARC too. If you set your system preference to NORMARC, it should output
{CONTROLNUMBER} correctly now.

For testing add following code to the system preference and check output
of SearchForTitleIn for different records in your OPAC and all 3 available
views (normal, MARC and ISBD):
<li>ISSN: {ISSN}</li>
<li>ISBN: {ISBN}</li>
<li>001: {CONTROLNUMBER}</li>

Patch also includes some unit tests:
perl t/db_dependent/Biblio.t

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Tested with marcflavour = NORMARC, on one book and one periodical record.

* Book

- Before the patch:
ISSN: {ISSN}
ISBN: 0375726446
001:

- After the patch:
ISSN:
ISBN: 0375726446
001: 022976914

* Journal

- Before the patch:
ISSN: {ISSN}
ISBN:
001:

- After the patch:
ISSN: 1890-6931
ISBN:
001: 080721370

Looks good in all 3 views! Thanks for fixing the 001 thing for NORMARC!

Also tested with marcflavour = MARC21, on the same records with the same good
results. Signing off!

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Tested marcflavour= UNIMARC, works fine too
2012-02-27 11:44:20 +01:00
Paul Poulain
f7a525fa09 Merge remote-tracking branch 'origin/new/bug_6875' 2012-02-20 16:45:42 +01:00
Paul Poulain
49b167e848 Bug 6875 de nesting C4::Biblio
C4::Biblio is used in many many places. The goal of this cleaning is to do from C4::Biblio a package with as many dependancies as possible.

* C4::Heading is called only in 1 place, highly rarely used (only in 1 misc/link_bibs_to_authorities.pl), moving to require
* PrepareItemrecordDisplay is a sub that is more related to Items, moving it here. It means some scripts that used this sub must be checked against use C4::Items
* C4::Items is needed in EmbedItemsInMarcBiblio, moving it only in this sub, and switching to require
* 2 subs are totally useless z3950_extended_services and set_service_options, removing them

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No test plan included, but tested some opac and cataloging functions.
Code looks good. Marked as Passed QA.
2012-02-20 16:35:17 +01:00
Paul Poulain
46a5154df9 Bug 6137 follow-up, moving new test to db_dependent directory 2012-02-17 18:40:33 +01:00
Julian Maurice
76be6208ee Bug 6137: unit tests for C4::Circulation::_GetCircControlBranch
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-17 18:38:43 +01:00
Jonathan Druart
0200639b00 Bug 5346: Linking suggestions and orders.
Display suggestion info in acquisition module:
  basket.pl
  neworderempty.pl
  orderreceive.pl
  parcel.pl

To Test:
Create a suggestion and accept it.
Create a new order from this suggestion
Receive this order

For each step, check if suggestion info are visible.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test provides more unit tests, all complete successfully.
perl t/db_dependent/Suggestions.t
Note: test case should be cleaned up after running tests.

Display changes are consistent and information about the suggestion
is shown on every important screen now.

I created an order from a suggestion and one from an existing record.

No problems found.
2012-02-17 10:27:52 +01:00
Paul Poulain
324615e396 Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-13 15:06:16 +01:00
Chris Cormack
181f3b36ee Bug 5327 : Removing a broken test
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-02-13 15:04:43 +01:00
Paul Poulain
28646dd550 Merge remote-tracking branch 'origin/new/bug_929' 2012-02-07 16:43:29 +01:00
Chris Cormack
6a06860f0c Bug 929 : Follow up, shifting test 2012-02-07 16:42:22 +01:00
Paul Poulain
5900dfff9a Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-01 18:15:45 +01:00
Robin Sheat
8aacb28fc0 Bug 5327 - move another test around 2012-02-01 18:15:21 +01:00
Chris Cormack
227cafe8c2 Bug 5327: Shifting a db dependent test to the right place
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
2012-02-01 18:15:19 +01:00
Paul Poulain
d508f0244b Merge remote-tracking branch 'origin/new/bug_5327' 2012-01-31 17:30:28 +01:00
Sam Sanders
a0c1414f6d Bug 5327 added tests for C4/Languages.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:51 +01:00
Connor Dewar
597fabf4f4 Bug 5327 Added unit tests for C4/SIP/ILS/Transaction/Renew.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:51 +01:00
Bart Jorgensen
37c9ffcf7d Bug 5327 added unit tests for C4/TmplToken.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:50 +01:00
Kate Henderson
66fecdd798 Bug 5327 added unit tests for C4/Search_PazPar2.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:50 +01:00
Sam Sanders
77a9e9162e added unit tests for C4/Serials.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
2012-01-31 17:21:50 +01:00
Kate Henderson
1e2e7b9dd8 Bug 5327 added unit tests for C4/Scheduler.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:49 +01:00
Sam Sanders
0618b9db72 bug 5327 added unit tests for C4/Ris.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:49 +01:00
Jono Mingard
e81cbd7fe0 Bug 5327 added unit tests for C4/Creators/PDF.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:48 +01:00
Sam Sanders
200b5a8231 Bug 5327 added unit tests for C4/ClassSortRoutine/LCC
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:48 +01:00
Jorgia Kelsey
1a20feb4ca Bug 5327 added unit tests for C4/Barcodes_PrinterConfig.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:48 +01:00
Jono Mingard
5579abe41f Bug 5327 added unit tests for C4/AuthoritiesMarc/MARC21.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:47 +01:00
Sam Sanders
3b9722c7dd Bug 5327 added tests for C4/Labels.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:47 +01:00
Sam Sanders
f918c57e89 bug 5327 added unit test for C4/Csv.pm
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
2012-01-31 17:21:47 +01:00
Colin Campbell
263dded818 Bug 6752: Be stricter with utf-8 encoding of output
use encoding(UTF-8) rather than utf-8 for stricter
encoding
Marking output as ':utf8' only flags the data as utf8
using :encoding(UTF-8) also checks it as valid utf-8
see binmode in perlfunc for more details
In accordance with the robustness principle input
filehandles have not been changed as code may make
the undocumented assumption that invalid utf-8 is present
in the imput
Fixes errors reported by t/00-testcritic.t
Where feasable some filehandles have been made lexical rather than
reusing global filehandle vars

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-27 12:11:06 +01:00
Chris Cormack
c77b8756f7 Updating perlcriticrc to allow Modern::Perl to suffice instead of use warnings; and use strict;
http://bugs.koha-community.org/show_bug.cgi?id=6836

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2012-01-27 11:33:15 +01:00
Jonathan Druart
d12a381f49 Bug 5347: Followup change class for message + Unit test 2012-01-20 14:12:28 +01:00
Paul Poulain
a642b1c72a Merge remote-tracking branch 'origin/new/bug_5327' 2012-01-17 15:35:19 +01:00
Sam Sanders
dbb29b4042 bug 5327 add tests for C4/BackgroundJob.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl t/db_dependent/BackgroundJob.t
All tests complete successfully.

Note: Test 11 does not tell what it's about, but it has been there before.
2012-01-17 15:31:56 +01:00
Connor Dewar
e96c92d077 Bug 5327 Added unit tests for C4/Reports.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl t/Reports.t b/t/Reports.t
All tests complete successfully.
2012-01-17 15:31:56 +01:00
Connor Dewar
f053ca0c22 Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-01-17 15:31:55 +01:00
Connor Dewar
995485e574 Bug 5327 added unit tests for C4/ClassSortRoutine/Generic
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-01-17 15:31:55 +01:00
Paul Poulain
6456afea95 Bug 6990 follow up PODDOC & unit test updating
This patch removes the TransformKohaToMarcOneField sub, but there was some remaining POD & unit test about it
2012-01-17 12:07:03 +01:00
Paul Poulain
d7a51d83c1 Merge remote-tracking branch 'origin/new/bug_6132' 2012-01-16 14:53:08 +01:00
Julian Maurice
6eac5284ee Bug 6132: Add unit test for system preferences
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-16 14:52:24 +01:00
Chris Cormack
55d0b65522 Bug 929 : Follow up adding unit tests, discovered C4::Dates cached the syspref with no way to clear it, fixed also. 2012-01-13 16:17:48 +01:00
Chris Cormack
e6bbb97942 Bug 929: Follow up adding the Koha:: namespace to the list of modules to test 2012-01-13 16:17:46 +01:00
Liz Rea
3c12d5f2f6 Bug 7333 - Fixing up db_dependent/Search.t to use sample data Thanks to Chris N. for helping figure out that it was because there were no French stopwords in the DB that the test was failing.
Patch changes the French string (with French stopwords) to an English string with English stopwords, as only English stopwords are installed in the default data.

This patch will allow Search.t to run on the database attached to this bug.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 18:41:10 +01:00
bb92ac1ee0 Test to check for XXX in kohaversion.pl or updatedatabase.pl
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the original patch of Chris to add two exceptions for a line in SetVersion and TransferToNum.

http://bugs.koha-community.org/show_bug.cgi?id=6700
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 17:56:03 +01:00
Srdjan Jankovic
6e07fd7b00 bug_2830: Remove reserve when checking out if the borrower is not the first one in the reserve queue
To test:
Create 4 holds on a bib, for patrons A, B, C, and D,

Check in the item to mark hold as waiting for patron A
Check out the item to patron B -> reserve for patron B should be removed
Check in the item to mark hold as waiting for patron A
Check out the item to Patron A, hold should complete normally
Check in the item to mark hold as waiting for patron C
Check out the item to patron D -> reserve for patron D should be removed.
Check in the item to mark hold as waiting for patron C
Check out the item to patron C, hold should complete normally
Check in the item -> there should be no more reserves.

We also tested:
Created 4 holds on a bib with two items, for patrons A, B, C, and D

All worked as expected.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 16:21:38 +01:00
Paul Poulain
a1ec828453 Merge remote-tracking branch 'origin/new/bug_5327' 2011-12-16 15:45:12 +01:00
Duncan Tyler
3ae23cd6cf Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test requires a database installed using the sample data.
All tests pass.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 15:43:04 +01:00
Liz Rea
b955692c84 Bug 7333 - modifying Members.t to use a branchcode that exists in the sample data
To test:
Create a fresh koha db with all of the sample data (if you have one that has the sample branches in it, that will work too)
run the test: prove t/db_dependent/Members.t

All subtests should complete.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests complete successfully with my database created from
sample data and with the database provided on the bug.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 18:13:29 +01:00
Paul Poulain
8df873c1a2 Revert "Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm"
This reverts commit 06c822c37c.
2011-12-15 16:14:35 +01:00
Duncan Tyler
06c822c37c Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test requires a database installed using the sample data.
All tests pass.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:52:50 +01:00
Chris Hall
64a9c64100 Added missing reference case to Boolean.t and corrected count
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:50:41 +01:00
Paul Poulain
e12fca0eb8 Merge remote-tracking branch 'origin/master' into new/bug_5327 2011-12-15 13:49:47 +01:00
Chris Hall
dfa4b73737 Added missing reference case to Boolean.t and corrected count
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:41:47 +01:00
Duncan Tyler
47b514cf56 Added unit tests for Scrubber
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:41:43 +01:00
Duncan Tyler
bb79d37b87 Added unit test for AuthoritiesMarc/UNIMARC.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:41:41 +01:00
Duncan Tyler
7876d4fa8d Added unit tests for Sip Checksum.pm
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 13:41:37 +01:00
Chris Cormack
9c66c42764 Bug 7215 : The Module changed, but the tests weren't updated to reflect that
Updating the test

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-13 14:25:46 +01:00
Paul Poulain
484c1f6dea Merge remote-tracking branch 'origin/new/bug_7141' 2011-12-08 11:05:35 +01:00
Chris Cormack
ce59911932 Bug 7141 : Changing test to match new formatting of xsl style sheet
http://bugs.koha-community.org/show_bug.cgi?id=7141
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
verified tests pass

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-08 10:51:25 +01:00
Chris Cormack
7dbb966b49 Bug 6679 : Allowing eval require
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-08 10:25:14 +01:00
Chris Cormack
dc6e1031f8 Bug 6679 : Adding license statement and stopping declaring variables in a conditional 2011-12-08 10:11:27 +01:00
Chris Cormack
a047dea5e4 Bug 6679 : cataloguing/ now passing critic tests
Declare variables outside of conditionals
Don't use prototypes http://www.modernperlbooks.com/mt/2009/08/the-problem-with-prototypes.html
Use ":encoding(UTF-8)" to get strict validation.
2011-12-08 10:11:23 +01:00
Paul Poulain
b9d743a928 Merge remote-tracking branch 'origin/master' into new/bug_6679
Conflicts:
	catalogue/showmarc.pl
2011-12-08 10:08:44 +01:00
Chris Cormack
4a14e7dbe6 Bug 6679: catalogue/ now passing perl critic tests
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-08 10:05:48 +01:00
Paul Poulain
e06f3ee0fa Jenkins complaining = fixing number of tests
(see jenkins build http://jenkins.koha-community.org/job/Koha_master/557/#showFailuresLink)
2011-12-07 18:04:10 +01:00
Paul Poulain
ffb544e8e4 t/UploadedFile, updated comment 2011-12-07 16:37:31 +01:00
Chris Cormack
94e1691a74 Bug 5327: Fixing the Members.t test
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm Members.t tests complete
2011-12-07 16:17:11 +01:00
Chris Cormack
dbe36a2bf3 Bug 5327 : Fixing unit test for SQLHelper.pm
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Confirm that all SQLHelper tests pass.
2011-12-07 16:17:10 +01:00
Chris Cormack
19d071910f Bug 5327 : Complete coverage for BackgroundJob.pm
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests run without problems.
2011-12-07 16:17:08 +01:00
Chris Cormack
a9bbeae6cc Bug 5327 : Adding more unit tests
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
New tests run without problems.
2011-12-07 16:17:07 +01:00
Chris Hall
16c51d0376 Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-12-07 16:17:05 +01:00
Maxime Pelletier
d2c101a8a9 fix test xml records
http://bugs.koha-community.org/show_bug.cgi?id=5327
2011-12-07 16:17:03 +01:00
Paul Poulain
13f29dd7f3 Test suite: ignoring backups from vi (files ending with a ~)
On my laptop, this test was failing because some scripts had a conflict marker in a backup ... of a conflict I just fixed!
ignoring any file ending with a ~
2011-12-07 15:17:54 +01:00
Ian Walls
d059079caf Bug 2346: Remove C4::Overdues::UpdateBorrowerDebarred in favour of C4::Members::DebarMember
Removes now-unused subroutine from C4::Overdues, as well as the db_dependent unit test

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-12-06 19:12:20 +01:00
Paul Poulain
d019b4c63a Bug 6328 Fixes for comment 35
* correctly indenting with tab the debarrcomment field
* setdebar.pl is called without status parameter, thus it is not working anymore. It's fixed & some dead code has been removed. To test : debar someone, then go to patron detail page and click "lift debarment"
* the test function had not been updated. The fix define a debarment date of 2099-12-31 (no limit)
2011-11-25 14:00:47 +01:00
Chris Nighswonger
a340ded2ca Bug 7095: Fixing cut and paste error and removing the use of diag() as this does not produce output when the test is run in a harness
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-11-18 22:51:28 +01:00
Srdjan Jankovic
18b8991cf1 bug_6253: Unified member Search()
Removed SearchMembers() and replaced with more generic Search()
Amended Search() to try cardnumber first
Replaced SearchMembers() calls with Search()
Replaced SELECT with Search() where appropriate
C4::SQLHelper:
- added support for '' key for search filter.
- when passing an array to filter, join with OR (rather than AND)
- added support for key => [val1, val2] in filter
- did not document - there was no input documentation to start with,
  and SQLHelper should be replaced with something better anyway

Signed-off-by: Liz Rea <lrea@nekls.org>
(again - testing merge issue)
The functionality of the patch seems to be maintained with Biblibre's changes.

I tested the following:
Extended attribute searching: works
3 part name searching: works
2 part name searching: works
1 part name searching: works

From:
mainpage.pl
members-home.pl
	Patron search limited by branch: Works
	Patron search limited by patron category: works
	Ordering by cardnumber instead of surname: works
The "Check Out" field in the masthead.

Circ Autocomplete is not reliably functional at this time, but the problem appears to predate this patch.
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 16:23:02 +13:00
Paul Poulain
69732f5c62 Bug 7034: de-nesting C4/Branch.pm
use C4::Koha was loaded only to call C4::Koha::get_infos_of in get_branchinfos_of

the sub get_branchinfos_of was used nowhere
(checked with "grep -R get_branchinfos_of *")
only one reference was made to get_branchinfos_of, in reserve/request.pl, but the sub was not used in fact (maybe removed previously & silently)

This patch removes sub get_branchinfos_of and use C4::Koha in C4::Branch, as well as the reference in request.pl and the t test

The patch doesn't remove use C4::Branch in reserve/request.pl, as it's still used for other subroutines.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-19 03:23:31 +13:00
Srdjan Jankovic
4770555855 bug_5533: Slightly improved marking items as lost
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:01:39 +13:00
Chris Cormack
7244d5060b Fixing a broken test 2011-09-26 11:55:58 +13:00
MJ Ray
a746e11c14 Bug 6460: alternative fix, updating template and script instead of C4::Log
Add some test cases and fix a bug in C4::Log found by in review.
Thanks-to: Katrin Fischer.

Signed-off-by: Liz Rea <lrea@nekls.org>
Passes test, interface works as expected.

Signed-off-by: Liz Rea <lrea@nekls.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-24 10:01:09 +12:00
Chris Cormack
e1bb9e5137 Bug 6679 : Enable Critic tests for authorities and fixed resulting warnings
Signed-off-by: Ian <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-23 14:18:21 +12:00
Chris Cormack
7cdea5de35 Bug 6679 Fix scripts in admin & acqui to pass Perl::Critic
Scripts in admin & acqui subdirectores weren't passing t/00-testcritic.t. This
patch add admin & acqui scripts to test case and fix various errors related to
Perl::Critic compliancy.

- Fixing a style error to pass Perl::Critic, plus silencing a warn
- More style errors, plus fixing a security issue
- Explicitly using Carp

Contrary to common belief, subroutine prototypes do not enable
compile-time checks for proper arguments. Don't use them.

Defining a named sub within another sub, does not prevent that
subroutine being global

Signed-off-by: Frédéric Demians <frederic@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-21 14:56:29 +12:00
Srdjan Jankovic
54d38461f0 Bug 6721 - improve searching in the acquisitions system
This allows a basket to be searched for by name or invoice number from
anywhere in the acquisitions system. It is accessible by clicking on
"orders search", clicking the '[+]' and filling in the basket or invoice
no. fields.

Author:    Srdjan Jankovic <srdjan@catalyst.net.nz>
Author:    Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-26 11:34:27 +12:00
d2f49e1976 bug 5653: use itemcallnumber in bib label layouts
The sample bib label layouts and the hard-coded default
format_string for new layouts used 'callnumber' when they
should have used 'itemcallnumber', preventing call numbers
from being printed on spine labels that use the system-supplied
layouts.  Besides correcting the sample data, this patch
now also enshrines 'callnumber' as an alias for 'itemcallnumber'.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
After applying patch it works for new and old layouts (itemcallnumber and callnumber).

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-13 11:15:34 +12:00
Chris Cormack
7aa3a05591 Merge remote-tracking branch 'kc/master' into new/bug_5683 2011-06-02 09:02:50 +12:00
Jared Camins-Esakov
d949472324 Add unit tests to ensure bug 5683 doesn't reappear
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
2011-06-02 08:46:40 +12:00
Colin Campbell
d8b362e0f9 Bug 5415 Let calls of SimpleSearch utilize considtent interface
Remove some unnecessary checks when check of error is
sufficient. Make the order in some cases more logical
Should remove some possibilities of runtime warning noise.
Although some calls belong to the 'Nothing could
ever go wrong' school have added some warnings

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 13:52:57 +12:00
b9cee99da4 Bug 5065 Add ability to choose framework on import
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-21 20:36:35 +13:00
Julian Maurice
b1e3b6753e Follow up for bug 5880: Improved unit test
The unit test Koha.t now skip tests of the two subroutines if the insert
query failed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-18 09:10:43 +13:00
Julian Maurice
1eb9d9e581 Follow up for bug 5880: Added unit tests for the two new subroutines
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-18 09:10:40 +13:00
Colin Campbell
5f7b1a58f0 Bug 5485: Add script to run Test::Perl::Critic
Tests are run if TEST_QA environment variable is set
and Test::Perl::Critic is installed
e.g.
TEST_QA=1 prove =l t/00-testcritic.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-17 12:35:58 +13:00
Chris Cormack
8215cc8bad Bug 5595 : Fixing a security glitch (please always use placeholders or
dbh->quote and fixing the tests
2011-03-13 20:30:13 +13:00
Colin Campbell
0d082204ea Bug5063: C4::Bookseller Changes
Merge unfao changes to C4::Bookseller
Enable warnings in Bookseller.pm
Some cleanups in Bookseller code
Do not export everything by default
Display vendors more rationally
    Was displaying by id make it name as the searchstring is for all
    embedded substrings
Have removed "if mysql" logic as we want to deal with this by
    abstracting the DB interaction and it makes cleaner code until then

Sponsered by UN FAO, Rome

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-12 08:42:26 +13:00
Robin Sheat
9df2a4a8fc Bug 5477 [SIGN-OFF] Fix test cases that require database access
This moves the DB-requiring tests out of the way, with the exception of
00-load.t which is used by the git hooks. For it, it makes it skip
loading problematic modules. This allows 'make test' to complete successfully
without a database configured, wich is a required part of making packages.

This has been tested against the v3.02.03 tag and the master branch.

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-29 17:02:31 +13:00
Chris Cormack
d64008644a Bug 5327 fixing missing number of tests 2011-01-21 11:28:58 +13:00
Zach Sim
5f0f2e297a Added more unit tests to check when JSONStream should fail.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-21 10:57:00 +13:00
Zach Sim
434d9a3c66 Bug 5327: Added unit tests to Output_JSONStream.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-21 09:52:17 +13:00
Chris Cormack
1c89ce34b9 Bug 5327: small typo in the Members.t test 2011-01-20 20:14:04 +13:00
johnboy
669280c7ab Bug 5327 Made test file for Accounts.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-20 19:57:50 +13:00
Chris Cormack
314772637c Bug 5327: Shifting and little tidy up of the members tests 2011-01-20 11:53:06 +13:00
johnboy
d567945517 Bug 5327 Some tests added
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-20 11:33:01 +13:00
Chris Cormack
e03026adff Bug 5327 - Now we are doing db calls, we need to shift this to t/db_dependent 2011-01-19 13:38:52 +13:00
Zach Sim
b56121db02 Added unit tests to test all of get_amazon_tld in Amazon.pm.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 13:38:15 +13:00
Chris Cormack
73f0857003 Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-19 11:26:18 +13:00
Chris Cormack
23f92a8f8d Bug 5327: Little change to Record.t 2011-01-19 11:24:24 +13:00
johnboy
5aa8040875 Bug 5327 1 more test added.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 11:04:37 +13:00
Zach Sim
65e2cda8d2 Added unit tests for Biblio and moved it to db_dependent as it requires the database.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-19 11:03:19 +13:00
Chris Cormack
22e5f27ff4 Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-18 22:54:06 +13:00
Chris Cormack
4093615e9f Bug 5327 Cleaning up XISBN.t a bit 2011-01-18 22:52:02 +13:00
Chris Cormack
6c0b51460e Merge remote branch 'kc/new/bug_5327' into kcmaster 2011-01-18 19:55:12 +13:00
Chris Cormack
71a7d2ad38 Bug 5327 - Fixing a path issue with XISBN.t 2011-01-18 19:53:58 +13:00
Chris Cormack
c8ba99e155 Bug 5327 litte fix for Background tests 2011-01-18 16:35:08 +13:00
Chris Cormack
eff21765f9 Bug 5327 shifting database dependent modules and scripts to t/db_dependent 2011-01-18 16:18:37 +13:00
johnboy
cc039cdb0f bug 5327 updated test file
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:08:11 +13:00
Zach Sim
52762c6c79 Added unit tests using a test database for XISBN.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:04:15 +13:00
Zach Sim
f2d575c92c Created unit testing using the testdatabase for XISBN.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 16:03:11 +13:00
Zach Sim
3b22fc6cc0 Added extra unit tests to Debug.t
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:59:07 +13:00
johnboy
80f8c41e4c bug 5327 started testing
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:57:08 +13:00
johnboy
594a31bfe1 Bug 5327 Starting tests for BackgroundJob
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:56:48 +13:00
spartaness
3df717479c Bug 5327 Starting Unit Tests for Auth.pm
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 11:33:27 +13:00
claudia
81f9c4976c Bug 5327 removing uneeded tests
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-18 09:10:26 +13:00
Zach Sim
53a301b8f2 Bug 5327 - Adding UNIT Tests.
Squashed commit of the following:

commit 146d14665c52edaa85e38b70aabc9d52be5d64b6
Author: Zach Sim <joseph.zachariah.sim@gmail.com>
Date:   Mon Jan 17 16:07:24 2011 +1300

    Edited DisplayISBN to cleanup the ISBN using _isbn_cleanup if it is not 13 or 10 digits long.

commit ba97b26d9a25470b0717cdd60a3d4f7a5c459ca9
Author: Zach Sim <joseph.zachariah.sim@gmail.com>
Date:   Mon Jan 17 16:06:14 2011 +1300

    Added extra unit tests to test C4::Koha::DisplayISBN.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-17 16:25:08 +13:00
Colin Campbell
073fb1aee6 Bug 5611 Tidy up C4::Scrubber
Remove the unneeded package variables
Remove unnecessary variables
Removed some cargo-cult programming
Tidied the indentation from mix of tabs & spaces
Add a Test that we actually return the required class
of object

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-13 06:44:46 +13:00
Colin Campbell
0d5029ec5b Bug 5601 :: Add tests for bugfix
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-12 19:30:40 +13:00
Henri-Damien LAURENT
63a8c5bc9d MT3801 followup : Cannot claim for issues
was missing an opening (
Adding test script

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 13:30:47 +00:00
f36747f5e8 Fix for Bug 4473 - Recent comments view for the OPAC
- modifies opac-showreviews.pl to display recent comments for all
  titles, sorted in descending order by date.
- includes RSS feed
- includes (thanks to Chris N.):

[Enhancement][3.4] Add RFC822 Format to C4::Dates

This patch adds RFC822 formatting to C4::Dates. It also updates Dates.t
appropriately. Consult the POD for this module for how to use
this format.

Please note that this module *does not* handle TZ conversion at this point.
This means that the TZ portion of a RFC822 time will be truncated and the converted
time will be in the same TZ as was passed in. When generating an RFC822 time,
the local TZ offset will be included since none of the other supported formats
provide a means for including their TZ. This is not a problem introduced by the
addition of RFC822 formatting. Rather it is due to this module not having TZ
support to begin with.

Also note that the dow, moy abbreviations are English as required by
RFC822 section 3.3 (thanks to self for pointing that out).

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-13 09:43:01 +13:00
Koustubha Kale
e4cbc4f421 Bug 5418: Rev-5 patch new itemBarcodeInputFilter for libsuite8 style barcodes
In India a ILS product called Libsuite8 prints barcodes like b0007432. The barcode is not stored anywhere in libsuite8's database. Neither is barcode available in any of the reports generated by the software.

The barcode 'b0007432' when scanned into the libsuite8 software is de-constructed like 'b' which is the itemtype i.e. Book in this instance, and '7432' which is the 'Accession Number'. The software then takes the logged in staff's branchcode and does a join on three tables 'Location', 'Media_Type', and 'Books' to retrieve the particular record from the database.

There is no possibility of recreating the barcodes for insertion in Koha while doing a retrospective conversion, because of arbitrary length of the barcode string AND arbitrary number of zeros in the numeric part of the printed barcode AND the fact that there are no reports available from the software which contain barcodes AND the fact that the barcode is not stored in the database.
But most importantly due to the simple fact that printed barcodes are duplicated among branches.

Therefore this patch emulates the functionality of Libsuite8 software of converting the scanned barcode into one stored in Koha using the itemBarcodeInputFilter system preference.

To use this new itemBarcodeInputFilter systempreference choice called 'libsuite8', the barcodes stored in Koha must match the pattern of <branchcode>-<itemtype_code>-<accession_number>. This is easy to achieve while doing retrospective conversion from Libsuite8 to Koha.

As expected the itemBarcodeInputFilter will return unmodified barcode if presented with a barcode of pattern <branchcode>-<itemtype_code>-<accession_number>

This revision corrects the way updatedatabase.pl is changed in order to correctly update version and insert the libsuite8 option in the database. Also kohaversion.pl is changed in the recommended format of 3.0X.0X.XXX to reflect database has changed.

This revision also changes the erronorous itemBarcodeInputFilter description in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref from 'scanned patron barcodes' to 'scanned item barcodes' there by eliminating need for a separate patch for bug 5417.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

1) applied patch to HEAD
2) set next database number in kohaversion.pl and updatedatabase.pl
3) webinstaller kicked in, update ok
4) typed the barcodes from test cases into check-in

Barcodes used my local branch code, everything seemed ok to me.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-12 20:39:20 +13:00
Colin Campbell
78be08c73e Bug 5448 Use Test::More in Boolean.t
Use Test::More's structure as more readable
Replaced a test of an used function with a use_ok test
of the module

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-02 08:51:32 +13:00
4cef5ec961 bug 5400: new test case to find files with merge conflict markers
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-14 09:37:27 +13:00
35d2008ef0 bug 5393 [SIGNED-OFF]: add test case to check well-formedness of XML/XSLT files
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-13 11:51:49 +13:00
Colin Campbell
51eb4fa12e Bug 4305: Add test case for ISBN-13 to ISBN-10 conversion
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-13 06:43:49 +13:00
bcedff69bc bug 4305: add a couple test cases for _isbn_cleanup
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 10:26:57 +13:00
Chris Cormack
af1d829031 Merge remote branch 'kc/new/bug_5386' into kcmaster 2010-11-12 06:41:25 +13:00
e3322f732e bug 5386: remove dep on Path::Class from t/00-load.t
File::Spec is a core module, Path::Class isn't; not yet
worth adding a new dependency.

Also some minor whitepace cleanup.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 06:40:02 +13:00
Chris Cormack
235cf872a5 Merge remote branch 'kc/new/bug_5105' into kcmaster 2010-11-11 21:33:48 +13:00
5ebb5d4f4c Bug 5105 Regression test for switch statement
Add a test identifying Perl scripts and modules using switch statements.
This test file follow Chris pre-hook naming convention in order to be
triggered for patch submissions.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-11 21:32:31 +13:00
Chris Cormack
7ecf2c2dc4 Test modules compile
Script to test modules compile, when used with a pre-commit hook this
can test before a commit

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-11 21:31:02 +13:00
Chris Cormack
c836b63a7d Bug 5363 - Removing unused module (C4::Cache::FastMemcached)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-04 20:05:36 +13:00
f88f88dcc5 bug 5301: improve escaping of XML characters in bib output
<, >, ', or " in an item call number will no longer make
the bib displays break when using XSLT mode.

Added a new routine to C4::Koha, xml_escape(), to implement
converting &, <, >, ', and " to their corresponding
entities.

Patch loosely based on work done by Daniel Latrémolière <daniel.latremoliere@bulac.fr>

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-02 08:31:47 +13:00
7fd5071e67 bug 5327: follow-up to fix SIP tests
* removed t/SIP_SIPServer.t - despite the file name,
  C4/SIP/SIPserver.pm is not actually a module and
  cannot be 'used' or 'required'
* set module search path so that t/SIP_ILS.t and
  t/SIP_Sip.t will pass

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-01 15:35:52 +13:00
Katrin Fischer
e0892a5139 Bug 5327: More basic unit tests for C4 modules
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-01 15:35:50 +13:00
Nate Curulla
cea1ef2720 Bug 5327: Add unit test for ItemType.pm
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-31 22:16:47 +13:00
Daniel Grobani
c45b18251e unit test stub for Z3950.pm
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-31 10:33:35 +13:00
Brian Engard
69037606f5 Create Unit Test for ImportBatch
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-31 10:32:29 +13:00
Magnus Enger
d15790d9c5 Bug 5327: Add basic unit tests to some C4 modules
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-30 20:22:30 +13:00
Katrin Fischer
cc9a34c274 Bug 5327: Add basic unit tests to some C4 modules
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-30 20:12:53 +13:00
Nicole Engard
88acebeebe create unit test files
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-30 20:12:50 +13:00
Liz Rea
12f9aa973d Adding a simple test for Service.pm
At the advisement of the great Chris Cormack. (thanks for the lesson)

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-10-30 20:12:47 +13:00
ce5e2429db fixing various links to point to *.koha-community.org
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-21 22:08:24 -04:00
12d53ca26b Merge remote branch 'koha-fbc/k_bug_5284' into master
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 13:46:02 -04:00
Chris Nighswonger
63c527a10e Bug 5284 - Generic report covering various problems with the labels/patron card tests
This patch removes a very incomplete test script which was really not even formed into
a test routine.

Note: In all probability, the labels tests could be adapted to test patroncards as well.
2010-10-06 13:41:34 -04:00
7041f19ee1 Merge remote branch 'koha-fbc/k_bug_5284' into master
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 13:38:44 -04:00
Chris Nighswonger
04a0d94295 Bug 5284 - Generic report covering various problems with the labels/patron card tests
This patch fixes the C4::Labels::Template tests
2010-10-06 13:33:16 -04:00
Chris Nighswonger
04601a3b4d Bug 5284 - Generic report covering various problems with the labels/patron card tests
This patch fixes the C4::Labels::Profile tests
2010-10-06 13:28:18 -04:00
Chris Nighswonger
a115a474c1 Bug 5284 - Generic report covering various problems with the labels/patron card tests
This patch fixes the C4::Labels::Layout tests
2010-10-06 13:17:32 -04:00
6049aeeacb fix invalid invocation of GetBranches in test case
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 12:54:21 -04:00
Chris Nighswonger
49f7faf34a Bug 5284 - Generic report covering various problems with the labels/patron card tests
This patch fixes the C4::Labels::Batch tests
2010-10-06 12:52:55 -04:00
d243847c0a more test case fixes
SQLHelper.t - clean up after itself better
Context.t - fix reporting of test plan

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 11:56:32 -04:00
917c397968 cleanup of DB-dependent fund test cases
* remove test that was adding a second active budget period,
  which was throwing off later tests
* updated to reflect current API

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 11:13:07 -04:00
01bf4aa658 fix typo/thinko in list test
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 10:55:44 -04:00
037686eff2 various improvements to t/db_dependent/VirtualShelves.t
* updated to reflect recent (and old) changes to the API
* corrected test plan
* adopted Test::More
* correctly handle and test functionality to not add duplicate
  bibs to a list

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 10:39:57 -04:00
58e2f6a991 fix test plan and false test errors in Search.t
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 09:51:55 -04:00
f19307b54c fix test plan for SQLHelper.t
Also removed incorrect comments about test case numbers - we should
just let Test::More number them.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 09:44:18 -04:00
93b882cdde use Test::More for t/Koha.t
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 09:15:36 -04:00
Chris Cormack
d82c1cf05f Shifting the tests that need user input to their own directory, they cant be used by the automated tester
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:58:35 -04:00
Chris Cormack
9b0bd43f10 Fixing the VirtualShelves test
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:58:34 -04:00
Chris Cormack
6d581f9f6b Fixing C4::Boolean tests, in August 2009 we changed the die to a warn, tests didn't reflect this. Now we should have 100% of C4::Boolean
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:58:33 -04:00
Colin Campbell
6a1191bb3f Bug 4905 Runtime errors in about.pl
Calls to VERSION were generating errors when called on a string.
Use a bit of sleight of hand to avoid this
Added a couple of tests on Installer/PerlModules
Module needs better coverage testing (esp on newer perls)
Sorted to list of modules to make koha_perl_deps.pl more
human-friendly

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-24 14:16:36 -04:00
Henri-Damien LAURENT
09d0a978a7 Fixing Tests on SQLHelper
one test was failing for want of correct parameters
An other one was not correctly described

test on search with a simple string fails because was done with branchcode and start_with includes NULL branches
Removing branchcode from filtercolumns

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-04-29 22:35:28 -04:00
Donovan Jones
23a19c6c9a Bug 2505 - Add commented use warnings where missing in *.t 2010-04-21 20:29:31 +12:00
Colin Campbell
d027e4dcd6 add warnings to Serials.pm
Change obvious warning generators:
     ( use of string comparisons in numeric comparison)
     ( declaration of variable in comnditional )
also some errors caused by undefined values:
    abouttoexpire was not checking for undef values
    Pass a valid planneddate in generation of next expected
    (undef here causes odd results)
Add a basic test script
    test is minimal but I fell over a bug this would have caught
2010-04-08 13:28:40 +01:00
Lars Wirzenius
13af9b6195 Fix FSF address in directory t/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:51 -04:00
Colin Campbell
7ea29365df bugfix Dates.t test plan has wrong value
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-10 05:53:28 -05:00
f36c042b80 Merge commit 'workbuffer.org-koha/translation' into to-push
Conflicts:
	installer/data/mysql/updatedatabase.pl

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-02 19:10:41 -05:00
088b22b8ed More fixes to the shelves test 2010-01-29 08:39:09 +13:00
031a7c8379 Fixing the tests for VirtualShelves, still a bit more to do 2010-01-29 08:39:08 +13:00
98e972128a More fixes to the shelves test 2010-01-29 08:13:42 +13:00
af75714431 Fixing the tests for VirtualShelves, still a bit more to do 2010-01-29 08:13:41 +13:00
Henri-Damien LAURENT
2086615a35 SQLHelper : InsertInTable enhancement
InsertInTable can now add values to table where primaryKey requires
user input such as branches table
2010-01-28 15:11:54 +01:00
Henri-Damien LAURENT
6a3579b2f3 MT 2285 : enhancement for patronSearch 2010-01-28 15:11:51 +01:00
Henri-Damien LAURENT
67bc72d7bb Test Improvements : Adding Reserves.t 2010-01-28 15:11:49 +01:00
Henri-Damien LAURENT
23a1397419 Dates : improvements string recognition
Dates can now have one digit for month and day
2010-01-28 15:11:47 +01:00
Henri-Damien LAURENT
697e8e7014 SearchInTable : problem with primary key searches
SearchInTable was filtering primary Key thus returning the whole table when asked a search on a primary key
2010-01-28 15:11:45 +01:00
Henri-Damien LAURENT
d339abf0bf Merge branch 'patroncards-wip' of git://git.foundations.edu/koha into community
Conflicts solved:
	Makefile.PL
	installer/data/mysql/en/mandatory/sysprefs.sql
	installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
	installer/data/mysql/updatedatabase.pl
	kohaversion.pl
2010-01-20 23:16:34 +01:00
Chris Nighswonger
278007e847 [3/30] Adding a test script for C4::Patroncards::Patroncard
To be used for development initially and then can be modified for use as a test.

NOTE: This does not work in its present form.
2010-01-11 18:16:17 -05:00
Jesse Weaver
09d153d85a Remove diagnostic output from t/Members_Attributes.t
While this might be useful for developers, is mostly pointless
otherwise. Should be replaced with a true test of these four
functions.
2009-12-20 14:31:39 +01:00
e85b4557f9 C4::Bookfund no longer exists, removing the test 2009-12-20 14:31:37 +01:00
11c0adea4e C4::Boolean has had its' exception changed to warns, the test was erroring falsely 2009-12-20 14:31:36 +01:00
Henri-Damien LAURENT
fc1a5ed318 MT1883 : Serials enddate was not cleanly used
GetExpirationDate should now be used only to get the NEXT expirationdate based on startdate
Perltidying C4/Serials.pm
2009-11-11 14:00:11 +01:00
Henri-Damien LAURENT
1ec6e3df73 Change in API : ordnum becomes ordernumber 2009-10-30 00:30:47 +01:00
Henri-Damien LAURENT
e3a8f1e20d MT 2168 : Logical AND between multiple words strings
C4::SQLHelper was doing an implicit OR of multiple words strings
It is now fixed and does an AND
2009-10-26 15:34:33 +01:00
Henri-Damien LAURENT
e16a034e9c Remove Stopwords bug fixing
in french, les is a stopword

Modèles would match because of the combining and \P{IsAlnum} would not detect that.
2009-10-14 18:19:09 +02:00
Henri-Damien LAURENT
70a6b86c74 Improving SQLHelper
More concise and more readable
removing do local $"= using join instead
Adding Caching of queries
Adding Some tests
API between function reorganizing for more consistency
2009-09-30 11:30:37 +02:00
Henri-Damien LAURENT
2a4f2098b4 Improving C4::SQLHelper
Adding support for string, hash and arrayref in SearchIntable
SearchInTable now add
	limits and
	sortby
	filter on fields to returns (enter an arrayref here)
	filter on fields to limit the search on
	searchtype which can be exact or wide

GetPrimaryKey now returns an array of all the fields which are primary keys
Adding Internal functions
_Process_Operands
_filter_hash
_filter_string
_filter_fields
2009-09-30 11:30:36 +02:00
Nahuel ANGELINETTI
d399ff3494 [biblibre-newacq](bug #3611) fix user interface and others
This big patch, fix xhtml code, and user interface.
It Delete the term of budget period and use it as "Root Budget".
It add improvment on UI, adding tooltip, and table tree.
2009-09-30 11:30:34 +02:00
Henri-Damien LAURENT
e53b5e10ed Adding some fields in GetSubscriptions
GetSubscriptions now searches string in
notes
internalnotes
callnumber
title
2009-09-30 11:30:33 +02:00
Henri-Damien LAURENT
e3a9d21d6e Improving and bug fixing admin/aqbudgets
Adding FormatData and FormatNumber in C4::Output
Using them
Adding duplication detection for budget periods
Factorizing some code
2009-09-30 11:30:30 +02:00
Paul Poulain
90141c2b32 Test script, removing Bookfund references 2009-09-30 11:30:22 +02:00
Henri-Damien LAURENT
8802bbf5fe Editing C4::Suggestions.pm
Enhancing C4::SearchSuggestion
And changing its API
Changing C4::Suggestions API taking a hashref for NewSuggestion and ModSuggestion

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:29:23 +02:00
Henri-Damien LAURENT
4271bbb738 Modifying Members : Add Mod and GetMember
This update the way Member is added and editing so that import and Edition
 could be best automatized
GetMember evolves and allow ppl to serach on a hash of data

Adding SQLHelper A new package to deal with INSERT UPDATE and SELECT

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:29:23 +02:00
Nahuel ANGELINETTI
17c831399f Delete unused function
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-29 19:53:04 -04:00
Chris Nighswonger
c25dc92fd1 Bug 2500 Correcting incorrect splitting of cutter numbers
This patch does two things to improve the call number splitting algorithms:

1. It makes changes to ensure that cutter numbers are split correctly in ddcns

2. It moves custom/fiction/biography call number splitting to a separate algorithm.
    Before they were incorrectly placed in ddcns.

This patch also modifies the call number splitting tests to accept call numbers from the
command line to allow quick testing of any give call number against a particular algorithm.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-15 20:29:16 -04:00
8b296fc778 updated DB-dependent tests to reflect labels rewrite
* removed lib/KohaTest/Labels.pm, which is now completely outdated
* updated list of database tables to truncate in lib/KohaTest.pm

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-15 08:59:26 -04:00
0bbcfeda0e replace syslog with warns
As discussed with Chris Nighswonger on #koha, this patch
removes the calls to syslog and replaces them with warns
so that error messages generated by the labels code
are sent to the Apache error log.  This avoids splitting
this sort of logging across multiple files and is consistent
with current practice in most of the rest of Koha.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-05 21:43:12 -04:00
Chris Nighswonger
6066b79817 [38/40] Misc bugfixs 2009-09-01 15:57:46 -04:00
Chris Nighswonger
9b56b1ead9 [35/40] Work on C4::Labels tests and various bugfixs resulting
This patch also moves the Labels tests into their own sub directory.

Due to a squash mistake this patch also includes the following:

Fixing up POD for C4::Labels modules

Also a minor bugfix and code refactoring.
2009-09-01 15:54:01 -04:00
Chris Nighswonger
537880591a [3/40] Work on C4::Labels::Profile module and tests 2009-09-01 15:47:52 -04:00
Chris Nighswonger
1c39484c4b [2/40] Work on C4::Labels::Template and associated tests
This commit also contains some work on C4::Labels::Layout as well
2009-09-01 15:47:32 -04:00
Chris Nighswonger
f4d46222e8 [1/40] Work on C4::Labels::Layout module and tests
NOTE: This patch is the first of 40 which almost completely re-factor the
label creator code into a hopefully more scalable form. The new format is
a move in direction of OO handling labels, batches, templates, layouts, and
profiles as objects thus permitting easier implementation of features and
enhancements. It should be possible to export label data in any format one
might choose with the simple addition of a script similar to those included
which produce pdf, csv, and xml format.

One of the larger improvements is a change in workflow that results in template,
layout, and start label selection occurring just before export.

There are also various bugfixes and smaller interface improvements woven into it.

It should be noted that this patch series removes the patron card creator feature
for the present. This feature was only partially completed. A completed variation
will be submitted as a separate patch series to follow in the near future.

The following bugs and enhancements are fixed by this series of patches:

2944 Search to add items to a label batch broken
2061 labels_conf DB values: NULL vs. 0
2511 CSV format string is not cleared when unselected in the label layout editor
2515 Re-factor C4::Labels::DrawSpineText
2823 Label Generator not generating barcodes
3171 Problem due to internationalization in label-create-template.tmpl in de-DE and possibly others
3180 Active settings for label settings should be set at print time only

This work was sponsored by Foundations Bible College & Seminary, Dunn, NC USA
2009-09-01 15:15:45 -04:00
ae5b76c89b bug 2157: add ability to 'clean' staged record batches
batches, it is now possible to 'clean' a batch by
removing all bib and item records staged in the batch.  This
has the effect of helping to reduce database space used
by old import batches as well as removing staged records
from the cataloging reservoir search.  Note that 'cleaning'
a batch affects only the copies of the records that were staged;
if the batch was committed, cleaning the batch does not
affect any bibs and items that were committed into the catalog.

Also note that once you clean a committed batch of records, it is
impossible to undo the previous commit operation.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-10 20:34:55 -04:00
Joe Atzberger
51e8fc2cb6 bug 3435: AddReturn overhaul.
Required for SIP checkin implementation, but also for internal correctness.
AddReturn had too many things going on, with no guarantee of data being
available for the later calls.  At some point we started tacking on all the
branch transfer logic without testing edge cases.  In particular, $borrower
is not checked to be sure it is defined, considering the item may not have been
checked out so no borrower would be associated.  That means that CircControl
of "PatronLibrary" would be inaccurate, Circ Alerts will be totally confused
(untargeted), and the Fix... subs would fail.

Note that *many* errors are still present in _FixAccountForLostAndReturned, including
those where comments are added, such that it might behave strangely even with $borrower.

Renamed the internal subs with leading underscore, per convention.  Changed
the arguments to be scalars when only scalars are needed, not entire objects.
Added depth to WrongBranch message that includes Rightbranch.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-30 11:06:50 -04:00
Galen Charlton
2d880c73d1 removing disused C4::Serials functions
The following functions are no longer in use:

* old_newsubscription
* old_modsubscription
* old_getserials

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-09 09:31:12 -05:00
Galen Charlton
ecdf595208 bug 3314: remove disused scripts and API functions
The distributedto column of the subscription table is
no longer used, having been replaced by the serials
routing list table.  This patch removes two C4::Serials
functions and a script and template, none of which were
reachable by current code:

C4::Serials::GetDistributedTo()
C4::Serials::SetDistributedTo()
koha-tmpl/intranet-tmpl/prog/en/modules/serials/distributedto.tmpl
serials/distributedto.pl

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-08 17:03:05 -05:00
Galen Charlton
c53c9ff8c6 bug 3303: removed references to news_channels*
Removed routines in C4/NewsChannels.pm that refered
to missing database tables news_channels and news_channel_categories.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-07 20:09:18 -05:00
Galen Charlton
456e2a65b3 bug 3302: removed disused references to opac_electronic
Removed routines in C4/NewsChannels.pm that refer to
a missing opac_electronic table.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-07 20:09:17 -05:00
Joe Atzberger
82f362673c Allow option to preserve Extended Attributes on patron import update.
Essentially, this patch provides the option to overwrite only matching
Extended Attributes, instead of all of them, treating the ext. fields more
like normal fields.

Several functions added to Members::Attributes with corresponding tests.

[ LL ref. 342 ]

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-28 06:50:39 -05:00
Chris Nighswonger
e72a02e08b Bug 2500 Tweaking DDCN Split for Hyphenated Volumn Numbers
Presently 252.051 T147 v.1-2 is split as

252.051
T147
v.1
-2

This patch corrects the algorithm so that it splits as

252.051
T147
v.1-2

It also updates Labels_split_ddcn.t to include this particular case.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-27 10:45:36 -05:00
Galen Charlton
d8bd2345ed bug 3120: tweak DDCN call number splitting for labels
Allow a call number of the form MP3-CD F PARKER to be split as

MP3-CD
F
PARKER

instead of

MP
3
-CD
F
PARKER

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-21 08:01:41 -05:00
Galen Charlton
3f49ad62c8 bug 3236: remove disused scripts and a function
Removed opac/opac-dictionary.pl and catalogue/dictionary.pl,
which were not in use and not linked to from any active
template files.  According to Henri, the functionality that
these scripts implemented hasn't been working since 2.2.

Also removed C4::Search::findseealso(), which was used
only by the two scripts.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-20 08:37:58 -05:00
Galen Charlton
b244cac492 bug 3120: tweak splitting of Dewey call number
If a call number prefix contains a hyphen, try not to
split on the hyphen.  For example, rather than
splitting the call number 'CD-ROM 787.87 EAS'
like this:

CD
-ROM
787.87
EAS

it should be

CD-ROM
787.87
EAS

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-11 07:47:09 -05:00
Galen Charlton
2e08f626f5 remove incomplete bib bulk editing code
Per discussion I had with Henri, removing experimental
bulk editing from the staff search results code, as
feature is incomplete and can be dangerous if
one tries to use it on a large search result
set.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-06 10:53:50 -05:00
Joe Atzberger
657371808a DDCN callnumber splitting with test.
Similar to previous patch for LCCN splitting, this patch incorporates
changes to split_ddcn and supplies a test file for verifying proper
operation.  Note that the only previously documented example for intended
operation is included as one of the tests.

This regexps are created to be rather forgiving.  For example, the function
will not choke if two spaces were included where the "spec" (such as it is)
expects one.  Obviously this is because for CN splitting purposes, it doesn't
matter, we're not going to ever split in the middle of whitespace.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 18:47:48 -05:00
Joshua Ferraro
69c74c06ae Move Amazon.pm to External/ directory
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:49 -05:00
Joe Atzberger
a3ae0a5628 Test for LCCN splitting.
This test establishes what LCCN splitting is required to do
to be considered successful.  See Bug 2691.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:37:27 -05:00
Joe Atzberger
abe306c2df Allow LDAP test to bail if LDAP disabled.
Also added more feedback and the ability to override KOHA_CONF
"useldapserver" value with ENV variable KOHA_USELDAPSERVER.

This patch should be considered for inclusion to 3.0 stable branch
because it prevents unnecessary failure of test battery.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-05 09:49:10 -06:00