Commit graph

30875 commits

Author SHA1 Message Date
4339291f44 Bug 20227: Check for categorycode in default_borrower_circ_rules
Fixes silent crash when adding the same category twice.
DBD::mysql::st execute failed: Duplicate entry 'ST' for key 'PRIMARY' [for Statement "
                INSERT INTO default_borrower_circ_rules
                    (categorycode, maxissueqty, maxonsiteissueqty, max_holds)
                    VALUES (?, ?, ?, ?)
            " with ParamValues: 0="ST", 1=undef, 2=undef, 3="3"] at /usr/share/koha/devclone/admin/smart-rules.pl line 309.

(Line number affected by bug 15524.)

Very trivial solution.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:18 -03:00
Kyle M Hall
427b9a70ba Bug 12598: Fix POD
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:18 -03:00
2b07298991 Bug 12598: Use Pod::Usage and make the help more explicit
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:18 -03:00
bd122369dc Bug 12598: Remove warnings from tests and make them pass
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:18 -03:00
29e4291718 Bug 12598: Add use Koha::Patron::debarments statement
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:17 -03:00
2cd0f388fa Bug 12598: Re-add bug 18555: Create patron list from patron import
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:17 -03:00
Colin Campbell
8f8eb35c2f Bug 12598: Allow matched patron to be updated
When a test was introduced to not add duplicate userids
it overlooked that if you were matching on userid you
do not want the update to be rejected.

Add a test to overcome this logical flaw if updating
by matching userid

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 14:05:14 -03:00
b361ff2d7d Bug 12598: Re-add some missing stuffs
This patch will have to be squashed with previous ones, but for
readability I prefer to let it alone for now.

It reintroduces 2 missing changes:
  commit fd12390365
    Bug 15010: Import patron tool creates 'duplicate' restrictions (
    debarments )
  commit 011d8e9855
    Bug 12543 - Add userid as matchpoint for "Import patrons" tool

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:58 -03:00
c9c0697ca5 Bug 12598: Fix conflict with 17829 - GetMember
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:58 -03:00
70c45c3781 Bug 12598: Fix conflict with bug 16911
Tests will have to be written for this change

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:58 -03:00
e1476578f2 Bug 12598: Update code to use new modules
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:58 -03:00
c2066bcadc Bug 12598: New misc/import_borrowers.pl command line tool
Test Plan:
1) Apply this patch
2) Test importing patrons from command line,
   options are availble with --help.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Tested with minimal csv
(cardnumber,surname,firstname,categorycode,branchcode,password,userid)

Overwrite does not change category or branch.
Patrons are loaded, userid & password works

Updated license to GPLv3
No other koha-qa errors.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Tidy import_borrowers.pl

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Move importing code to a subroutine

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Update command line script to use patron import subroutine

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 [QA Followup]

* Fix copyright on import_borrowers.pl
* Changes -c --csv to -f --file
* Adds -c --confirm option
* Renames misc/import_borrowers.pl to misc/import_patrons.pl
* Restore userid matchpoint option

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Fix merge to master. Backport 3 updates from latest import_borrowers.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Started regression tests. Fix missing C4::Members::Attributes package

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - More refactoring and regression tests in Koha::Patrons::Import

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Creating objects in misc/import_patrons.pl and tools/import_borrowers.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Refactoring Koha::Patrons::Import includes bug fixed for critical date types and header column parsing

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598 - Rebase + backport of 16426 plus fixing 16426

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 12598: catch warnings raised by import_patrons in tests

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:57 -03:00
97bfd4be33 Bug 18789: Add POD for is_adult and is_child
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:57:57 -03:00
249736a67f Bug 18789: (QA follow-up) Fix viewlog when accessed via circulation
Test plan:
Go to any patron and then to Modification log of this patron
-- without patch you will not see the left side menu and patron information
-- with patch menu and patron information is here, and should be fully
working (links)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:59 -03:00
0b2c4ff551 Bug 18789: (QA follow-up) Update holdshistory.pl, fix is_child, is_adult, patron->image, clear template params
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
36bd68842f Bug 18789: (QA follow-up) Use is_child in circulation.pl
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
5008ccd11e Bug 18789: (QA follow-up) Use patron object in batch checkout template
1) Enable batch checkouts in system preferences and set it on for some
patron categories
2) Try to batch checkout for some patron with one of these categories
--> without patch the batch checkout page is even not shown
--> with patch batch checking out is working as expected

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
e8ff7ccd5f Bug 18789: (QA follow-up) Fix showing cardnumber when creating a hold
Test plan:
1) Try to create a hold request for a patron
2) On place hold form on the first line is shown the patron name
--> without patch the cardnumber is not shown
--> with patch there is cardnumber right after the patron name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
c6058953da Bug 18789: (QA follow-up) Fix showing patron name when checking in
Test plan:
1) Have a patron with more then one checkouts
2) Check in one of the checkouts
--> without patch patron name is not shown in checked-in items table
--> with patch the patron is shown with name, category, number of
checkouts and both links are working

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
9c8b420dd7 Bug 18789: (QA follow-up) Fix loading saved address data to edit patron form
Test plan:
1) Have patron with address filled in
2) Edit the patron
-- without this patch the fields for address are blank
-- with patch the fields are filled with actual data

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
146faf5d67 Bug 18789: (QA follow-up) Use first_valid_email_address on Tranfers to receive page
For consistancy with waitng reserves

