]> git.koha-community.org Git - koha.git/log
koha.git
9 years agoBug 14510: Allow column visibility in additem.pl to be customized
Jesse Weaver [Thu, 9 Jul 2015 22:26:36 +0000 (16:26 -0600)]
Bug 14510: Allow column visibility in additem.pl to be customized

This patch adds the table of items on additem.pl to the columns
customizer.

Test plan:
  1. Open item editor on a record, and verify that all columns are visible.
  2. Apply patch.
  3. Reload editor, and verify that column visibility hasn't changed.
  4. Open "Hide/show columns," and verify that you can add and remove
     columns.
  5. Change the visibility and togglability of some columns in
     columns_settings.pl, and verify that these correctly apply to
     additem.pl.

NOTE: The columns that are configurable are selected from the non-hidden
columns that have mappings to MARC subfields in the default MARC21
framework (and can thus be displayed in the item editor).

Signed-off-by: Jenny Schmidt <jschmidt@switchinc.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 13781: Fix missing heading columns for relative's checkouts table in check out...
Genevieve Plantin [Tue, 8 Sep 2015 17:58:10 +0000 (13:58 -0400)]
Bug 13781: Fix missing heading columns for relative's checkouts table in check out patron page

Theres was two missing heading columns Location and Fines in the Check out section of a Patron

Tested both patches together. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 13781: Fix relatives's checkouts missing heading columns
Genevieve Plantin [Fri, 4 Sep 2015 13:15:26 +0000 (09:15 -0400)]
Bug 13781: Fix relatives's checkouts missing heading columns

There was two missing heading columns (location and fine) and one hidden heading missing column (this hidden column is needing for sorting the table) it was taking the due_date column for the hidden column, so I added them

Both patches tested together. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: (follow-up) Include item data only in extended mode
Alex Arnaud [Thu, 27 Aug 2015 12:28:50 +0000 (14:28 +0200)]
Bug 12252: (follow-up) Include item data only in extended mode

Fix perlcritic error.

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: Include item data only in extended mode
Frédéric Demians [Thu, 23 Jul 2015 16:38:25 +0000 (18:38 +0200)]
Bug 12252: Include item data only in extended mode

Previous patches attached to this bug have been refactored to merge bug
3206 and bug 13568 features. So OAI server must be carrefully tested to
ensure that there is no regression in this area: deleted records and
resumption token.

This last patch fixed the way items are returned. They are returned only
if OAI server operates in extended mode, and specifically for format
having the parameter include_item set to 1 (true). For example this
configuration file set via OAI-PMH:ConfFile syspref will return items:

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: (qa-follow-up) Remove perlcritic error
Jonathan Druart [Wed, 7 Jan 2015 14:29:50 +0000 (15:29 +0100)]
Bug 12252: (qa-follow-up) Remove perlcritic error

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: Add tests for EmbedItemsInMarcBiblio
Jonathan Druart [Fri, 2 Jan 2015 14:46:03 +0000 (15:46 +0100)]
Bug 12252: Add tests for EmbedItemsInMarcBiblio

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: include item data in OAI-PMH ListRecords result
Robin Sheat [Mon, 23 Jun 2014 05:16:50 +0000 (17:16 +1200)]
Bug 12252: include item data in OAI-PMH ListRecords result

Same in spirit to the other patch, this also includes the item detail in
ListRecords.

Test plan:
* Fetch a URL like:
http://koha/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
* Verify that there are 952 entries in the returned records where
  appropriate.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
ListRecords OAI verb returns a list of records including items in 952/995 which
are not hidden based on OpacHiddenItems syspref.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: OAI-PMH items respect OpacHiddenItems
Robin Sheat [Tue, 20 May 2014 05:15:52 +0000 (17:15 +1200)]
Bug 12252: OAI-PMH items respect OpacHiddenItems

This allows the OAI-PMH service to not provide item information when
there is a rule that would supress it in OpacHiddenItems.

Test plan:
* Find an OAI-PMH URL that shows you some items.
* Add an entry to OpacHiddenItems that would block that.
* Check that it's blocked.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Tested, playing with OpacHiddenItems. GetRecord OAI verb returns a record
complying with OpacHiddenItems rules, for example without items from a specific
library.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 12252: OAI-PMH result includes item data
Robin Sheat [Wed, 14 May 2014 02:39:03 +0000 (14:39 +1200)]
Bug 12252: OAI-PMH result includes item data

GetRecord for OAI-PMH was pulling the MARCXML directly from the
database. Now it uses GetMarcBiblio and includes the item data with it,
making it more generally useful.

Test plan:
* Run an OAI-PMH query, for example:
http://koha/cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:52&metadataPrefix=marcxml
  to fetch biblionumber 52
* Note that it doesn't include the 952 data
* Apply the patch
* Do the same thing, but this time see that the 952 data is at the
  bottom of the MARCXML.

Note:
* This patch also includes a small tidy-up in C4::Biblios to group
  things semantically a bit better, so I don't spend ages looking for a
  function that was staring me in the face all along again.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described. Simple yet useful patch.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
952/995 item fields are back in response to GetRecord OAI verb.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14245: (QA followup) already global
Tomas Cohen Arazi [Wed, 16 Sep 2015 14:51:12 +0000 (11:51 -0300)]
Bug 14245: (QA followup) already global

The original patch correctly unmasks the global variable (by
removing the 'my' on the marc2ris function, but wrongly introduces
a new global variable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14245: Problems with RIS export in unimarc
Bernardo Gonzalez Kriegel [Thu, 21 May 2015 17:00:05 +0000 (14:00 -0300)]
Bug 14245: Problems with RIS export in unimarc

Variable $itype is used an all C4/Ris.pm to switch
between marc falvors, but is local and not passed along
as argument.

As a quick solution, is defined as global

To test:
1) On UNIMARC setup, export a record as RIS,
check that author (and other fields) are displayed
incorrectly

2) Apply the patch

3) Export again, improved results

4) Run t/Ris.t

There are other problems in this script, needs maintenance
(e.g. no Modern::Perl friendly)

Signed-off-by: Victor do Rosário <jvr@fct.unl.pt>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14640: 'Cancel Hold' check box on check-out confirmation does not cancel the...
Kyle M Hall [Tue, 25 Aug 2015 14:35:28 +0000 (10:35 -0400)]
Bug 14640: 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out.

This bug is dealing with the situation where an item is checked out to a
patron that is not the next in line hold-wise for an item. In this case,
Koha will warn the librarian that there are holds on the item and
show the first person in line. Again, I want to stress that this
is the case where the item *is not waiting* for a patron. The
hold for the patron listed will just have a priority of 1.

The only situation where the "Cancel hold" checkbox will function
is when the priority 1 hold is an item level hold. This is due to
the fact that CancelReserve is being passed the trio of
biblionumber, borrowernumber, and itemnumber rather than the
singular reserve_id.

