Jonathan Druart [Mon, 4 Mar 2019 19:52:30 +0000 (16:52 -0300)]
Bug 22219: Add tests
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Thu, 7 Mar 2019 17:28:34 +0000 (17:28 +0000)]
Bug 22477: Missing DataTables configuration when searching patrons for holds
This patch adds columns configuration to the holds request page to fix a
JavaScript error in the console and to allow the patron search results
table to be enabled as a DataTable.
To reproduce: Place a hold on a title in the staff client. When prompted
for a patron, perform a search which will return multiple results. The
patron search results will appear in an unsortable table. A JS error can
be seen in the browser console.
To test, apply the patch and repeat the steps above. The patron search
results table should be sortable and there should be no JS error.
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Bin Wen <bin.wen@inlibro.com> 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: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This patch adds a maintenance script that generates the missing
tags_approval entries based on the tags_all table, and then recalculates
the weights for both tags_approval and tags_index tables.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21846: Make 'term' use utf8mb_bin collation on tags tables
This patch makes the utf8mb4_bin collation preferred for comparing tags.
Otherwise suppolemental unicode characters all match.
To test:
- Enable tags and disable moderation (or plan to moderate and accept tags)
- Tag 3 records:
a - with 🐋
b - with 🌮
c - with 👍
- Note the weight on each says '3'
- Click the tag to search, you get back all the records
- Apply the previous patches from this bug report
- Run:
$ kshell
k$ prove t/db_dependent/Tags.t
=> FAIL: Tests fail, related to counting stuffs
- Apply this patch and
(a) Run updatedatabase to upgrade the schema
- Run:
k$ prove t/db_dependent/Tags.t
=> SUCCESS: Tests pass!
(b) reset_all to get a fresh DB using kohastructure.sql
- Run:
k$ prove t/db_dependent/Tags.t
=> SUCCESS: Tests pass too!
- Sign off :-D
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Due to collation issues, add_tag_approval wrongly calculates
the weight for strings including extended UNICODE characters.
This patch introduces a test for this situation.
To test:
- Apply this patch on master
- Run:
$ kshell
k$ prove t/db_dependent/Tags.t
=> FAIL: Tests fail because all extended characters match the same
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 21846: Add Koha::Tags::Approval(s) and Koha::Tags::Index(es)
In order to avoid writing the tests using plain DBIC which would later
need to be replaced by a Koha::Object-based counterpart, I introduce
this stub classes.
Stub tests are added as well.
To test:
- Apply this patch
- Run:
$ kshell
k$ prove t/db_dependent/Koha/Tags.t \
t/db_dependent/Koha/Tags/Approvals.t \
t/db_dependent/Koha/Tags/Indexes.t
=> SUCCESS: Tests pass
- Sign off :-D
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Tue, 18 Dec 2018 17:02:19 +0000 (14:02 -0300)]
Bug 21987: Do not generate true color thumbnails if not needed
If the original image is not a true color image we should not generate a
true color thumbnail.
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Tue, 18 Dec 2018 17:02:14 +0000 (14:02 -0300)]
Bug 21987: Add tests
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Mon, 11 Mar 2019 14:47:01 +0000 (14:47 +0000)]
Bug 22493: Clean up DecreaseLoanHighHolds.t
To test:
1 - prove -v t/db_dependent/DecreaseLoanHighHolds.t
2 - should pass
3 - read code, confirm changes make sense
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>
We were passing around possibly undefined $return_date variables from
AddReturn and then instantiating a new DateTime object as a default for
each routine. This followup sets the default higher up the stack within
AddReturn which provider clearer logic and a small performance
improvment.
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>
Kyle M Hall [Thu, 14 Mar 2019 12:20:53 +0000 (08:20 -0400)]
Bug 14591: Update unit tests
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>
Kyle M Hall [Thu, 14 Mar 2019 11:58:09 +0000 (07:58 -0400)]
Bug 14591: Update other calls to AddReturn
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>
Kyle M Hall [Thu, 14 Mar 2019 11:54:09 +0000 (07:54 -0400)]
Bug 14591: book drop / drop box mode incorrectly decrements accrued overdue fines
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>
Kyle M Hall [Fri, 21 Dec 2018 18:54:18 +0000 (13:54 -0500)]
Bug 22043: SIP Checkin Response alert flag set to often set to Y incorrectly
If a checkin has any messages at all, even informational like LocalUse, the alert flag ( 4th character of the response ) will be set to Y, even if we do not prove a corresponding alert code in the CV field. We should only set the alert flag if we are going to send a value in the CV field.If a checkin has any messages at all, even informational like LocalUse, the alert flag ( 4th character of the response ) will be set to Y, even if we do not prove a corresponding alert code in the CV field. We should only set the alert flag if we are going to send a value in the CV field.
Test Plan:
1) Set the checked_in_ok sip account flag to 1 for an account
2) Check in an already checked in item via SIP
3) Note the alert flag is set to Y
4) Apply this patch
5) Restart SIP
6) Check the item in again
7) Note the alert flag is set to N
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jill Kleven <jill.kleven@pueblolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Tue, 26 Feb 2019 15:05:50 +0000 (15:05 +0000)]
Bug 22222: Don't send empty params to mana service
Test plan:
0) Do not apply the patch
1) Go to serials > Search on Mana
2) Insert some value into the form
3) Submit -> you get many (3000+) results
4) Apply the patch and restart_all
5) Repeat, now, you get only the subscription matching your query
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Thu, 7 Mar 2019 16:49:11 +0000 (16:49 +0000)]
Bug 22476: Correct default for MarkLostItemsAsReturned
Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Fridolin Somers [Mon, 18 Feb 2019 16:33:37 +0000 (17:33 +0100)]
Bug 21560: create Koha::Util::OpenDocument with subroutine for ODS generation
There is nearly the same code in misc/cronjobs/gather_print_notices.pl and reports/guided_reports.pl.
This patch creates a new module with subroutine called by both scripts.
If file path or content is undefined, subroutine will just return undef.
If content is an empty arrayref, empty ods file is still generated.
Unicode encoding is kept outisde because it may not be necessary.
Note that for print notices the first line of message is always the column names so it is extracted only from first message.
Test plan :
Run previous patches test plans and check ODS files are the same.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Fridolin Somers [Fri, 7 Dec 2018 09:30:30 +0000 (10:30 +0100)]
Bug 21560: Optimize ODS export of gather_print_notices.pl
Like previous patch, the call on OpenOffice-OODoc lib can be optimized.
Based on https://grep.metacpan.org/search?qci=&q=expandTable&qft=&qd=OpenOffice-OODoc&f=examples%2Ftext2table
Test plan inspired from Bug 11679.
Test plan:
- define your ODUE notice for the print template as:
cardnumber:patron:email:item
<<borrowers.cardnumber>>:<<borrowers.firstname>> <<borrowers.surname>>:<<borrowers.email>>:<item><<items.barcode>></item>
- define overdues rules for a patron category
- check-out 2 items using a due date in order to generate the overdue notices
- check-in these 2 items
- launch the script /misc/cronjobs/overdue_notices.pl
- the 'message_queue' table should now contain 2 new entries
- launch the gather_print_notices cronjob :
perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=:
- A ods file should be generated in your /tmp/test directory
- Compare times with and without patch
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Fridolin Somers [Fri, 12 Oct 2018 12:09:54 +0000 (14:09 +0200)]
Bug 21560: report ODS export optimization
SQL reports can be exported with CSV, TSV of ODS format.
When report has thousands of rows, using ODS format is around 10 times longer than other formats.
It also loads CPU and RAM a lot.
The longest call is expandTable().
I found that the call on OpenOffice-OODoc lib can be optimized.
Based on https://grep.metacpan.org/search?qci=&q=expandTable&qft=&qd=OpenOffice-OODoc&f=examples%2Ftext2table
Test plan :
1) Don't apply patch yet
2) Create a new SQL report : Home > Reports > Create from SQL
3) Enter a SQL that will return thousands of results
4) Run report
5) Click Download > Semicolon separated text (.csv), look execution time
6) Click Download > Open Document Spreadsheet, look execution time
7) Apply patch
8) Redo 5) and 6) and compare times, CSV export should be the same but ODS export should be better
My tests shows 1,5 seconds for CSV export.
And for ODS export : 18 seconds without patch and 8 seconds with patch.
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
David Cook [Mon, 4 Mar 2019 06:43:29 +0000 (17:43 +1100)]
Bug 22429: Infinite loop in patron card printing
Text fields in Patron Card Text Layouts can contain regular
expression metacharacters, which - instead of being treated as
literal values - are interpreted and prevent line wrapping. This
causes the process to get stuck in an infinite loop, which keeps
running even after the web server has timed out (at least when
using CGI).
This patch escapes the relevant input from the text field so the
regular expression substitution treats characters as literals
instead of as metacharacters.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Wed, 30 Jan 2019 17:13:35 +0000 (17:13 +0000)]
Bug 22237: Subscriptions are not linked to Mana upon edit
This patch modifies C4/Serials.pm so that during the process of editing
a subscription a link to Mana can be created.
To test, apply the patch and go to Serials.
- Locate a subscription which was not created using Mana data but which
can be found in Mana.
- Edit the subscription, skipping to the second page.
- View the results returned by Mana and select one.
- Save the subscription.
- Upon being redirected to the subscription detail page you should see
a "Report mistake" button. This shows that the subscription has been
linked to Mana successfully.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Fri, 8 Feb 2019 20:24:05 +0000 (20:24 +0000)]
Bug 22296: Add Invoice Adjustments to GetBudgetHierarchy
To test:
1 - prove -v t/db_dependent/Budgets.t
2 - Create some invoices on a single budget
Invoice 1:
add a non-encumbered adjustment for 1
add an encumbered adjustment 2
leave open
Invoice 2:
add a non-encumbered adjustment for 4
add an encumbered adjustment for 8
3 - View acq home page, should see 2 order and 12 spent for the budget
4 - View the spent and ordered pages, they should show the correct amounts
5 - Add more orders etc and confirm things total correctly
https://bugs.koha-community.org/show_bug.cgi?id=22296 Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick Clemens [Tue, 12 Mar 2019 13:15:34 +0000 (13:15 +0000)]
Bug 22498: Rename variable for budgets loop for invoice adjustments
To test:
1 - Try to add some adjustments to an invoice (receive shipments, create invoice, click 'finish receiving')
2 - Note the fund dropdown has only 'No fund'
3 - Apply patch
4 - Refresh page
5 - Note you can now select funds, hooray!
Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Tue, 12 Mar 2019 17:29:38 +0000 (17:29 +0000)]
Bug 22489: Update onboarding tool for bug 18925
When going through the onboarding process, the tool fails on submit of step 5,
due to changes made in the database structure and rule definitions by bug
18925.
This patch fixes this, adding code that creates a circulation rule where an
issuing rule is also created in onboarding.pl. It removes maxissueqty from
being sent with params to make an issuing rule, and adds it instead to the
params to make a circulation rule, to reflect the changes that have been made
in the database.
Test plan:
1) Drop and recreate your database
2) Reload the staff client and follow the installer and onboarding
process
3) Confirm that the process finishes without errors
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Bug 22489: (follow-up) Correctly set success messages
The original patch was duplicating the success message upon successful
circ rule insertion. This corrects that.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Patches squashed for readability
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Thu, 17 Jan 2019 15:37:15 +0000 (15:37 +0000)]
Bug 11375: (follow-up) Add links to show all/hide all
This patch adds links in the toolbar to show or hide all
sub-permissions.
To test, apply the patch and view the permissions page for a patron.
Clicking the "Show all" or "Hide all" links should work to show or hide
all sub-permissions. The corresponding "Show details" and "Hide details"
links for each permission set should be correctly toggled.
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Thu, 24 May 2018 13:48:48 +0000 (13:48 +0000)]
Bug 11375: Improve patrons permissions display
This patch updates the patron permissions interface in order to
emphasize permission descriptions (which can be translated) over
permission code (which cannot).
The tree structure (and jQuery plugin) is removed, and permissions are
displayed in a table-like way. Sub-permissions are shown or hidden with
a link.
A free-text filter is added to the top for narrowing the list by
keyword.
Save and cancel buttons are now in a floating toolbar.
To test, apply the patch, regenerate the staff client CSS, and clear
your browser cache if necessary.
- Open the "Set permissions" page for any patron.
- Confirm that the filter works correctly to show only lines which
match your entry
- Note that the superlibrarian line stays visible all the time. This
is to make it clearer that sub-permissions cannot be selected if
superlibrarian is checked.
- Check the superlibrarain "hint" text for clarity.
- Test the show/hide controls.
- Test that checking a "parent" permission displays the
sub-permissions.
- Test that the toolbar with Save and Cancel floats when scrolling.
- Test that changing and saving permissions works correctly.
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Tue, 26 Feb 2019 17:35:22 +0000 (17:35 +0000)]
Bug 22368: (QA follow-up) Changed to LEFT JOIN as requested
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>
Martin Renvoize [Mon, 25 Feb 2019 12:39:19 +0000 (12:39 +0000)]
Bug 22368: (QA follow-up) Switch to using foreign_key_exists
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>
Martin Renvoize [Wed, 20 Feb 2019 16:51:22 +0000 (16:51 +0000)]
Bug 22368: (QA follow-up) Missing comma in kohastructure.sql
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>
Josef Moravec [Wed, 20 Feb 2019 16:08:38 +0000 (16:08 +0000)]
Bug 22368: (QA follow-up) Mute db errors in test
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Tue, 19 Feb 2019 14:03:34 +0000 (14:03 +0000)]
Bug 22368: Add missing constraints to `suggestions`
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Tue, 19 Feb 2019 15:31:20 +0000 (15:31 +0000)]
Bug 22368: Add tests
Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 25 Feb 2019 21:43:17 +0000 (21:43 +0000)]
Bug 19489: (QA follow-up) Revert changes in printinvoice
It would be change behaviour, libraries are often using POS printers and
wider table could make a problem for them and break theirs workflow.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 25 Feb 2019 21:36:31 +0000 (21:36 +0000)]
Bug 19489: (QA follow-up) Remove passing issue_id in pay form
This is not needed
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 25 Feb 2019 21:33:12 +0000 (21:33 +0000)]
Bug 19489: (QA follow-up) Update test to use objects and module methods for creating needed data
Test plan:
prove t/db_dependent/Koha/Account/Lines.t
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 25 Feb 2019 21:32:39 +0000 (21:32 +0000)]
Bug 19489: (QA follow-up) Cache checkout object in variable
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nazlı Çetin [Wed, 20 Feb 2019 07:21:33 +0000 (07:21 +0000)]
Bug 19489: (follow-up) Fix typos in the tests
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nazlı Çetin [Tue, 19 Feb 2019 12:45:56 +0000 (12:45 +0000)]
Bug 19489: Change method name issue --> checkout
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nazlı Çetin [Mon, 18 Feb 2019 09:50:10 +0000 (09:50 +0000)]
Bug 19489: Detailed Description of charges in Patron accounting
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nazlı Çetin [Mon, 18 Feb 2019 09:44:24 +0000 (09:44 +0000)]
Bug 19489: Koha::Account::Line->issue method and Unit test
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Thu, 21 Feb 2019 19:02:31 +0000 (16:02 -0300)]
Bug 22392: Reuse existing pattern
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Thu, 21 Feb 2019 17:26:33 +0000 (17:26 +0000)]
Bug 22392: Allow barcode to be passed to build_sample_item
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Thu, 14 Feb 2019 19:37:21 +0000 (19:37 +0000)]
Bug 22045: (follow-up) Fix tab-switching when some tab numbers are missing
This patch changes the way tab-switching is done so that it switching
tabs based on tab id rather than tab index. Using tab index doesn't work
when the tab number doesn't match the tab index.
To test, apply the patch and load a record or blank editor using a MARC
framework which doesn't include one or more tabs (for instance, by
deleting the entries in the framework for one tab:
DELETE FROM marc_subfield_structure WHERE frameworkcode = 'KT' AND tab = 4;
...backup first). In the MARC editor the numbered tabs should exclude
that number. Tab-switching should work correctly.
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Mon, 11 Feb 2019 17:13:55 +0000 (17:13 +0000)]
Bug 22045: (follow-up) Revert change to numbering of tabs
I wanted the tabs to be numbered like humans count, starting from 1.
But if the MARC framework setup isn't changed as well it doesn't make
sense. This patch removes the change.
Also fixed: Some missing template filters, an errant console.log()
removed.
To test, apply the patch and open a new or existing record for
editing. The tabs (now "Sections") should be labeled from 0-9.
Signed-off-by: John Doe <you@example.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Thu, 10 Jan 2019 13:07:10 +0000 (13:07 +0000)]
Bug 22045: Cataloging UX enhancement - Improve access to tabs
This patch makes style changes to the standard MARC editor with the goal
of both making it more responsive and making it easier to navigate among
tabs and tags.
Tabs are now part of the page's toolbar, which floats as the page
scrolls. In addition to the numbered tabs, there is also a section
showing in-page links to the MARC tags which are available on that page.
To test, apply the patch, regenerate the staff client CSS, and clear
your browser cache if necessary.
Open a blank or existing record in the standard cataloging editor. Test
the redesigned tabs, the floating toolbar, and the in-page tag links.
Confirm that everything works well at various browser widths.
Signed-off-by: Mikaël Olangcay Brisebois <mikael.olangcay-brisebois@inLibro.com> Signed-off-by: John Doe <you@example.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Owen Leonard [Wed, 28 Nov 2018 17:51:10 +0000 (17:51 +0000)]
Bug 21091: Move add item template JavaScript to a separate file
This patch moves the JavaScript in the add item template to separate
files: 1 JS file and 1 include file containing translatable strings.
While moving the JS to cataloging_additem.js I have made some changes to
quiet ESLint warnings (spacing, variable definition).
To test, apply the patch and open the add item page for an existing
record. Test the various JS-driven functionalities:
- Table sorting
- Table column configuration
- Table searching
- Table inline edit/delete links (click anywhere in the table row)
- Add multiple item form show/hide
- Add multiple item warning when adding 100+ items
Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Sun, 17 Feb 2019 22:45:07 +0000 (22:45 +0000)]
Bug 22363: Update Circulation.t to use Koha::ActionLogs instead of GetLogs
Test plan:
prove t/db_dependent/Circulation.t
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 18 Feb 2019 14:08:19 +0000 (14:08 +0000)]
Bug 22363: Use Koha::ActionLogs->search instead of GetLogs in log viewer
Test plan:
1) Use log viewer, try different parameters
2) Try screen and file export
3) prove t/db_dependent/Koha/ActionLogs.t
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 18 Feb 2019 14:01:44 +0000 (14:01 +0000)]
Bug 22363: Add tests
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Josef Moravec [Mon, 18 Feb 2019 13:28:34 +0000 (13:28 +0000)]
Bug 22363: Add Koha::ActionLog[s] objects
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
The install-CPAN.pl file was added in 2007 and hasn't been
updated or documented since.
This patch removed it from Koha.
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>
Josef Moravec [Tue, 26 Feb 2019 12:58:41 +0000 (12:58 +0000)]
Bug 22452: Fix typos in add mana comment modals
There are typos in modal where you can add a comment to mana:
'caracters' should be 'characters'
'commment' should be 'comment'
Test plan:
1) Create subscription from Mana
2) On subscription detail page: report mistake > other a modal is shown
--> without patch it reads 'Please enter a new commment (max 35 caracters)'
--> with patch it reads 'Please enter a new comment (max 35 characters)'
3) The same in mana search resultss and in reports
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>
Fridolin Somers [Thu, 28 Feb 2019 12:37:40 +0000 (13:37 +0100)]
Bug 22422: improve item location display with class "shelvingloc"
In record detail page, item location is displayed with CSS using class "shelvingloc".
Many many places at intranet and OPAC can use this class.
It allows to change display in all places using CSS customisation.
This patch removes the CSS "display:block" for class "shelvingloc".
Some places where using "inline" to correct the display.
I think the display should not be managed in template.
So it will be inline by default and it can be changed by custom CSS, on all places or depending on a selctor.
Test plan :
1) Compile SCSS to CSS
2) Add to preferences IntranetUserCSS and OPACUserCSS : .shelvingloc { color:red }
3) Go to pages impacted by patch, be sure to look at cart with "more details"
4) You see item location italic and red
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>
Owen Leonard [Tue, 5 Mar 2019 18:22:12 +0000 (18:22 +0000)]
Bug 21030: Date widget on suspend modal not working correctly
This patch makes a change to the suspend hold modal markup in order to
allow the datepicker <selects> to work properly.
To test, apply the patch and locate a patron in the staff client who has
holds.
- On the checkout or patron detail page, open the holds tab.
- Click the "Suspend" button for one of the holds.
- In the modal, trigger the date picker and confirm that the dropdowns
for selecting month and year work correctly.
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 [Mon, 4 Mar 2019 18:39:29 +0000 (15:39 -0300)]
Bug 19046: Make seach pulldown to retain index selection
This patch also fixes add the term in the search input
Test plan:
Enable IntranetCatalogSearchPulldown
Search for a term using the search input in the header (simple search)
Re-do selecting different indices
The selection must retain on the search result page.
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>
Test plan:
Export item search result as CSV
Without this patch the biblio and biblioitem values are not displayed.
With this patch applied everything is displayed correctly
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Fri, 8 Mar 2019 16:52:07 +0000 (16:52 +0000)]
Bug 22483: Restore undef behaviour
Turns out that we rely heavily on the side effect that passing undef
to haspermission would always return true no matter what permissions
or lack of permissions you had.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 22483: (follow-up) Fix wrong tests higlighted by bug
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Fri, 8 Mar 2019 15:10:20 +0000 (15:10 +0000)]
Bug 22483: (QA follow-up) Tweaking call to haspermission
This patch tweaks the logic to check the permissions is defined before
passing to haspermission.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Fri, 8 Mar 2019 14:20:41 +0000 (14:20 +0000)]
Bug 22483: (QA follow-up) Corrections to logic in check_cookie_auth
check_cookie_auth needs to allow for cases where we wish to check for
ANY permission and cases where we wish to skip the permissions check
entirely and just authenticate the session.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Fri, 8 Mar 2019 12:49:10 +0000 (12:49 +0000)]
Bug 22483: (follow-up) Improve POD as requested in bug 22031
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Martin Renvoize [Fri, 8 Mar 2019 12:24:17 +0000 (12:24 +0000)]
Bug 22483: Explicitly ban 'undef' as a valid $flagsrequired
Before bug 22031 the haspermission subroutine signature allowed for
passing 'undef' to mean 'any permission' in $flagsrequired. This feels
like a mistake and was only in practical use in two places in the
codebase.
This patch explicitly forbids this practice (`*` may be used to the same
result and is more explicit in it's nature) and replaces the two
instances of it's use.
Test Plan
1. Before this patch, the API tests are all failing with authentication
errors
2. After this patch the API tests should now all pass.
3. t/db_dependent/Auth/haspermission.t should continue to pass (with one
addition subtest added herin)
3. /svc/members/search is not unit tested. Please check that patron
searching still yields results in the UI after this patch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Fridolin Somers [Mon, 11 Feb 2019 08:54:43 +0000 (09:54 +0100)]
Bug 22303: Correct bottom in virtualshelves/addbybiblionumber.tt
In virtualshelves/addbybiblionumber.tt the include intranet-bottom.inc which closes the HTML last tag is not the last line of the template.
This patch moved bottom include to last line and uses popup-bottom.inc.
Test plan :
1) Permission OK :
1.1) Login in staff interface with user 'Bob'
1.2) Create a new list 'Readme' : category public and allow changes to contents from anyone
1.3) Perform a search
1.4) Check some results
1.5) Click 'Add to list' and on the list 'Readme'
1.6) A popup window opens
1.7) Check its HTML is OK, ending with </html>
2) Permission KO :
2.1) Open a new window (Firefox private session) and login in staff interface with user 'Bill'
2.2) Perform a search
2.3) Check some results
2.4) On session of 'Bob', edit list 'Readme'
2.5) Change : category private and allow changes to contents from owner only
2.6) On session of 'Bill'
2.7) Click 'Add to list' and on the list 'Readme'
2.8) A popup window opens saying 'Sorry, you do not have permission to add items to this list'
2.9) Check its HTML is OK, ending with </html>
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Ere Maijala [Fri, 1 Feb 2019 11:18:11 +0000 (13:18 +0200)]
Bug 22246: Fix indexing of large fields with Elasticsearch
Deduplicate multivalued fields and make sure sort fields are not excessively long. Also updates default mappings so that sort fields are not created for item fields where it doesn't make sense.
Test plan:
1. Reset ES mappings in administration
2. Check that sort is '0' for local-classification in biblio mappings.
3. Change sort back to '1' for local-classification for the next steps.
4. Create a record with 20 items, each with a 100 character long call number
5. Check that when indexed, the record in ES does not have duplicates in any of the item fields and local-classification__sort is truncated to 255 characters.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Tue, 5 Mar 2019 18:16:44 +0000 (15:16 -0300)]
Bug 22419: Records listed twice when select/unselect all from the cart
It fixes a browser timeout when records are removed from the cart.
The onchange event already call selRecord.
Test plan:
Launch a search
Add all the result to your cart
Open the cart
Click "select all"
Then remove them all from your cart
=> Without this patch the action will timeout
=> With this patch applied the action is immediate
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Andrew Isherwood [Thu, 27 Sep 2018 10:44:27 +0000 (11:44 +0100)]
Bug 20639: (follow-up) Fix population of backends
The OPAC view wasn't correctly restricting the display of backends when
the ILLOpacbackends preference was set.
See the test plan on comment 7
Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Tue, 24 Apr 2018 13:15:22 +0000 (14:15 +0100)]
Bug 20639: Add ILLOpacbackends syspref
This adds the ILLOpacbackends syspref, allowing users to refine the ill
backends available to opac users for initiating ill requests
Remove default assignment for backends
We don't need a default assignment for the ILLOpacbackends assignment,
if the pref isn't set, it returns undef anyway. Also, having this
default assignment actually breaks the fetching of the preference
Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Martin Renvoize [Sat, 22 Dec 2018 13:55:23 +0000 (13:55 +0000)]
Bug 22031: Add SQL::Abstract like syntax to haspermission
This patch adds an SQL::Abstract inspired query syntax to the
haspermission method in C4::Auth. One can now pass Arrayrefs to denote
an OR list of flags, a Hashref to denote a AND list of flags.
Structures can be nested at arbitrary depth.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Jonathan Druart [Wed, 27 Feb 2019 12:38:57 +0000 (09:38 -0300)]
Bug 22275: (bug 15836 follow-up) Fix class_sources.class_split_rule FK creation
18.06.00.060 will fail if custom Classification sources were created.
In that case we should use the 'generic' split rule.
Test plan:
% git checkout -b bug_22395_pre 3a0cba67f1387595f570ab9d9efdeabc856345b4
Reset the DB
Go to Home › Administration › Classification sources
Create a custom "Classification filing rules"
Create a custom "Classification sources" using this filing rules
% git checkout master
% perl installer/data/mysql/updatedatabase.pl
=> Without this patch you will get:
DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`#sql-33a_67`, CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`) REFERENCES `class_split
_rules` (`class_split_rule`)) [for Statement "
ALTER TABLE class_sources
ADD CONSTRAINT class_source_ibfk_2 FOREIGN KEY (class_split_rule)
REFERENCES class_split_rules (class_split_rule)
"] at installer/data/mysql/updatedatabase.pl line 17104.
=> With this patch applied the FK will be created successfully
class_sources.class_split_rule will be set to "generic" for these custom values.
Signed-off-by: Oliver Behnke <oliver.behnke@aei.mpg.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Bug 20535: ModZebra called with $record with items stripped
ModZebra called with $record with items stripped in
ModBiblioMarc. Remove $record argument to force
record to be loaded again from database with items
embedded.
How to test:
1) Make sure biblios are indexed (with
rebuild_elastic_search.pl).
2) Perform a search that will produce a sample result
containing at least one biblio with items.
3) Edit and save a biblio with items.
4) Perform the same search again, the updated biblio
should now have no items when viewed in the search
results (No items).
5) Apply patch.
6) Repeat step 1-3.
7) The updated biblio should now have items when viewed
in the search results.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Julian Maurice [Wed, 6 Mar 2019 07:58:03 +0000 (08:58 +0100)]
Bug 16251: Fix value of material select for Rancor 008 widget
The material type is selected in accordance with the leader (06-07)
Test plan:
1. Create a new record using the advanced editor
2. Set the leader 6th position to 'c'
3. Save the record and reload the page
4. 'Music' should be automatically selected for 008
5. Try other values for the leader 6th and 7th positions
See comment 0 of this bug for the complete mapping
Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>