Bug 10212: Columns configuration for tables

This development introduces ColVis into Koha and provides a configuration
page for columns visibility.

ColVis is a plugin for DataTables. It allows to change the visibility of
the columns in the table.

* This development adds:
  - the js and css file for ColVis
  - a new DB table 'columns_settings'
  - a new template plugin 'ColumnsSettings'
  - a new package C4::Utils::DataTables::ColumnsSettings
  - a new admin page admin/columns_settings.pl

* How it works:
A yaml file is created (admin/columns_settings.yml) in order to take an
inventory of all tables where ColVis is implemented. This file is read
to create the list of modules, pages and tables in the configuration
page.
There are 3 possible keys in the yml:
 - is_hidden: default is 0
The column will be hidden.
 - cannot_be_toggled: default is 0.
ColVis will allow to hide/show the column.
 - cannot_be_modified: default is 0
Default values (in the yml) won't be modifiable.

When a user changes (or saves) the configuration for one module, all
columns are added to the DB table. The values in the DB get the upper hand
on the yaml values.

* Humm, strange?
It seems weird to have 2 storages for the same values. But I
think it will be easy to add an entry and maintain the yaml rather than
adding a new row (and new entry in updatedatabase script) in the DB.

* To go further: We can imagine that the configuration is saved for each
user (and not globally like it is made with this patch).

This patch cannot be tested as it, you need to apply the "POC" patch.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script, more comments on last patch.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Columns configuration for tables - DB changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Columns configuration for tables - Unit tests

test plan:
Verify the
  prove t/db_dependent/ColumnsSettings.t
returns green.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Columns configuration for tables - Add Colvis files

This patch only adds Colvis js and css files.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Columns configuration for tables - POC

This patch proves that this feature is useful with a concret use case.

Test plan:
1/ Execute the updatedatabase in order to create the new table.
2/ Take a look to the yml structure.
3/ Go on the admin currency page (admin/currency.pl).
4/ Check that you cannot hide the 2 first columns on the table.
5/ Try to hide/show columns.
6/ Go on the columns configuration page (admin/columns_settings.pl).
7/ Only the admin tab are filled with data. Check/uncheck checkboxes and
save.
8/ Go on the admin currency page and check that the behavior is what
you expected.
9/ Give me some feedback :)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Add Colvis to the about page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Move colvis files to the include file

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

Implements the option to change the default columns that appear in
a table while giving the user the option to change the columns
individually for a session.

As an example, this feature is implemented for the currencies table.

Works well for all possible combinations in configuration.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: Use the update_or_create DBIC method when possible

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: (qa followup) accordion collapsed by default

By default, the accordion shows the first element (Acquisitions) which
is empty, and missleading. This patch collapses it by default.

The expected behaviour is that if we are rendering because the user saved
its changes, the modified accordion should be expanded, so I added a test
for the $panel variable.

Template comment added for future references about it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10212: DBRev 3.17.00.015

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12222: members-update.tt has a giant hash variable

This patch changes that giant hash by a TT block
to find apropriate strings

To test:
1) Apply the patch
2) On opac log as some user and request some modifications
on personal data
3) On staff, reload main, will see a notice that a patron
has requested modification, clic on the link
4) All modified data must show with apropriate legends
for each db column, check for regressions
5) Update translation files for your preferred language, xx-YY
Check for new strings, e.g.
egrep "Alternate address" misc/translator/po/xx-YY*
You must find old and new instances
(old with #~ , in particular the hash one)

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

Works as advertised, strings are now translatable.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
I like to have this fixed. I'd like it to use C4::Templates::GetColumnDefs
instead, but it belongs to another bug report I guess.
Bug 12808: remove useless diags from t/db_dependent/Context.t

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12718 - Show extended patron attributes in the OPAC

At some point the patron details page in the OPAC lost the display of
patron attributes. This patch returns the attributes to the update page.

To test, log in to the OPAC as a patron who has data in one or more
extended patron attributes. View the "your personal details" page
(opac-memberentry.pl):

- Confirm that the information displays correctly.
- Test with OPACPatronDetails both on and off.
- Test with patron who has no data in extended patron attributes.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Attributes only display when 'display in OPAC' is configured.
Attribute shows correct description, when authorised value is used.
Works as expected, updating is currently not yet possible.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402: Use an object for contacts

In preparation for adding the ability to handle multiple contacts, this
patch moves booksellers' contacts into their own class,
C4::Bookseller::Contact.

To test:
1) Apply patch.
2) Run database update.
3) Edit a bookseller, making sure to add a contact.
4) View the bookseller's information, making sure the contact
   information is there.
5) Run the unit test:
    > prove t/db_dependent/Bookseller.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402: Move contacts to separate table

This patch normalizes the data structures used for bookseller
contacts.

To test:
1) Repeat tests described on previous patch.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402: Add ability to enter multiple contacts

Some vendors may have more than one contact. For example, a technical
contact and a billing contact, or a contact for journals and a contact
for monographs. Rather than require that each contact be either made
into a separate vendor or recorded somewhere outside of Koha, it would
be really useful of Koha had the ability to add multiple additional
contacts to vendors in the Acquisitions module.

To test:
1) Apply patch.
2) Edit a bookseller, making sure to add a contact.
3) View the bookseller's information, making sure the contact
   information is there.
4) Run the unit test:
    > prove t/db_dependent/Bookseller.t
5) Add multiple contacts to a vendor, see that they show up.
6) Delete one contact from a vendor with multiple contacts,
   see that the result is correct.
7) Sign off.

Note: This test plan can supersede that on the previous two patches,
as all functionality of the previous two patches is required by this
one.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402 [Template follow-up] Add multiple contacts for vendors

This template-only follow-up tweaks the button labels and restructures
the vendor view layout a little bit to make it more amenable to multiple
contacts:

- Add spaces after button icons
- Change "Add contact" to "Add another contact" in hopes of making it
  less ambiguous whether clicking it will submit the whole form.
- Eliminate duplicate headers on the vendor view page by making the
  contact name the subheading for each individual contact.

To test, view details for vendors with one or more contacts, and try
editing to add additional contacts. Everything should look good and work
correctly.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402 follow-up: choose contacts for claims

This patch makes it possible to choose a particular contact for
acquisitions and serials claims. To test:

1) Select a contact to use for claiming late orders and a contact
   to use for claiming late issues.
2) Send a claim for a late order and a claim for a late issue.
3) Note that the claims went out to the proper people.
4) Run the unit test with:
    > prove t/db_dependent/Letters.t
5) Sign off.

Note: the claim messages are recorded in the logs in the *Acquisitions*
module, not the Letters module as you might expect

This patch also fixes several perlcritic violations and centralizes
contact-related unit testing in Bookseller.t.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10402: FIX conflicts in Letters.t

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
10402: DBRev 3.17.00.016

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>