1) place biblio level hold on a book to borrower A.
2) check out an item of the book to borrower B.
3) When confirming checkout, check the 'Cancel hold' check-box, and
   click the "Yes, check out" button.
4) Note the hold was not canceled
5) Apply this patch
6) Repeat steps 1 through 3
7) Note the hold was indeed canceled

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14640: Add tests
Jonathan Druart [Tue, 1 Sep 2015 09:52:51 +0000 (10:52 +0100)]
Bug 14640: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 10005: Inventory - Add an option to not check in items
Jonathan Druart [Tue, 14 Jul 2015 14:02:42 +0000 (15:02 +0100)]
Bug 10005: Inventory - Add an option to not check in items

The inventory tools automatically check in items, this patch adds it as
an option.

Test plan:
1/ Check an item out, fill a file with its barcode, and use this file in
the inventory tools.
2/ Check the new checkbox and confirm that the item is not checked in
3/ Repeat again and don't check it, the behavior should be the same as before
this patch.

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added a missing </li>.
Patch works as expected.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 7634: Prevent permanent_location to be set to NULL if not defined
Jonathan Druart [Wed, 2 Sep 2015 13:28:52 +0000 (14:28 +0100)]
Bug 7634: Prevent permanent_location to be set to NULL if not defined

The permanent_location is correctly filled when an item is added from
the cataloguing module (routine set_item_default_location from
cataloguing/additem.pl).
But when records are imported, this filled is not managed. It's only on
editing (_do_column_fixes_for_mod called from ModItem).

This patch set the permanent_location item fields to the location value for all
items created, even the imported ones.

Test plan:
0/ Do not apply this patch
1/ Import a record with items using the "Stage MARC for import" tool
2/ Check the values for the permanent_location in the items table.
They are set to NULL
3/ Apply this patch
4/ Repeat 2 and confirm that now the permanent_location values are set
to the location values.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 7634: Add tests
Jonathan Druart [Wed, 2 Sep 2015 13:46:02 +0000 (14:46 +0100)]
Bug 7634: Add tests

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 7634: Make the tests pass
Jonathan Druart [Wed, 2 Sep 2015 13:43:15 +0000 (14:43 +0100)]
Bug 7634: Make the tests pass

This patch just fixed a master bug, if your database already has some
items.homebranch set to CPL

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 6756: Add info messages
Jonathan Druart [Tue, 14 Jul 2015 10:38:41 +0000 (11:38 +0100)]
Bug 6756: Add info messages

NOTE: Before patch "./misc/cronjobs/batch_anonymise.pl --help" had no
      message, and neither did the anonymizing tool in the staff client.
      After the patch, both had informative messages.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 6756: Fix bad behaviors if AnonymousPatron is not defined
Jonathan Druart [Tue, 14 Jul 2015 10:30:51 +0000 (11:30 +0100)]
Bug 6756: Fix bad behaviors if AnonymousPatron is not defined

There are at least 2 wrong behaviors if the AnonymousPatron pref is not
defined (0 or empty string).
1/ If you use the clean borrower tools, you will get a successful
message when the nothing happened (the history has not been anonymised).
2/ At the OPAC, if a patron ask for delete his reading history, he will
get an error message "The deletion of your reading history failed,
because there is a problem with the configuration of this feature.
Please help to fix the system by informing your libr    ary of this
error". IMO this should not happen, the history should be anonymised.

With this patch, the old_issues.borrowernumber field will be set to NULL
if the AnonymousPatron pref if not defined.

Test plan:
1/ Fill the pref with "" or 0
2/ At the OPAC, go on the privacy tab and click on the "Immedia deletion" button.
You should get a green and friendly message. Confirm that the history
has been anonymised.
3/ Use the "Batch patron anonymization" tools (tools/cleanborrowers.pl)
to anonymize the checkout history.
Confirm that a) it works and b) you get a message.

Try again with AnonymousPatron set to a valid patron. You should not see
any changes with the current behaviors.

NOTE: This patch tweaks C4/Circulation.pm and provides tests.
      applying just this, and running prove success. Reverting just
      C4/Circulation.pm fails, as expected.
      Tested OPAC stuff with both patches applied.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 13622: [QA Follow-up] Add unit test descriptions
Marcel de Rooy [Mon, 18 May 2015 12:19:19 +0000 (14:19 +0200)]
Bug 13622: [QA Follow-up] Add unit test descriptions

This report adds a few unit tests for datonly flag in notices.
This patch adds (very trivial) unit test descriptions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 13622: Display a datetime without time in a notice
Jonathan Druart [Mon, 26 Jan 2015 16:24:36 +0000 (17:24 +0100)]
Bug 13622: Display a datetime without time in a notice

For some needs, a librarian would like to display a datetime or
timestamp field without the time.

This patch adds filter logic in the notice/letter parsing process.

Test plan:
1/ Defined a notice using a datetime or timestamp DB field
(biblio.timestamp for instance).
2/ Generate the notice
3/ Verify that the letter is generated with the time
4/ Use the "dateonly" filter like:
  <<your_table.your_field | dateonly>>
  <<biblio.timestamp | dateonly>>
5/ Generate the notice
6/ Confirm the the letter is generated without the time for this field.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14813: Fix encoding issues on editing help pages
Jonathan Druart [Mon, 14 Sep 2015 09:28:01 +0000 (10:28 +0100)]
Bug 14813: Fix encoding issues on editing help pages

It has been introduced by bug 11944.

Test plan:
1/ Install and set the fr-FR language (or ar-Arab).
2/ Go on the help page and edit it.
3/ The textarea should not contain encoding issues with this patch.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14197: TestBuilder - Remove the error on starting the transaction
Jonathan Druart [Thu, 9 Jul 2015 08:35:12 +0000 (09:35 +0100)]
Bug 14197: TestBuilder - Remove the error on starting the transaction

DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1560.
DBIx::Class::Storage::DBI::txn_rollback(): Storage transaction_depth 0 does not match false AutoCommit of DBI::db=HASH(0xa429648), attempting ROLLBACK anyway at t/lib/TestBuilder.pm line 363

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14197: Remove the warning on destroying TestBuilder objects
Jonathan Druart [Wed, 13 May 2015 15:58:45 +0000 (17:58 +0200)]
Bug 14197: Remove the warning on destroying TestBuilder objects

This module will be called by db_dependent tests, which already create a
transaction.
TestBuilder creates a new one (which is certainly useless) and the
rollback does not do anything.

To see the warning see patches on bug 14045.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 8723: Update hold_fill_targets, tmp_holdsqueue and linktracker tables
Jonathan Druart [Fri, 10 Jul 2015 14:18:48 +0000 (15:18 +0100)]
Bug 8723: Update hold_fill_targets, tmp_holdsqueue and linktracker tables