Test plan:
1) Have a hold for patron which need to be transfered, inititate
transfer and go to target library
2) Go to Circulation -> transfers to receive page and you should see any
first valid email for tha patron in column "On hold for"

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
5bb01c8616 Bug 18789: (QA follow-up) Fix showing the name of basket creator on booksellers page
Test plan:
1) Go to Acquisition and search for a vendor, you are presented with vendors and their baskets
2) Look to Created by column
--> without patch only firstname is shown
--> with patch you should see full name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
8eb00d2cbb Bug 18789: (QA follow-up) Fix borrowernumber in menu item links
Test plan:
Go to patrons routing list
Try to click Holds history or ILL requests menu link
--> without page blank page
--> with page desired page

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
7d9ba0d1b4 Bug 18789: (QA follow-up) Fix tab char
Test plan:

run koha qa tools, should be green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
105b3e10e8 Bug 18789: Use the patron variable in circulation.[pl|tt]
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
c49bffda19 Bug 18789: Add tests for is_adult and is_child
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
43b60d6eed Bug 18789: (follow-up) Use Koha::Patron->image from the templates
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
6f9c5d45a4 Bug 18789: (follow-up) Send Koha::Patron object to the templates
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
9773923bc0 Bug 18789: Update other occurences where is_child should be used
Trivial changes here, just do a code review on the QA step

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
2ee70dd082 Bug 18789: Remove adultborrower from the pay* scripts
This flag is not used in the templates

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
82474cad84 Bug 18789: Remove useless IS_ADULT variable
Test plan:
  git grep IS_ADULT
must not return any results

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
a723bbaf1b Bug 18789: Use Koha::Patron->is_adult where needed
Test plan:
When editing adult's info you must see the "Add child" button

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
d8b8799355 Bug 18789: Use Koha::Patron->is_child where needed
Test plan:
When you are on a page related to a child you should see the "Update
child to adult patron" button

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
e5f70a6010 Bug 18789: Add tests for is_adult and is_child
This patch add 2 methods to the Koha::Patron module: is_adult and
is_child.
That way the business logic is at only one place and covered by tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
b4c23e1a3e Bug 18789: Use Koha::Patron->image from the templates
Now that we have the 'patron' variable in all our templates, we can call
Koha::Patron->image and do the check from the templates.

Test plan:
On the different pages of the patron module, you should see the default
image if there is no image attached or the one that has been attached
(see pref patronimages)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
ab47e46ea0 Bug 18789: Pass a Koha::Patron object from returns.pl
This is a specific patch for returns.pl

Test plan:
Do some checkin for a patron and make sure the info are correctly
displayed (and info from someone that has placed a hold on this item)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
0ab22e1c7c Bug 18789: Send Koha::Patron object to the templates
In order to simplify and make uniform the code, the controller scripts send
a Koha::Patron object to the templates instead of all attributes of a patron.

That will make the code much more easier to maintain and will be less
error-prone.

The variable "patron" sent to the templates is supposed to represent the
patron the librarian is editing the detail.

In the members module and some scripts of the circulation module, the
patron's detail are sent one by one to the template. That leads to
frustration from developpers (making sure everything is passed from all
scripts) and to regression (we got tone of bugs in the last year because
of this way to do).
With this patch set it will be easy access patron's detail, passing only
1 variable from the controllers.

