Commit graph

252 commits

Author SHA1 Message Date
Mark Tompsett
d5986c9b97 Bug 19040: Refactor GetMarcBiblio parameters
Change parameters to a hashref.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Looks good to me.
Two calls in migration_tools/22_to_30 still in old style.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-08-25 10:23:42 -03:00
c73e269a13 Bug 18260: Koha::Biblio - Remove GetBiblio
C4::Biblio::GetBiblio can be replaced with Koha Biblio->find

Test plan:
Import batch, view issue history, search for items, see the image of a
bibliographic record, modify and delete records in a batch

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 13:03:38 -03:00
Julian Maurice
c69e02c441 Bug 18782: Remove unused C4::Serials::getsupplierbyserialid
TEST PLAN
----------
git grep -i getsupplierby
-- only the code removed and the test tweaked
git bz apply 18782
sudo koha-shell -c bash kohadev
prove -v t/db_dependent/Serials.t
qa -v 2 c 1
exit
-- sign off

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2017-07-05 13:41:47 -03:00
4e9701c36a Bug 18697: Final polishing
GetFictiveIssueNumber:
Returns undef instead of 0 for irregular frequencies. Also added to POD.
Removed unused variable $wkno.
Adding a return makes the if(unit) unneeded.
Replaced (a+b)/b by 1+a/b.

_delta_units:
Added a comment about its parameters.

GetFictiveIssueNumber.t:
Adjusted the tests for irregular frequencies accordingly.

Test plan:
[1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t
[2] Run t/db_dependent/Serials/GetNextDate.t

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-19 15:35:51 -03:00
f65ca90b0f Bug 18697: Fix date calculation for dayly frequencies in Serials
The changes in _get_next_date_day are actually only cosmetic. The sub
now reads exactly the same as its counterparts for other units, but
the results are exactly the same as before.

In GetFictiveIssueNumber we now call _delta_units for each type of unit.
The two Delta_Days calls are moved to _delta_units. Note that this also
is a cosmetic change; results should be exactly the same.

Test plan:
[1] Edit a subscription. Test predication pattern for some daily freq.
[2] Run t/db_dependent/GetNextDate.t

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-19 15:35:51 -03:00
ffb1c87d29 Bug 18697: Fix date calculations for weekly frequencies in Serials
Same solution applied as in bug 18356/18607. Consistency++

The code in _get_next_date_week is again very similar to the code in
_get_next_date_month or _get_next_date_year. I will not merge them here,
but we could consider that in the future.

Code in GetFictiveIssueNo has been adjusted similarly to month and year.

Test plan:
[1] Do not apply this patch. Create a subscription for 3/week.
    When the first issue date is on a Saturday or Sunday, the
    intervals in the prediction pattern are 0,0,7,0,0,7,etc.
    Starting on Wed-Fri 1,1,5,etc. Starting on Mon-Tue 2,2,3,etc.
[2] Apply this patch. Check again.
    The interval should be always 2,2,3 now and no longer depend on the
    day_of_week of first issue date.
[3] Check another weekly frequency with multiple units per issue.
    Say 1 issue/3 weeks.

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-19 15:35:50 -03:00
adfcd8d79c Bug 18607: Fix date calculations for monthly frequencies in Serials
Similarly to the solution of bug 18356, this patch fixes the date
calculation for monthly frequencies.

The calculation in GetFictiveIssueNumber now makes use of the new
_delta_units sub introduced on bug 18356.

The calculation in _get_next_date_month is also very similar to the one
in _get_next_date_year. I do not merge them here, but this could still
be considered later on. At least consistency is achieved now between
both routines. The connection with firstacquidate has been cut thru
just like for year units.

Test plan:
[1] Without this patch, look at the prediction pattern for a
    subscription with first issue on Feb 21 and 5 per month. The first
    issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc.
[2] Apply the patch. Look at the same prediction pattern. You will now
    see 6 day intervals and a new cycle starting on the 21st.
    So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc.
[3] Edit an subscription. Try a few other monthly frequencies.
[4] The next patch adjusts related unit tests.

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-19 15:35:50 -03:00
d71fb0e17c Bug 18356: Fix date calculations for yearly frequencies in Serials
The problem as described on BZ 18356 is a combination of an error in
GetFictiveIssueNumber and GetNextDate for unit==year.

[1] In GetNextDate the Add_Delta_YM calculation should be applied only to
frequencies based on years per unit.
In the case of multiple units per year we calculate the number of days to
add. And if we have reached the end of a cycle, we correct the
rounding applied in the cycle.
NOTE 1: We obsolete the idea here of rebasing dates on firstacqui. In case
of manual adjustments, we probably do not want it. And otherwise we do not
need it anymore due to the correction at the end of a cycle.
NOTE 2: The calls to Add_Delta_YM are intentionally not corrected for leap
years. Say you start at 2016-02-29. If you use 1/yr or 1/2yr, you will
switch to the Feb 28th in the following years. In 2020 there will be no
switch to Feb 29 again; if someone should need it, please use a manual
adjustment. This is probably highly exceptional.

[2] In GetFictiveIssueNumber the year should be decreased by one if you
have more units per year and you did not yet reach firstacqui day and
month. This affects calculations in GetNextDate with irregularities.
NOTE 1: I added a wrapper around Date::Calc::N_Delta_YMD in order to improve
its results; this will especially be needed when we use it later for
month units.
NOTE 2: In case of manual adjustments this calculation does not really make
sense. Another report should deal with improving irregularities.

Test plan:
[1] Verify that both GetNextDate.t as well as GetFictiveIssueNumber.t pass.
[2] Look at the prediction pattern for a few frequencies.
    For example: 1 iss/y, 1 iss/2y, 5 iss/y.

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-06-19 15:35:45 -03:00
17f4b05d23 Bug 14932: Do not call can_edit_subscription with an empty value
ref($sub) eq 'ARRAY' should always be true, what we want is to call
can_edit_subscription if there is at least 1 serial for this
subscription.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-13 08:31:47 -04:00
Olli-Antti Kivilahti
6940aa91a5 Bug 14932 - serials/serials-collection.pl-page is very slow. GetFullSubscription* checks permission for each serial!
Currently we have subscriptions with 300+ serials received.
It takes a lot of time to show serials-collection.pl (~20s).
This is especially troublesome when receiving serials, since after receival we get redirected to that page.

We no longer can receive daily serials in the allotted timeframe.

This quick and dirty fix prevents checking the subscription editing for each serial, but instead checks it for the first serial only.

This reduced page load time by ~18s

TEST PLAN:
1. Receive ~300 serials (or just a bunch :)  )
2. Observe the gradual slowing of the receival action.