Same as previous patch for 3 other tables.

Test plan:
Same as before but the hold should exist to the 3 tables before the
move.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 8723: Update the reserves table for item-level holds
Jonathan Druart [Fri, 10 Jul 2015 14:04:55 +0000 (15:04 +0100)]
Bug 8723: Update the reserves table for item-level holds

If an item is moved from a biblio to another, the holds should be
updated too.

See discussion on the bug report for more information.

Test plan:
1/ Place a item-level hold on biblio1
2/ Move the item to biblio2
3/ Confirm that the hold still exists and point to the biblio2

This patch should not change the existing behavior for bib-level holds.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 8723: Cover the existing behavior
Jonathan Druart [Fri, 10 Jul 2015 13:15:42 +0000 (14:15 +0100)]
Bug 8723: Cover the existing behavior

This patch cover the MoveItemFromBiblio subroutine

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14782: Add possibility to search patrons using the username (userid)
Marc Véron [Sat, 5 Sep 2015 14:41:58 +0000 (16:41 +0200)]
Bug 14782: Add possibility to search patrons using the username (userid)

This patch makes it possible to search for users using the username (userid / login name).

To test:

- Apply patch
- Do searches from Home > Patrons
- Search after a full username or parts of a username with Search fields = Standard and Search fields = Userid
- Perform the searches from the top bar (expand with [+]) and from the "Filters" part at the left
- Make sure that other searches behave as before

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14782: Add tests
Katrin Fischer [Sun, 13 Sep 2015 16:06:46 +0000 (18:06 +0200)]
Bug 14782: Add tests

Run:
perl t/db_dependent/Utils/Datatables_Members.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee
Marcel de Rooy [Mon, 14 Sep 2015 09:11:11 +0000 (11:11 +0200)]
Bug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee

The problem making some tests fail, actually was the unneeded addition
of zero accountline records by ChargeReserveFee, called by AddReserve.
The balance is still zero, but a test like !$var responds differently
when var is 0.00 instead of 0 or undef.

This patch adjusts the test in ChargeReserveFee in order to prevent
adding these records with 0.00.
The first patch that adjusts the tests in Reserves.t is not strictly
needed anymore, but can stay.

Test plan:
[1] Run t/db_dependent/Reserves.t
[2] Run t/db_dependent/Reserves/GetReserveFee.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14801: Fix Reserves.t
Marcel de Rooy [Thu, 10 Sep 2015 14:39:51 +0000 (16:39 +0200)]
Bug 14801: Fix Reserves.t

Fix the following errors:
not ok 59 - Bug 14464 - No fines at beginning
ok 60 - Bug 14464 - 1st reserve correctly created
not ok 61 - Bug 14464 - No fines after cancelling reserve with no charge configured
ok 62 - Bug 14464 - 2nd reserve correctly created
not ok 63 - Bug 14464 - No fines after cancelling reserve with no charge desired

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the x==0 test with !x || x==0 to include 0.00 and prevent warn.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14655: Fix wording
Jonathan Druart [Mon, 14 Sep 2015 12:22:21 +0000 (13:22 +0100)]
Bug 14655: Fix wording

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed a missing space after Error: :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14655: Add a warning on the about page if patrons have requested privacy
Jonathan Druart [Tue, 18 Aug 2015 17:15:02 +0000 (18:15 +0100)]
Bug 14655: Add a warning on the about page if patrons have requested privacy

New warning on the about page if at least a patron has requested a
privacy on checkin but the AnonymousPatron is not set to a valid patron.

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14655: Add a warning if the checkin will fail
Jonathan Druart [Tue, 18 Aug 2015 17:10:37 +0000 (18:10 +0100)]
Bug 14655: Add a warning if the checkin will fail

On the checkin and checkout page, the checkin will fail if the patron
has requested the privacy and the AnonymousPatron is not correctly set.

This patch adds a warning message on both pages.

Test plan:
0/ Be sure you don't have any patron with privacy=2 (Never)
1/ Set OPACPrivacy, not AnonymousPatron
2/ Go on the checkin, you should a warning (same as before this patch).
3/ Set the privacy=2 for a patron
4/ Go on the circulation page, a warning should appear (for this
specific patron)
5/ Check an item out to this patron
6/ Check the item in on the checkin page.
The item is not checked in and you get a specific message for this
patron.

Confirm other/correct situations don't trigger the messages.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
9 years agoBug 14472: DBRev 3.21.00.026
Tomas Cohen Arazi [Mon, 7 Sep 2015 17:07:47 +0000 (14:07 -0300)]
Bug 14472: DBRev 3.21.00.026

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12357: DBRev 3.21.00.025
Tomas Cohen Arazi [Mon, 7 Sep 2015 17:05:39 +0000 (14:05 -0300)]
Bug 12357: DBRev 3.21.00.025

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12357: Following whitespace failures on koha qa test tools.
Mark Tompsett [Mon, 25 May 2015 04:22:07 +0000 (00:22 -0400)]
Bug 12357: Following whitespace failures on koha qa test tools.

TEST PLAN
---------
1) Apply all patches before this.
2) run koha qa test tools
   -- whitespace failures
3) Apply this patch
4) run koha qa test tools
   -- no whitespace failures.

NOTE: More tabs were fixed than required, to also clean up a little indenting.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Koha-qa tools now happy

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12357: Fix comma issues related to additional fields.
Mark Tompsett [Mon, 25 May 2015 04:06:24 +0000 (00:06 -0400)]
Bug 12357: Fix comma issues related to additional fields.

TEST PLAN
---------
1) Apply patches, except this one.
2) prove t/db_dependent/Record.t
   -- fails like comment #38
3) Apply this patch
4) prove t/db_dependent/Record.t
   -- now it passes.
5) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Make test work, koha-qa problems fixed in next patch

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12357: [QA Followup] - Unit Test
Kyle M Hall [Tue, 28 Apr 2015 12:56:49 +0000 (08:56 -0400)]
Bug 12357: [QA Followup] - Unit Test

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
This works with next patch

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12357: Enhancements to RIS and BibTeX exporting
Kyle M Hall [Fri, 23 Jan 2015 12:11:36 +0000 (07:11 -0500)]
Bug 12357: Enhancements to RIS and BibTeX exporting

Some libraries would like to be able to add arbitrary fields to both the
RIS and BibTeX citation formats that a record can be saved as from the
staff intranet and public catalog. In addition, they would like to be
able to override the default record type and use Koha's itemtype as the
record type for those formats as well.

Test Plan:
 1) Apply this patch
 2) Run updatedatabase.pl
 3) Add the following to the new syspref RisExportAdditionalFields:
