Commit graph

6993 commits

Author SHA1 Message Date
2d3aaff84e Bug 18925: Fix null/empty behavior, again
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>
2019-03-05 20:42:22 +00:00
6845cd6a67 Bug 18925: Replace logic in GetBranchBorrowerCircRule with get_effective_rule
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>
2019-03-05 20:41:42 +00:00
Jesse Weaver
d1303ca834 Bug 18925: (follow-up) Fix null/empty behavior
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>
2019-03-05 20:41:42 +00:00
Jesse Weaver
f9d90a2644 Bug 18925: (follow-up) Change name of rule to fix ambiguity
There was previously an ambiguity between the branch/category/itemtype
specific max{,onsite}issueqty and the total-per-patron max{,onsite}issueqty.
The latter has been renamed to patron_max{,onsite}issueqty.

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>
2019-03-05 20:41:42 +00:00
26a779eded Bug 18925: Move maxissueqty and maxonsiteissueqty to circulation_rules
This patch set moves maxissueqty and maxonsiteissueqty to the
circulation_rules table.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) prove t/db_dependent/Circulation.t
4) prove t/db_dependent/Circulation/Branch.t
5) prove t/db_dependent/Circulation/GetHardDueDate.t
6) prove t/db_dependent/Circulation/Returns.t
7) prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
8) prove t/db_dependent/Circulation/TooMany.t
9) prove t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
10) prove t/db_dependent/Reserves.t
11) Note no changes in circulation behavior related to check out limis
    both on and off site

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>
2019-03-05 20:41:42 +00:00
b104046d89 Bug 21720: Use Koha::Account->add_debit in AddIssuingCharge
Known Side Effect: Prior to this patch issuing charges were not
recorded in the FinesLog. After this patch, if the FinesLog is
enabled then the 'action' will be recorded as `create_rent`.

Sponsored-by: PTFS Europe

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 19:15:41 +00:00
e7dbe41242 Bug 21728: Use Koha::Account->add_debit in ChargeReserveFee
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 19:08:25 +00:00
55d18aeca6 Bug 21722: Use Koha::Account->add_debit in chargelostitem
This patch updates C4::Accounts::chargelostitem to use the newly
available add_debit method from Koha::Account.

Known Side Effects: If the FinesLog is enabled then the 'action'
recorded will change from the generic `create_fee` (for both the lost
charge and any associated processing charge) to the more descriptive
terms `create_processing` and `create_lost_item`.

Sponsored-by: PTFS Europe

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 19:08:25 +00:00
Hayley Mapley
62b4fbb9dd Bug 18584: remove trailing space from C4/XSLT.pm
Test plan:
1) Open C4/XSLT.pm and confirm that the trailing space at line 313 is
gone.
2) Sign off.

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-04 18:43:05 +00:00
1a385cae8d Bug 21747: (follow-up) Intelligent rename of offsets
This patch intelligently renames the account_offset types for updateing
fines from `Fine Update` to `fine_increment` and `fine_decrement`
depending on the sign of the calculated difference of the adjustment.

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>
2019-02-27 09:14:21 -05:00
b3969c52f8 Bug 21747: Use Koha::Account:: routines in UpdateFine
Set to use Koha::Account->add_debit and Koha::Account::Line->adjust

Known Side Effect: The format of the FinesLog, if enabled, is changed
after this patch. Prior to this patch the $actionname was left undefined
and the $infos field contained the string:

`"due=".$due."  amount=".$amount." itemnumber=".$itemnum`

After this patch, the logs are more consistent with other FINES logs,
with an $actionname of 'CREATE' or 'UPDATE' and the $infos field
containing a Dumper of fine data.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
7c3a5c78c1 Bug 21765: Make AutoUnsuspendReserves call Koha::Hold->resume
This patch makes the mentioned method use the biult-in method for
resuming a suspended hold, instead of manually setting the specific
attributes using the accessors.

The side effect for this is that HoldsLog is now honoured.

This patchset also refactors the tests a bit so they rely on the exposed
methods and thus don't rely on specific implementation details (like
suspended hold means a date in suspended_until plus suspended=1).

To test:
- Apply the regression tests patch
- Run:
  $ kshell
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> FAIL: It fails loudly because things are done manually
- Apply this patch
- Run:
 k$ prove t/db_dependent/Reserves/AutoUnsuspendReserves.t