AFTER THIS PATCH:
1. Receive ~300 serials more (or just a bunch)
2. Observe a significant performance improvement.

Signed-off-by: Paul POULAIN <paul.poulain@biblibre.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-13 08:31:47 -04:00
53f2b56fa1 Bug 7728: [QA Follow-up] Fix POD whitespace
Resolves complaints from qa tools.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-03-31 12:48:03 +00:00
Paul Poulain
1843ee148b Bug 7728: Fix subs history end date consistency
Without this patch, there is an inconsistency in subscriptions:
 * a new subscription has no history end date set (as expected)
 * if you renew it, a date is set.

This patch removes the setting of the history end date during renewal

Test plan:
 * create a subscription, go to subscription-detail.pl page, tab "Summary". No History end date is set
 * renew the subscription => a date has been set
 * apply the patch
 * create another subscription
 * renew it => no history end date has been set
 * sign-off

Signed-off-by: beroud <isabelle.beroud@univ-lyon3.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-03-31 12:48:02 +00:00
Luke Honiss
f9a4f5edb8 Bug 17865 'If a subscription has no history end date, it shows as expired today in OPAC'
--TEST PLAN--
1) View a subscription with no history end date
2) Search for an item with a subcription in OPAC
3) Under subscription tab click more details
4) The end date will be the current date
5) Apply patch and refresh
6) The end date will not be shown

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-02-21 19:55:13 +00:00
Katrin Fischer
40cb8e3b75 Bug 17902: Follow-up fixing SQL statement
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 13:02:57 +00:00
f42dbd67d1 Bug 17902: Fix possible SQL injection in serials editing
/cgi-bin/koha/serials/serials-edit.pl?serstatus=*/+,2,3,'2016-12-12','2016-12-12',6,'jjj7','jjj8'%20--%20-&subscriptionid=1+and+1%3d2+Union+all+select+111+/*

The SQL query is not constructed correctly, placeholders must be used.
Subscription id and status list can be provided by the user.

This vulnerability has been reported by MDSec.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 13:02:56 +00:00
4dc7c32a3d Revert "Bug 17902: Fix possible SQL injection in serials editing"
This reverts commit 904716f581.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 12:12:08 +00:00
904716f581 Bug 17902: Fix possible SQL injection in serials editing
/cgi-bin/koha/serials/serials-edit.pl?serstatus=*/+,2,3,'2016-12-12','2016-12-12',6,'jjj7','jjj8'%20--%20-&subscriptionid=1+and+1%3d2+Union+all+select+111+/*

The SQL query is not constructed correctly, placeholders must be used.
Subscription id and status list can be provided by the user.

This vulnerability has been reported by MDSec.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 12:08:31 +00:00
e2d1bafa22 Revert "Bug 17902: Fix possible SQL injection in serials editing"
This reverts commit 8924439054.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 11:52:56 +00:00
8924439054 Bug 17902: Fix possible SQL injection in serials editing
/cgi-bin/koha/serials/serials-edit.pl?serstatus=*/+,2,3,'2016-12-12','2016-12-12',6,'jjj7','jjj8'%20--%20-&subscriptionid=1+and+1%3d2+Union+all+select+111+/*

The SQL query is not constructed correctly, placeholders must be used.
Subscription id and status list can be provided by the user.

This vulnerability has been reported by MDSec.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-30 11:52:38 +00:00
Andreas Roussos
f57df28f96 Bug 9896 - Show vendor in subscription search when creating an order for a subscription
In the staff client, when creating an order from a subscription
the vendor name should be shown in a separate column.

This patch adds that feature. The 'Vendor' column is added before
the 'Library' column since they appear in that order in Advanced
search.

Test plan:
0) [PREREQUISITES] In the Staff client, under Acquisitions, create
   a Vendor and associated Basket if you don't already have them.
   Then, under Serials, add a new Subscription using the Vendor
   you've just created.
1) Go to Acquisitions, and under 'Manage orders' search for a vendor,
   then click on 'Add to basket' and select 'From a subscription'.
2) Click 'Search' on the left hand side to search for all subscriptions.
   Notice how there is no 'Vendor' column in the results table.
3) Apply the patch.
4) Repeat step 2. Confirm that the patch works, i.e. there is now
   a 'Vendor' column which displays the vendor name.

Followed test plan, works as expected.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-25 14:09:56 +00:00
5fc1c11198 Bug 7677 [QA Followup] - Replace GetItemnumberFromSerialId with use of Koha::Serial::Item(s)
GetItemnumberFromSerialId has no unit tests. It would be better to start
using our object system here.

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:13:56 +00:00
Matthias Meusburger
c3a95f92da Bug 7677 [Follow-up]: New areas in subscriptions and new functions when receiving.
- Various fixes.

Test plan:

Once the makePreviousSerialAvailable syspref is enabled, receive a serial, and then another, then check that:

 - the first received itemtype has been set to the "previous item type" value (set in the subscription).

 - the first received has been made available.

 - the last received serial itemtype has been set to the "item type" value (set in the subscription).

 - 995$l is automatically prefilled.

Configure the serialsFieldsToAV syspref. When creating or editing a subscription, check that:

 - the domain and/or origin and/or support fields are correctly displaying the authorized values configured in the syspref.

Signed-off-by: Chris <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:13:56 +00:00
Matthias Meusburger
99c2513559 BZ7677: New areas in subscriptions and new functions when receiving.
When enabling the makePreviousSerialAvailable syspref, the previously
 received serial's itemtype is set as defined in the subscription.
 (Please note that the item-level_itypes syspref must be set to specific item.)
 It is also made available.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

http://bugs.koha-community.org/show_bug.cgi?id=7767

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:13:54 +00:00
b416ac16b5 Bug 12178: Update serial status to "claimed" when exporting to CSV
On the same way as late issues, the serial status should be updated to
'claimed' when the issues as exported as csv.

QA note: The updateClaim and UpdateClaimdateIssues subroutine did almost the
same thing, I kick the second on off to centralize the code.

Test plan:
1/ Export some late issues as CSV (serials/claims.pl).
2/ Refresh the page (the export does not do it) and confirm that the
status, the claim date and the claim count have been updated.
3/ Select some others issues, select a notice and send the notification.
Confirm that the behavior is the same.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-15 14:07:40 +00:00
557a598909 Bug 16692 - Error "No method update!" when creating new serial issue
An improper method call was left over in C4::Serials::NewIssue from the
switch from DBIx::Class to Koha::Object.

Test Plan:
1) prove t/db_dependent/Serials.t
2) Note the errors
3) Apply this patch
4) prove t/db_dependent/Serials.t
5) No errors!

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:37:00 +00:00
30946eff3c Bug 12748: findSerialByStatus has been renamed with findSerialsByStatus
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:25:19 +00:00
44062c07b7 Bug 12748: Code tidy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:25:19 +00:00
remi
1bd5a177d0 Bug 12748 - Add test for step 7 and 8 and rename findSerialByStatus
https://bugs.koha-community.org/show_bug.cgi?id=12478

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:25:19 +00:00
remi
10fd9f5ec0 Bug 12748 - Fixes duplicate serials with an "expected" status bug
Added a new sub to Serials.pm to be able to get serials with their statuses.
Now the sub ModSerialStatus checks for other serials with an "expected" status before doing anything.

Also modified Serials.t to be able to test those changes.

Test Plan
1) Apply patch
2) Run ./t/db_dependent/Serials.t
3) Validate that there are no errors
4) Go on "Serial collection information" page for a serial of your choice
5) Click on "Generate next"
6) Change the status of the original serial from "late" to "expected"
7) Change the newly generated serial from "expected" to "delete"
8) Validate that there are no new serials created by instruction 7 and that the serial was deleted
9) Run ./t/db_dependent/Serials.t

With QA Fixes

- Use the constant instead of the code (1 vs EXPECTED)
- Avoid interpolation in query
- use selectall_arrayref instead of fetchall_arrayref

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 14:25:18 +00:00
dde0e01503 Bug 16289: Refactore code and add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-10 18:09:48 +00:00
Karl Holten
d753644c2f Bug 16289: Abbreviated formatting for numbering patterns
To test:

1) Go to Serials -> Manage numbering patterns
2) Create .New Numbering Pattern.
3) Type in a name of 'Day, Month, Season' and a numbering formula of '{X} {Y} {Z}'.
4) Set up the X field as following: add 1, every 1, set back to 1, when more than 30.
5) Select the formatting for X. There should be six options available instead of the original three. Use the formatting 'Name of Day (abbreviated)'.
5) Set up the Y field to add 1 every 30 reset back to 1 when more than 12. Use the formatting option 'Name of month (abbreviated)'.
6) Set up the Z field to add 1 every 90 reset back to 1 when more than 4. Use the formatting option 'Name of season (abbreviated)'.
8) Select a frequency of 1/day.
9) Select a first issue publication date of Jan 1, 2016.
10) Set X to begin with 5 and have an inner counter of 5. Set Z to begin with 3 and have an inner counter of 10.
11) Click the 'Test Pattern' button.
12) Abbreviated versions of the day, month and season should appear in the test pattern.

Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-10 18:09:48 +00:00
017699c345 Bug 16011: $VERSION - Remove the $VERSION init
Mainly a
  perl -p -i -e 's/^.*3.07.00.049.*\n//' **/*.pm
