This patch changes the way CanBookBeReserved() and CanItemBeReserved() return error
messages and how they are dealt with in the templates. This change makes it possible
to distinguish between different types of reservation failure.
Currently only two types of errors are handled, all the way to the user, from the CanItemBeReserved():
-ageRestricted
-tooManyReserves which translates to maxreserves
#############
- TEST PLAN -
#############
((-- AGE RESTRICTION --))
STAFF CLIENT
1. Find a Record with Items, update the MARC Subfield 521a to "PEGI 16".
2. Get a Borrower who is younger than 16 years.
3. Place a hold for the underage Borrower for the ageRestricted Record.
4. You get a notification, that placing a hold on ageRestricted material is
forbidden. (previously you just got a notification about maximum amount of reserves reached)
((-- MAXIMUM RESERVES REACHED --))
0. Set the maxreserves -syspref to 3 (or any low value)
STAFF CLIENT AND OPAC
1. Make a ton of reserves for one borrower.
2. Observe the notification about maximum reserves reached blocking your reservations.
((-- MULTIPLE HOLDS STAFF CLIENT --))
3. Observe the error notification "Cannot place hold on some items"
((-- MULTIPLE HOLDS OPAC --))
1. Make a search with many results, of which atleast one is age restricted to the current borrower.
2. Select few results and "Place hold" from to result summary header element.
(Not individual results "Place hold")
3. Observe individual Biblios getting the "age restricted"-notification, where others can be
reserved just fine.
Updated the unit tests to match the new method return values.
t/db_dependent/Holds.t & Reserves.t
Followed test plan. Works as expected and displays meaningful messages for the reason why placing a hold is not possible.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds:
- a new maintenance script batch_sanitize_records
- a new subroutine C4::Charset::SanitizeRecord
- new unit tests for the new subroutine
Test plan:
1/ prove t/db_dependent/Charset.t
2/ Create a record containing "&amp;" (could be follow with as many
'amp;' as you want) in one of its fields and the same for the field
linked to biblioitems.url.
The url should not be sanitized, it may contain "&".
3/ Launch the maintenance script with the -h parameter to see how to use
it.
4/ Launch the script using the different parameters:
--filename=FILENAME
--biblionumbers='XXX'
--auto-search
The auto-search permits to sanitize all records containing "&amp;" in
the marcxml field.
Use the verbose flag for testing.
Without the --confirm flag, nothing is done.
5/ Use the --confirm flag and verify in the biblioitems.marcxml field
that the record has been sanitized.
6/ Try the --reindex flag to reindex records which have been modified.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
There is no reason for underage borrowers to reserve ageRestricted material and
then be denied it's check-out due to ageRestriction.
This patch prevents reserving material for borrowers not suitably aged.
# # # # # #
# A PRIORI #
# # # # # #
BOTH THE STAFF CLIENT AND THE OPAC
1. Find a Record with Items, update the MARC Subfield 521a to "PEGI 16".
2. Get a Borrower who is younger than 16 years.
3. Place a hold for the underage Borrower for the ageRestricted Record.
4. You can reserve an ageRestricted Record with ease.
STAFF CLIENT ONLY
5. Check-in an Item from the ageRestricted Record and catch the reservation.
6. Check-out the ageRestricted Item for this underage Borrower.
7. You get a notification about being unable to check-out due to age restriction.
How lame is that for a 12 year old?
# # # # # # # #
# A POSTERIORI #
# # # # # # # #
STAFF CLIENT
1. Find a Record with Items, update the MARC Subfield 521a to "PEGI 16".
2. Get a Borrower who is younger than 16 years.
3. Check-out an ageRestricted Item for this underage Borrower.
4. You get a notification about having the maximum amount of reserves.
5. Place a hold for the underage Borrower for the ageRestricted Record.
6. You get a notification, that placing a hold on ageRestricted material is
forbidden.
Includes Unit tests.
Followed test plan. Patch behaves as expected. (Note: Propagating error messages to template will be handled in Bug 13116 or 11999)
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch moves the logic of deciding whether or not a borrower is old enough to access this material
to its own function GetAgeRestriction.
This makes it easier to use AgeRestriction elsewhere, like with placing holds.
This feature adds a new function C4::Members::SetAge() to make testing ages a lot easier.
A ton of Unit tests included.
C4::Circulate::CanBookBeIssued() fixed and issue with undefined $daysToAgeRestriction per Marc Véron's
suggestion.
Test plan:
(See comment #10 for screenshots about using age restriction)
1) Without patch
Configure Age Restricition (see Syspref AgeRestrictionMarker) and have a biblio record with e.g. PEGI 99 in age restriction field
Try to check out to a patron with age < 99
Check out should be blocked
Change entry in age restriction field to PEGI99
Check out schould now be blocked
2) With patch
Try checkouts again, behaviour should be th same.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch makes t/Biblio.t mock the DB connexion setting
a void one. All tests in this file currently call the C4::Biblio
functions with invalid (absent) parameters, so they are expected to
raise warnings and return undef values.
If someone writes mocked tests for the rest of the functionality,
it is expected to mock the DB calls to match the desired scenario.
To test:
- Turn of MySQL
- Run
$ prove t/Biblio.t
=> FAIL: Tests fail because of missing MySQL server
- Apply the patch
- Run
$ prove t/Biblio.t
=> SUCCESS: Tests now pass
- Start MySQL
- Run
$ prove t/Biblio.t
=> SUCCESS: Tests still pass
- Sign off
Regards
Tomas
Sponsored-by: The will to procrastinate
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Sponsored-by: Wanting the darn packages to build
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Sponsored-by: Not wanting to read in my maths book
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
While testing the string change on 12264, I had this result:
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
# Child (GetItemsInfo tests) exited without calling finalize()
not ok 4 - GetItemsInfo tests
This was caused by this line in the unit test:
my $biblionumber = get_biblio();
This routine returns:
return ($bibnum, $bibitemnum);
So instead of the bibnum the bibitemnum is saved in biblionumber.
In my test database bibnum and bibitemnum somehow got out of sync, revealing
this bug :)
The fix is just adding parentheses:
my ( $biblionumber ) = get_biblio();
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
One of the tests claims 'item-level_itypes is disabled'
when it should be 'item-level_itypes is enabled'.
Patch fixes this.
To test:
- run t/db_dependent/Items.t
- tests should all pass
- verify the last test reads 'enabled'
- look at the code and see it's true
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The default value for *by and *date fields is NULL.
But without this patch, the values are 0 or 0000-00-00.
It comes from the fact that the form set to an empty string the values
and DBIX::Class does not consider them as undefined.
This patch is very ugly, not sure how we can fix that.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
No regressions found, adding and editing suggestions from
OPAC and staff.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
With this patch, the subroutines NewSuggestion and ModSuggestion use DBIx::Class instead of C4::SQLHelper.
Moreover, the tests and the .pl have been adapted.
Test plan:
1) Apply the patch.
2) Execute the unit tests by launching :
prove t/db_dependent/Suggestions.t
3) The result has to be a success without error or warning :
t/db_dependent/Suggestions.t .. ok
All tests successful.
Files=1, Tests=91, 2 wallclock secs ( 0.05 usr 0.01 sys + 1.65 cusr 0.09 csys = 1.80 CPU)
Result: PASS
4) Log in the intranet, create a suggestion and verify the created suggestion.
5) Edit a suggestion from the intranet and verify the suggestion is correctly modified.
6) Log in the OPAC and verify you can add a suggestion.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, suggestion created on staff and opac,
suggestion edited without problems, no koha-qa errors.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script:
Also tested:
- adding suggestion from staff and OPAC
- edit suggestion from staff
- deleting suggestion from OPAC
- changing to a normal status (email got created)
- changing to a custom status (SUGGEST_STATUS)
- display of custom status in OPAC
No problems found.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
package Koha::Item::Search::Field
function C4::SQLHelper::GetColumns
function C4::Items::SearchItems
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tests run without error
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
- use Modern::Perl;
- fix a typo
- remove an old comment
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This feature will allow libraries to specify that, when an item is returned,
a local hold may be given priority for fulfillment even though it is
of lower priority in the list of unfilled holds.
This feature has three settings:
* LocalHoldsPriority, which enables the feature
* LocalHoldsPriorityPatronControl, which selects for either tha patron's
home library, or the patron's pickup library for the hold
* LocalHoldsPriorityItemControl, which selects for either the item's
holding library, or home library.
So, this feature can "give priority for filling holds to
patrons whose (home library|pickup library) matches the item's
(home library|holding library)"
Test Plan:
1) Apply this patch
2) Run t/db_dependent/Holds/LocalHoldsPriority.t
Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds the ability to set an owner to a fund hierarchy
On editing a fund, if it has children, a new checkbox appears "Set this
owner to all children funds".
If checked, all the fund hierarchy will herit to this owner.
This will facilitate the fund owner modifications.
Test plan:
- Verify that the new checkbox only appears if the fund has at least a child.
- Create a consistent fund hierarchy, something like:
fund1
fund11
fund111
fund12
fund2
fund21
- Try to modify a fund owner without checking the checkbox. Verify the
children have not been modified.
- Try to modify a fund owner with checking the checkbox. Verify all fund
hierarchy has been modified.
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
It works as announced.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Unit test added
http://bugs.koha-community.org/show_bug.cgi?id=11876
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds an unit test on C4::Biblio::UpdateTotalIssues method
call on non existing record
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I can't comment on the correctness of the test other than to say it ran
successfully.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Improves CLI script, works as described.
Note: A small improvement would be to output the problematic biblionumber.
While updating the number of unit tests from 12 to 13,
the number of tests to skip due to a outdated version
of DBD::Mock was missed.
This patch retains the test number change, and corrects
the number of tests.
TEST PLAN
---------
1) prove -v t/db_dependent/ReportsGuided.t
-- on an UBUNTU git (lacks DBD::Mock >= 1.45)
2) prove -v t/db_dependent/ReportsGuided.t
-- on a DEBIAN git (has DBD::Mock >= 1.45)
3) compare results.
-- skipped tests should be 8 (2 individual tests + 6 in the loop)
under Ubuntu.
-- non-skipped tests should align.
-- everything should be 13 tests.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
By tweaking the GetReservedAuthorisedValues function in
C4::Reports::Guided, biblio_framework can be added as a dropdown
list into the guided reports parameters.
The change in C4/Reports/Guided.pm required a test, which is
found in t/db_dependent/ReportsGuided.t
Code was then added to reports/guided_reports.pl to build the
appropriate hash to trigger the proper dropdown list.
TEST PLAN
---------
1) Apply patch
2) prove -v t/db_dependent/ReportsGuided.t
-- all should pass, this confirms that both
C4/Reports/Guided.pm and this test file work.
3) Log into staff client
4) Reports
5) Create from SQL
6) Enter appropriate information like:
Report name: Test 13141
-- no need to change Report group or Report is public or Notes or Type
SQL:
SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',
biblio.biblionumber,'\">',biblio.biblionumber,'</a>') AS
BiblioNumbers, title, author, frameworkcode
FROM biblio
WHERE frameworkcode=<<Enter the frameworkcode|biblio_framework>>
7) Save report
8) Run report
-- The parameter entry page should have a drop down of
framework codes.
9) Select a framework code, and click Run the report
-- The displayed SQL should have a "frameworkcode=" portion
matching the selected framework.
10) Run the koha qa test tool.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Test plan followed successfully.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
To test
1/ Stop your database server
2/ run t/Koha_Email.t
3/ Notice the errors
4/ Apply patch
5/ run t/Koha_Email.t again
6/ No errors
(Don't forget to restart your db server after)
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Verified that it fixes a package build.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tests pass now without database connection.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The unit tests did not take into account the new DB field.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Also all Acquisition related
patches.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Modifying C4/Tags.pm should have tests.
TEST PLAN
---------
1) Apply this test patch only.
2) prove -v t/db_dependent/Tags.t
-- should see two warnings.
3) Apply the first patch.
4) prove -v t/db_dependent/Tags.t
-- no warnings.
Signed-off-by: Chris <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The C4::Acquisition module should be exploded in order to add
readability and maintainability to this part of the code.
This patch is a POC, it introduces a new Koha::Acquisition::Order module and put in
it the code from NewOrder and NewOrderItem.
Test plan:
1/ Create an order, modify it, receive it, cancel the receipt.
2/ Launch the prove command on all unit tests modified by this patch and
verify that all pass.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
this patch:
- reintroduces the ISSN column
- fix a wording (already there before the main patch)
- fix the tests if a serial was already in late
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small change: Removed 2 tabs in claims.tt and fixed order
of ISSN/Issue number column descriptions as they were switched.
Note: The <order> tags are currently not stripped out of the
notice.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.
Test plan:
0/
a) Does not apply the patch.
b) Remove all your claimissues notices and be sure you have some serial issues
in late.
c) remove email address for the vendor you will use.
d) remove email address for the logged in user.
e) Export claims using the csv export => The selected issues will be
marked as claimed.
f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
<<LibrarianFirstname>>
<<LibrarianSurname>>
The following issues are in late:
<order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
It seems that this column has never been used.
Test plan:
1/ Execute the updatedatabase entry.
2/ git grep cancelledby should not return occurrence in the code (except
in Koha/Schema/*
3/ prove t/db_dependent/Acquisition.t should return green.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I couldn't find any trace of this column being used.
Passes tests and QA script, updates all necessary files.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Tests need to learn about the new fields in the branches table.
To test:
prove t/db_dependent/Branch.t
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Looking with Katrin at the default configuration of Number::Format, she
has the p_cs_precedes value set to 0 (put the symbol at the end) and
p_sep_by_sep set to 1.
Now it is possible to sent these values to the format subroutine.
On this way, the tests can force them in order to pass on all configuration.
This default value for this variable certainly depends on the locales.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch introduces a new module to manage prices into Koha and
especially the acquisition module.
How to use is:
1/ You can use it in a perl script/module:
my $price = Koha::Number::Price->new(3);
$price->format; # Will display 3.00 (or 3,00 depending on the CurrencyFormat syspref).
$price->format({with_symbol => 1}); # Will display €3.00 (or [$]3,00 depending on the CurrencyFormat syspref).
2/ But this module is usefull to display the price from a template file.
[% my_price | Price %]
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
On the 23 July development meeting it was decided to formally deprecate
GRS-1 indexing mode for Zebra. This patch makes code fallback to DOM
on the remaining places. No behaviour change should be noticed, as DOM
has been the default for a while.
Regards
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Also checked running Makefile.PL
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
To test
1/ Apply patch
2/ run t/Koha_Email.t
No changes to behaviour have been implemented yet
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Added a MoveMemberToDeleted set of tests.
TEST PLAN
---------
1) prove -v t/db_dependent/Members.t
-- all should pass.
2) Run koha QA tests.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Due to the fact that Sunday is a repeating holiday in the example data
which is used for part but not all of Holidays.t, the last test will
fail on Sundays. The test is to see if today is *not* a special holiday
for MPL, but since it's already a repeating holiday, is_holiday will
return true rather than false.
Test Plan:
1) Wait until Sunday
2) prove t/db_dependent/Holidays.t
3) Note the failure
4) Apply this patch
5) Repeat step 2
6) Note there is no longer a failure
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Used my time machine... :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
- Convert Auth_with_shibboleth to use dbic stanzas.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>