Bug 9890: fix plugin handling by koha-create and koha-create-dirs

1) koha-create: fill in __PLUGINS_DIR__
2) koha-create-dirs: create the directory, set permissions (writeable by the koha user)

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10379: silence zebra rebuild cron when no instances are enabled

This adds a -q option to koha-rebuild-zebra that prevents it outputting
help if no instances are provided on the command line. This means that
if you've just installed the package, you won't get messages from cron
telling you how to use the script.

Test plan:
* install koha-common 3.12 or master onto a system with no enabled
  instances.
* note that you or the sysadmin will start getting emails every 5
  minutes.
* replace /etc/cron.d/koha-common and /usr/sbin/koha-rebuild-zebra with
  the versions from this patch.
* note that the emails stop flowing.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
"sudo koha-rebuild-zebra -q" gives no output, as expected.
Followed the test plan, all looks good.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10379 - Followup: add koha-rebuild-zebra -q to the man page

The first patch on this bug forgot to add the new -q option to
koha-rebuild-zebra to the man page for that command. This patch
fixes it.

To test, run something like these commands:

$ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
  debian/docs/koha-rebuild-zebra.xml
$ man -l koha-rebuild-zebra.8
This should display the man page. (Remember to remove koha-rebuild-zebra.8
when you are done :-)

$ prove xt/verify-debian-docbook.t
All tests should pass.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9757: Make staff client list contents view more like search results

This patch revises the staff client list contents view to better match
staff client search results, showing more information and offering more
ways to interact with the contents than before.

- List contents output has been modified so that the staff client can
  use XSLT-formatted data just as the OPAC can. As in the OPAC it
  depends on XSLTResultsDisplay being enabled.
- A "toolbar" has been added which is similar to that in search results,
  offering the option to add items to a Cart, add them to a different
  list, place multiple holds, remove items from the list, or merge
  records.
- This toolbar has been made to float on scroll like the one on the
  MARC edit page.
- Library and shelving location have been added to the display of call
  numbers. Call numbers are linked to a search as they are in search
  results.
- Edit links are included just as they are in search results.
- Automatic focus on the add by barcode form has been removed so that
  the page doesn't jump to the bottom unnecessarily.
- basket.js's "addMultiple" function has been modified so that it
  receives an array of checkboxes rather than looking for checkboxes in
  a specific form. This helps abstract its functionality for use on both
  search results and lists. results.tt is modified accordingly.
- The page layout has been widened to make room for the increased amount
  of information on the page.
- A new "merge" icon has been added to the default Bootstrap sprite.

To test:

- View both public and private lists in the staff client.
- View lists with and without contents.
- Test the functionality of options in the toolbar: Add to cart, add to
  lists, place multiple holds, remove items, merge items.
- Test with users with and without cataloging privileges to confirm that
  catalog-related controls are correctly shown or hidden.
- Test with XSLTResultsDisplay set both to "default" and empty.
- Since the staff client and OPAC use some of the same code, test that
  lists in the OPAC have not broken.
- Since JavaScript was modified which affects both lists and search
  results, confirm that adding items to the Cart and Lists from search
  results hasn't been broken by this patch.

Revision corrects conditional display of hold link, hiding it in cases
where there are no items or the record's itemtype is not for loan.

Also corrected is the behavior of the Cart/List "save" button in order
to prevent it from submitting the "remove items" action which is the
default for the form.

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>

Edit: Patch rebased against current master and hard-coded paths to
/prog/ corrected.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9757: Remove duplicated action buttons.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bug 10495: set precondition for HoldsQueue test

t/db_dependent/HoldsQueue.t assumed, but did not check,
that the AutomaticItemReturns system preference was off
at the beginning of the test un.  This patch makes sure
that that assumption is met.

To test:

[1] Make sure that at least one item is on loan (this is
    another assumption that the test case makes, one
    that should be corrected with the work proposed
    for bug 10336.
[2] Turn the AutomaticItemReturn system preference on.
[3] Run the test:

prove -v t/db_dependent/HoldsQueue.t

[4] Tests 4 and 6 should fail.
[5] Apply the patch.
[6] Run the test case again; this time, all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10336: HoldsQueue.t needs to create its own data

After applying this patch and the patch submitted in bug 10495, you can
run prove t/db_dependent/HoldsQueue.t and admire that all tests pass.

This patch creates a borrower and uses Koha routines instead of directly
updating the database.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7368: Followup for columns names in userflags.sql

An insert statement should contain the column names to avoid confusion and
future problems with table definition changes.

This patch updates the English userflags.sql.

Will send updates for the other languages in connection with replacing inserts
by updates for the additional languages (where possible). For userflags this
will be possible.

Test plan:
Do an install (English).

Or -- as a dangerous(!) alternative--:
Do this ONLY on a restorable database.
Delete all records in userflags. (Note: This cascades to permissions a.o.)
Run this file from command line.
Check if you have records again in userflags. (You also messed up your Koha.)
Restore your database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested both ways myself :)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described. No errors.
Tested using second alternative

Just a note: if you update other lang files replacing INSERTs for UPDATEs
then you must install using EN and later apply lang files by hand.
If you do a translate first before webinstaller, and finish your install
in your lang, then that kind of file will fail.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

mysql> create database test;
Query OK, 1 row affected (0.00 sec)

% mysql -u koha -p test < installer/data/mysql/kohastructure.sql
% mysql -u koha -p test < installer/data/mysql/en/mandatory/userflags.sql

mysql> select count(*) from userflags;
+----------+
| count(*) |
+----------+
|       19 |
+----------+
1 row in set (0.00 sec)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10386: improvements to VirtualShelves.t

Most important: Does no longer delete all shelves!
Checks if there are ten borrowers for testing. But even works without them :)
When creating or modifying lists, takes name clashes into consideration.

Small change to _CheckShelfName in VirtualShelves module. Making it possible to
check a name for a list whose owner has been set to NULL. Note that a test
like field=? with undef for placeholder will not work in MySql.

Test plan:
How do you test a test? Well, you could run it on various databases..
But for real hacking, you could also add some debug lines.
I tested this by forcing 10 undefs in @borrowernumbers.
And by overwriting the return value of randomname with an existing name.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>