Bug 8970 - fix MARC import under plack

There were database handles being shared between a parent and a child
process, which is a big no-no, and was leading to crazy crashes. Fine
under CGI, but not in a persistent environment. This causes the child to
make a new database handle to use. Also some small cleanups.

To test:
* In a plack environment,
* Tools -> stage MARC records for import
* Use a reasonable size file (but not too big as it all goes into RAM -
  I made one about 40MB.)
* Make sure that it works, and that the progress bars progress.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Tested with a 55M file, I reproduced the error and I confirm this patch
fixes it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: Changed OPACItemHolds syspref to be no|yes|force choice

Currently, the Koha system preference OPACItemHolds allows a library
system to choose to allow patrons to place bib and item level holds from
the OPAC, or to allow patrons only to place bib level holds only from
the OPAC.

This patch set adds a third option, "force", which *requires* that
patrons place item level holds from the opac, with no option of making a
bib level hold.

This patch modifies the system preference OPACItemHolds to be of the
type "Choice", with the choices being "no", "yes", "force". The patch
does not alter the currently set value of OPACItemHolds for database
updates, only adding the additional option.

Test Plan:
1) Set OPACItemHolds to "no". Check that OPAC holds behave as it is now
(no "Place On" column, no "Select a specific copy" table, making a
reserve is successful)
2) Set OPACItemHolds to "yes". Check that OPAC holds behave as it is now
( "Place On" column is there, "Select a specific copy" table shows when
"A specific copy" is selected, making a reserve is successful)
3) Set OPACItemHolds to "force". Check that OPAC holds behave as follows:
  -  no "Place On" column is present
  -  "Select a specific copy" table is opened
  -  making a reserve is successful

This patch is a squashed patch of the 3 following patches:

Amended opac-reserve.tt accordingly

Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>

Bug 7825: Followup prevent submission without choosing an item

+ Fix some ergonomic issues in opac-reserve

Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com>

Bug 7825: Updatedatabase should only change the type and options values.

The value field should not be changed. We have to keep '1' for 'yes' and ''
for 'no'.

Original patch is from Srdjan Jankovic.

Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on 4th patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: Changed OPACItemHolds syspref to be no|yes|force choice - bootstrap

Same test plan as previous patch but with the bootstrap theme set.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: (follow-up) clarify the yes and no values

The value of the pref should be '1' (for yes) or '0' (for no).
The options could be kept as 'yes' and 'no': since the ImplicitTyping is
set, yes/no would become '1/0'. But I think it is preferable not to use
the yes/no value in order not to introduce a bug here if ImplicitTyping
is unset later.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: (follow-up) fix the force value for the bootstrap theme

If the pref was set to 'force', the item selection was not shown.
.copiesrow should be hidden before showing specific #copiesrow_ID

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Works on template level, tested with Boostrap and Prog theme
with all 3 possible seetings of OPACItemHolds:

1) no = offer only title level holds
2) yes = offer both title and item level holds
3) force = offer only item level holds

Also ran some additional tests on the Boostrap theme with
deactivated Javascript.

Note: I like this, but I think when "force" is selected the
item list needs to be shown by default. I am also not happy about
preselecting the first item.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: (follow-up) do not preselect item when OpacItemHolds is 'force'

This patch changes the default behavior for the 'force' value.
If the pref is set to force, no item is preselected and the item list is
shown.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: (follow-up) do not preselect item when OpacItemHolds is 'force' - bootstrap

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Retested with all 3 themes, works as expected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7825: DBrev 3.17.00.003

Signed-off-by: Galen Charlton <gmc@esilibrary.com>