TY: 942$c
LC: 010$a
NT: [501$a, 505$g]
 4) Find or create a record with an 010$a (lccn) field, a 501$a field,
    a 942$c field, and multiple 505$g fields.
 5) Locate the record in the catalog, choose "Save" and select RIS
 6) Inspect the downloaded file, note the replaced TY field, the LC
    field, and multiple NT fields
 7) Add the following to the new syspref BibtexExportAdditionalFields:
'@': 942$c
lccn: 010$a
notes: [501$a, 505$g]
 9) Using the previously selected record, choose "Save" and select BIBTEX
10) Inspect the downloaded file, note the lccn, the multiple note
    fields, and the new record type value

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - FA framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 16:34:01 +0000 (13:34 -0300)]
Bug 10963: Simplified creation - FA framework

Patch 1/9

This patch modifies Fast Add framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Revert old hidden values
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 19:06:08 +0000 (16:06 -0300)]
Bug 10963: Revert old hidden values

This patch reverts old hidden values to marc_subfield_structure.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - SER framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:59:07 +0000 (14:59 -0300)]
Bug 10963: Simplified creation - SER framework

Patch 9/9

This patch rewrites SER framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - IR framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:52:38 +0000 (14:52 -0300)]
Bug 10963: Simplified creation - IR framework

Patch 8/9

This patch rewrites IR framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - KT framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:46:43 +0000 (14:46 -0300)]
Bug 10963: Simplified creation - KT framework

Patch 7/9

This patch rewrites KT framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - AR framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:41:50 +0000 (14:41 -0300)]
Bug 10963: Simplified creation - AR framework

Patch 6/9

This patch rewrites AR framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - VR framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:35:15 +0000 (14:35 -0300)]
Bug 10963: Simplified creation - VR framework

Patch 5/9

This patch rewrites VR framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - SR framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:27:38 +0000 (14:27 -0300)]
Bug 10963: Simplified creation - SR framework

Patch 4/9

This patch rewrites SR framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - CF framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:16:35 +0000 (14:16 -0300)]
Bug 10963: Simplified creation - CF framework

Patch 3/9

This patch rewrites CF framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 10963: Simplified creation - BKS framework
Bernardo Gonzalez Kriegel [Sat, 12 Apr 2014 17:05:48 +0000 (14:05 -0300)]
Bug 10963: Simplified creation - BKS framework

Patch 2/9

This patch rewrites BKS framework

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14683: [QA Follow-up] Similar change for staff
Marcel de Rooy [Tue, 1 Sep 2015 14:11:54 +0000 (16:11 +0200)]
Bug 14683: [QA Follow-up] Similar change for staff

Script memberentry.pl contained a similar line.
Solution is simpler here.

Test plan:
[1] Add, change or clear the sms number at staff side.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber
Marcel de Rooy [Fri, 28 Aug 2015 07:13:09 +0000 (09:13 +0200)]
Bug 14683: [QA Follow-up] Mixup between mobile and smsalertnumber

This is an issue discussed on older reports already in the past.
Column mobile in borrowers is actually 'Other phone', not necessary a
mobile number. The name of the field is confusing. (Renaming it is
outside the scope of this report.)
The field that we are editing here is smsalertnumber. It should not be
compared with mobile at all.

What could be the side-effect of this correction?
===
First, the change is only relevant for libraries with pref SMSSendDriver
enabled.
In the past patrons editing their message preferences saw mobile (read:
other phone) in their smsalertnumber field (if the latter was still empty).
If they saved it, it was copied to smsalertnumber.
This change does not affect these patrons. They just have the same number
in two columns. No big deal.
What if a patron does not yet have a smsalertnumber? In that case no sms
is sent in Letters.pm. So no change in behavior. If he submits
opac-messaging now, he will no longer copy his other phone to smsalert [we
cannot assume that it was mobile anyway!]. If he enters a mobile number,
it will be saved correctly in the right field.

Conclusion: this change will not break things or hurt anyone. It only
prevents unwanted copying other phone to smsalertnumber.

Also modified the compare to prevent uninitialized warnings.
And removed a commented warn.

Test plan:
[1] Add, edit or delete the SMS number on opac-messaging regardless of
    the value of Other Phone (in the badly named mobile field).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14683: Unable to clear SMS number
Joonas Kylmälä [Wed, 19 Aug 2015 11:42:50 +0000 (11:42 +0000)]
Bug 14683: Unable to clear SMS number

Enables to clear SMS number.

To test:
1. Go to opac-messaging.pl
2. Insert SMS number and submit
3. Clear SMS number and submit
4. Observe that the sms number did not change
5. Apply patch
6. Clear SMS number and submit
7. Observe that the sms number changes

Sponsored-by: Vaara-kirjastot
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding a follow-up.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14621: Messaging preferences table needs to be sorted
Lari Taskula [Thu, 30 Jul 2015 15:34:49 +0000 (18:34 +0300)]
Bug 14621: Messaging preferences table needs to be sorted

I have been working with messaging preferences and I noticed a weird issue in Firefox on Ubuntu.

On messaging preferences page, the table is unsorted and the content in rows are generated randomly
on every page refresh. When you select/deselect checkboxes and refresh the page (without posting the changes),
Firefox will remember your choices. Now the issue is that when the table is unsorted and the rows keep
changing on page refresh, Firefox has trouble remembering your choices. This makes it appear as if the
checkboxes are magically changing values on each page refresh.

Here is a patch that prevents this problem by sorting the messaging settings.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14760: Disabled courses display in the course reserves list for items
Kyle M Hall [Mon, 31 Aug 2015 13:36:02 +0000 (09:36 -0400)]
Bug 14760: Disabled courses display in the course reserves list for items

If an item is on reserve for two courses but one of those courses is
disabled, both courses are still listed on opac-detail.pl!

Test Plan:
1) Enable course reserves
2) Create two courses
3) Place one item on reserve for both courses
4) Disable one of the two courses
5) View the record details for that record/item
6) You should see both courses listed in the course reserves column
7) Apply this patch
8) Reload the page
9) You should now only see the active course in the course reseves column

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14470: Do not allow renew for on-site checkouts
Jonathan Druart [Tue, 4 Aug 2015 09:38:29 +0000 (10:38 +0100)]
Bug 14470: Do not allow renew for on-site checkouts

At the opac, the renew checkbox should not be displayed if it's an
on-site checkout (same on the intranet).

On the way, this patch adds a specific message to the intranet if the
librarian try to renew an on-site checkout.
Indeed before this patch a renew was allowed if the barcode was scanned.

Test plan:
1/ Create an on-site checkout for a patron
2/ Confirm that the checkbox 'renew' is not displayed on the checkout
list tables
3/ At the OPAC, the renew should not be allowed (no checkbox)
4/ Try to check the item out to the same patron, confirm that you get a
specifig message to inform you the renew is not allowed for on-site
checkouts.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changed 'issue' to 'item' in the error message.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14639: (QA followup) make schema mandatory
Tomas Cohen Arazi [Thu, 3 Sep 2015 13:13:18 +0000 (10:13 -0300)]
Bug 14639: (QA followup) make schema mandatory