Test plan:
Play with the patron and circulation module and make sur the detail of
the patron you are editing/seeing info are correctly displayed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
Magnus Enger
265070081a Bug 20205: Add IDs to buttons in patron-toolbar.inc
The buttons in patron-toolbar.inc lack unique IDs, making them
hard to style/remove with CSS. This patch adds IDs to all three
buttons.

To test:
- Look in koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
  and verify there are no IDs
- Apply the patch and look at the file again to verify the IDs have
  been added
- Test the "New patron" and "Quick add new patron" buttons to verify
  they still work as intended
- Check that the new buttons are globally unique:
  $ grep -rn "new-patron-button" *
  $ grep -rn "patron-lists-button" *

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>
2018-02-16 13:03:58 -03:00
795aeaefff Bug 20185: Remove warnings from stats.print.pl
This needs a full rewrite!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
216b0cff0d Bug 20185: Remove warnings from aqplan.pl
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
eac8f7d9ac Bug 20182: [sql_modes] Remove group by clause in search_patrons_to_anonymise
Not trivial, more attention needed on this one!

Fix for:
'koha_kohadev.me.cardnumber' isn't in GROUP BY

Looks like the query is complexified, perf tests needed, see bug 19599.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
524eab6788 Bug 20176: [sql_modes] Set biblio.datecreated to NOW if not defined
Fix at ->store level, this issue appears in lot of places.

Fix for:
Field 'datecreated' doesn't have a default value

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:03:58 -03:00
fd70cdcc31 Bug 12904: Add KOHA_VERSION to few more .css
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:01:19 -03:00
e01b3be15a Bug 20193: Path to Greybox CSS broken after Bug 12904
Bug 12904 changed the way CSS and JS assets should be linked, but the
Greybox CSS path wasn't changed in the process. This patch adds the
required VERSION template variable to greybox.inc.

To test, apply the patch and test usage of Greybox in the staff client.
For instance:

- Go to Tools -> Labels -> Manage -> Label batches
- Select a batch for export and click the 'Export selected' button
- A Greybox modal should be triggered, and the export process should
  proceed correctly.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:01:03 -03:00
04005f2ea1 Bug 20191: Use find with unique key combination
To prevent unexpected issues later.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:01:03 -03:00
2f90cd2be0 Bug 20191: Make OAI/Server.t tests use timestamps from the DB
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:01:03 -03:00
3672df5226 Bug 20221: Fix for JavaScript error during checkout patron search
This patch fixes a bug caused by the changes in Bug 19641. JavaScript
embedded in circ-patron-search-results.inc executes before jQuery is
loaded.

This patch adds a separate javascript file which can be included both in
circulation.tt and request.tt since both use the same include.

To test, apply the patch and submit a patron name in the check out form.
On the page of search results, clicking a table row should work the same
as clicking the patron name link.

Perform the same test during the hold process: Locate and place a hold
on a title. In the patron search form, submit a patron name and test the
behavior of the search results screen.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 13:00:57 -03:00
8d30669458 Bug 18403: Prevent Modifications.t to fail randomly
#   Failed test 'pending_count() correctly returns 2 if filtered by library'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 355.
    #          got: '0'
    #     expected: '2'

    #   Failed test 'pending_count() correctly returns 2'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 360.
    #          got: '0'
    #     expected: '2'

    #   Failed test 'pending_count() correctly returns 1'
    #   at t/db_dependent/Koha/Patron/Modifications.t line 365.
    #          got: '0'
    #     expected: '1'
    # Looks like you failed 3 tests of 16.

 #   Failed test 'pending_count() and pending() tests'
 #   at t/db_dependent/Koha/Patron/Modifications.t line 374.
 # Looks like you failed 1 test of 6.
 [19:45:28] t/db_dependent/Koha/Patron/Modifications.t

The logged in patron did not have permissions to view patron's info from other branches.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-16 10:49:45 -03:00
3848f81c3c Bug 19881: Remove authorities-list.pl
For obvious reasons...

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-15 16:05:13 -03:00
51b6cf2aaf Bug 19847: Track links within the records and 404 for others
Test plan:
Behave like a robot, you will get 404
Be a human, you will be tracked

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-02-15 16:04:52 -03:00