Bug 9591 : Set Library changes after viewing Holds Queue >> reserves item

To test
1. Log in to the staff client. Note your logged in library.
2. Navigate to Circulation -> Holds queue.
3. Select a holds queue report for a library other than your own.
4. From the holds queue report page, click the "Check out" tab and
   enter the card number of a patron who has holds.
5. On the circulation page for that patron, click the "Holds" tab.
6. Click one of the titles in the list of holds.

Your logged in branch will now match the library you chose for the
holds queue report.

Alternate sequence:

4. From the holds queue report page, click the "Check out" tab and
   do a non-exact search (search which will return more than one result)
   for a patron who has holds.
5. Choose the correct patron from the list of results.

Your logged in branch will now match the library you chose for
the holds queue report.

Apply the patch and repeat, this time it should not change your logged
in branch

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Weird bug, the patch works for me.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch. All tests and QA script pass.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 10185: Fix update 3.09.00.025

It can remove all reserves from reserves table when there is no entries
in old_reserves.
This is due to @ai which is set to NULL in
  SET @ai = ( SELECT MAX( reserve_id ) FROM tmp_reserves )
and reserve_id > NULL returns no results in
  INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > @ai

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan and comments on second patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 37c52367b08f30514483b02a387cb5a463ea15d0)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 254173bc21043b92cecd3037962da832175bcdcc)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 10185: Add missing columns in update 3.09.00.025

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
SQL only changes fixing an important database update.

IMPORTANT: Patches must be backported to all versions containing
the database update 3.09.00.025.

I used the test plan provided by Julian with some additions:
1/ Do a fresh 3.8 install
2/ Do some reserves
3/ Check your old_reserves table is empty
4/ Update your sources to 3.10
5/ Run updatedatabase.pl
6/ Your reserves table is now empty!

I made sure I had item level and title level holds, also
suspended holds.

I repeated the test with entries in my old_reserves table
(cancelled and filled holds) to make sure this is also still
working correctly.

Before the patch we lost all suspended holds and when the
old_reserves table was empty also all holds in general.
After the patch the reserve_id is added but the other data
in both tables is not altered.

NOTE: Adding the reserve_id first to old_reserves and then
to reserves we are missing one id in between.
old_reserves: 1,2,3
reserves: 5,6
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 30d067400e6d15cd86d8b35daed4bb10438d0e2e)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 059cc4cd3ac5e40326fb8653b581a35dca585ed8)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Merge remote-tracking branch 'kc/3.10.x' into 3.10.x
Bug 9679 - can't place hold from cart in CCSR

When the CCSR theme is enabled, selecting items in the cart and clicking
"place hold" triggers a JavaScript error and fails. This patch adds a
function missing from the CCSR version of basket.js.

To test, apply the patch and clear your browser cache.

- Enable the CCSR theme and put items into the OPAC cart.
- Open the cart, select one or more items, and click "place hold."

The cart should automatically close and the main window should redirect
to the holds screen showing your selections.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed patch fixes the problem described.
All tests and QA script pass, JavaScript only change.
No strings involved, save for inclusion in 3.12.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit d0f93e67726ed242e1124d36ed00d1a4a3645701)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit 2b0ba53cad029941c8ecb21825cee5c904e89529)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Merge remote-tracking branch 'origin/3.10.x' into 3.10.x
Bug 7228: can't add items in an order with Modify

We have a message if we want to add items and we can't add, substract only.
It's ok if we choose to create items on ordering, in this case koha can't add items, just substract
and in this case we have to delete manually the items(s) in the catalog.
But if via the syspref AcqCreateItem we choose to create items when receiving this limitation is not usefull
The patch just checks if the syspref AcqCreateItem is on 'ordering'
if not the message is not shown and we can add items

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Here is the test I made for signing off :
after applying the patch
- syspref AcqCreateItem  : create items on RECEIVING
- in a basket, create an order (quantity = 1)
- save the order
- reopen the order
- change the quantity (2 instead of 1)
- save the order
=> changing quantity was not possible before the patch

- syspref AcqCreateItem  : create items on CATALOGING
- in a basket, create an order (quantity = 1)
- save the order
- reopen the order
- change the quantity (2 instead of 1)
- save the order
=> changing quantity was not possible before the patch

- syspref AcqCreateItem  : create items on ORDERING
- in a basket, create an order (click on "add" to add an item => quantity = 1)
- save the order
- reopen the order
- try to change the quantity (2 instead of 1), without clicking on "add" to create a new item => you cannot (alert message)
=> the behavior is the same as before the patch

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Copied test plan from bug report.
Template only change deactivating the Javascript that blocks
you from changing the quantity when AcqCreateItem is set to
something else than 'ordering'.
Passes all tests and QA script.
**Rebased for 3.10.x**

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>