Bug 7673: New patron permissions

    This patch adds the following permissions:

     - editcatalogue.limited_item_edition: Limit item modification to barcode, status and note
     - editcatalogue.delete_all_items: Delete all items at once
     - tools.items_limited_batchmod: Limit batch item modification to item status

    The SubfieldsToAllowForLimitedEdition syspref is used to define which subfields can be edited
    when the editcatalogue.limited_item_edition permission is enabled.

    In the same way, the SubfieldsToAllowForLimitedBatchmod is used to define which subfields
    can be edited when the tools.items_limited_batchmod permission is enabled.

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: QA Followup: trailing whitespace and perlcritic issues

This patch fixes the following qa issues:

 FAIL   cataloguing/additem.pl
   FAIL   forbidden patterns
        forbidden pattern: trailing space char (line 833)
   FAIL   critic
        # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).

 FAIL   tools/batchMod.pl
   FAIL   critic
        # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: The delete all items link should only be displayed if delete_all_items is set

This test had been lost in a rebase.

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: the limitation on editing an item does not affect FA framework

The pref SubfieldsToAllowForLimitedEdition should not affect Fast
cataloguing framework (FA).

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: Update syspref names in script

The both syspref names have been changed since the first patch.

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: Update permission names in script

Two permission names have been changed since the first patch.

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: Change the superlibrarian check

To know if the user is a superlibrarian, we have to call
C4::Context->IsSuperLibrarian

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: DB changes - Add permissions

This patch adds:
3 permissions:
- edit_items_restricted
- delete_all_items
- items_batchmod_restricted

2 system preferences:
- SubfieldsToAllowForRestrictedEdition
- SubfieldsToAllowForRestrictedBatchmod.

Signed-off-by: Koha Team AMU <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: Assume that all fields can be edited if the pref is empty

If the sysprefs are empty, we assume that the librarian can edit all
subfields, even if s/he has the restricted permission.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673: add syspref in sysprefs.pl

Also fix a typo in the permission description

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

Copying the test plan from the bug report:
Test plan:
1/ add the following permissions to the logged in patron:
edit_item, edit_items_restricted, delete_all_items,
items_batchmod, items_batchmod_restricted

2/ Fill the prefs SubfieldsToAllowForRestrictedEdition
and SubfieldsToAllowForRestrictedBatchmod with some
subfield (for instance "995$f 995$o" and "995$o")

3/ Verify you are allowed to edit the item fields defined
in the pref SubfieldsToAllowForRestrictedEdition.

4/ Try to edit item in a batch and verify you are allowed
to edit the item fields defined in the pref
SubfieldsToAllowForRestrictedBatchmod.

5/ Try to delete all items of a record

Play with the pref/permissions and verify they are
correctly taken into account.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 7673 [Terminology follow-up] New patron permissions to manage items

This bug adds a new preference, "SubfieldsToAllowForRestrictedEdition,"
but the use of the term "Edition" in this context is incorrect. I think
it would be more clear to change the preference name to
"SubfieldsToAllowForRestrictedEditing." This patch makes this change.

I realize this isn't a big issue since the preference has a good
description, but I thought that if we were going to make this as clear
as possible now would be the time to do it.

To test, start with a database which hasn't previously been used to test
Bug 7673. Apply all patches and run the database update. Follow the test
plan as described in the bug.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, change appears complete.
All tests and QA script still pass.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13203: Plugin housekeeping: UNIMARC field 123i, 123j, 210c

In working on bug 10480, I noticed that these plugins needed some attention:

[2] unimarc_field_123i.pl: added missing template
[3] unimarc_field_123j.pl: resolved missing template with same file
[4] unimarc_field_210c_bis.pl: removed a warn, corrected some POD lines

Note about UNIMARC field 123i and 123j: Subfields $i and $j are each 8
characters long and contain the same components as subfields $f and $g
except that character position 0 contains a plus sign (for the northern
celestial hemisphere) or a minus sign (for the southern celestial hemisphere).

Test plan:
Connect unimarc_field_123i and 123j to some field.
Look especially at changing + or - for the hemisphere in the popup.
Check left-padding with zeroes for the other positions.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Checked plugin in a UNIMARC installation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12988: Update table footer with the visible rows - budgets

On the budget list view, the total was not updated.
With this patch, the footer (totals) will be updated on filtering rows.

Test plan:
To test with both CurrencyFormat pref values.
1/ Go on the budget list view
2/ Verify the totals are correct.
3/ Filter the table using the filter input and verify the totals are
updated with the rows shown
4/ Hide/Show inactive budgets and verify the totals are still corrects.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12984: Improvement of the funds list view - acqui home

Bug 11578 improved the funds list view in the administration module.
It would be great to have the same improvement on the acquisition
home page.

This improvement groups funds by budget and displays them with a
hierarchy.

Test plan:
0/ Create a budget and fund hierarchy, with active and inactive budgets.
1/ Go on the acquisition home page and verify the values are the same as
before
2/ Verify the funds are correctly listed
3/ Verify the links on top of table work (expand/collapse all, show/hide
inactive budgets).

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12989: Update table footer with the visible rows - acqui-home

Note that bug 12984 changes the view of this table.

On the acqui-home page, the total was not updated.
With this patch, the footer (totals) will be updated on filtering rows.

Test plan:
1/ Go on the acqui home page.
2/ Verify the totals are correct.
3/ Filter the table using the filter input and verify the totals are
updated with the rows shown.
4/ Hide/Show inactive budgets and verify the totals are still corrects.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12989: Fix JS error

inactive and active are not defined anymore. They should be removed. The
filter is done with DataTables.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9214 - Show damaged status in the OPAC for items which are not for loan

Item statuses in the OPAC displayed according to a cascading hierarchy:
If something is lost it will appear as lost, "else if" it is checked out
it will appear as checked out, etc. I don't think there is a logical
reason why statuses should appear this way.

This patch modifies the logic in the template so that multiple statuses
can be displayed at the same time. The patch also wraps each status in
its own class so that libraries can apply custom CSS if they wish.

Some tweaks have been made to the LESS file adding some style to the
common "item-status" class for display of item statuses.

To test, apply the patch and view one or more titles in the OPAC which
have items with the following statuses: lost, checked out, damaged, not
for loan, waiting, on order, in transit, withdrawn, and available.

Modify items to have more that one status simultaneously, in particular
not for loan and damaged.

Also test the display of item statuses in the OPAC cart and the OPAC's
course details page (Course reserves -> [Course name]) since these pages
use the same include file.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 9214 [Compiled CSS] Show damaged status in the OPAC for items which are not for loan

This patch contains the compiled opac.css file generated from the
revised LESS file in this bug's other patch.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12258 Adds Datatables to the Fines->Account page of patrons (members/boraccount.pl). Also adds a button "Filter paid transactions" to hide fines with no outstanding value (0.00).

Test steps :

* Create a few manual invoices with fines.
* Pay a fine.
* Go back to the account tab.
* Try the "Filter paid transactions" button. It should filter everything with 0.00 in the Outstanding column.
* Try the "Show all transactions" button.
* Play around with the buttons

Followed test steps. 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@gmail.com>