=> SUCCESS: Tests pass!

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>
2019-02-27 09:14:21 -05:00
aae5e55846 Bug 21875: Handling subject line in Letters.pm
The variable name $utf8 is very misleading: it contains MIME-Header encoding.
$message->{subject} comes from the database and is in perl internal format;
it should NOT be decoded as a MIME-Header.
After encoding to MIME-Header, previously another (useless) encoding to
UTF-8 was done. Since the string is plain ASCII, this is useless and
theoretically wrong. We should stay in MIME-Header.

Test plan:
See Bugzilla comment5.

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: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-27 09:14:21 -05:00
3e63209fa8 Bug 22016: Always send CT field for SIP checkin, even if empty
Some SIP devices ( in this particular case, bin sorting machines from RFID Library Solutions ) require a CT field to be sent, even if that field is empty. Koha should be able to support this behavior.

Test Plan:
1) Apply this patch
2) Enable the new option ct_always_send for a SIP2 account
3) Restart SIP
4) Check in an item successfully via SIP, which will not be transferred
5) Note the response contains a CT field with no value

Sponsored-by: Pueblo City-County Library District

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>
2019-02-27 09:14:21 -05:00
9cdac855c9 Bug 22014: Add ability to send "00" in SIP CV field on checkin success
Some SIP devices ( in this particular case, bin sorting machines from RFID Library Solutions ) require a checkin success to return a CV field of the value "00" rather than no CV field at all. Koha should be able to support this behavior.

Test Plan:
1) Apply this patch
2) Enable the new option cv_send_00_on_success for a SIP2 account
3) Restart SIP
4) Check in an item successfully via SIP
5) Note the response contains a CV field with the value '00'

Sponsored-by: Pueblo City-County Library District

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>
2019-02-27 09:14:21 -05:00
8bbfd0c027 Bug 21206: Fix SwitchOnSiteCheckouts.t
Fix conflict with
  commit f8544ba579
  Bug 21999: Move attributes to a variable to not dup them

Thanks tests!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
2a58e32f7d Bug 21206: (QA follow-up) Rebase problem and leftover mocked GetItem
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
ee9f4aed8b Bug 21206: (follow-up) Fix Circulation.t
Test plan:
prove t/db_dependent/Circulation.t

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
c729610824 Bug 21206: Remove GetItem
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
31c29fd31f Bug 21206: Replace C4::Items::GetItem
Note: This is here for information purpose, feel free to test it if you
wan to play with it.

TODO: C4::Reserves::_get_itype is not longer in use

No more GetItem must be returned by:
git grep GetItem|grep -v GetItemsAvailableToFillHoldRequestsForBib|grep
-v GetItemsForInventory|grep -v GetItemsInfo|grep -v
GetItemsLocationInfo|grep -v GetItemsInCollection|grep -v
GetItemCourseReservesInfo|grep -v GetItemnumbersFromOrder|grep -v
GetItemSearchField|grep -v GetItemTypesCategorized|grep -v
GetItemNumbersFromImportBatch|cut -d':' -f1|sort|uniq

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
4585228ea9 Bug 18957: Record the time part of the last renewed date
issues.lastreneweddate is a datetime and we could record the time part
of the date.

Test plan:
Renew an issue
note that the time part of the last renewed date is set correctly

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>
2019-02-26 13:09:02 +00:00
fac2c17214 Bug 21997: SIP patron information requests can lock patron out of account
Many SIP services send an empty password field (AD). Even if allow_empty_passwords is enabled for the given SIP account, this empty password is run though Koha's password checker which increments the number of login attempts for a patron. Thus repeated patron information requests can lock a patron out! Empty password fields in SIP should not call for a password check if allow_empty_passwords is enabled.

Test Plan:
1) Enable a patron password attempt with a limit of 3
2) Send 4 patron information requests with an empty AD field
3) Note the patron's account is now locked
4) Apply this patch
5) Repeat step 2 with a different patron
6) Note the patron's account does not get locked!

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>
2019-02-22 13:09:07 +00:00
Mark Tompsett
5b0eb51c80 Bug 18143: Silence ods MARC framework export flood
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:15 +00:00
Mark Tompsett
719153455c Bug 18143: Silence XML MARC Framework export flood
TEST PLAN
---------
1) Log in to staff client
2) Click Koha administration
3) Click MARC bibliographic framework
4) export default as xml
5) Read the error log
   -- it's floody and export is default framework