This patch makes the 'schema' param mandatory. It is passed in every
call on the current codebase, so it makes no harm now, but makes
the code less error-prone.

Tests for this situation are added to t/Koha_MetadataRecord.t (schema
param is omitted and new() returns undef and a carped warning).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14639: Extend Koha::MetadataRecord to handle serialization format and record id
Tomas Cohen Arazi [Mon, 3 Aug 2015 14:41:23 +0000 (11:41 -0300)]
Bug 14639: Extend Koha::MetadataRecord to handle serialization format and record id

The description of this changes is on the regression tests commit
message.

To test:
- Apply the test patch
- Run
  $ prove t/Koha_MetadataRecord.t
=> FAIL: Tests fail because changes are not implemented
- Apply this patch
- Run
  $ prove t/Koha_MetadataRecord.t
=> SUCCESS: tests pass
- Run
  $ prove t/Koha_Util_MARC.t
=> SUCCESS: it still passes
- Sign off :-D

NOTE: Tested as above. Read code. Seems to cover all cases.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14639: (regression tests) Extend Koha::MetadataRecord to handle serialization...
Tomas Cohen Arazi [Mon, 3 Aug 2015 14:37:36 +0000 (11:37 -0300)]
Bug 14639: (regression tests) Extend Koha::MetadataRecord to handle serialization format and record id

In order to use Koha::MetadataRecord as a container for moving records
around it is important to let it carry the serialization format
of the record object it was built with, so it is easier and cheaper to
make decisions about records.

This patch introduces regression tests for the changes to be made.
The 'format' param is introduced, and also sets default values:
  schema => 'marc21'
  format => 'MARC'

A new (optional) 'id' param is added so the record carries its own id outside
of it.

The default behaviour is preserved, and no changes are needed in places
Koha::MetadataRecord is used.
->new also returns undef if no record is passed, and raises a carped warning.

To test:
- Apply this test patch
- Run the new tests
  $ prove t/Koha_MetadataRecord.t
=> FAIL: Tests shoud fail as the changes are not implemented on Koha::MetadataRecord

Edit: made serialization format be upper-case to match what is used on Koha::Filter's

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14702: [QA Follow-up] More readable variable names, less queries
Marcel de Rooy [Tue, 1 Sep 2015 13:39:16 +0000 (15:39 +0200)]
Bug 14702: [QA Follow-up] More readable variable names, less queries

The names are much better now :)
Combined the queries for items and issues.
Only check the number of holds when needed.

Test plan:
Verify the changes here by running the unit test again.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14702: Unit tests for GetReserveFee and ChargeReservesFee
Marcel de Rooy [Fri, 21 Aug 2015 11:00:11 +0000 (13:00 +0200)]
Bug 14702: Unit tests for GetReserveFee and ChargeReservesFee

Test plan:
Run the test: t/db_dependent/Reserves/GetReserveFee.t

Signed-off-by: Joonas Kylmala <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14702: Refactor GetReserveFee
Marcel de Rooy [Fri, 21 Aug 2015 09:44:55 +0000 (11:44 +0200)]
Bug 14702: Refactor GetReserveFee

The code of GetReserveFee was not very clear.
What it did was: check if there are some items not issued. If so and there
are no holds, calculate no fee.

While doing so, I moved the code to charge the fee (in AddReserve) to a small
new sub ChargeReserveFee.

There is no change in behavior.
The follow-up patch adds unit tests.

Test plan:
[1] Make sure that a patron category (X) includes a hold fee.
[2] Select a biblio with 2 items.
[3] Issue one item to another patron.
[4] Place a hold on this biblio by patron with category X. No charge?
[5] Cancel the hold from the previous step.
[6] Use another patron to place another hold on this biblio.
[7] Place hold again by patron with category X. Is it charged?
[8] Cancel that hold again. Issue the second item to another patron.
[9] Place hold again by patron with category X. Is it charged again?

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12525: Prevent adding several patron lists with the same name
Jonathan Druart [Wed, 15 Jul 2015 10:50:18 +0000 (11:50 +0100)]
Bug 12525: Prevent adding several patron lists with the same name

If you add patron to a patron list, from the patron search result, a
list is created when you click on "Save".
The list is considered as new each time.

To reproduce:
1/ Launch a patron search
2/ Select 1 patron, and create a new list 'aaa'
3/ Select another patron and click Save again
2 lists are created

Test plan:
1/ Launch a patron search
2/ Select 1 patron, and create a new list 'aaa'
The dropdown list should be populated with this new list, and should be
selected
3/ Select another patron and click Save again
Only 1 list should be created

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12525: FIX patron lists dropdown is empty
Jonathan Druart [Wed, 15 Jul 2015 10:36:26 +0000 (11:36 +0100)]
Bug 12525: FIX patron lists dropdown is empty

On the patrons home page, the dropdown list is not populated.

Test plan:
1/ Go on the patrons home page (members/members-home.pl)
2/ Launch a search
3/ The dropdown list close to "Add selected patrons to" should contain
all your patron lists

NOTE: Initially tested with both which created lists.
      git reset --hard origin/master
      And then dropdown list was missing them.
      Applied just this one, and they were listed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14343: Remove the DT pagination
Jonathan Druart [Fri, 4 Sep 2015 13:53:37 +0000 (14:53 +0100)]
Bug 14343: Remove the DT pagination

It does not make sense to have 2 paginations here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14343: Incorrect links to results pages in Receive Shipment List
Lyon3 Team [Fri, 5 Jun 2015 13:37:57 +0000 (15:37 +0200)]
Bug 14343: Incorrect links to results pages in Receive Shipment List

Numbered links have incorrect url. Links to result pages
don't work in Receive Shipment List (but fortunately, Next
and Previous buttons work) It's because the booksellerid is
not furnished in the url.

Test Plan :
1) Go to Acquisitions module, enter a bookseller name that you
   know you can get many page of invoices for and search for it.

2) click on Receive shipment button.

3) On bottom of the first results page, click on page number 2
   link. (cf joined screencast)

You'll see that the results include invoices from other
booksellerid. Indeed, I suppose that you get results from all booksellerid.

Intall patch and redo 3 steps.

NOTE: I did not follow this test plan.
      I read the acqui/parcels.pl code.
      The template parameter numbers is assigned in a function which has
      no reference to booksellerid at all!
      Additionally, the booksellerid is set directly elsewhere.
      It is also strange that the booksellerid references before and after
      this loop do not use the numbers.booksellerid, but just booksellerid.
      The change from numbers.booksellerid to booksellerid is correct!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14649: Followup - correct budget_period_id in fund name link
