Jonathan Druart [Fri, 22 Nov 2019 16:37:42 +0000 (17:37 +0100)]
Bug 24151: Copy info to the pseudonymized table when a transaction is done
This is the commit where you will find useful information about this development.
The goal of this new feature is to add a way to pseudonymize patron's
data, in a way they could not be personally identifiable.
https://en.wikipedia.org/wiki/Pseudonymization
There are different existing way to anonymize patron's information in
Koha, but we loose the ability to make useful report.
This development proposes to have 2 different tables:
* 1 for transactions and patrons data (pseudonymized_transactions)
* 1 for patrons' attributes (pseudonymized_borrower_attributes)
Entries to pseudonymized_transactions are added when a new transaction
(checkout, checkin, renew, on-site checkout) is done.
Also, anonymized_borrower_attributes is populated if patron's attributes are
marked as "keep for pseudonymization".
To make those informations not identifiable to a patron, we are having a
hashed_borrowernumber column in pseudonymized_transactions. This hash will be
generated (Blowfish-based crypt) using a key stored in the Koha
configuration.
To make things configurable, we are adding 3 sysprefs and 1 new DB
column:
* syspref Pseudonymization to turn on/off the whole feature
* syspref PseudonymizationPatronFields to list the informations of the
patrons to sync
* syspref PseudonymizationTransactionFields to list the informations
of the transactions to copy
* DB column borrower_attribute_types.keep_for_pseudonymization that is a
boolean to enable/disable the copy of a given patron's attribute type.
Test plan:
1/ Turn on Pseudonymization
2/ Define in PseudonymizationPatronFields and
PseudonymizationTransactionFields the different fields you want to copy
3/ Go to the about page
=> You will see a warning about a missing config entry
4/ You need to generate a key and put it in the koha-conf.xml file. The
following command will generate one:
% htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
Then edit $KOHA_CONF and add it before of the end of the config section (</config)
it should be something like:
<key>$2a$10$PfdrEBdRcL2MZlEtKueyLegxI6zg735jD07GRnc1bt.N/ZYMvBAB2</key>
5/ Restart memcached then plack (alias restart_all)
=> Everything is setup!
6/ Create a new transaction (checkin for instance)
=> Confirm that a new entry has been added to pseudonymized_transaction with the data
you expect to be copied
7/ Edit some patron attribute types and tick "Keep for pseudonymization"
8/ Create a new transaction
=> Confirm that new entries have been added to pseudonymized_borrower_attributes
11/ Delete the patrons
=> Confirm that the entries still exist in the pseudonymized_* tables
12/ Purge the patrons (ie. use cleanup_database.pl to remove them from
the deleted_borrowers table)
=> Confirm that the entries still exist in the pseudonymized_* tables
See bug 24152 to remove data from the anonymized_* tables
Sponsored-by: Association KohaLa - https://koha-fr.org/ Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 17 Jul 2020 13:57:34 +0000 (13:57 +0000)]
Bug 26005: OPAC cart display fails with error
This patch removes the "opac_option" parameter from opac-basket.pl. It
was included in Bug 25402 because the bug was dependent on 5087.
To test, apply the patch and add some items to the Cart in the OPAC.
Click the Cart button to show the cart. The pop-up window should load
correctly without errors.
Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 20 Jul 2020 13:16:29 +0000 (15:16 +0200)]
Bug 24379: Fix failing tests
kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Patrons/Import.t
t/db_dependent/Koha/Patrons/Import.t .. 2/159
# Failed test 'No warning raised by import_patrons'
# at t/db_dependent/Koha/Patrons/Import.t line 171.
# found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
# found warning: Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3a> line 2.
# didn't expect to find a warning
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_2> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_3> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018, <$handle_4> line 2.
t/db_dependent/Koha/Patrons/Import.t .. 152/159 # Looks like you failed 1 test of 159.
t/db_dependent/Koha/Patrons/Import.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/159 subtests
1) Create two Checkouts
2) view patron's checkout list
cgi-bin/koha/members/moremember.pl?borrowernumber=pp <show
checkout>
3) in mysql shell delete a checkout home branch: update items set
homebranch = null where itemnumber = xx;
4) view patron's checkout list, again
Without this patch the list is empty.
Same if biblio title is null (update biblio set title = null where
biblionumber = yy;).
Javascript error:
TypeError: oObj.title is null
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Slava Shishkin [Mon, 29 Jun 2020 19:26:42 +0000 (22:26 +0300)]
Bug 25896: Add missing closing </td> tag
File koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt had
one lost closing </td> tag in "daysmode" block. Added.
Mentored-by: Andrew Nugged <nugged@gmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Fri, 10 Jul 2020 14:30:09 +0000 (14:30 +0000)]
Bug 25974: Remove inline style from table settings administration page
This patch removes an inline style attribute from the table settings
administration template. A different style is added to the page's
<style> block to try to accomplish a similar effect of expressing the
hierarchy of the page.
To test, apply the patch and go to Administration -> Table settings.
The individual tables of settings should be offset from the headings
above them.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Tue, 14 Jul 2020 21:30:39 +0000 (21:30 +0000)]
Bug 25987: Fix alignment of fields in label batch creation form
This patch makes minor markup changes to the template for the label
batch creation process so that form fields line up correctly.
Unrelated change: A hint has been moved out of the label area to below
the textarea in order to conform with established patterns.
To test, apply the patch and go to Tools > Label creator > New > Label
batch.
- In the batch creation form the "Enter by itemnumber" and "Enter by
barcode" should be aligned correctly with each other.
- The "One number per line..." hint should appear below the textarea.
- Test that the form fields are still correctly aligned after adding
some items to the batch and the "description" field is shown in the
form.
Works for me!
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Tue, 21 Jan 2020 17:53:09 +0000 (17:53 +0000)]
Bug 24473: Add $raw filter for Syndetics content
Syndetics offers enhanced content in the OPAC under the tabs 'Title Notes',
'Excerpt', 'About the author', 'Editions'. They provide this info as HTML
therefore we should filter it as $raw so the content shows up without the markup.
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Didier Gautheron [Wed, 24 Jun 2020 14:03:16 +0000 (16:03 +0200)]
Bug 25862: Prevent TinyMCE to mangle local url links
To test:
1 create a report 1 if it doesn't exist
2 open /cgi-bin/koha/tools/koha-news.pl
3 create a news
4 add a HTML link with Insert/Edit link tinyMCE dialog box to
/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1"
5 save
6 on the main page "report 1" link returns a 404 error
Apply patch
7 Modify news' URL
8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 8 Jan 2020 20:59:38 +0000 (20:59 +0000)]
Bug 24379: Make login_attempts not nullable
While the column defaults to 0 in Koha::Object->store we set to NULL if NULLABLE
When trying to reset a patrons password we check that the account is not administratively locked:
login_attempts != -1
This query does not return rows where login_attempts IS NULL. It will return accounts where login_attempts = 0
Let's default to 0 like we intend
To test:
1 - Create a new patron
2 - Note their login_attempts is NULL
SELECT login_attempts FROM borrowers ORDER BY borrowernumber DESC LIMIT 1
3 - Enable OpacResetPassword
4 - Attempt to reset password before logging in, you cannot
5 - Apply patch, updatedatabase, restart_all, update schema
6 - Create another patron
7 - Their login attempts should be 0
8 - Attempt to reset password, it works!
Bug 24379: Fix the test
First we create a patron using TestBuilder to get a hashref of valid
info. Then we delete it and create a new patron using Koha::Patron->new
Once stored, we should call discard_changes to make the calculated
values available in the currenct object.
Bug 24379: Don't drop default of 0 for login attempts
When moving the column we drop the default, this means that DBs upgraded form earlier versions
get the wrong values set
To test:
1 - Checkout 16.11.x
2 - Reset all
3 - Checkout master
4 - updatedatabase
5 - SHOW CREATE TABLE borrowers;
6 - Note the column login_attempts defaults to NULL
7 - Apply patch(es)
8 - Repeat
9 - Now it defaults ot 0 (and has NOT NULL if applied all)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Fridolin Somers [Wed, 24 Jun 2020 15:05:30 +0000 (17:05 +0200)]
Bug 25868: Fix transfers page to show effective itemtype
In transfers page /cgi-bin/koha/circ/branchtransfers.pl :
Itemtype is always from biblioitems.itemtype, regardless of system preference item-level_itypes.
Patch also changes template to use the object Koha::Item.
Patch also fixes a small typo : closed <form> tag.
Test plan :
1) Test with both values of system preference 'item-level_itypes'
2) Go to Circulation > Transfert
3) Enter a barcode
4) Enter another barcode
5) Check you see in table all datas and that 'Item type' is correct
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 24 Jun 2020 16:17:19 +0000 (16:17 +0000)]
Bug 25869: Fix Coce display for lists
To test:
1 - Enable Coce for Opac
CoceHost: https://coce.bywatersolutions.com
CoceProviders: Select all
OpacCoce: Enable
2 - Do a search on the Opac, confirm you see some covers
3 - Add some of the items with covers to a public list
4 - View the public list
5 - Note no covers display
6 - Apply patch
7 - Success!
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null
To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit
Signed-off-by: donnab <donna@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 2 Jul 2020 12:50:17 +0000 (12:50 +0000)]
Bug 25909: Recent change to datatables JS in the OPAC causes errors
This patch reverts some changes made by Bug 25287 which prematurely
introduced the double-underscore i18n function. The i18n features
haven't been fully implemented in the OPAC.
Some lines are reverts to the previous version, and some are additions,
for instance where Bug 25287 introduced new DataTables features and a
new string translation is required.
In addition to i18n changes, the patch also reverts the default
configuration of DataTables in the OPAC so that the "dom" configuration
option is set back to "t." This turns off features like pagination
buttons, filters, etc. which were previously disabled by default.
Enabling these features requires revision to the OPAC CSS in order for
them to display well.
To test, apply the patch and view a page in the OPAC which includes a
DataTable. For instance: checkouts on the "your summary" page, serial
issues on the "full subscription history" page.
Tables should display correctly and sorting should work correctly. There
should be no other DataTables controls visible.
To test translatability:
To test, apply the patch and test that the correct strings are
translatable. In this example I'm testing fr-FR:
- Update a translation:
> cd misc/translator
> perl translate update fr-FR
- Open the corresponding .po file for the strings pulled from
the templates e.g. misc/translator/po/fr-FR-opac-bootstrap.po
- Locate strings pulled from bootstrap/en/includes/datatables.inc
for translation, e.g.:
#. SCRIPT
#: opac-tmpl/bootstrap/en/includes/datatables.inc:4
msgid "Copy to clipboard"
msgstr ""
- Edit the "msgstr" string however you want (it's just for testing)
- Install the updated translation:
> perl translate install fr-FR
Open the translated copy of datatables.inc and confirm that the
translated string appears.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Tue, 7 Jul 2020 08:27:48 +0000 (09:27 +0100)]
Bug 25944: Schema fix for illrequests route
The illrequests path was missing the `comments` and `status_alias`
embedable relations in the path specification.
Test plan:
1/ Ensure you have the latest Mojolicious + OpenAPI modules installed.
2/ Navigate to the ill requests page and note that the table is empty.
3/ Note that under the networking tab in your browsers developer tools
that the api call fails with a 400 error.
4/ Apply the patch
5/ Refresh the page
6/ The table should now load and the api route should return a proper
200 response.
7/ Signoff
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch to a production server that was having the 400
error on the main ILL page, and the error was gone. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nick Clemens [Thu, 21 May 2020 13:41:23 +0000 (13:41 +0000)]
Bug 25566: Add option to ignore found holds and use it when checking high holds
To test:
1 - Find or create a record with 10 items
2 - Set sysprefs:
decreaseLoanHighHolds - enable
decreaseLoanHighHoldsDuration - 2
decreaseLoanHighHoldsValue - 2
decreaseLoanHighHoldsControl - 'over the number of holdable items'/dynamic
3 - Set circ rules to allow 1 hold per record on the relevant record
4 - Place 3 holds on the record
5 - Check one item in and confirm hold to set to waiting
6 - Issue to the patron with the waiting hold
7 - Get a notice that loan period is decreased
8 - Don't confirm the checkout
9 - Apply patch
10 - Restart all the things
11 - Repeat checkout, no decrease this time!
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Andreas Jonsson [Tue, 23 Jun 2020 13:57:29 +0000 (15:57 +0200)]
Bug 25850: Adapt day of week in Koha::Calendar::get_push_amt to 0..6 with 0 being Sunday.
1. Go to tools -> calendar and make sure Sundays are holidays by adding
a holiday on a Sunday and selecting "Holiday repeated every same day
of the week" and "Copy to all libraries" and save.
2. Go to administration -> system preferences and select "Use the
calendar to push the due date to the next open matching weekday
for weekly loan periods, or the next open day otherwise" for the
system preference "useDaysMode" and save the system preferences.
3. Put the below code in a file name test.pl and execute it using
the command "sudo koha-shell -c 'perl test.pl' kohadev"
use Koha::Calendar;
my $calendar = Koha::Calendar->new( branchcode => 'CPL' );
$dt = DateTime->new(
year => 2020,
month => 06,
day => 21
);
print "This is a sunday: " .
$dt->day_of_week . "\n";
my $ndt = $calendar->next_open_days($dt, 0);
print "This is a monday: " .
$ndt->day_of_week . "\n";
4. Without the patch applied, this script
will freeze after printing "This is a
sunday ...". Abort using ctrl-c.
5. Apply patch and run the script again.
The test script will now complete.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Fri, 26 Jun 2020 15:52:50 +0000 (16:52 +0100)]
Bug 25850: Regression Test
This patch adds a unit test to test for an infinite loop as highlighted
by the bug.
Test plan
1/ Run the test before applying the fix
2/ The test should fail for 'Sundays'
3/ Apply the subsquent patch
4/ Re-run the test
5/ It should now pass
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Martin Renvoize [Fri, 26 Jun 2020 15:24:00 +0000 (16:24 +0100)]
Bug 25850: Add tests for weekday holidays
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
To test:
In kohadevbox run for example:
$ ps -aux # check that no existing sip server is running, kill the process if exists
$ perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml
$ koha/misc/sip_cli_emulator.pl -su koha -sp koha -l CPL -a 127.0.0.1 -p 6001 --item 3999900000001 -m item_information
After applying this patch the Undefined subroutine error should be gone.
Note: when using the sip_cli_emulator.pl the credentials can be anything.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Jonathan Druart [Thu, 9 Jul 2020 08:52:11 +0000 (10:52 +0200)]
Bug 25964: Prevent data loss when editing items from a MARC record
Coming from:
Bug 23463: Use new method Koha::Object->set_or_blank
We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly.
In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Katrin Fischer [Sun, 24 May 2020 00:04:03 +0000 (02:04 +0200)]
Bug 25443: Improve translation of 'Select the record to link%s to'
Before this patch the title was set in italic, which caused the
translation string to be cut off. Removing the italic formatting in
favor of quotes and splitting the string into 2 sentences (dealing
with title existing and not existing:
Select the host record to link to '[% bibliotitle | html %]'
Select the host record to link
To test:
- Activate EasyAnalyticalRecords system preference
- Search for a record in staff
- Use Edit > Link to host record
- Verify the text is shown as above with the reord's title
- The second case is a bit theoretical:
- Delete 245$a from the record or empty out biblio.title using SQL
- Verify the string still shows but without the 'to...' part.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Mon, 29 Jun 2020 11:04:59 +0000 (11:04 +0000)]
Bug 25890: Update sorting column for checkouts table
Test plan:
- Check some items out, all from different libraries
- Modify the checkout and due dates, like:
2018-10-22
2018-01-23
2018-05-27
- Sort by checkout date, verify it is actually sorting on homebranch
- Apply patch
- Reload page
- Note you can now sort items correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Slava Shishkin [Thu, 18 Jun 2020 09:11:29 +0000 (12:11 +0300)]
Bug 25695: merge of similar code blocks after circulation_rules update
In onboarding.pl we have second block with adding just one more
rule parameter (maxissueqty) which can be merged to first one
after all parameters now stored in circulation_rules table.
Also this eliminates the need of adding forgotten "warn $@" after
the second eval block.
Mentored-by: Andrew Nugged <nugged@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Thu, 2 Jul 2020 12:32:51 +0000 (08:32 -0400)]
Bug 25914: Fix incorrect variable name causing relative's checkouts column to be empty in OPAC
In the OPAC, the title column in the relatives checkouts table is always empty.
Test Plan:
1) Enable viewing of relative's checkouts in OPAC
2) Check some items out to a patron
3) Log into the OPAC as a relative of that patron that should be able to
view them
4) Note the title column is empty in the relative's checkouts tab
5) Apply this patch
6) Reload the page
7) Titles should appear in the title column!
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Alex Buckley [Sun, 14 Jun 2020 22:41:03 +0000 (22:41 +0000)]
Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded
If 'Actual cost' has not been set then it has the value of 0.00 which
Perl evaluates to true so this patchset resets it to 0, so the fallback
to ecost_tax_included/ecost_tax_excluded happens.
Test plan:
1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax')
2. Set 'Vendor price' = 10 and do not set 'Actual cost'
3. Save order
4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST
column has value of -8.70
5. Jump into the database:
select tax_value_on_ordering from aqorders where
ordernumber=<ordernumber>;
[You can get the ordernumber from clicking on the 'Modify' line the item
is listed in]
6. Observe a negative value: -8.70
7. Apply patch and restart plack
8. Add a second item to the basket
9. Set 'Vendor price' = 10 and don't set 'Actual cost'
10. Save order
11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST
has value of 1.30
12. Repeat step 5 and observe tax_value_on_ordering = 1.30
13. Run t/Prices.t unit test:
sudo koha-shell <instancename>
prove t/Prices.t
Sponsored-by: Horowhenua District Council, NZ Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
Repeat the commands above and confirm that with this version of the
script you get /kohadevbox/koha inside the koha-shell
Search for possible regressions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Wed, 24 Jun 2020 12:20:03 +0000 (12:20 +0000)]
Bug 25864: Lower case fields for searching
To recreate:
1 - Have Koha using ES5 and Elasticsearch as search engine
2 - Enable DumpTemplateVarsIntranet and DumpSearchQueryTemplate
3 - Do a search in authorities using 'Search entire record' (abduction if using sample db)
4 - Note no results
5 - View the page source and find 'search_query'
6 - Note the uppercased fields
7 - curl 'es:9200/koha_kohadev_authorities/data/417?pretty'
8 - Note all fields lower-cased
9 - Apply patch
10 - Repeat search
11 - It works!
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 24 Jun 2020 06:37:18 +0000 (08:37 +0200)]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string
On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.
Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Nugged [Wed, 17 Jun 2020 20:18:01 +0000 (23:18 +0300)]
Bug 25440: Fixed list of 'show_rule' forming variables in the template
In smart-rules.tt we have `SET show_rule = ...` section which filled
with 'all used in the loop' variables. Because if historical reasons it
seems that there are some missing, few old, and even doubled ones.
This list is fixed now by:
- variable names 'article_requests' and 'renewalsallowed' repeated
so duplicates are removed;
- 'hardduedatebefore' and 'hardduedateexact' not present in the whole
site code anywhere anymore;
IMPORTANT NOTE: these 'hardduedatebefore/hardduedateexact' also
exists as remnants in .po-translation files, a lot.
- 'note', 'hardduedatecompare', 'renewalperiod', 'rentaldiscount'
template variables were missing from this 'show_rule =' checking
code so they are added.
Order of fields updated to match with above "SET field = ..." pack.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 25440: (QA follow-up) Correction for typo
'engthunit -> lengthunit
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Nugged [Sun, 10 May 2020 15:18:35 +0000 (18:18 +0300)]
Bug 25440: Fix for "uninitialized value in hash" warning in smart-rules.pl
This warning emitted:
Use of uninitialized value in hash element
at /admin/smart-rules.pl line 569.
that happened because we have NULLs in SQL results for 'categorycode'
and 'itemtype' which later used as 'any' kind of category/item in the
template, so for the template it passed this way:
but undef will stringify as "" to become a hash key ("Hashes are
unordered collections of scalar values indexed by their associated
string key" https://perldoc.perl.org/perldata.html),
that's why "undef warning". To prevent warning here is the simple fix:
Andrew Nugged [Sun, 10 May 2020 10:28:40 +0000 (13:28 +0300)]
Bug 25440: Fix for "CGI::param called in list context" in smart-rules.pl
This warning emitted:
CGI::param called in list context from /admin/smart-rules.pl line 262,
this can lead to vulnerabilities. See the warning in "Fetching the value
or values of a single named parameter" at CGI.pm line 412.
And because all these params are not multi-params, so simple "scalar .."
forcing for CGI->param is the fix. Changes are transparent and same
values should be assigned as before, just no more warnings.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Andrew Nugged [Sun, 10 May 2020 10:54:29 +0000 (13:54 +0300)]
Bug 25440: Extra duplicated call to CGI->param method removed
In code CGI param 'no_auto_renewal_after_hard_limit' assigned to
"$no_auto_renewal_after_hard_limit" var, and then just in the next line
again variable "$no_auto_renewal_after_hard_limit" reassigned with
call to same "$input->param('no_auto_renewal_after_hard_limit')".
Fixed. No logic or results should be changed.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Mon, 29 Jun 2020 11:42:55 +0000 (13:42 +0200)]
Bug 21395: Remove 'variable $DEBUG masks earlier declaration in same scope' warning
% prove t/db_dependent/Serials.t
t/db_dependent/Serials.t .. 8/49 "my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 45.
"my" variable $DEBUG masks earlier declaration in same scope at /kohadevbox/koha/C4/Barcodes/ValueBuilder.pm line 87.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Julian Maurice [Fri, 21 Sep 2018 16:05:42 +0000 (18:05 +0200)]
Bug 21395: Make perlcritic happy
This patch adds a .perlcriticrc (copied from qa-test-tools) and fixes
almost all perlcrictic violations according to this .perlcriticrc
The remaining violations are silenced out by appending a '## no critic'
to the offending lines. They can still be seen by using the --force
option of perlcritic
This patch also modify t/00-testcritic.t to check all Perl files using
the new .perlcriticrc.
I'm not sure if this test script is still useful as it is now equivalent
to `perlcritic --quiet .` and it looks like it is much slower
(approximatively 5 times slower on my machine)
Test plan:
1. Run `perlcritic --quiet .` from the root directory. It should output
nothing
2. Run `perlcritic --quiet --force .`. It should output 7 errors (6
StringyEval, 1 BarewordFileHandles)
3. Run `TEST_QA=1 prove t/00-testcritic.t`
4. Read the patch. Check that all changes make sense and do not
introduce undesired behaviour
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Thu, 1 Aug 2019 11:49:59 +0000 (11:49 +0000)]
Bug 23410: Add submenus to system preferences sidebar menu
This patch adds a submenu to the sidebar menu in the system preferences
interface. Submenu links let you jump to the sub-sections in each
preference category.
In the search results view, a link is added to allow the user to jump
directly to the section from which those results came. For instance, if
your search returns the "SuspendHoldsOpac" preference, the link will
take you to to the Circulation preferences page and jump the page to the
"Holds policy" section.
This patch also converts the expand/collapse arrows to Font Awesome
icons. The obsolete image files are removed.
If you click a submenu link for a section on the current page which has
been collapsed, the section will expand.
To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).
- Go to Administration -> System preferences.
- Test the various preference categories and confirm that the submenus
appear correctly and jump you to the right section.
- Test that if you click a section heading to collapse it that
clicking the corresponding submenu link in the sidebar causes it to
expand again.
- Do a search for system preferences and confirm that the sidebar menu
displays correctly.
- Confirm that the "View all..." links take you to the correct page and
section.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Katrin Fischer [Sun, 21 Jun 2020 16:41:04 +0000 (16:41 +0000)]
Bug 15400: Add class on patron brief info to allow hiding date of birth
This just makes a small addition by adding a class to the new
"Born:" entry in the patron brief information area to allow for hiding
it easily with css.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Thu, 18 Apr 2019 09:27:30 +0000 (09:27 +0000)]
Bug 15400: (follow-up) Add class to years span
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Aleisha Amohia [Thu, 21 Feb 2019 19:45:49 +0000 (19:45 +0000)]
Bug 15400: (follow-up) Updating text display
Now shows as 'Born: [date of birth] (age)' in circ sidebar menu and
search results
Sponsored-by: Catalyst IT Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Josef Moravec [Fri, 2 Nov 2018 08:13:35 +0000 (08:13 +0000)]
Bug 15400: Display date of birth and age more consistantly
Test plan:
0) Apply the patch
1) Go to all of these pages
Patron detail
Other patron pages - look on the left side (circ-menu)
Patron search
Guarantor search ( go to child patron -> edit -> in guarantor
section click "Set to patron"
Search through "Check out" (in the header)
2) Confirm that does show date of birth and date consistantly,
try it on patrons with and without date of birth set to find
possible reggressions
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Petro Vashchuk [Wed, 17 Jun 2020 13:44:42 +0000 (16:44 +0300)]
Bug 25322: fix for not selected "relationship" defaults to father
When a user creates a patron's guarantor on /cgi-bin/koha/members/memberentry.pl but doesn't select the relationship from a dropdown, the relationship defaults to first value, which in default sysprefs is "father". This may or may not be correct as this is not a conscious choice from the user.
The solution is to make the "Relationship" field mandatory when there is no empty entry in the system preferences, always starting with an empty option but not allowing the user to save an empty entry.
And if there is an empty option in sysprefs, it allows to save empty, as well as makes it default choice.
To reproduce with default system preferences:
1) Create a new patron who is assumed to have a guarantor or modify the existing one.
2) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
3) Observe that relationship is set as "father".
4) Apply the patch.
5) Repeat steps 1 and 2.
6) Observe that it doesn't allow you to save the form until you pick a relationship type.
To reproduce with empty entry added to system preferences:
1) Add an empty entry to borrowerRelationship at /cgi-bin/koha/admin/preferences.pl?tab=patrons in Patron relationships section (example: "|father|mother").
2) Create a new patron who is assumed to have a guarantor or modify the existing one.
3) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes.
4) Observe that relationship is set as "father".
5) Apply the patch.
6) Repeat steps 1, 2 and 3.
7) Observe when you save the empty entry it does set the relationship as empty.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Lucas Gass [Wed, 27 May 2020 21:35:16 +0000 (21:35 +0000)]
Bug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt
This patch attempts to replace <i> with <em> AND <b> with <strong> in
order to more accessible to screen readers. This patch makes no attempt
to change Font Awesome icons which typically use <i>. I found templates,
includes and XSLT by using 'git grep ‘<b>’
koha-tmpl/opac-tmpl/bootstrap/en/' and git grep ‘<i>’
koha-tmpl/opac-tmpl/bootstrap/en/
TEST PLAN:
There should be no visible difference on the changed pages. The files
changed are:
koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browser.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/xslt/OAI.xslt
Read the changes and make sure everything looks correct, try to visit as
many pages as possible and confirm that everything looks as it should.
grep around for cases of <b> or <i> that I could have missed.
Signed-off-by: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nick Clemens [Thu, 25 Jun 2020 10:38:26 +0000 (10:38 +0000)]
Bug 25875: Move check for module_bit and code to the JOIN
If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons
To test:
1 - Give a patron full acquisitions permissions
2 - Also give them several subpermissions on other areas
3 - Go to Acquisitions
4 - Edit a fund
5 - Add a user to the fund
6 - Search for user above
7 - They return multiple times in results
8 - Apply patch
9 - Restart all the things
10 - Repeat search
11 - Patron appears once
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Owen Leonard [Mon, 22 Jun 2020 23:57:29 +0000 (23:57 +0000)]
Bug 25793: OAI 'Set' and 'Metadata' dropdowns broken by OPAC jQuery upgrade
This patch modifies the OAI XSLT file, correcting the path to jQuery
assets and adds a link to jquery-migrate.
To test, apply the patch and make sure the "OAI-PMH" system preference
is enabled.
1. Go to: <OPACBaseURL>/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
e.g.
localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marc21
2. Click on the 'Sets' and 'Metadata' links. The corresponding
panels with set and metatdata information should be shown.
Tested against master, works as described. Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Martin Renvoize [Wed, 24 Jun 2020 10:34:32 +0000 (11:34 +0100)]
Bug 25807: Add Template 3.008 to the exclude list
This patch adds version 3.008 of Template to the excludes list in our
cpanfile. It also adds support for displaying this version on the about
page.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Slava Shishkin [Wed, 13 May 2020 17:20:27 +0000 (20:20 +0300)]
Bug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm
This warning was thrown:
Use of uninitialized value $info{"invalid_username_or_password"}
in numeric eq (==) at /home/vagrant/kohaclone/C4/InstallAuth.pm
line 387.
There is the case when hash key can be undefined in numeric comparison.
Fixed by adding additional precheck for
$info{"invalid_username_or_password"} being Perl's "true".
To test:
1) Go to the first page of the web-installer where it asks to login.
2) Observe the warning in the log file.
3) Apply patch.
4) Repeat step 1.
7) Check that previous warning suppressed.
Mentored-by: Andrew Nugged <nugged@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Wed, 5 Feb 2020 12:00:38 +0000 (13:00 +0100)]
Bug 24156: Fix set sort order to the first column
In that case it's equal to 0 and we need to adjust the test condition.
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 5 Dec 2019 16:55:00 +0000 (17:55 +0100)]
Bug 24156: Make sort order and number of items to display configurable (basket page)
This patch is the main patch of this patchset, you will find the
description and the test plan.
The idea of this new enhancement is to add the ability to define the
default sort order and the default number of rows displayed on the
acquisition basket page.
The existing "columns settings" feature was replaced by a
"tables settings" feature. To prepare the ground, there were some
works that were needed:
* rename variables and files
* Modify the structure of the yml files
* Create a new DB table to store the tables settings
Test plan:
0)
a. Execute the update DB entry to create the new table
b. Restart all (to get a new version of the yml file, that is cached by
memcached)
c. Create several orders for a given basket
1) Go to the basket view page
=> The default values are the same than without this patchset, the
number of entries to display is set to "20" and the table is sorted by
basket number (first column)
2) Go to the "Columns settings" page
3) Unfold the "Acquisition" tab
=> Notice the 2 dropdown lists at the bottom of the basket table
4) Select different values for "Default display length" and "Default
sort order"
5) Refresh the basket view page
=> Notice that the default settings are now effective on the table
QA note: We can decide to replace the different occurrences of "Columns settings"
by "Tables settings" if needed.
Sponsored-by: Institute of Technology Tallaght Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 10 Dec 2019 17:00:37 +0000 (18:00 +0100)]
Bug 24156: Adjust other tables in the yml file
To match the new structure, we adjust the other tables.
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 12 Dec 2019 15:18:09 +0000 (16:18 +0100)]
Bug 24156: Add columns_settings.yml changes
Modification of the structure of the yml file.
It was
table:
- column list
It now becomes
table:
default_display_length: X
default_sort_order: Y
columns:
- column list
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 5 Dec 2019 16:40:08 +0000 (17:40 +0100)]
Bug 24156: move ColumnsSettings to TablesSettings
We are preparing the ground with this patch. As the "Columns settings"
page will now add the ability to modify settings for the whole table, it
makes sense to rename the file and the variables.
Note that the controller script (admin/columns_settings.pl) and the yml
(admin/columns_settings.yml) files have not been moved to not break
shortcuts and abits people could have. But if QA decides, it could be
easy to do.
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 5 Dec 2019 16:13:50 +0000 (17:13 +0100)]
Bug 24156: DBIC changes
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 5 Dec 2019 16:13:30 +0000 (17:13 +0100)]
Bug 24156: DB changes
Add a new table tables_settings to store default_display_length and
default_sort_order.
Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Tue, 24 Mar 2020 17:13:38 +0000 (18:13 +0100)]
Bug 24159: Fix shift in the header
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 12 Mar 2020 08:00:15 +0000 (09:00 +0100)]
Bug 24159: Fix one occurrence in updatedatabase.pl
Here we just want to get the value from the syspref, the circ rule does
not exist yet.
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 12 Mar 2020 07:46:59 +0000 (08:46 +0100)]
Bug 24159: Use days_mode circ rule to calculate the dropbox date
Calculate the drop box date depending on the circ rule. Note that only
the branchcode is taken into account here. Is that correct?
Test plan:
Use the drop box date feature and confirm that it takes into account the
calendar, depending on the circ rule.
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Thu, 12 Mar 2020 07:29:27 +0000 (08:29 +0100)]
Bug 24159: Set days_mode according to circ rules in 3 other places
There are 3 other occurrences where the new circ rule can be used:
* C4::Circulation::checkHighHolds
* Koha::Hold->set_waiting
* misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl
Test plan:
* checkHighHolds
Enable decreaseLoanHighHolds and fill decreaseLoanHighHoldsDuration
Setup things to hit a "high demand" alert with a shortened due date
Check an item out
=> The due date must be recalculated depending on the circ rule useDaysMode.
* set_waiting
Set ExcludeHolidaysFromMaxPickUpDelay to "1" (note that there is currently
a bug in the description of the syspref, see bug 22381 comment 19)
Mark a hold waiting
The expiration date should have been set depending on the value of the
circ rule.
* TalkingTech cronjob
Cannot test this
Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 28 Feb 2020 13:49:50 +0000 (14:49 +0100)]
Bug 24159: Add new tests for get_useDaysMode_effective_value
Sponsored-by: Institute of Technology Carlow Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 28 Feb 2020 13:28:33 +0000 (14:28 +0100)]
Bug 24159: Adjust tests
Sponsored-by: Institute of Technology Carlow Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 28 Feb 2020 13:28:21 +0000 (14:28 +0100)]
Bug 24159: Add UI changes
Sponsored-by: Institute of Technology Carlow Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 28 Feb 2020 12:33:13 +0000 (13:33 +0100)]
Bug 24159: Throw an exception if days_mode option is not given when needed
Sponsored-by: Institute of Technology Carlow Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Jonathan Druart [Fri, 28 Feb 2020 12:29:09 +0000 (13:29 +0100)]
Bug 24159: Move useDaysMode pref to circulation rules
Moving the useDaysMode system preference to a circulation rule will add
much more flexibility in the calculation of the due date.
The initial request was to make hourly loan returned on closed when
(when checked out on the same close day).
To do so we do not want to take into account the calendar.
However the calendar need to be taken into account for other loan item types.
Other scenarios are possible, for instance depending on the branch.
This patchset will add a new "Days mode" column (next to "Loan period")
to the circulation rules page, with the different values of the
"useDaysMode" system preference + a "default" value, to default to the
system preference value.
Test plan:
- Define a long loan item type (like 10 days) that will use the calendar
(or default to the pref value, if the pref is not set to "ignore the
calendar")
- and a hourly loan (like 2 hours) that will ignore the calendar
- Create items with those item types
- Mark today as a closed day
- Check the items out
=> The hourly loan is due the same day
=> The other loan is due on an open day
QA note:
There is the need to force the "days_mode" option when Koha::Calendar is
initiated for the due date calculation. To make sure devs will not
forget it, the methods that need have it defined will throw an
exception.
Sponsored-by: Institute of Technology Carlow Signed-off-by: Simon Perry <simon.perry@itcarlow.ie> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle M Hall [Tue, 21 Apr 2020 17:52:40 +0000 (13:52 -0400)]
Bug 25232: Add ability to skip trapping items with a given notforloan value
This is a companion/alternative to bug 25184, in that it allows an
explicit workflow for placing returned books into temporary storage for
a few days for decontamination purposes.
The idea here is to create a specific notforloan value for "In
Decontamination" or something along along those lines. This notforloan
value would never be trappable. At the end of decon,
UpdateNotForLoanStatusOnCheckin could be used to remove the
notforloan status and allow checkins to be trapped to fill holds.
Test Plan:
1) Apply this patch
2) Restart all the things!
3) Give an item a negative notforloan value
4) Place a hold on the item
5) Check the item in
6) Note the item is trapped for hold
7) Set SkipHoldTrapOnNotForLoanValue to the same notforloan value
you used in step 3
8) Check the item in again
9) Note Koha did not ask you to trap the item for hold!
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>