6) export another framework as xml
7) Read the error log
   -- it's floody and export is the correct framework
8) apply the patch
9) repeat steps 4-7
   -- expected frameworks exported, and no flooding.
10) run koha qa test tools

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:15 +00:00
39d2885d13 Bug 10676: Fix behaviour of OpacHiddenItems for items.restricted
The numerical restricted value was overwritten in GetItemsInfo
with the description. So OpacHiddenItems would only work for
restricted using the description, not the numerical value
of the authorised value like for other similar status fields.

This changes GetItemsInfo to use a separate variable for
the description, as it's already done for notforloan and
changes the template files where the variable is used
accordingly.

To test
- Before applying patch
- Configure OpacHiddenItems with:
  restricted: [1]
- Find a record with more than one item and mark one of the items
  as "Restricted Access"
  (assume standard sample data - check authorised value if status doesn't exist)
- Verify the item is still shown in OPAC.
- Apply patch
- Verify that the item is now hidden
- Verify that the status still displays nicely in the staff detail page
- Delete OpacHiddenItems
- Verify that the status is showing nicely in the OPAC detail page

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:48 +00:00
012200fbc0 Bug 19832: (QA follow-up) Remove obsolete pending_queue call
Only use of $pending was removed in the former patch.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:45 +00:00
c3b41cb124 Bug 19832: Don't fill holds in SIP/Transaction/Checkout.pm
AddIssue already checks for holds in the item being issued and deals with them

The sip code, additionally, does not consider that multiple holds per bib
is allowed

To test:
 0 - Apply only first patch (unit tests)
 1 - Place two holds for a patron on a bib
 2 - Checkout that item via sip_cli_emulator
 3 - Note all holds are cancelled/filled
 4 - prove -v t/db_dependent/SIP/Transaction.t
 5 - it fails
 6 - Apply second patch
 7 - prove tests, all green
 8 - Place two holds on a single bib for one patron again
 9 - Checkout the item via sip_cli_emulator
10 - Only one holds is filled

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>
2019-02-15 18:42:44 +00:00
12fe392d26 Bug 22140: Use of EasyAnalyticalRecords pref is get_hostitemnumbers_of
Like Bug 20702 defined GetHostItemsInfo does nothing if EasyAnalyticalRecords pref is disabled, get_hostitemnumbers_of must be dependant on this pref too.

Test plan :
1) Build an analytical record with 773$0 and $9
2) Enable EasyAnalyticalRecords
4) Place an hold on the record
5) => You see the linked item
6) Disable EasyAnalyticalRecords
7) Place an hold on the record
8) => You dont see the linked item

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 13:34:57 +00:00
7266d50dd2 Bug 22140: Use of EasyAnalyticalRecords pref in search
Like Bug 20702 defined GetHostItemsInfo does nothing if EasyAnalyticalRecords pref is disabled, there are other places where code must be dependant on this pref.

Test plan :
1) Build an analitical record with 773$0 and $9
2) Enable EasyAnalyticalRecords
3) Don't apply patch
4) Go to OPAC
5) Perform a search that displays the record, check there is the linked item
6) Open record detail page, check there is the linked item
7) Apply patch and redo 5) and 6)
8) Disable EasyAnalyticalRecords
9) redo 5) and 6), you should not see the linked item

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 13:34:57 +00:00
5b160af2a0 Bug 21829: Correctly format dateexpiry in notices (date only)
dateexpiry is a date, we should not display the time
part in notice.

Test plan:
Create a notice with borrowers.dateexpiry, generate this notice.
The value should be displayed without the time part

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-11 18:32:40 +00:00
Alex Arnaud
102b1ca4bf Bug 21738: make call of CanBookBeReserved more safe
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-08 20:44:07 +00:00
Alex Arnaud
870191d406 Bug 21738: check items count in C4:ILSDI::HoldTitle
Test plan:
  - Try holding a title without items via ILS-DI
    (cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1),
  - you get an error,
  - apply this patch,
  - try again,
  - you should get the code "Notitems"Bug 21738: check items count in
    C4:ILSDI::HoldTitle

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-08 20:44:06 +00:00
b3c25b64b8 Bug 22097: CataloguingLog should be suppressed for item branch transfers
Bug 18816 missed the fact that a branch transfer triggers ModItem and
thus generates an action log line. We should not be creating those
action logs, especially considering the transfers table itself already
documents the transfer.