Fridolin Somers [Thu, 6 Aug 2015 07:36:42 +0000 (09:36 +0200)]
Bug 14649: Followup - correct budget_period_id in fund name link

Now that fund name is displayed in the table as a link, you see that arg budget_period_id is never defined in this link.

This is because the template var is [% budget_line.budget_period_id %] instead of [% budget_period_id %].
This looks like a mistake when converting from tmpl to tt.

Test plan :
- Without patch
- Look for a planning with funds :
    /cgi-bin/koha/admin/aqplan.pl?budget_period_id=2&authcat=MONTHS
- Click on a fund name
=> You see in URL that budget_period_id is empty :
    /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=6&budget_period_id=
- Apply patch
- Look for a planning with funds :
    /cgi-bin/koha/admin/aqplan.pl?budget_period_id=2&authcat=MONTHS
- Click on a fund name
=> you see in URL that budget_period_id is defined like in planning page :
    /cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=6&budget_period_id=2

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14649: Fix regression - display fund name on budget planning
Jonathan Druart [Thu, 6 Aug 2015 06:19:06 +0000 (07:19 +0100)]
Bug 14649: Fix regression - display fund name on budget planning

A patch from bug 11714 removes 'budget_name_indent', which was useless.
The script and the template should use the budget_name value.

Note that this patch impacts the CSV export, which does not work, so it cannot be
tested.

Test plan:
Edit a fund and click on one of the Planning value (by months, etc.)
The "Fund name" column should be correctly populated with the fund
names.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14726: Checkout summary doesn't show title
Blou [Wed, 2 Sep 2015 13:59:45 +0000 (09:59 -0400)]
Bug 14726: Checkout summary doesn't show title

Right after checking out, a small box appear with "Checkout out: Some Title (32154001669305). Due on 24/09/2015".
The title doesn't appear anymore (since the move to db schemas). This fixes it.

Test:
1) checkout ANY item, for ANY user
2) Look at summary right below the checkout input box.  The title doesn't show up.
3) apply patch, reproduce same steps (after checkin if same item).  Title appears.

Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Todo: You need to track what are the queries generated here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14602: Fix failing t/Creators.t test
Mason James [Sat, 25 Jul 2015 08:51:52 +0000 (20:51 +1200)]
Bug 14602: Fix failing t/Creators.t test

to test..

1/ run t/Creators.t test from git repo, get a FAIL

2/ apply patch

3/ repeat step 1, get a PASS

mason@xen1:~/g/k/3.16.x$ sudo  koha-shell -c 'export PERL5LIB=/home/mason/g/k/3.16.x ; cd /home/mason/g/k/3.16.x ;  prove -v  t/Creators.t' k316x1
t/Creators.t ..
1..16
ok 1 - use C4::Creators;
ok 2 - use C4::Creators::PDF;
ok 3 - testing new() works
ok 4 - testing pdf file created
ok 5 - testing Add() works
ok 6 - testing Bookmark() works
ok 7 - testing Compress() works
ok 8 - testing Font() works
ok 9 - testing FontSize() is set to 12 by default
ok 10 - testing FontSize() can be set to a different value
ok 11 - testing Page() works
ok 12 - testing StrWidth() returns correct point width
ok 13 - testing Text() writes from a given x-value
ok 14 - testing Text() writes to the correct x-value
ok 15 - testing End() works
ok 16 - test file /tmp/4YjPQDExeS created OK
ok
All tests successful.
Files=1, Tests=16,  1 wallclock secs ( 0.03 usr  0.01 sys +  0.48 cusr  0.05 csys =  0.57 CPU)
Result: PASS

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14779: Cannot paginate reviews
Blou [Thu, 3 Sep 2015 14:44:15 +0000 (10:44 -0400)]
Bug 14779: Cannot paginate reviews

When having more than 20 (or numSearchResults) reviews waiting to be approved in <site>/cgi-bin/koha/reviews/reviewswaiting.pl?status=1,
the paging at the bottom only offset by 1 entry, instead of moving a full page (20 entries) ahead.

The simple fix uses 'page' instead of 'offset'.

TEST:
1) Modify numSearchResult preference to a low (5?) value.
2) create X comments, where X is greater than the value above.
3) approve them all (although this step is probably unnecessary)
4) Go to tools >> comments (approved comments tab)
5) You see X entries.  Click on page 2 at bottom.  Link should show "offset=2")
6) You get same results, except the first one which "slided out".

Apply patch, redo step 4-5.

With patch, paging works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14472: (follow-up) Wrong ISSN search index in record matching rules
Jonathan Druart [Thu, 3 Sep 2015 08:53:18 +0000 (09:53 +0100)]
Bug 14472: (follow-up) Wrong ISSN search index in record matching rules

Follow-up for
- it-IT unimarc
- ru-RU unimarc
- uk-UA unimarc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14472: Wrong ISSN search index in record matching rules
Amit Gupta [Mon, 29 Jun 2015 16:12:08 +0000 (21:42 +0530)]
Bug 14472: Wrong ISSN search index in record matching rules

To Test
---------
 1) Apply the patch
 2) Export some MARC bibliographic records from Koha
 3) Import those same MARC bibliographic records using the
    "ISSN(022$a)" record matching rule.
 4) The incoming records should match perfectly
 5) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.
For new Koha installation
 1) create the koha database
 2) Go to the staff client page, and do a "fresh" install making
    sure to select lots of optional marc 21 matching rules so
    the .../marc21/optional/marc21_default_matching_rules.sql
    gets triggered.
 3) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.

Bug 14472 - Added Atomic Update to fix wrong issn search index

    - Fix comments

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14098: DBRev 3.21.00.024
Tomas Cohen Arazi [Mon, 7 Sep 2015 14:22:30 +0000 (11:22 -0300)]
Bug 14098: DBRev 3.21.00.024

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14098: Implement the copy_and_replace action for MTT
Jonathan Druart [Wed, 27 May 2015 12:02:25 +0000 (14:02 +0200)]
Bug 14098: Implement the copy_and_replace action for MTT

This patch implements the copy and replace action for the marc
modification templates.
Instead of copying a field/subfield, it will erase the destination
fields/subfields.

Test plan:
Find it yourself.
Compare the differences between the copy and the copy_and_replace
actions.
The easier way to test is to 1/ create a complete record, 2/create some
modification templates and 3/ use the batch record modification with the
"preview" function.

QA note: I kept the same tests as "copy" and, if no change were
expected, I noted them "(same as copy)", to be sure this new action won't
introduce regression on these tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14098: Add copy_and_replace action to MMT
Jonathan Druart [Wed, 27 May 2015 11:38:38 +0000 (13:38 +0200)]
Bug 14098: Add copy_and_replace action to MMT

