Martin Renvoize [Thu, 1 Nov 2018 17:12:14 +0000 (17:12 +0000)]
Bug 21727: Add ->adjust to Koha::Account::Line
This patch introduces a high-level method for updating existing debits,
similar to Koha::Account::add_credit and Koha::Account::add_debit.
It updates the Koha::Account::Line object, and adds an offset. It also
logs if required.
It whitelists the account types that are allowed to be adjusted, just in
case some others require adjusting, having a single source for truth.
To test:
- Apply this patches
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account/Lines.t
=> SUCCESS: Tests pass!
Sponsored-by: PTFS Europe Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Fri, 30 Nov 2018 11:52:12 +0000 (11:52 +0000)]
Bug 21727: Add tests for Koha::Account::Line->adjust
Sponsored-by: PTFS Europe Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Fri, 2 Nov 2018 10:04:46 +0000 (10:04 +0000)]
Bug 21753: Update to remove the field from the database
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Fri, 2 Nov 2018 09:42:53 +0000 (09:42 +0000)]
Bug 21753: Remove all reference of chargename from scripts
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Mon, 10 Dec 2018 12:02:41 +0000 (12:02 +0000)]
Bug 21980: Add new exceptions for Koha::Account
He add two new exceptions here; One to be thrown when negative 'amount'
is passed into verious account methods that always expect positive
decimals and another to be thrown when a bad 'type' is passed into an
account method.
Sponsored-by: PTFS Europe Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Fri, 4 May 2018 14:25:16 +0000 (14:25 +0000)]
Bug 21436: Update two-column templates with Bootstrap grid: Tools part 4
This patch modifies several tools templates to use the
Bootstrap grid instead of YUI.
This patch also removes obsolete "text/javascript" attributes from
<script> tags and "text/css" attributes from <style> tags in the
modified templates.
To test, apply the patch and view the following pages, confirming that
they look correct at various browser widths:
- Tools -> Task scheduler
- Tools -> Staged MARC management -> View batch -> View diff of
imported record which duplicates a record in the catalog
- Tools -> Stage MARC for import
- Test each step
- Tools -> Upload local cover image
- Test each step
- Tools -> Upload any file
- Test each step
- Tools -> Log viewer
- Test from the tools menu and from both the bibliographic
patron details pages ("Modification log").
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds a CLI script, reconcile_balances.pl that takes care
of calling the reconcile operation for all patrons that have outstanding
credits.
A weird situation has been spotted in the wild, in which a debit ends up
actually being a credit, because amount outstanding is tweaked in
dropbox-mode returns. Until we figure what to do about that (probably a
new account type, etc), we catch any exceptions and warn about the
situation.
To test:
- Have patrons with outstanding credits and debits
- Run the script:
$ kshell
k$ perl misc/cronjobs/reconcile_balances.pl --verbose
=> SUCCESS: Notice patrons got their balances reconciled, and useful
information is output.
- Add new outstanding credits and debits to patrons you con easily
identify
- Run:
k$ perl misc/cronjobs/reconcile_balances.pl
=> SUCCESS: Notice balances are reconciled, but no output
- Run:
k$ perl misc/cronjobs/reconcile_balances.pl --help
=> SUCCESS: Usage information is printed.
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21915: Call reconcile_balance on manual credit creation
This patch makes the manual credit creation step call
Koha::Account::reconcile_balance when the AccountAutoReconcile syspref
is set.
To test:
- Apply the patch
- Have some outstanding debits
- Create a manual credit
=> SUCCESS: Same behaviour as always
- Set AccountAutoReconcile
- Create a manual credit
=> SUCCESS: Reconcillation happened
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21915: Call reconcile_balance on manual invoice creation
This patch makes the manual invoice creation step call
Koha::Account::reconcile_balance when the AccountAutoReconcile syspref
is set.
To test:
- Apply the patch
- Have some outstanding credit
- Create a manual invoice
=> SUCCESS: Same behaviour as always
- Set AccountAutoReconcile
- Create a manual invoice
=> SUCCESS: Reconcillation happened
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21915: Reconcile balance on _FixAccountForLostAndReturned call
This patch makes _FixAccountForLostAndReturned reconcile the patron's
account balance, when the AccountAutoReconcile syspref is set.
To test:
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests pass, peace \o/
- Sign off :-D
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This syspref will be used to call the reconcile_balance routing as
needed.
Sponsored-by: ByWater Solutions Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 22071: (follow-up) Add POD for validate_query_parameters
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
In order to add features to this method, the current code would force us
to do it for each authentication method.
There's duplicated code that could be simplified. This patch makes the
authentication code just set $user on each block (oauth and cookie
authentication) and moves the final permissions check to the end of the
authenticate_api_request method.
Bug 22071: Make authenticate_api_request stash koha.user in OAuth use case
This patch makes the OAuth code stash the requestion Koha::Patron.
To test:
- Apply the tests patch:
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail :-(
- Apply this patch
- Run:
k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> SUCCESS: Tests pass :-D
- Sign off =D
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The authenticate_api_request() behaviour needs more tests. This patch
adds tests for the stashed Koha::Patron object. It highlights the bug in
the OAuth authentication case.
To test:
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/auth_authenticate_api_request.t
=> FAIL: Tests fail in the OAuth case, pass in the cookie-based auth
case.
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21788: Make ProcessOfflinePayment pass the library_id parameter
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> FAIL: branchcode is not set
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch refactors the tests related to ProcessOfflinePayment and adds
checks for setting branchcode on the account line.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Circulation.t
=> FAIL: branchcode is not set
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Wed, 31 Oct 2018 12:50:27 +0000 (12:50 +0000)]
Bug 22073: Add to diacritics mappings for Ž and ž
To test:
1 - Find or add a record by author Slavoj Žižek
2 - Search for 'Zizek'
3 - No results
4 - Apply patch
5 - Reindex
6 - Search again
7 - Success!
Signed-off-by: Eric Phetteplace <ephetteplace@cca.edu> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Wed, 19 Dec 2018 19:00:52 +0000 (16:00 -0300)]
Bug 22020: (bug 21777 follow-up) Fix columns visibility for circulation.pl
The table is used by circulation.pl and moremember.pl
When it is modified we need to take care of the two view.
Test plan:
Use the columns settings to hide/show the "check in" and other columns
Confirm the this patch fixes the display for moremember.pl
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21786: Make balance and credits endpoints handle library_id
This patch:
- Adds the branchcode <-> library_id mapping in the controller
- Adds 'library_id' to the credit and account_line definitions
- Makes add_credit handle the library_id param, passing it to the
underlying $account->add_credit method.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> FAIL: Tests fail, because library_id is not mapped
(balance) and because it is not handled when adding a credit.
- Apply this patch
- Run:
k$ prove t/db_dependent/api/v1/patrons_accounts.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Mon, 12 Nov 2018 17:35:25 +0000 (17:35 +0000)]
Bug 21813: In-page JavaScript causes error on patron entry page
This patch removes a block of JavaScript from memberentrygen.tt which
was being included in the page before jQuery is loaded. This causes a
JavaScript error.
To test, apply the patch, regenerate CSS, and clear your browser cache
if necessary.
- In Administration -> Patron categories, confirm that you have two
patron categories with different default messaging preferences
defined.
- Go to Patrons -> New patron
- Create a new patron using one of the categories with messaging
preferences.
- Confirm that when you switch the category selection to the other
patron category, the patron messaging preference checkboxes are
changed to the default for that category.
- A "Loading" indicator should appear above the checkboxes to show
that an operation is in process. It should disappear when new
default prefs are loaded.
- Manually change one or more patron messaging preference checkboxes.
- Switch the patron category again and confirm that you are prompted
to confirm resetting the preferences to the default for that
category.
- Perform the same set of tests when editing a patron.
- Defaults should not be loaded during the edit process.
- Confirm that there are no other JavaScript errors in the console.
- Test again with EnhancedMessagingPreferences disabled.
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch changes the sub to use Koha::Objects and updates the tests.
Previously the sub would die on borrowers with checkouts and would
delete borrowers if they had fines
To test:
1 - prove -v t/db_dependent/
2 - Set your selfreg preferences:
PatronSelfRegistration: Allow
PatronSelfRegistrationDefaultCategory: SELFREG (or of your choice)
PatronSelfRegistrationExpireTemporaryAccountsDelay: 30
3 - Register a patron into SELFREG or how you set above
4 - Set their date enrolled to two months ago
5 - Checkout an item to the patron
6 - Issue a fine to that patron
7 - perl misc/cronjobs/cleanup_database.pl --del-exp-selfreg -v
8 - The job should die with an error
9 - Check in the item
10 - run the corn again - patron is deleted, oops
11 - Apply patch
12 - Create another patron in the same way
13 - Checkout and fine the patron
14 - run the cron
15 - they are not deleted, and no error
16 - checkin the item
17 - run the cron
18 - they are not deleted and no error
19 - clear the fine
20 - run the cron
21 - patron is deleted, huzzah
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Fri, 28 Dec 2018 18:48:15 +0000 (18:48 +0000)]
Bug 22052: Unit tests
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Wed, 19 Dec 2018 17:53:08 +0000 (17:53 +0000)]
Bug 22030: Use preference to determine username sent to overdrive
Overdrive configuration generally defaults to cardnumber, however, they
have confirmed that some libraries use usernames. We need to allow for
both scenarios.
To test:
1 - Have an OverDrive account setup with SIP authentication
Note: You can apply for a testing account at developer.overdrive.com
and setup an environment
2 - Fill in all your OverDrive system preferences
3 - Test with a patron whose username is their cardnumber
4 - Confirm their overdrive account tab on opac loads
5 - Change the username to be another value like "borked_wont_work"
6 - Note the overdrive account tab won't load
7 - Apply patch, update database, not new system preference
OverDriveUsername (default to 'cardnumber)
8 - Note the OD account loads successfully
9 - Change the system preference to 'user name' - the account load fails
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Thu, 13 Dec 2018 13:59:38 +0000 (14:59 +0100)]
Bug 21605: (follow-up) Simple ternary boolean to number conversion
Imo it is much easier to do just "$a ? 1 : 0" than testing defined($a) etc.
in the additional loop.
Less code, more readable?
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Colin Campbell [Fri, 26 Oct 2018 09:42:13 +0000 (10:42 +0100)]
Bug 21605: Ensure EDI acct fields set to boolean val
Validate the input to the fields indicating account
functionality. The only valid values are 1 and 0
non-integer (or integers other than 0/1) are invalid
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 22059: Fix exception params in Koha::Patron->set_password
This simple patch fixes a wrong call to ->throw. Parameters shouldn't be
enclosed in curly brackets.
To test:
- Apply the tests patch
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Patrons.t
=> FAIL: Tests fail because the throw call is wrong
- Apply this patch
- Run:
k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
-Sign off :-D
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds tests for Koha::Account->pay, to make sure the
library_id param is used to set the branchcode attribute. The use of
userenv to set branchcode if library_id not passed is removed.
Responsability is left to the callers to pass library_id.
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Reserves.t
=> FAIL: Tests fail because branchcode is not set
- Apply this patch
- Run:
k$ prove t/db_dependent/Reserves.t
=> SUCCESS: Tests pass!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 19066: Tests for AddRenewal AddIssuingCharge and ChargeReserveFee
This patch adds some tests that cover functions changed by this
patchset. A bug in ChargeReserveFee is highlighted.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Kyle M Hall [Wed, 9 Aug 2017 16:55:56 +0000 (16:55 +0000)]
Bug 19066: Add branchcode to accountlines
For the purposes of statistics, it appears that it would help many
libraries to have branchcode recorded in the accountlines table. For
payments, the field would contain the code for the branch the payment
was made at. For manual invoices, it would be the code of the library
that created the invoice.
Test Plan:
1) Apply this patch set
2) Create and pay some fees
3) Note the branchcode for those fees and payments is set
to your logged in branch
Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Test plan:
Hit /cgi-bin/koha/acqui/parcel.pl
Notice the background color change with and without this patch
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Thu, 20 Dec 2018 22:55:46 +0000 (19:55 -0300)]
Bug 22034: Handle default framework for MARC view with framework
To test:
- Create a record in any framework that is not default
- Search for the record in your catalog
- Switch to the MARC tab
- Change framework pull down to default on top
- Note the page reloads and the framework stay default
- Verify it works for other frameworks
Also test the "labeled MARC" view (you will need the pref viewLabeledMARC turned on)
Signed-off-by: Nazlı Çetin <nazli@devinim.com.tr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21578: Terminology changes in patron's account section (staff)
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:34:59 +0000 (17:34 -0300)]
Bug 22007: Generated with add_missing_filters.pl
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:34:52 +0000 (17:34 -0300)]
Bug 22007: Also handle Price and HtmlTags
Those 2 filters should return safe output as well
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 20:20:52 +0000 (17:20 -0300)]
Bug 22007: Remove html filters when KohaDates called with a parameter
Bug 13618 took care of the KohaDates output but not if it is called
with a parameter (eg. [% var | $KohaDates with_hours => 1 %]).
We could avoid unnecessary processing by removing the extra html filter.
Patch generated with the following command:
% perl -p -i -e 's/KohaDates([^%\|]*)\s?\|\s?html\s?/KohaDates $1/g' **/*.inc **/*.tt
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
To recreate:
1 - Set CircAutoPrintQuickSlip to 'clear'
2 - Bring up a patron in circulation
3 - Click in checkout box and hit enter to submit empty
4 - Patron is partially loaded
5 - Apply patch
6 - Restart all the things
7 - Test again
8 - Patron is cleared correctly
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Aleisha Amohia [Tue, 23 Oct 2018 00:06:27 +0000 (00:06 +0000)]
Bug 16939: (follow-up) Adding missing bracket
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Tue, 29 May 2018 18:09:44 +0000 (18:09 +0000)]
Bug 16939: (follow-up) Correction for orderreceive.tt
This patch makes a change to orderreceive.tt which corresponds to the
changes made in the previous patch.
To test, apply the patch and set the AcqCreateItem system preference to
"receiving an order."
- Go to Acquisitions -> Vendor -> Receive shipment.
- Submit the "Receive a new shipment" form.
- Click "Receive" for an order line.
- Fill out the item form and click "Add item."
- The table of existing items should display correctly, with a single
"Actions" column containing an "Edit" and "Delete" button.
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 16939: Making all 'add to basket' actions buttons
Edit: Fixing 'clas' typo in addorderiso2709.tt
Edit: Adding actions class to td
Edit: Fixing js error
Edit: circ/reserveratios.tt updated so that the plus icon doesn't show
if there is no link
Edit: fixing logic in circ/reserveratios.tt
Edit: merge conflicts
Edit: updating buttons to bootstrap 3, which i believe fixes the problem
in comment 16
To test:
1) Go to Acqui -> find a vendor -> view a basket
2) Click add to basket -> fill in 'for an existing record' and hit search
3) 'View MARC' and 'Order' buttons should show under an Actions column with appropriate icons
4) Click Order
5) Click add item when you are redirected to the New order page (no need to fill in any details)
6) Confirm that 'Edit' and 'Delete' buttons now show under an Actions column with appropriate icons
7) Go back to your basket and click add to basket -> from a subscription (we are skipping from a suggestion because this already has a button before my patch)
8) Confirm that 'Order' shows as a button with appropriate icon
9) Go back to your basket and click add to basket -> from an external source
10) fill in any fields and click search to bring up results
11) 'Order' should now show as a button with appropriate icons. MARC and Card preview have been moved into a dropdown menu - confirm this works as expected. Links have not been changed when clicking on a row
12) Go back to your basket and click add to basket -> from a staged file
13) 'Add orders' should now show as a button with appropriate icon
14) Go back to your basket and click add to basket -> from titles with highest hold ratios
15) 'X to order' should now show as a button with appropriate icon
Sponsored-by: Catalyst IT Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21909: Make Koha::Account::outstanding_* preserve context
This patch modifies the methods so they preserve the caller's context
(list and scalar).
To test:
- Apply the first patch
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: outstanding_credits and outstanding_debits tests fail
- Apply this patch
- Run:
k$ prove t/db_dependent/Koha/Account.t
=> SUCCESS: We are so happy now :-D
- Sign off :-D
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch introduces regression tests for the behaviour to be
introduced. Both outstanding_credits and outstanding_debits methods
should return a Koha::Account::Lines object in scalar context, and a
list of Koha::Account::Line objects in list context.
To test:
- Apply this patch
- Run
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: The current behaviour doesn't match the described
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Mon, 12 Nov 2018 21:21:58 +0000 (18:21 -0300)]
Bug 21817: Centralize the mock of userenv from tests
This patch adds a new method mock_userenv from t::lib::Mocks in order to
simplify the mock of the userenv.
Test plan:
prove all the test files modified by this patch
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21547: (follow-up) Rely on Koha::Patron->set_password checks
This patch makes the controller just call $patron->set_password and use
the exceptions it might raise instead of manually checking the passwor
strength.
No behaviour change should be expected. It also removes some leftovers.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Thu, 11 Oct 2018 10:00:31 +0000 (12:00 +0200)]
Bug 21547: Use set_password in opac-passwd and remove sub goodkey
Remove sql statement to change password by calling set_password.
Remove sub goodkey by calling C4::Auth::checkpw_hash.
Adding the scalar before param Oldkey (from bug 21036).
Rebased on top of 21178 (using set_password instead of update_password).
Test plan:
Try to change password in OPAC with good and bad pw.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Alex Buckley [Wed, 31 Oct 2018 10:27:41 +0000 (10:27 +0000)]
Bug 21754: Automatically clean up outstanding transfers on lost items
This is an alternative to bug 21732 as transfers are automatically cancelled on marking an item lost, and the items holding rbanch is set to the transfers source ('from') branch.
When an item is marked as lost, the routine should also clean up any
outstanding transfers.
Also added tests to t/db_dependent/Circulation.t which check:
* If transfer is automatically deleted when item is marked as lost
* If the items holdingbranch automatically changes when item with
transfers on it is marked as lost.
Test plan:
1. Find a item which is in transfer, i.e. find an item with the text in
the 'Status' field of the table in detail.pl that indicates it is in
transfer
2. Set the item to 'Lost' either by clicking on Edit->Edit items from
the detail.pl page
OR
clicking on the Items tab on the left side of the detail.pl page
3. Notice that the transfer is now cancelled for the item and the items
holdingbranch is the transfers source ('from') branch
4. Run t/db_dependent/Circulation.t
Sponsored-by: Brimbank Library, Australia Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
(fixed the introduction of a whitespace line and removed a double
declare warning from the new tests as part of QA) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Tue, 16 Oct 2018 14:51:40 +0000 (11:51 -0300)]
Bug 21571: Make ACCTDETAILS translatable
This patch makes the notice "ACCTDETAILS" translatable.
Test plan:
1. Switch on TranslateNotices and AutoEmailOpacUser
2. Define templates for different languages for ACCTDETAILS
3. Create a new patron, define an email address, userid and password.
Also pick a different "preferred language" then the default value
4. You should receive the email with the correct, translated, email.
Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 15 Nov 2018 18:56:00 +0000 (18:56 +0000)]
Bug 21844: Include itemcallnumber in lost fine description
To test:
1 - Make sure WhenLostChargeReplacementFee is set to charge
2 - Find an item with a replacement cost (or default) and a call number
3 - Checkout the item to a patron
4 - Mark the item lost
5 - View the fine - the description includes title and barcode
6 - Apply patch
7 - Check the item in
8 - Check it out again
9 - Mark it lost
10 - Note the fine includes the callnumber
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Fri, 26 Oct 2018 16:15:39 +0000 (16:15 +0000)]
Bug 21693: Clean up checkout notes template
This patch modifies the checkout notes template to help compliance with
coding guidelines and interface patterns:
- Convert to Bootstrap grid
- Improve DataTables configuration
- Put buttons into a toolbar and move above selection links
Also corrected: Minor markup error in circ-nav.inc
To test, apply the patch and enable the AllowCheckoutNotes system
preference. Add a few checkout notes via the OPAC.
- Go to Circulation -> Checkout notes.
- Confirm that the page looks correct at various browser widths.
- Confirm that the first and last columns of the table of notes are
not sortable.
- The table should be sorted by default by title.
- Title sorting should ignore articles "a," "an," and "the."
- Test with the CircSidebar preference both on and off.
- With CircSidebar turn on, the checkout notes menu item in the
left hand sidebar should show a count of checkout notes.
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Make sure the directory exists and contains multiple files.
- Go to Tools -> Access files
- Confirm that the page looks correct and the layout adjusts at various
browser widths.
- Confirm that DataTables functionality works correctly, including
correct sorting by date.
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Julian Maurice [Wed, 16 Dec 2015 00:25:44 +0000 (01:25 +0100)]
Bug 21789: Example usage of I18N Template::Toolkit plugin
Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Fri, 16 Nov 2018 08:41:04 +0000 (09:41 +0100)]
Bug 21848: Remove Text::Unaccent from C4::Members
At refactoring time the unac_string call was moved to Koha::Patron.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Marcel de Rooy [Thu, 13 Dec 2018 12:07:48 +0000 (13:07 +0100)]
Bug 21848: Resolve unac_string warning from Circulation.t
Just add "use utf8".
Test plan:
Run Circulation.t; verify there are no warnings.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 18 Dec 2018 18:30:28 +0000 (18:30 +0000)]
Bug 22022: Correct ordering for authorised values
To test:
1 - Add a shelving location with code "ZZZZ" and lib "Awake"
2 - Load some items in batch modification
3 - Note shelving location dropdown is wrong
4 - Apply patch
5 - Reload page
6 - Note order is correct
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Katrin Fischer [Tue, 18 Dec 2018 21:43:05 +0000 (22:43 +0100)]
Bug 22024: Correct new installations with missing data
For a new installation the data in the class_* will be
missing as class_sources.sql couldn't be executed. It will
fail with:
DBD::mysql::st execute failed: Cannot add or update a child row:
a foreign key constraint fails (`koha_kohadev`.`class_sources`,
CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`)
REFERENCES `class_split_rules` (`class_split_rule`)) at /usr/share/perl5/DBIx/RunSQL.pm line 273.
As this might have been missed and the web installer can still
be completed, this patch checks for the tables being empty and
adds the default data if they are.
To test:
- Without the patch
- Run the de-DE or another translated installer
- Verify the error is shown
- Complete the installer
- Verify class_sources table is empty
- Apply patches
- Run the database update
- Verify data classification sources, filing rules, and
slitting rules are now complete
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 11 Dec 2018 15:15:57 +0000 (15:15 +0000)]
Bug 21984: Pass param_name in pagination URL
To test:
1 - Create a report like:
SELECT <<cat>>,<<dog>>,<<cat>> FROM items
2 - Run the report, enter 'CATS' and 'DOGS'
3 - Get results LIKE "CAT | DOG | CAT"
4 - Try to go to page 2
5 - FAIL! (last column is blank)
6 - Apply patch
7 - Run the repot, enter 'CATS' and 'DOGS'
8 - Verify first page looks right
9 - Go to page 2
10 - Results are correct!
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: “Lucas Gass” <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 14 Dec 2018 15:49:44 +0000 (12:49 -0300)]
Bug 21065: Set ON DELETE SET NULL on accountlines.borrowernumber
Note: Why do we have ON UPDATE SET NULL on accountlines.itemnumber? Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 17:14:06 +0000 (14:14 -0300)]
Bug 14334: Remove AutoCommit from tests
And use a DBIx transaction instead.
Test plan:
prove that the test files modified by this patch are passing
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Andreas Roussos [Fri, 23 Nov 2018 17:30:23 +0000 (19:30 +0200)]
Bug 21880: "Relationship information" disappears when accessing paginated results in authority searches
When linking authorities with authorities, if you perform a
search that returns >20 results, the "Relationship information"
section disappears when you click on the pagination hyperlinks.
This patch fixes that.
Test plan:
1) In the Authorities module, edit an authority (or create a new
one) and try to link it with another authority (via UNIMARC
500$a, for example).
2) When the authority finder comes up, search for something that
will yield more than 20 results, then click on the pagination
links -- notice how the "Relationship information" section is
no longer visible.
3) Apply the patch (and restart Plack/memcached, if necessary).
4) Repeat step 2) -- "Relationship information" is now persistent.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Wed, 12 Dec 2018 14:05:19 +0000 (11:05 -0300)]
Bug 21986: Do not escape quotation marks when cataloguing
In several places we escape quotation marks using
$value =~ s/"/"/g;
All the occurrences are wrong and must be removed.
Most of them are leftover of bug 11638 (Remove HTML from
addbiblio.pl), which removes the construction of html from pl scripts.
The problem has been highlighted by bug 13618, I did not track down why
the issue did not exist before (?)
Test plan:
0/ Use strings with quotation marks, like:
'Fiddle tune history : "bad" tunes'
You can also use other html characters to make the tests more complete,
like 'Fiddle tune history : <"bad" tunes>'
1/ authorities/authorities.pl
a. Edit an authority filling different fields with quotation marks
b. Edit it again
=> The display (inputs' values) is wrong, if you save the escaped quotes
will be inserted
2/ cataloguing/addbiblio.pl
Same editing a bibliographic record
3/ cataloguing/additem.pl
Same editing items
4/ members/memberentry.pl
Edit a patron's record and fill some fields with quotation marks
+ fields borrowernotes and opacnotes
=> The quotes are inserted directly in DB (escape is done before the
insert!)
5/ opac/opac-review.pl
For QA only: $js_ok_review is never used
6/ tools/batchMod.pl
For QA only: $value is always undefined at that point
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 13:26:02 +0000 (10:26 -0300)]
Bug 21973: Do not url escape casServerUrl
It is already escaped correctly in
C4::Auth_with_cas::_url_with_get_params using URI::Escape::uri_escape
Note that shibbolethLoginUrl is not and must be url escaped in template
("be consistent, they said")
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Fri, 7 Dec 2018 19:49:00 +0000 (16:49 -0300)]
Bug 21931: Do not reset the ES mapping on 3.23.00.050
This update DB entry uses DBIx schema which does not make it crashes if
the table structure is changed.
Which happens on 18.06.00.054, that added search_field.weight
The entry 3.23.00.050 fails with
Unknown column 'me.weight' in 'field list'
This patch removes the reset of the mapping and display a warning to
tell the administrator the mapping must be reset/inserted
Test plan:
Use a 3.22 dump and upgrade it
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Wed, 12 Dec 2018 16:16:50 +0000 (16:16 +0000)]
Bug 21991: Pass param names to report limit tool
To test:
1 - Define a report like:
SELECT barcode, itemnumber
FROM items
WHERE (homebranch = <<Branch|branches>> AND 0 ) OR
<<Branch|branches>>=<<Branch|branches>>
2 - Run it, you get results
3 - Select 'Rows to display' 50
4 - No results
5 - Apply patch
6 - Run report
7 - Change display rows
8 - Results remain!
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Thu, 6 Dec 2018 13:07:18 +0000 (10:07 -0300)]
Bug 21950: Remove filtering for query_cgi and limit_cgi
We must not escape query_cgi and limit_cgi template-side, they are already
escape properly from build_query_compat using uri_escape_utf8.
To fix further problems we should replace all occurrences to make things
clear (I decided to keep the html filter so far, which did not hurt, but uri or url do)
query_cgi is uri_escaped from the pl, so we should displayed as raw
Test plan:
Use wide characters ❤
Search, filter, facets, search history, rss (both interfaces)
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21969: Fix Koha::Account->outstanding_* matching the opposite on pathological cases
This patch makes outstanding_* methods be safe regarding pathological
account lines that get converted into another type because of the value
of amountoutstanding
To test:
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Account.t
=> FAIL: Tests fail because pathological account lines are wrongly
picked.
- Apply this patch
- Run:
k$ prove t/db_dependent/Koha/Account.t
=>SUCCESS: All green!
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>