Test Plan:
1) Enable CataloguingLog
2) Transfer an item to another branch
3) Note the new action log line created
4) Apply this patch
5) Create another item transfer
6) No new action log line should be created!

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>
2019-02-04 15:52:57 +00:00
d2ce727e26 Bug 19915: Use cn_sort values for getting inventory items
To test:
1 - Catalog an item under LCC with callnumber GT95
2 - cn_sort should calculate as GT0095
3 - Go to inventory tool
4 - Enter a range that should have your item e.g LC GT90 to GT100
5 - Item is not returned
6 - Apply patch
7 - Item should be returned
8 - Verify things otherwise work as expected

Signed-off-by: Anne-Claire Bernaudin <anne-claire.bernaudin@univ-rennes1.fr>

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

https://bugs.koha-community.org/show_bug.cgi?id=19905

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-04 14:42:10 +00:00
fd30cac85a Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema
This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-30 11:35:34 +00:00
helene hickey
9a5bfee706 Bug 21290: Updating documentation for ModItem
To test:
Review the patch and check it is now updated correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 14:35:27 +00:00
f6599b2c54 Bug 17353: Add phone number column to checkout search
This patch adds borrowers.phone as 'Primary phone' in the checkout
search results. It also ads the table to columns configuration

To test:
1 - Perform a checkout search
2 - Note phone is not displayed
3 - Apply patch
4 - Note phone does not display
5 - Visit columns configuration
6 - Unhide the 'phone' column
7 - Note phone displays
8 - Ensure page functions as before patch

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>
2019-01-28 13:06:35 +00:00
Alex Arnaud
e7b26fcdf0 Bug 19945: Use CanItemBeReserved in ILSDI HoldItem instead of CanBookBeReserved.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 13:06:29 +00:00
Mark Tompsett
abf19383ed Bug 19945: (follow-up) optimization and test correction
The double call to CanItemBeReserved was pointless in
the C4/Reserves.pm HoldItem, as CanBookBeReserved calls
CanItemBeReserved and even returns that code.

Additionally, the tests failed, because there were 5
tests not 4.

TEST PLAN
----------
prove t/db_dependent/ILSDI_Services.t
run koha qa test tools

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 13:06:28 +00:00
Alex Arnaud
ac840a8460 Bug 19945: ILSDI - Return the reason a reserve is impossible
Currently, the ILDSI services HoldTitle and HoldItem always return a
"NotHoldable" code is the reserve is impossible. We need to know why