This patch add the new value for the MTT action.
It updates the marc_modification_template_actions.action DB field to
allow 'copy_and_replace_field'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14098: Remove unedeed subroutines
Jonathan Druart [Wed, 27 May 2015 11:34:09 +0000 (13:34 +0200)]
Bug 14098: Remove unedeed subroutines

Just some cleaning before to continue, _copy_field and _copy_subfield did not
do anything useful.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14098: FIX Copy a subfield should not update the original field
Jonathan Druart [Wed, 27 May 2015 10:51:37 +0000 (12:51 +0200)]
Bug 14098: FIX Copy a subfield should not update the original field

There is an inconsistency in the copy action:

Given the following control sample:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aA_exists
         _bB_exists

If we apply action (a) Copy the whole field 245 to 300, we get:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aA_exists
         _bB_exists
  300    _aThe art of computer programming
         _cDonald E. Knuth.

If we apply action (b) Copy the subfield 245$a to 300$a, we get:

  245    _aThe art of computer programming
         _cDonald E. Knuth.
  300    _aThe art of computer programming
         _bB_exists

In (a) the field is copied but in (b) the subfield is erased.

We should be consistent and don't erase the destination field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14721: OAI-PMH must return error when no results
Fridolin Somers [Tue, 25 Aug 2015 09:33:04 +0000 (11:33 +0200)]
Bug 14721: OAI-PMH must return error when no results

When getting records from OAI-PMH, an error must be returned if there is no results.

See : http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions

Test plan :
- Enable OAI webservice
- Perform a query that will return no results. ie : /cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml&from=2099-12-30&until=2099-12-31
=> Without patch you get a response with :
   <ListRecords/>
=> With patch you get a response with error code :
   <error code="noRecordsMatch">No records match the given criteria</error>
- Check a good query returns still results
- Same test with ListIdentifiers verb

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14766: unimarc_field_4XX: escape ', ", \n, \r
Julian Maurice [Fri, 4 Sep 2015 06:57:08 +0000 (08:57 +0200)]
Bug 14766: unimarc_field_4XX: escape ', ", \n, \r

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14766: Complete cataloguing plugin unimarc_field_4XX
Paul Poulain [Wed, 26 Aug 2015 08:54:30 +0000 (10:54 +0200)]
Bug 14766: Complete cataloguing plugin unimarc_field_4XX

Add subfields l, n and o for better UNIMARC compliance

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Note: I just did a code audit here, as I don't know enough about
UNIMARC to know if the 4XX fields should have these subfields.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14651: Koha::Item->effective_itemtype fallback to bib-level
Tomas Cohen Arazi [Tue, 18 Aug 2015 19:37:27 +0000 (16:37 -0300)]
Bug 14651: Koha::Item->effective_itemtype fallback to bib-level

In some situations (bad migrations, old bugs that introduced bad data,
people having bib-level itypes for ages and switching to item level...)
the user ends with undex itype values for items.

The current code, if the user has item_level-itype set, just returns
undef. It should fallback to bib-level. In order to avoid hiding the problem
a warning is raised.

To test:
- Run the regression tets:
  $ prove t/db_dependent/Items.t
=> FAIL: tests fail.
- Apply the patch
- Run the tests again
=> SUCCESS: The tests now pass.
- Sign off :-D

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14651: (regression test) fallback to bib-level if itype is undef
Tomas Cohen Arazi [Tue, 18 Aug 2015 19:34:25 +0000 (16:34 -0300)]
Bug 14651: (regression test) fallback to bib-level if itype is undef

Koha::Item->effective_itemtype should fallback to biblio-level itemtype
even if item-level item types are set, in the case the item has no itemtype
set (bad migration, bad old code).

To test:
- Run
  $ prove t/db_dependent/Items.t
=> FAIL: Koha::Item->effective_itemtype doesn't work properly

Edit: Added a test for a warning when falling back as per QA request
and because it made a lot of sense :-D

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14717: DBRev 3.21.00.023
Tomas Cohen Arazi [Mon, 7 Sep 2015 14:12:49 +0000 (11:12 -0300)]
Bug 14717: DBRev 3.21.00.023

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14171: Update borrowers date fields
Jonathan Druart [Thu, 3 Sep 2015 15:07:42 +0000 (16:07 +0100)]
Bug 14171: Update borrowers date fields

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
http://bugs.koha-community.org/show_bug.cgi?id=14717

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14717: Prevent 0000-00-00 on updating a patron
Jonathan Druart [Thu, 3 Sep 2015 15:03:17 +0000 (16:03 +0100)]
Bug 14717: Prevent 0000-00-00 on updating a patron

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14717: Invalid dates in debarred column
Chris Cormack [Mon, 24 Aug 2015 22:00:20 +0000 (10:00 +1200)]
Bug 14717: Invalid dates in debarred column

To test
1/ Import a patron using the patron import tool, make sure they have
no debarred column in the file
2/ Check the database, notice the debarred column is 0000-00-00
3/ For bonus points, checkout an item to that borrower, then check it in
notice Koha errors
4/ Apply patch
5/ Import a new patron
6/ Notice column is now NULL and that checkins work

Signed-off-by: Eugene Espinoza <eugenegf@yahoo.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 11273: FIX barcode generation in acquisition if hbyymmincr
Jonathan Druart [Tue, 14 Jul 2015 12:12:46 +0000 (13:12 +0100)]
Bug 11273: FIX barcode generation in acquisition if hbyymmincr

When AutoBarcode is activated and you have set AcqCreateItem to 'on
order' there is a Javascript error when you try to generate a barcode
for the item:

TypeError: document.f is undefined
http://localhost:8080/intranet-tmpl/lib/jquery/jquery.js
Line 11

Test plan:
0/ a. Set AutoBarcode to hbyymmincr
   b. Set AcqCreateItem to 'on ordering'
   c. Set the plugin barcode.pl to the barcode field for the default
   and the ACQ frameworks
1/ Go on the add items page (cataloguing/additem.pl) and confirm that
the plugin works as expected.
2/ Go on the New order page (acqui/neworderempty.pl) and confirm that
the plugin works as expected.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 13585: Add a cronjob which send UsageStats monthly.
Julian FIOL [Wed, 15 Jul 2015 14:10:17 +0000 (16:10 +0200)]
Bug 13585: Add a cronjob which send UsageStats monthly.

This patch introduces entries for monthly running the share_usage_with_koha_community.pl
script to the packages and also the crontab.example file for manual
installs use.

Edit: I fixed the Copyright line

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14354: Prevent edition of items from other branches if IndependentBranches is on
Jonathan Druart [Tue, 14 Jul 2015 17:07:37 +0000 (18:07 +0100)]
Bug 14354: Prevent edition of items from other branches if IndependentBranches is on

If IdependentBranches is ON, to edit/delete items from other branches
you need to be superlibrarian.
Currently a "simple" staff user cannot edit them from the edit item page
but from the catalogue detail page.