Then some adjustements

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:28 +00:00
3830d78d46 Bug 16011: $VERSION - remove use vars $VERSION
perl -p -i -e 's/^(use vars .*)\$VERSION\s?(.*)/$1$2/' **/*.pm

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:26 +00:00
3128151713 Bug 12375 [7] - Update to use Koha::Object classes
This code was written before the introduction of Koha::Object(s)

Considering the triviality of updating the code, we should go ahead
and switch this code to use Koha::Object(s) now.
2015-12-31 12:29:05 +00:00
0e2ccf0801 Bug 12375 [4] - Replace use of DBI with Koha::Database in C4::Serials::NewIssue
Currently, all serials enumeration data is stored in conglomerated
fashion in serial.serialseq. This makes it extremely difficult to do any
reporting based on the individual sequence values due to this fact. In
addition to the formatted version of the sequence, we should be storing
the individual values as well.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Create a new subscription, and add serials to it. The new x y and
   z fields should be populated with the same data the replaces {X} {Y} and
   {Z} in the enumeration field.
4) Inspect some existing serials. The update script will have made a
   best effort to recover the existing enumeration data to store in
   separate fields.

Signed-off-by: Paul Landers <paul.landers@ttuhsc.edu>
2015-12-31 11:58:00 +00:00
736bcf457c Bug 12375 [3] - Store serials enumeration data in separate fields
Signed-off-by: Paul Landers <paul.landers@ttuhsc.edu>
2015-12-31 11:58:00 +00:00
Katrin Fischer
302e082086 Bug 14870: QA follow-up - fixing tiny typo
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 13:05:06 -03:00
Marc Véron
e8b2f04638 Bug 14870: (followup) Remove stray C4::Dates
(See comment #23)

This patch removes stray C4::Dates (date_fromat...) from
C4/Items.pm
C4/Log.pm
C4/Serials.pm
serials/acqui-search-result.pl
t/DateUtils.t
t/db_dependent/Items/GetItemsForInventory.t
tools/koha-news.pl

Some of them were inside comments etc.

To test:
- git grep 'C4::Dates' should give no result
- git grep 'format_d' should give no result
  Exception: in one cron job there exists an own sub format_date, and occurences not
             related to C4::Dates
- Search for regressions

http://bugs.koha-community.org/show_bug.cgi?id=14870
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
serials/acqui-search-results.pl looks like it should be revisited,
containing code that might not be needed. Searching a vendor
in serials still works witout a problem.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 13:05:06 -03:00
018de8802d Bug 14969: Remove C4::Dates from serials/*.pl files
Warning: This area is a mess, especially with date management.

For the same reasons as other "Remove C4::Dates from*" patches, this one
will deal with the serials module.

Note that this patch add the datepicker on 3 input fields (on
serials/subscription-detail.tt and serials/subscription-renew.tt).
There was also weird behavior when the dates were invalid. Now default
to undefined. But with the datepicker it will reduce the number of
cases even if the user is still allowed to fill invalid dates.

Test plan:
1/ Create a subscription, fill the first issue pub date and the
subscription start date.
You can fill or not the end date.
Play with the numbering pattern and confirm that there are generated as
before this patch.
2/ On the check expiration page, confirm that the dates are correctly
displayed.
3/ Renew the subscription and confirm that the behavior is correct.
4/ Go on the subscription history page and confirm you have now the
datepicker plugin set on the 2 date fields.

QA notes: The startdate, histstartdate and enddate are not used in
the serials-collection template, this patch removes them from the pl
script.

Tested on top of 15166 15168 15171, full browser reload for date pickers.
Note for 4/: It is the link in tab planning on subscription
detail page, near "Manual history" (if manual history is enabled).
Works as advertised.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 15:35:57 -03:00
42ef8c7e98 Bug 15168: Remove C4:Serials::ItemizeSerials
This subroutine has been introduced in 2006, when C4::Serials has been
added to the codebase.
If you checkout this commit
commit 18d2cd0990
Date:   Fri Jul 7 08:45:47 2006 +0000
    this file replace C4/Bull.pm

You won't find any occurrences of this subroutine neither.

Interesting module's name by the way.

Test plan:
  git grep ItemizeSerials
should not return any result

Followed test plan, no results found.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 15:34:00 -03:00
Julian Maurice
353ed5b914 Bug 8296: Add descriptive (text) published date field for serials
Add a new field serial.publisheddatetext for displaying published date
in another format that dateformat syspref permit.

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:41:28 -03:00
Jonathan Druart
b9a22b3636 Bug 8438: Users can only claim for serials related to their branch.
Only superlibrarian users and users with superserials permission
can override this limitation.

This patch adds a new subroutine C4::Serials::can_claim_subscription.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

The upgrading of the DB was as required:
for each [PT/S] patron with the permission "claim_serials" ON,
the permission "superserials" became[/was kept to] ON.

Then, after having checked the DB upgrading, to test the currently
adding limitation:
> Users can only claim for serials related to their branch
, I reset 2 PT/S patrons-users to:
permission claim_serials: YES
permission superserials: NO
and I set the syspref "IndependendeBranches" to "Prevent".

For:
> Only superlibrarian users can override this limitation.
the S patron-user could list AND claim:
A) subscriptions of his own branch,
B) subscriptions of other branch,
C) subscriptions without branch.

For:
> Only users with superserials permission can override this limitation.
the PT patron-user could list:
A) subscriptions of his own branch,
B) subscriptions of other branch,
C) subscriptions without branch,
and could claim only:
A) subscriptions of his own branch,
C) subscriptions without branch.

NB: a subscription is selected to be claimed.

Then I set the syspref "IndependendeBranches" to "Don't prevent".
The behaviour was [exactly the same as in master] without the added
limitation.

On [S/PT] patrons, if permission claim_serials was NO, no Claims
link was available on Serials' page, either under "Prevent" or under
"Don't prevent".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Added the results of Paola's testing to the commit message
as test plan.

Note to RM: Maybe we could add a note to the release notes, that
Koha now enforces superserials with independent branches better,
so people might have to adapt permissions in order to claim
for other branches.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:12:28 -03:00
4f5d26aa49 Bug 10855: (follow-up) Bug 10855: Remove additional field values when subscription is removed
The subscriptionid should not be escaped and placeholders used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Julian Maurice
10c5109221 Bug 10855: Remove additional field values when subscription is removed
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
640abc852c Bug 10855: Squash several fixes
Bug 10855: FIX: Add additional fields for closed subscriptions

Bug 10855: Fix instance vs static method

This patch fixes the error message.
The 3 modified routines *are* static methods.

Bug 10855: FIX conflicts with bug 7688

Bug 10855: Fix typo addition_fields -> additional_fields

Bug 10855: A partial search should return the subscriptions

If a search on an additional fields is done using a partial string
("foo" and the defined value is "foobar"), the subscription should
appear in the result list.

Test plan:
Try to search a part of the string for an additional field.

Bug 10855: Filtering on additional fields don't work if value is equal to 0

If you tried to filter on an additional field linked to an authorised
value, that did not work if the value was 0.

Bug 10855: Remove the advanced serial search box on the serial home page

Bug 10855: FIX an add field should not be created if the marc field does not exist.

This patch fixes the following:
Create an add fields linked to a nonexistent marc field (does not exist
in serials).
Edit a subscription and save.
Without this patch, an error occured:
Software error:
DBD::mysql::db do failed: Column 'value' cannot be null at
/var/root-koha/bug-10855/Koha/AdditionalField.pm line 107.

Bug 10855: Fix Type table vs tablename

Koha::AdditionalField->all method take "tablename" not "table" in
parameter".

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
37319996b0 Bug 10855: Search subscriptions by additional fields on the claim page
Test plan:
- create some serials in late.
- go on serials/claims.pl.
- choose a vendor.
- verify that additional fields are displayed in new columns.
- try filters on columns.
- verify there is no regression on this page.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
e0c43b5825 Bug 10855: Search subscriptions by additional fields
Now you will abble to search subscriptions by additional fields.
The additional field values will be displayed in the table results.

Test plan:
- go on the subscriptions advanced search page
  (serials/serials-search.pl).
- verify all searchable additional fields are displayed on the form.
- combine 1 or more values and verify results are consistent.
- verify the values are displayed in new columns of the table.
- for field linked to an authorised value category, the description is
  displayed (not the code).

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
Jonathan Druart
e153d095d4 Bug 10855: New fields on adding/updating a subscription
This patch adds the ability to add values for additional fields when
adding/updating a subscription.

Test plan (test the following on adding a new subscription and on
editing an existent one):
- add/edit a subscription.
- verify all additional fields appears into the "Additional fields"
  block.
- fill a value for af1 and af3.
- fill others values if you are adding a new subscription.
- save.
- verify values appears on the detail of the subscription page.
- verify the af2 field is automatically filled with the specified
  marc field of the notice.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
Katrin Fischer
c1d9a2c770 Bug 13972: Include fields from subscription and serial table in serial notification email
Currently it's not possible to include information about which
issue has arrived in the serial notification notice the patron
can subscribe to from the OPAC.

The patch makes the fields from the subscription and serial
table available to the notice template.

In order to be able to print information about the correct
issue, the GetAlert has been modified to expext the serialid
as externalid when the module is issue.

git grep SendAlerts (only call with 'issue' is in Serial.pm)

To test:
- Add a subscription, select a patron notification template
- Search for the record in the OPAC
- Go to the subscription tab - More details
- Subscribe to the notification
- Edit the notice template you selected for the subscription
  - add fields from subscription
  - add fields from serial (serial.serialseq has the issue
    information)
- Receive an issue for the subscription
- Check that you have received the notification and that
  all information has been printed correctly
  NOTE: notice is sent directly, not through the message_queue

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:41:41 -03:00
Stefan Weil
64925f7522 Bug 14383: C4: Fix some typos (mostly in comments and documentation)
Most of them were found and fixed using codespell.
Fix also some related grammar issues.

In C4/Serials.pm a variable was renamed to make future codespelling
checks easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:45 -03:00