Test plan:

 - Apply this patch
 - Place a hold on a non reservable title using ILS-DI web service
   (http://koha-opac.example.org/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1&request_location=)
 - you should get the reason instead of NotHoldable,
 - Place a hold on a non reservable item using ILS-DI web service
   (http://koha-opac.example.org/cgi-bin/koha/ilsdi.pl?service=HoldItem&patron_id=1&bib_id=1&item_id=1)
 - you should get the reason instead of NotHoldable,

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 13:06:27 +00:00
89d4b5ea58 Bug 21241: (follow-up) Made SQL change idempotent
Also added the new pref to sysprefs.sql

Also simplified the conditional statement.

Sponsored-By: Brimbank Library, Australia

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 11:42:32 +00:00
a4b38a18b3 Bug 21241: (follow-up) Code Golf
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 11:42:31 +00:00
3f7b2fa418 Bug 21241: (follow-up) Syspref to control fallback to SMS when no email is defined
This patch adds a new system preference (FallbackToSMSIfNoEmail)
which if enabled Koha will send suggestion notices by SMS if a borrower
has a defined SMSalertnumber and no email.

The use of the syspref prevents automatic fallback to sending suggestion notices as SMS when there's no defined email.

Test plan:
1. Chose a patron who has no email address set, but does have a
smsalertnumber set (this value is set in the Patron messaging
preferences section after the SMSSendDriver syspref is set)

2. Log into the OPAC with that user and submit a suggestion

3. In the staff client go to Acquisitions->Suggestions and tick the
suggestion and set its status to 'Accepted'

4. In the database query the message_queue and notice the
message_transport_type of the message is set to 'email' even though the
patron has no email address set.

5. Apply patches, restart memcached and plack

6. Check the 'FallbackToSMSIfNoEmail' syspref
is disabled

7. Repeat steps 2,3 and observe in the message_queue
table the message_transport_type = 'email'

    i.e. If the syspref is disabled then the message is still sent by email
    to borrowers with defined smsalertnumber and no email address

8. Enable the 'FallbackToSMSIfNoEmail' syspref
and repeat steps 2,3 and notice the
message_transport_type = 'sms'

    i.e. If the syspref is enabled then the message is sent by sms to
    borrowers with defined smsalertnumber and no email address

9. Repeat steps 2,3 with a patron with an email
address and no smsalertnumber trying with the 'FallbackToSMSIfNoEmail' syspref
enabled and disabled and notice in both cases the
message_transport_type = email.

    i.e. If a borrower has an email address defined the suggestion
    notice will always be sent via email

10. Repeat steps 2,3 with a patron with no email or smsalertnumber trying with the 'FallbackToSMSIfNoEmail' syspref enabled and disabled and notice in both cases the message_transport_type = email

    i.e. If the borrower has no smsalertnumber and no email defined then the
    suggestion notice will be sent by 'email'

11. Run t/db_dependent/Suggestions.t

Sponsored-By: Brimbank Libraries, Australia
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 21241: (follow-up) Renamed system preference

Sponsored-By: Brimbank Library, Australia
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-28 11:42:31 +00:00
dfa883bbd0 Bug 21241: Conditional to choose appropriate message_transport_type for suggestion notices
Introducing a conditional into C4/Suggestions.pm to check if no patron
email exists but a smsalertnumber does exist then the suggestion notice
message_transport_type is set to 'sms', otherwise the suggestion
message_transport_type='email'.

This ensures patrons with no email address still receieve their
suggestion notices because at present the message_transport_type is
hardcoded to 'email'.

Test plan:
1. Chose a patron who has no email address set, but does have a
smsalertnumber set (this value is set in the Patron messaging
preferences section after the SMSSendDriver syspref is set)

2. Log into the OPAC with that user and submit a suggestion

3. In the staff client go to Acquisitions->Suggestions and tick the
suggestion and set its status to 'Accepted'

4. In the database query the message_queue and notice the
message_transport_type of the message is set to 'email' even though the
patron has no email address set.

5. Apply this patch, restart memcached and plack

6. Repeat steps 2,3 with the same patron and query the message_queue
table again and notice this time the message_transport_type = 'sms'

7. Repeat steps 2,3 with a patron with no smsalertnumber or email
address. Query the database and observe the
message_transport_type=email.

If no smsalertnumber is set then the message_transport_type is set to
'email' by default

Sponsored-By: Brimbank Library, Australia

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>
2019-01-28 11:42:31 +00:00
5e1fd6218c Bug 22049: (QA follow-up) update MarkIssueReturned call in process_koc.pl
Test plan:
Try to upload koc file with some returns
Success: the file should be correctly processed

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:46:48 +00:00
a243104bf7 Bug 22049: (follow-up) Remove leftover variable
The $circControlBranch variable was originally set to be used to pick
the right dropbox branch. It was only used in MarkIssueReturned, to get
the right Koha::Calendar object. As this responsability was moved top to
the AddReturn caller, and the fact that _GetCircControlBranch is
actually used for fines rules, there's no use for it in this context.
And it was left on the previous patch as a mistake.

To test:
- Make sure the variable is not actually used:
  $ git grep '$circControlBranch'
=> SUCCESS: removed variable is not actually used.
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:46:48 +00:00
3cd669e527 Bug 22049: Make MarkIssueReturned rely on returndate only
This patch changes the params accepted by
C4::Circulation::MarkIssueReturned by removing the $dropbox_branch
param.

This passed branchcode was only used to initialize the Koha::Calendar
object, but the date arithmetic has already taken place in a couple
places before we reach this point. This logic needs to be simplified
(bug 14591), and this is the starting point.

To test:
- Apply this patch
- Run:
  $ git grep MarkIssueReturned
=> SUCCESS: Check all the uses of the function either originally passed
undef, or now pass the same date that would've been calculated anyway,
in the returndate param.
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:46:47 +00:00
197a7029f6 Bug 22048: Use set_password in Auth_with_ldap.pm
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>
2019-01-25 20:15:31 +00:00
Ere Maijala
7cb88d24a8 Bug 21826: Remove strict and warning from Heading.pm
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:13:41 +00:00
441040264a Bug 21826: (QA follow-up) Add UNIMARC support
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>
2019-01-25 20:13:39 +00:00