The edit links should not be displayed on this table.

Test plan:
O/ Set IndependentBranches to "Prevent".
Create a record and add 2 items:
   Set homebranch to L1 for item I1.
   Set homebranch to L2 for item I2.
1/ With a superlibrarian user, you should be able to edit both items.
2/ With a "simple" user attached to L1, you should only be able to edit
I1. The edit links should not be displayed for I2.

Note that the checkbox is displayed on the catalogue detail page (item
list), but on the batch tools, it won't be possible to select non-modifiable
items.

TODO: Add a server-side check. Indeed it is still possible to edit an
item if the user know the url.

Followed test plan. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14526: (follow-up) add a space before equals sign
Joonas Kylmälä [Mon, 31 Aug 2015 05:06:16 +0000 (05:06 +0000)]
Bug 14526: (follow-up) add a space before equals sign

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14526: Add some unit tests for MoveReserve
Marcel de Rooy [Wed, 15 Jul 2015 12:17:11 +0000 (14:17 +0200)]
Bug 14526: Add some unit tests for MoveReserve

The change in MoveReserve from the previous patch begs for a test.
Here we add some to Reserves.t.
In all six tests we place a hold, move it and check the reserves again.
Depending on the status of ConfirmFutureHolds, and the reservedate the
hold should be moved or not.

Test plan:
Run the unit test.
Bonus: If you run Reserves.t by applying this patch but without the first
patch that changed MoveReserve, tests 60 and 61 should fail:
    not ok 60 - MoveReserve filled future hold now
    not ok 61 - MoveReserve filled future waiting hold now
This may further illustrate the need of the first patch.

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 14526: MoveReserve should look at future holds too
Marcel de Rooy [Mon, 13 Jul 2015 19:55:55 +0000 (21:55 +0200)]
Bug 14526: MoveReserve should look at future holds too

At checkout a hold for the same borrower is considered to be filled.
It is consistent to do the same for holds of the same borrower within
[ConfirmFutureHolds] days (if non-zero).

This goal is achieved by adjusting the CheckReserves call within
MoveReserve, adding the lookahead parameter.
I used this occasion to revisit other calls of CheckReserves:
- transferbook: no need to add lookahead; a future hold should not block
  a transfer;
- CanBookBeIssued: no lookahead; future hold does not block an issue;
- CanBookBeRenewed: idem.
- GetOtherReserves (only used in circ/returns): this call might be a
  candidate for lookahead too, but I leave that for another report. It is
  in the context of checkin and transfer, not checkout.

Test plan:
[1] Set ConfirmFutureHolds to zero days. (You may also need to enable
    AllowHoldDateInFuture.)
[2] Place a hold with borrower A on biblio X for tomorrow. Also place a hold
    with borrower B on X for today. (Use biblio level holds.)
[3] Check out item Y of X to borrower A. Ignore the warning for borrower B
    and do not cancel the hold of B (so: confirm checkout).
    Verify that X has still two holds.
[4] Check in Y (without confirming a hold).
[5] Enable ConfirmFutureHolds, say 2 days.
[6] Check out Y to A again. Ignore the warning for B (no cancel). Verify that
    X now only has one hold for borrower B (the hold for A was filled).

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
Katrin Fischer [Mon, 25 May 2015 15:01:46 +0000 (17:01 +0200)]
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts

To test:
- prove t/db_dependent/Letters.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 13972: Include fields from subscription and serial table in serial notification...
Katrin Fischer [Mon, 25 May 2015 12:53:29 +0000 (14:53 +0200)]
Bug 13972: Include fields from subscription and serial table in serial notification email

Currently it's not possible to include information about which
issue has arrived in the serial notification notice the patron
can subscribe to from the OPAC.

The patch makes the fields from the subscription and serial
table available to the notice template.

In order to be able to print information about the correct
issue, the GetAlert has been modified to expext the serialid
as externalid when the module is issue.

git grep SendAlerts (only call with 'issue' is in Serial.pm)

To test:
- Add a subscription, select a patron notification template
- Search for the record in the OPAC
- Go to the subscription tab - More details
- Subscribe to the notification
- Edit the notice template you selected for the subscription
  - add fields from subscription
  - add fields from serial (serial.serialseq has the issue
    information)
- Receive an issue for the subscription
- Check that you have received the notification and that
  all information has been printed correctly
  NOTE: notice is sent directly, not through the message_queue

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12965: Prevent to erase an existing item type
Jonathan Druart [Fri, 10 Jul 2015 15:11:48 +0000 (16:11 +0100)]
Bug 12965: Prevent to erase an existing item type

On creating an item type, if it already exists, it will replace the
existing one.
This patch prevent that and display a message to the interface.

Note: The fields are lost.

Test plan:
1/ Create an item type 'AAA', description 'AAA'
2/ Edit it, update the description with 'BBB'
3/ Create an item type 'AAA' with a description 'CCC' => you should get
a warning "already exists".

Works well, no errors

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Warning message is triggered.
Adding, editing and deleting item types still works.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 12885: Fix if url contains +*... and HTML5 Media is enabled
Jonathan Druart [Wed, 15 Jul 2015 11:49:03 +0000 (12:49 +0100)]
Bug 12885: Fix if url contains +*... and HTML5 Media is enabled

The special regex chars are not escaped in C4::HTML5Media.

Test plan:
1/ Set 856$u=http://www.mrqe.com/lookup?talented+mr.+ripley
2/ Enable the pref HTML5Media
3/ Go on the detail page
It should not explode.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 13943: Prevent the deletion of items if the user cancels
Jonathan Druart [Mon, 13 Jul 2015 16:34:53 +0000 (17:34 +0100)]
Bug 13943: Prevent the deletion of items if the user cancels

On the edit items page, there is some weird JS code: if the user clicks
on the delete link and then cancel, the item is deleted anyway.

It's caused by the following JS code in browser.js
  $('a[href*="biblionumber="]').click(function (ev) {
      ev.preventDefault();
      window.location = $(this).attr('href') + '&searchid=' + me.searchid;
  });

Test plan:
- Do a search with multiple results
- Go to the detail page (make sure results browser shows up!)
- Use the "Edit items" link from the toolbar
- Delete an item (try both way)
- Choose "cancel"
- Delete an item (try both way) and confirm the deletion
You should see the browser after the deletion and the item should have
been deleted correctly.
- Edit an item (try both way)
You should see the browser (did not work before this patch)

Note: Before this patch, the 2 first columns didn't contain the
edit/delete item links, now it's only the 1st one.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Much better!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
9 years agoBug 11247: Improve tests
Jonathan Druart [Wed, 2 Sep 2015 14:07:07 +0000 (15:07 +0100)]
Bug 11247: Improve tests

This patch makes the tests non dependent on the DB and test the 3 marc
flavours.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>