Commit graph

252 commits

Author SHA1 Message Date
Bernardo Gonzalez Kriegel
65b7ad030c Bug 13423: Remove unused serials-recieve
This patch removes two files, serials-recieve.pl and serial-recieve.tt
serials-recieve.pl is not called anyware
(it's recieve!)

Also removes the sub removeMissingIssue called only from serials-recieve.pl

git grep serials-recieve.pl .
C4/Serials.pm:called when a missing issue is found from the serials-recieve.pl file
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f2" action="serials-recieve.pl">
serials/serials-recieve.pl:serials-recieve.pl

Just a POD entry and self reference.

After removing of files

git grep removeMissingIssue .
C4/Serials.pm:      &check_routing &updateClaim &removeMissingIssue
C4/Serials.pm:=head2 removeMissingIssue
C4/Serials.pm:removeMissingIssue($subscriptionid)
C4/Serials.pm:sub removeMissingIssue {
t/db_dependent/Serials.t:is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');

Not used anymore

To test:
1) Apply the patch
2) Check serials workflow, no changes must be noted

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-14 11:48:17 -03:00
Olli-Antti Kivilahti
0057fa933a Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts.
When getting the next frequency number, use the real number of days for each month and each year.

Unit tests updated.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-05 15:22:10 -03:00
Julian Maurice
8b94c89f0b Bug 12671: Guess next serial date when there are several issues per unit
This guess uses the following algorithm
1/ Get the number of days remaining from first issue of this unit of
time until the end of the unit of time (using 7 days for week, 28 for
month and 365 for year)
2/ Divide it by the number of issues per unit
3/ Take the integer part of the result, this is the number of days to
add to previous serial published date

This patch also try to guess the date of the first issue of a unit of
time. Before that, it was:
- for week: monday of week
- for month: 1st day of month
- for year: 1st day of year
Now it uses firstacquidate.

Example:
  firstacquidate = 1970-01-07 (wednesday)
  unit = week
  issuesperunit = 2 (2 issues per week)

  From wednesday to sunday, there are 4 days so we add 2 days to get the
  next date.
  The next dates should be:
  - 1970-01-09 (+ 2 days)
  - 1970-01-14 (wednesday of next week)
  - 1970-01-16 (+ 2 days)
  - ... and so on

Test plan:
1/ Go to numbering pattern creation page (Serials -> Manager numbering
patterns -> New numbering pattern)
2/ In "Test prediction pattern" fieldset, set subscription length to 50
issues (this avoid to compute the next 1000 dates, which can take time)
3/ Fill first issue publication date
4/ Choose the frequency you want to test
5/ click on "Test pattern" button
6/ Check that the dates are correct
7/ Repeat steps 3-7 until you think you have tested enough cases

Interesting frequencies to test:
- 1/day
- 1/week
- 2/week
- 6/week (firstacquidate should be monday or tuesday, or the generated
  dates will be the same for all the week)
- 1/month
- 2/month
- 3/month
- 1/year
- 2/year
- 3/year

----------------
Sign off report:
----------------
-Followed the test plan. Unit tests work. Also trying some more strange
 frequencies with our librarians:
 5/year, 43/year, 10/year.
-Received all serials for a subscription and found no errors.
-Received some serials with frequency 2/month pre-patch, getting publication
 date as 1st of every month for each magazine. Having applied the patch,
 publication dates started working mid-subscription for new magazines.
-Works well and fine!
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-05 15:22:10 -03:00
Julian Maurice
bad95fc8b3 Bug 12671: Refactor GetNextDate
A much needed refactoring. Thanks for seeing the effort through.
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-05 15:22:09 -03:00
Jonathan Druart
7c5c6b3ca9 Bug 11814: Fix existing tests
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:33:12 -03:00
Jonathan Druart
89bfc422e6 Bug 11814: Fix sql parameters order
Oops, bad paramaters passed on executing the sql query produced
unexpected behaviors.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:33:12 -03:00
Jonathan Druart
4598479fd5 Bug 11814: (follow-up) Use constants to describe statuses
This patch deals with all hard-coded status codes in the C4::Serials
module.

Test plan:
Test a complete workflow in the serial module (create, order, receive,
generate next) trying to use all statuses.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:33:00 -03:00
31922af471 Bug 11814: Use constants to describe statuses
Make the code a bit more understandable by using constants to define
the status values and reference those. Adds self-documentation.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 15:32:49 -03:00
381959a935 Bug 13109: Serial failure for received and general viewing.
to test...

1/ attempt to view a subscription-detail that has a NULL value for either it's 'startdate' or 'enddate'

  an example url would be...
  http://koha-admin.foo.org/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1

  observe error...
  'Date::Calc::PP::Delta_Days(): Usage: Date::Calc::Delta_Days($year1,$month1,$day1,$year2,$month2,$day2) at /your/koha/C4/Serials.pm line 2325'

2/ apply patch
3/ repeat step 1/
   observe that detail page displays OK

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I confirm the issue if startdate is null (can exist with old data,
before the js check on the form).
Amended patch: Remove trailing space char and the link to the bz number
(can be found using git log).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-28 23:19:37 -03:00
Jonathan Druart
a6c9bd0eb5 Bug 9978: Replace license header with the correct license (GPLv3+)
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:38 -03:00
Jonathan Druart
27b534dc56 Bug 11337: Remove the C4::Serials::GetSubscriptions routine
Since SearchSubscriptions is the way to search subscriptions, each call
to GetSubscriptions could be replaced by a call to SearchSubscriptions.

Test plan:
Verify following pages display the same thing as before this patch:
- catalogue/detail.pl
- opac/opac-ISBDdetail.pl
- opac/opac-detail.pl

Verify the following page returns correct results:
- serials/checkexpiration.pl

Verify the Serials UT file still passes:
- prove t/db_dependent/Serials.t

Note: The title filter on checkexpiration now only searches on the title
DB field. I don't think it is a regression, it should be the way to use
this field. Maybe should we add new search fields on this form.
Bug 5337 reintroduces a bug fixed by bug 5864, this patch restore the
right way to search subscription (based on biblionumber).

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:36:19 -03:00
Katrin Fischer
b5fac05bc3 Bug 13746: On creating a new subscription, notes fields get confused
For every subscription we have 4 notes fields in Koha, 2 are in the
subscription itself and another 2 are in the subscription history.

When creating a new subscription, the notes fields from the
subscription get copied to the fields of the subscription history,
leading to doubled up display of notes in the OPAC.

To test:
- Add a new subscription without patch
  - check manual history
  - Fill in both notes fields
- Verify that the notes fields got also saved into the
  subscription history (easy from the Summary tab)
- Apply patch
- Add another subscription, like above
- Verify now only the subscription notes fields are saved
- Edit subscription and notes - verify all is ok
- Edit subscription history (Planning tab) - verify all is ok

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-15 08:40:05 -03:00
Jonathan Druart
8b19fd4b0d Bug 12850: C4::Serials::GetLateIssues can be removed
This routine is not used and can be removed.

Test plan:
  git grep GetLateIssues
should not return any result

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-14 21:32:03 -03:00
Jonathan Druart
7690cd5ad1 Bug 5342: Serial claiming improvements: add a counter
This patch adds a new DB field serial.claims_count
This field already exists for late orders. It makes sense to introduce
it for serial.

Test plan:
0/
 a) Does not apply the patch.
 b) Remove all your claimissues notices and be sure you have some serial issues
    in late.
 c) remove email address for the vendor you will use.
 d) remove email address for the logged in user.
 e) Export claims using the csv export => The selected issues will be
 marked as claimed.
 f) logout/login (to update the email address).
1/ Apply the patch and execute the updatedb entry.
2/ Go on the Serials > Claims page
3/ Verify that you get a warning message 'No claimissue notice defined'
4/ Verify the vendor list is correct (with the number of serial in late.
You should not get any changes here.
5/ Select one vendor and verify that the issue which was claimed before
has a claim count set to 1.
6/ Verify that you are not able to send notification to the vendor.
7/ Create a claimissue notice.
Something like:
  <<LibrarianFirstname>>
  <<LibrarianSurname>>
  The following issues are in late:
  <order><<biblio.title>>, <<biblio.author>> (<<biblio.serial>>)</order>
8/ Go on the Serials > Claims page, the warning message does not appear
anymore.
9/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for this vendor).
10/ Add an email for the vendor.
11/ Select issues. Select a notice. And "Send notification".
You should get an error (no email defined for your user).
12/ Add an email address to your user
logout/login
13/ Select issues. Select a notice. And "Send notification".
You should get a happy message: the email has been sent!
14/ The email will contain the order tags if bug 12851 is not
pushed/applied.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, some small issues fixed in a follow-up.
Note: If you change the email address of your staff user, you will
have to log out and back in to make the change take effect.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-28 10:07:37 -03:00
4eabe87a22 Bug 12338: Remove smartmatch operator from C4/Serials.pm
This patch removes the use of the 'when' smartmatch operator from
Serials.pm

Regards
To+

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-16 15:07:01 -03:00
Julian Maurice
9b2431e83a Bug 11843: prevent manual history from being overwritten if subscription switched to automatic history
Test plan:
1/ Create a new subscription, with manual history enabled
2/ Edit history by clicking on "Edit history" under Planning tab (add
   some text)
3/ Receive some serials, see that received and missing issues are not
   updated in Summary tab
4/ Edit subscription and disable manual history
5/ Receive some serials, see that received and missing issues are
   updated, but your notes have been kept.
6/ Edit serials and change status from/to missing or not available.
   Check that missing issues are updated correctly.
7/ Edit serials and change status from/to arrived. Check that received
   issues are updated correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-09 14:28:48 +00:00
Galen Charlton
05949b49bc Bug 11262: (follow-up) base generation of day name on a week starting with Sunday, not Monday
This fixes test failures reported by
t/db_dependent/Serials/GetNextSeq.t.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 16:27:01 +00:00
Jonathan Druart
8e364c4c6a Bug 11262: Don't require hardcoded translations for seasonal numbering pattern to work
This patch removes the use of POSIX::strftime which is based on the
locales of the system.

The DateTime module translates month and day name with success, without
any locale installed.

For the saesons, I use the way used in Koha: write the word in
templates. On this way the translate script will match them and allow
translators to translate them.

This patch adds a regression: the season names are not translated
following the locale selected.
This could be done when bug 8044 will be pushed.

Test plan:
0/ Update your po files and translate the season name.
1/ Create a numbering pattern using season.
example:
Name: Seasonal
Numbering formula: {X}
X: Season, Add=1, Every=1, Set back to 0 when more than 3, formatting
"name of season"
And test the prediction pattern with:
frequency: 1/3 month
First issue : 2013-09-21
length: 12 months
X begins with 2 (21th Septembre is Fall)
2/ Click on the test pattern button, you should get:
Fall       21/09/2013
Winter     21/12/2013
Spring     21/03/2014
Summer     21/06/2014

Change the locale and verify the season names are *not* translated.
Change the Koha language and verify the season names are translated.

3/ Create a numbering pattern using day or month name.
example:
Name: day
Numbering formula: {X}
X: day, Add=1, Every=1, Set back to 0 when more than 6, formatting "name
of day"
Frequency: 1/day
First issue: 2013-11-18
length: 1 month
X begins with 0
You should get:
Monday  18/11/2013
Tuesday     19/11/2013
Wednesday   20/11/2013
[...]
Sunday      15/12/2013
Monday      16/12/2013
Tuesday     17/12/2013

change the locale and verify the day names are translated.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors

Tested on top of Bug 11265 and Bug 11263,
and solved merge conflict

Updating PO file gives seasons to translate.
Tested using seasons, day and month

Only note is different behavior
1) To use seasons you need to use staff in desired language
2) To use day and month only need to select locale

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
No regressions found. Passes koha-qa.pl, t and xt

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested this again on top of 11263 and it works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 05:05:54 +00:00
0e32cd9b9f Bug 11719 - Use new DataTables include in serials templates
Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to all
serials-related pages which use DataTables.

Apply the patch and test the following pages to confirm that table
sorting works correctly:

- Serials search results (serials/serials-search.pl): Perform a search
  which will return more than one subscription. The expiration date
  column is now sorted using the "title-string" filter for sorting based
  on the unformatted date. The "anti-the" filter has been added to the
  title column to exclude articles when sorting.

- Serials collection (serials/serials-collection.pl): View the serial
  colection page for an existing subscription. The table of issues
  should be sorted correctly.

- Serial claims (serials/claims.pl): The "since" and
  "claim date" columns have been modified to use the title-string filter
  for sorting based on the unformatted date.
  C4::Serials.pm::GetLateOrMissingIssues has been modified to pass an
  unformatted date along with the formatted date. The "anti-the" filter
  has been added to the title column to exclude articles when sorting.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested all 3 tables, no regressions found.
Passes QA script and tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-28 18:26:31 +00:00
Galen Charlton
9064395892 Bug 11689: (follow-up) fix another warning when running Serials.t
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 21:12:31 +00:00
Jonathan Druart
d2c424eda2 Bug 11689: (follow-up) fix warnings generated when running Serials.t
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 21:10:39 +00:00
Jonathan Druart
3285e34dc2 Bug 11689: Take new serial missing statuses into account in more places
Bug 10851 introduced new missing status (codes 41,42,43,44), but in
GetSerials and _update_missinglist, they are not taken into account.

This patch corrects the issue.

To reproduce:
1/ Create a serial with 10 issues.
2/ Set different statuses on each one, with at least 6 missing statuses
(not only "Missing").
3/ Go on the subscription detail page, tab "Summary", the issues with a
new missing status are not listed in the missing issues list.
4/ On the "Issues" tab, all missing are listed (normally only 5 should
be listed.
5/ Apply the patch.
6/ Edit serial (to rewrite the missing list).
6/ Verify that steps 3 and 4 have now correct behavior.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes QA script and tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 21:07:59 +00:00
Julian Maurice
47a9afcb7e Bug 12003: Do not calculate next pubdate for irregular subscriptions
Show 'Unknown' when planneddate and publisheddate cannot be calculated

Also fixes SQL query in misc/cronjobs/serialsUpdate.pl that was still
using "periodicity != 32" to exclude irregular subscriptions from
results

Test plan:

1) Create a subscription in the serials module. Make sure to choose:
   Frequency = Irregular
2) Test the prediction pattern, first publication date is set to
   "First issue publication date" field, others will show as
   'unknown'
3) Save the subscription
4) Check the created issue - it will show a published date and a
   planned date (same as "First issue publication date" field)
5) Receive the issue and check the next generated issue, planned
   date and published date should show as 'Unknown'
6) Generate a next issue, planned date and published date should
   also show as 'Unknown'

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described following test plan.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Also tested:
- multi receiving generates mulitple issues without dates - 'unknown'
- staff detail page shows the dates empty, which is fine
- OPAC detail page shows the dates empty, which is fine
- serial collection page shows 'unknown' and those issues appear
  on the 'manage' tab, as they did in the past
- Editing the issue from the serial collection page leaves the
  date fields empty.
- Receving the issue, setting the status to 'Arrived' the Expected on
  date is set to 'today' automatically. Date published has to be
  entered manually (maybe something we could improve later
- subscription detail > issues tab shows Uknown.
- t/db_dependent/Serials/GetNextDate.t pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:57:51 +00:00
Galen Charlton
dc6d8a2199 Bug 12098: (follow-up) put can_show_subscription() into use
This patch puts C4::Serials::can_show_subscription() into use.

Note that there is user-visible change: if a subscription has a
blank library, all users with serials permissions will be able
to view and/or edit it.  It remains to be determined whether
we *want* such subscriptions to exist, or if they should only
be tied to specific libraries.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:47:48 +00:00
Jonathan Druart
4d78b9588a Bug 12098: Refactor can_*_subscription in C4::Serials
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested on top of patches for 12048 and 12080.

Subscription search
- superlibrarian, IndyBranches on/off - always sees all subscriptions
- superserials, IndyBranches on/off - always sees all subscriptions
- no superserials, IndyBranches on - only sees own subscriptions
Note: Subscriptions without branches will only show, when all subscriptions
      are visible. In a future enh it might be good to enforce setting a
      branch, when IndyBranches is used.
- no superserials, IndyBranches off - always sees all subscriptions

Subscription editing
- superlibrarian, IndyBranches on/off - can edit all subscriptions
- superserials, IndyBranches on/off - can edit all subscriptions
- no superserials, IndyBranches on - can only edit own subscriptons and
  subscriptions without branch
  NOTE: it would make sense to also allow Edit > Edit as new (duplicate)
  here, so one can copy the subscription from another branch to modify
  it for the own branch.

Passes tests in t, xt and QA script, also newly provided unit tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:46:00 +00:00
Jonathan Druart
4f7803e469 Bug 12098: Fix C4::Serials::can_edit_subscription
This patch fixes a problem whereby staff users could
edit subscriptions they are not permitted to by going directly
to the subscription details page.

It also adds some unit tests for the can_edit_subscription routine
and add a new can_show_subscription routines.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:45:59 +00:00
b772969cdd Bug 12080: (follow-up) fix test failure and warnings in Bookseller.t
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the tests as promised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:45:59 +00:00
f0e574be4a Bug 12080: restore effect of superserials permission
The superserials permission is meant to allow an operator
to see all subscriptions regardless of branch when IndependentBranches
is on without having to have full superlibrarian permissions.  This
patch restores this behavior.

TEST PLAN
---------
1) Apply the patch for bug 12048 (as needed -- it may be pushed)
2) Ensure you have two users: superlibrarian, non-superlibrarian
   with all access to the staff client except superserials.
3) Ensure you have serials belonging to a different branch than
   the non-superlibrarian.
3) Log into staff client as superlibrarian
4) Click 'Serials'
5) Click the 'Submit' button in the search area.
   -- note the number of results.
6) Log into staff client as non-superlibrarian
7) Click 'Serials'
8) Click the 'Submit' button in the search area.
   -- note the number should be less, note the number.
9) Give the non-superlibrarian superserials access.
10) Home -> Serials
11) Click the 'Submit' button in the search area.
   -- the number will still be the same at the one in step #8.
12) Apply the patch
13) Refresh the page
   -- the number should now match the one in step #5.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:45:59 +00:00
214d6b8d13 Bug 12048: restore ability of superlibrarian to see other libraries' subscriptions
This patch fixes a regression in master and 3.14. When a user has
superlibrian permissions, a search on serials subscriptions should
display other libraries' subscriptions even when IndependentBranches
syspref is enabled.

To reproduce/test the bug/patch:

1. Enable IndependentBranches (i.e. 'Prevent' staff...)
2. Login as a user not having superlibrarian permission
3. Search for a serial subscription on:
   /cgi-bin/koha/serials/serials-search.pl
4. Search a title which has at least 2 subscriptions: one in the user
   branch, and one in another branch
5. On the result page, just 1 subscription is displayed: the one
   attached to the userbranch
   => this is normal
6. Login as a user having superlibrarian permission
7. Repeat step 3-5.
8. You get the same result as 5. You should have seen all subscriptions.
   That's what you get after applying this patch.

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

NOTE: I tested a variation. My superlibrarian was a branch that
      was not the same as the non-superlibrarian. The serial was
      the same branch as the non-superlibrarian. Without the
      patch, the superlibrarian saw nothing, with the patch it
      saw the serial as expected.
      Also, remember the superserials permission can affect the
      results. I successfully changed the branch of the
      subscription, and then it ceased to show up with
      superserials not granted to the non-superlibrarian.
      I corrected the system preference name in the text here.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Superlibrarian permission now allows to see all subscriptions
independent from the branch.
Passes all tests and QA script.

But the superserials permission appears broken to me before
and after this patch. If I have superserials - the search
doesn't show all subscriptions. If I don't have superserials
I can still edit any subscription accessing the subscription
detail page through the serial collection page or accessing
the detail page directly by manipulating the URL.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-18 20:45:59 +00:00
Julian Maurice
65b62137fc Bug 11861: Add ISSN column in serials claims table
Signed-off-by: Koha Team Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added Sign off line.
Passes all tests and QA script, including t/db_dependent/Serials.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-03-12 17:42:41 +00:00
Jonathan Druart
dec3f8ec70 Bug 10851: (follow-up) fix issues reported by QA script
This patch fixes following warnings:

 FAIL   C4/Serials.pm
   FAIL   valid
        Useless use of a constant (43) in void context
        Useless use of a constant (41) in void context
        Useless use of a constant (44) in void context
        Useless use of a constant (42) in void context
        Useless use of a constant (4) in void context

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-02-04 17:48:37 +00:00
Jonathan Druart
776825651a Bug 10851: add additional "missing" statuses for serials issues
4 new statuses to represent variations on "missing" is added by this
patch: "never received", "sold out", "damaged", and "lost.

These status have the same behavior than the simple Missing status.

Test plan:
- Find a serial to claim.
- Modify the status of this serial with one of these new statuses.
- Try to find it with the "serials to claim" search.
- Verify that the status is displayed on the serial module pages and on
  the OPAC.

Signed-off-by: Nicolas Bravais <nicolas.bravais@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-02-04 17:43:49 +00:00
fb4025b67b Bug 10277 - Add C4::Context->IsSuperLibrarian()
The method of checking the logged in user for superlibrarian privileges
is obtuse ( $userenv && $userenv->{flags} % 2 != 1 ) to say the least.
The codebase is littered with these lines, with no explanation given. It
would be much better if we had one subroutine that returned a boolean
value to tell us if the logged in user is a superlibrarian or not.

Test Plan:
1) Apply this patch
2) Verify superlibrarian behavior remains unchanged

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-30 15:47:23 +00:00
Galen Charlton
945dbfc490 Bug 10852: (follow-up) update the POD for C4::Serials::SearchSubscriptions
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-14 00:35:22 +00:00
Galen Charlton
8a5ce95916 Bug 10852: (follow-up) fix POD for C4::Serials::NewSubscription
The error in the POD was discovered in the course of writing
test cases for the main patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-14 00:35:22 +00:00
Jonathan Druart
4651bbff21 Bug 10852: serials search improvements
This patch adds 3 filters for the serials search:
- location
- callnumber
- expiration date

To test:
- Search serials by location and/or callnumber and/or expiration date
  and check that results are consistent.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-12-14 00:34:30 +00:00
Jonathan Druart
6e3e1eed48 Bug 11168: fix regression that broke exporting serial claims to CSV
Bug 7688 broke the exporting serial claims as CSV (see bug 10854).

For C4::Serials::GetLateOrMissingIssues(), $supplierid is not
meant to be mandatory.  This patch fixes that.

Test plan:
try to export a serial claim.
Without this patch, the csv is always empty.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 16:10:48 +00:00
Galen Charlton
4f4946f8df Bug 8435: (follow-up) make SearchSubscriptions handle lack of userenv
This patch allows t/db_dependent/Bookseller.t to pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:37:00 +00:00
Jonathan Druart
5248f12a0e Bug 8435: (follow-up) handle lack of userenv gracefully
C4::Serials::can_edit_subscription now deals with C4::Context->userenv.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:29:42 +00:00
Jonathan Druart
dc3dd3ede6 Bug 8435: (follow-up) add unit tests for can_edit_subscription
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:29:19 +00:00
Jonathan Druart
d2052311cb Bug 8435: add permission to enable editing other library's serials if IndependantBranches is on
In the serial module, we want to hide serials from others libraries.
However, to permit central serials manage, this patch introduces a
new permission, 'superserials'. If a staff member has this permission,
that person can override the restriction.

Test plan:
- Switch on the IndependantBranches syspref
- Add the permission 'superserials' for a patron and test you can
  navigate and see all serials
- Remove this permission and test you cannot manage/view subscriptions
  from others libraries

Signed-off-by: Frederic Durand <frederic.durand@unilim.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 15:27:19 +00:00
Galen Charlton
f0aef5e044 Bug 7688: (follow-up) update test cases to reflect change in NewSubscription()
This patch also corrects an error in the description of
NewSubscription().

Named parameters for this function cannot come soon enough.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 02:27:20 +00:00
Julian Maurice
d93ec41012 Bug 7688: (follow-up) rewrite t/db_dependant/Serials.t
A lot of tests were just a call to a funtion without any arguments,
whereas the function expect at least one argument.
These tests were kept, but all return values are now undef when a
mandatory argument is missing, so return values are consistent.

The part where subscription periodicity is changed could not work
because of ',' appended to each key in ModSubscription call. So it's
rewritten, taking into account the new API for subscription frequencies.
This script should leave your database intact because it revert any
modification made.

Also fix some warnings in C4::Serials and in C4::Items.
And fix a typo in koha-tmpl/.../subscription-numberpatterns.tt

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

Comment: Work as described. No errors
Tested, again, without trouble.
With a suscription, tests successful.
No koha-qa errors

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 00:35:38 +00:00
Julian Maurice
48b0472a63 Bug 7688: Change subscription numbering pattern and frequencies
Serials numbering pattern and frequencies are no longer hard-coded. Now
it's possible to create, edit and delete numbering patterns (and
frequencies). This patch adds two new sql tables
(subscription_numberpatterns and subscription_frequencies)

Numbering patterns behave almost as before, there are still the same
values to configure (addX, everyX, settoX, whenmorethanX). lastvalueX
and innerloopX remain in subscription tables.

There is a new value in numbering patterns: numberingX. For each
"column" (X, Y or Z) you can tell how to format the number. Actually
numberingX can be set to:
 - 'dayname' (name of the day) (0-6 or 1-7 depending on which day is the
   first of the week)
 - 'monthname' (name of the month) (0-11)
 - 'season' (name of the season) (0-3) (0 is Spring)

These names are localized by using POSIX::setlocale and POSIX::strftime
and setting a 'locale' value to the subscription. Locale have to be
installed on the system.

Note that season names are not localized using POSIX::strftime (it can't
do this), so names are hardcoded into the code (available languages: en,
fr). This could be fixed in the future by using a Perl localization
framework.

Frequencies can be configured using 3 parameters:
 - 'unit': one of 'day', 'week', 'month', 'year'
 - 'issuesperunit': integer >= 1, the number of received issues per
   'unit'
 - 'unitsperissue': integer >= 1, the number of 'unit' between two
   issues
One of 'issuesperunit' and 'unitsperissue' must be equal to 1.
Examples:
  unit = 'day', issuesperunit=3, unitsperissue=1 => 3 issues per day
  unit = 'week', issuesperunit=1, unitsperissue=3 => 1 issue each 3
  weeks

Prediction pattern is now computed server-side and is more consistent
with what Koha will do. The publication date is displayed alongside the
serial number.

Irregularities can now be checked one by one, in the prediction pattern
table, or if frequency is 'day-based' (unit is 'day'), there is the
possibility to check all issues for a week day at once.

When an irregularity is found, there is the possibility to keep the
serial number unchanged, or to skip it. It is configured at subscription
creation or modification.

For instance, with a daily subscription you can have:
  skip serial number  |  keep serial number
----------------------+----------------------
 2012-01-01  ¦  No 1  | 2012-01-01  ¦  No 1
 2012-01-03  ¦  No 3  | 2012-01-03  ¦  No 2

To lighten the subscription modification page, manual history has been
moved in its own page subscription-history.pl which is accessible on
subscription-detail.pl, tab 'Planning'.

Important note: updatedatabase.pl script takes into account existing
subscriptions and create appropriate numbering patterns for them (it
tries to create as few patterns as possible). Frequency is
mapped to the correct entry in subscription_frequencies table.

This patch includes kohastructure.sql and updatedatabase.pl changes
+ sample frequencies data and sample numberpatterns data for fresh
installs (sample data is included in updatedatabase.pl)

=== TEST PLAN: ===

Create a new subscription:

  - Go to Serials module and click "New subscription" button
  - On the first page, choose a biblio and click next to go to the
    second page
  - Pick a first issue publication date
  - Choose frequency '1/day'
  - Choose a subscription length of 15 issues
  - Choose a subscription start date
  - Choose numbering pattern 'Volume, Number'
  - A table appears, fill 'Begins with' cells with '1'
  - Click on 'Test prediction pattern' button

The prediction pattern is displayed at the right of the page. You can
see in it the serial number, the publication date and a checkbox to
allow you to choose which serials will not be received (irregularities).

You can see that serial number start from "Vol 1, No 1" continue to "Vol
1, No 12" and then restart with "Vol 2, No 1".

Frequency is '1/day' so you can see that publication date is incremented
by one day line after line.

  - Now you can play a little with frequencies and numbering patterns,
    change one of them (or both) and click again on 'Test prediction
    pattern'
  - For example, choose frequency '3/weeks' and click on 'Test
    prediction pattern' button'.

There is a little behaviour change compared with current master.
Publication date will not be guessed within the week. Koha can't know
when you will receive issues. So the publication date stay the same
(monday of each week) for 3 consecutive issues and then jump to the next
week.

  - Now choose frequency '1/3 months' and numbering pattern 'Seasonal'
  - Fill 'Begins with' cells with '2012' for Year and '0' for Season
  - Click on 'Test prediction pattern'
  - You should have something like 'Spring 2012', 'Summer 2012', ...,
    'Winter 2012', 'Spring 2013'
  - Note that you can have seasons for south hemisphere by entering '2'
    in 'Year/Inner counter'
  - 2nd note: if you have some locales installed on your system, you can
    type its name in the 'Locale' field (actually it does not work for
    seasons name, only for month names and day names)

If you want to modify the numbering pattern you can still do it here:

 - Click on 'Show/Hide advanced pattern' link. The advanced pattern
   table is shown but all fields are readonly
 - Click on 'Modify pattern' button. All readonly fields are now
   editable. Note that 'Begins with' and 'Inner counter' line are
   repeated here and any modifications in the small table will be
   replicated in the big table, and vice versa.
 - Pattern name is emptied, if you type a new name, a new pattern will
   be created, and if you type the same name as an existing numbering
   pattern, this one will be modified (with a confirmation message)
 - There is two new lines in this table:
   - Label: it's what is displayed in the smaller table headers above
   - Numbering: used to format numbers in different ways. can be
     'seasons', 'monthname' or 'dayname'. Month name and day name can be
     localized using the 'Locale' field. Seasons can't (values for
     English and french are hard-coded in Serials.pm)
 - You can modify what you want in the table and click on 'Test
   prediction pattern' button each time you want to see your
   modifications. (Note that checkboxes for irregularities aren't displayed
   in this mode, and you can't save the subscription until you have saved
   or cancelled your changes).
 - To cancel your modifications, just click on 'Cancel modifications'
   button.
 - To save them, click on 'Save as new pattern'. If the pattern name is
   already existing, a confirmation box will ask you if you want to
   modify the existing numbering pattern. Otherwise a new pattern will be
   created and automatically selected.

Once you have finished modifying numbering pattern, you can click again
on 'Test prediction pattern' to define irregularities, and then click on
'Save subscription'.

Now you can check the serials module still works correctly:

 - Check the subscription detail page to confirm that nothing is
   missing. Especially the 'Frequency' and 'Number pattern' information.
 - Try to receive some issues. Check that the serial number is correctly
   generated and if irregularities you have defined are taken into
   account (if you have defined some).
 - Check that receiving is blocked once you have reached the number of
   issues you have defined in subscription length (or once you have
   reached the subscription end date)

In serials menu (to the left of almost each page of serials menu) you
have two new links: 'Manage frequencies' and 'Manage numbering
patterns'.

'Manage numbering patterns' lead to a page which list all numbering
patterns and allow you to create, edit or delete them. The interface is
almost the same as numbering pattern modification in subscription-add.pl

'Manage frequencies' lead to a page which list all frequencies and allow
you to create, edit or delete them.

Try to create a new frequency:
 - Click on 'Manage frequencies' link in the serials menu and then click
   on 'New frequency':
 - Fill in the description (mandatory).
 - Unit is one of 'day', 'week', 'month', year' or 'None' ('None' is for
   an irregular subscription)
 - If unit is different from 'None' you have to fill the two following
   fields (Issues per unit, and Units per issue)
 - Note that at least one of those must be equal to 1
 - Issues per unit is the number of received issues by 'unit' and Units
   per issue is the number of 'unit' between two issues
 - Display order is used to build the drop-down list. Leave empty and it
   will be set to 0 (top of the list)
 - Then click on 'Save'
 - Check that this new frequency appears in the frequencies table and in
   the drop-down list in subscription-add.pl

Subscription history has been moved in its own page. To test if it still
works, choose a subscription with manual history enabled (or modify an
existing subscription to turn on manual history).

 - On the detail page, tab 'Planning', you should have a link 'Edit history'.
 - Click on it
 - Modify history and click on Save
 - In tab 'Summary' you should have the infos you just entered

And finally, you can check that old subscriptions (by old I mean
subscriptions that existed before the update) are correctly linked to an
existing numbering pattern and an existing frequency. Numbering patterns
should be named 'Backup pattern X' where X is a number.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Great development! Work as described. No koha-qa errors
(with all patches applied). Please QA this fast.

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

Squashed commits:
-----------------

Bug 7688 follow-up: Small fixes for QA

- # Subroutines::ProhibitExplicitReturnUndef: Got 1 violation(s) in
  C4::Serials::GetSubscriptionIrregularities
- Bad template constructions fixed in serials/subscription-add.tt

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

----

Bug 7688 follow-up: Small fixes for QA #2

- "return undef" -> "return"
- ":utf8" -> ":encoding(UTF-8)"
- TAB -> SPACES

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

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

----

Bug 7688: Translate sample frequencies for french

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

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

----

Bug 7688: Fix generating next serial when there is no 'Expected' issue

It can happen when the Expected issue is claimed. In this case the
status of the last serial is 'Claimed'

This patch change the API of GetNextSeq and GetSeq

Test plan:
- Create a subscription which starts a long time ago so that serials
  automatically appear in late issues
- Receive the first serial
- Go to claims page and claim the 2nd serial.
- Go back to the subscription page and click on 'Serial collection'
- You should have 2 serials, one 'Arrived' and one 'Claimed'.
- Click on Generate Next. This should fail with a software error message
  ("can't call method output ...")
- Apply this patch and click again on Generate Next. A new issue must be
  created with status 'Expected'.

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

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

----

Bug 7688: Followup FIX perldoc

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 00:29:38 +00:00
Fridolyn SOMERS
4458e86865 Bug 10689: make public note appear in subscriptions search
In a serials module, when searching subscriptions, the results table as
a "Notes" column.
In TT code, you see that it tries to display public note
"subscription.notes" and internal note "subscription.internalnotes".

The internal note is displayed well but not the public note.

You can see the 2 notes in serial details in summary tab.

The problem commes from the SQL query. A join is perform on subscription
and biblio, both containing a "notes" column.

This patch solves the problem by using a alias in query for both columns
(biblio.notes is acutally not used in template but could be).

Test plan :
- Edit a subscription
- Add public and internal notes. For example : "too busy" and "on holiday"
- Perform a subscription search that returns this subscription
=> "Notes" column contains both notes. For example : "too busy (on holiday)"
- Test with only public note
- Test with only internal note

Works as described.
Signed-off-by:Mathieu Saby <mathieu.saby@uhb.fr>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Works as described, fixes a bug as the templates show that
the intention was to display both notes in the column.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-11 04:21:47 +00:00
ba470954fd Bug 9916 - Use DataTables in the OPAC
The OPAC still uses the old tablesorter plugin which isn't being
actively maintained. We use DataTables in the staff client and should in
the OPAC too. The plugin was added a while ago but never implemented on
any pages. This patch upgrades the plugin to the latest version and
places it in opac-tmpl/lib for cross-theme access. The patch implements
DataTables on all pages which previously used the tablesorter plugin.

The old tablesorter plugin is removed.

The customized DataTable configuration script, datatables.js, has been
trimmed-down from the staff client version in order to limit it to only
that functionality required in the OPAC.

Sorting based on date is done based on the data's enclosing <span> title
attribute as it is in the staff client:

<span title=" [% iso date %]">[% date | $KohaDates %]</span>

Slight modifications to Serials.pm and opac-search-history.pl have been
made to accommodate this change.

To test, view each page in the OPAC which uses JS-based table sorting:

- The bibliographic detail page
- The cart
- The search history page
- The suggestions page
- The tags page (logged in as a user who has entered tags)
- The "most popular" page (opac-topissues.pl)
- The logged in user summary page (opac-user.pl)
- The subscription "full history" page (opac-serial-issues.pl?selectview=full)
- The self-checkout main page (with existing checkouts)

Table sorting should work correctly on all pages in both the prog and
ccsr themes. Sorting should work for dates whatever your dateformat
system preference setting. Tables listing titles should exclude articles
("a," "an," and "the" in English) when sorting.

Also test the serial collection page in the staff client, which is
affected by the change to Serials.pm. Confirm that dates are displayed
and sorted correctly.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised!

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works really nicely on all pages.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-19 14:19:02 +00:00
Chris Hall
97bbf04757 bug 10356: improve display of serial issue dates in staff bib details page
This patch adds the date published to the subscriptions tab in the staff
interface bib display and renames the former "Date" column to
"Date arrived".

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-10 14:50:41 +00:00
b00ec06968 Bug 10080 - Change system pref IndependantBranches to IndependentBranches
Test Plan:
1) Enable IndependantBranches
2) Apply this patch
3) Run updatedatabase.pl
4) Verify that the system preference still functions correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-22 07:58:23 -07:00
e5b467e81f Bug 8896 QA Followup for regex
Making sure that the regex does not kill more than it should.
Amended: does now only look at separating colons(;) not commas(,).
Amended: two index expressions in direct context replaced by same regex for
consistency.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-06 08:49:36 -04:00
Lyon3 Team
ccc7f535cb Bug 8896: Delete serials no more missing from missinglist
When manual history is disabled in subscription history section
if a serial has been previously set as missing and is received
or set as expected, late or claimed, it will be deleted from missinglist

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Regex needs a followup. More comments on Bugzilla.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-06 08:49:35 -04:00
Jared Camins-Esakov
b9db6ae0f7 Revert "Merge branch 'bug_7688' into 3.12-master"
This reverts commit 60508cb03d, reversing
changes made to 8579d07f14.

The patches for bug 7688 caused a failure in t/db_dependent/Serials.t:
not ok 8 - test getting history from sub-scription

Conflicts:

	installer/data/mysql/kohastructure.sql
	installer/data/mysql/updatedatabase.pl
	kohaversion.pl
2013-03-23 00:36:37 -04:00
Jonathan Druart
8e978c7ce0 Bug 5343: It is not possible to add a subscription for another supplier
If a supplier is defined for a subscription, you cannot order this
subscription to another supplier. If no supplier is defined, you can.

FIX: If a cancelled order is linked to a subscription, you can order it.

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 23:54:46 -04:00
Jonathan Druart
ed63c13957 Bug 5343: Link serial and acqui modules
DB changements:
- Adds 2 fields: subscription.reneweddate and aqorders.subscriptionid.
- Removes 2 unused fields: aqorders.serialid and aqorders.subscription.

Main test plan:
1) Create a subscription
2) Create a bookseller and a basket
3) Add a new order 'from a subscription'
4) Search your subscription and check if results are correct
5) Click on the "order" link
6) Check the biblio information are filled in the form
7) Select a budget and fill some price information.
8) retry steps 3 and 4. Verify you cannot order the same subscription.
Message:Outstanding order (only one order per subscription is allowed).
9) click on your subscription (already added) and check you have a new
table "Acquisition details" with your price information in the "Ordered
amount" line.
10) receive this order
11) On your subscription detail page, the "Spent amount" line must be
filled with your price information.
12) Re order the same subscription. Now you are allowed to. Prices
information have to be filled with the previous information.
13) Retry some orders and click on a maximum of links in order to find a
bug :)

Signed-off-by: Leila Arkab <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on last patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 23:54:43 -04:00
Jonathan Druart
a4d25333b4 Bug 7688: Followup FIX perldoc
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 22:14:36 -04:00
Julian Maurice
da5aca223f Bug 7688: Fix generating next serial when there is no 'Expected' issue
It can happen when the Expected issue is claimed. In this case the
status of the last serial is 'Claimed'

This patch change the API of GetNextSeq and GetSeq

Test plan:
- Create a subscription which starts a long time ago so that serials
  automatically appear in late issues
- Receive the first serial
- Go to claims page and claim the 2nd serial.
- Go back to the subscription page and click on 'Serial collection'
- You should have 2 serials, one 'Arrived' and one 'Claimed'.
- Click on Generate Next. This should fail with a software error message
  ("can't call method output ...")
- Apply this patch and click again on Generate Next. A new issue must be
  created with status 'Expected'.

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 22:14:36 -04:00
Julian Maurice
ed49537002 Bug 7688 follow-up: Small fixes for QA
- # Subroutines::ProhibitExplicitReturnUndef: Got 1 violation(s) in
  C4::Serials::GetSubscriptionIrregularities
- Bad template constructions fixed in serials/subscription-add.tt

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 22:14:35 -04:00
Julian Maurice
dc9ff3c53d Bug 7688: Change subscription numbering pattern and frequencies
Serials numbering pattern and frequencies are no more hard-coded. Now
it's possible to create, edit and delete numbering patterns (and
frequencies). This implies new sql tables (subscription_numberpatterns
and subscription_frequencies)

Numbering patterns behave almost as before, there are still the same
values to configure (addX, everyX, settoX, whenmorethanX). lastvalueX
and innerloopX remain in subscription tables.

There is a new value in numbering patterns: numberingX. For each
"column" (X, Y or Z) you can tell how to format the number. Actually
numberingX can be set to:
 - 'dayname' (name of the day) (0-6 or 1-7 depending on which day is the
   first of the week)
 - 'monthname' (name of the month) (0-11)
 - 'season' (name of the season) (0-3) (0 is Spring)

These names are localized by using POSIX::setlocale and POSIX::strftime
and setting a 'locale' value to the subscription. Locale have to be
installed on the system.
Note that season names are not localized using POSIX::strftime (it can't
do this), so names are hardcoded into the code (available languages: en,
fr). This could be fixed in the future by using a Perl localization
framework.

Frequencies can be configured using 3 parameters:
 - 'unit': one of 'day', 'week', 'month', 'year'
 - 'issuesperunit': integer >= 1, the number of received issues per
   'unit'
 - 'unitsperissue': integer >= 1, the number of 'unit' between two
   issues
One of 'issuesperunit' and 'unitsperissue' must be equal to 1.
Examples:
  unit = 'day', issuesperunit=3, unitsperissue=1 => 3 issues per day
  unit = 'week', issuesperunit=1, unitsperissue=3 => 1 issue each 3
  weeks

Prediction pattern is now computed server-side and is more consistent
with what Koha will do. The publication date is displayed alongside the
serial number.
Irregularities can now be checked one by one, in the prediction pattern
table, or if frequency is 'day-based' (unit is 'day'), there is the
possibility to check all issues for a week day at once.

When an irregularity is found, there is the possibility to keep the
serial number unchanged, or to skip it. It is configured at subscription
creation or modification.
For instance, with a daily subscription you can have:
  skip serial number  |  keep serial number
----------------------+----------------------
 2012-01-01  ¦  No 1  | 2012-01-01  ¦  No 1
 2012-01-03  ¦  No 3  | 2012-01-03  ¦  No 2

To lighten the subscription modification page, manual history has been
moved in its own page subscription-history.pl which is accessible on
subscription-detail.pl, tab 'Planning'.

Important note: updatedatabase.pl script takes into account existing
subscriptions and create appropriate numbering patterns for them (it
tries to create as few patterns as possible). Frequency is
mapped to the correct entry in subscription_frequencies table.

This patch includes kohastructure.sql and updatedatabase.pl changes
+ sample frequencies data and sample numberpatterns data for fresh
installs (sample data is included in updatedatabase.pl)

=== TEST PLAN: ===

Create a new subscription:

  - Go to Serials module and click "New subscription" button
  - On the first page, choose a biblio and click next to go to the
    second page
  - Pick a first issue publication date
  - Choose frequency '1/day'
  - Choose a subscription length of 15 issues
  - Choose a subscription start date
  - Choose numbering pattern 'Volume, Number'
  - A table appears, fill 'Begins with' cells with '1'
  - Click on 'Test prediction pattern' button

The prediction pattern is displayed at the right of the page. You can
see in it the serial number, the publication date and a checkbox to
allow you to choose which serials will not be received (irregularities).

You can see that serial number start from "Vol 1, No 1" continue to "Vol
1, No 12" and then restart with "Vol 2, No 1".

Frequency is '1/day' so you can see that publication date is incremented
by one day line after line.

  - Now you can play a little with frequencies and numbering patterns,
    change one of them (or both) and click again on 'Test prediction
    pattern'
  - For example, choose frequency '3/weeks' and click on 'Test
    prediction pattern' button'.

There is a little behaviour change compared with current master.
Publication date will not be guessed within the week. Koha can't know
when you will receive issues. So the publication date stay the same
(monday of each week) for 3 consecutive issues and then jump to the next
week.

  - Now choose frequency '1/3 months' and numbering pattern 'Seasonal'
  - Fill 'Begins with' cells with '2012' for Year and '0' for Season
  - Click on 'Test prediction pattern'
  - You should have something like 'Spring 2012', 'Summer 2012', ...,
    'Winter 2012', 'Spring 2013'
  - Note that you can have seasons for south hemisphere by entering '2'
    in 'Year/Inner counter'
  - 2nd note: if you have some locales installed on your system, you can
    type its name in the 'Locale' field (actually it does not work for
    seasons name, only for month names and day names)

If you want to modify the numbering pattern you can still do it here:

 - Click on 'Show/Hide advanced pattern' link. The advanced pattern
   table is shown but all fields are readonly
 - Click on 'Modify pattern' button. All readonly fields are now
   editable. Note that 'Begins with' and 'Inner counter' line are
   repeated here and any modifications in the small table will be
   replicated in the big table, and vice versa.
 - Pattern name is emptied, if you type a new name, a new pattern will
   be created, and if you type the same name as an existing numbering
   pattern, this one will be modified (with a confirmation message)
 - There is two new lines in this table:
   - Label: it's what is displayed in the smaller table headers above
   - Numbering: used to format numbers in different ways. can be
     'seasons', 'monthname' or 'dayname'. Month name and day name can be
     localized using the 'Locale' field. Seasons can't (values for
     english and french are hard-coded in Serials.pm)
 - You can modify what you want in the table and click on 'Test
   prediction pattern' button each time you want to see your
   modifications. (Note that checkboxes for irregularities aren't displayed
   in this mode, and you can't save the subscription until you have saved
   or cancelled your changes).
 - To cancel your modifications, just click on 'Cancel modifications'
   button.
 - To save them, click on 'Save as new pattern'. If the pattern name is
   already existing, a confirmation box will ask you if you want to
   modify the existing numbering pattern. Otherwise a new pattern will be
   created and automatically selected.

Once you have finished modifying numbering pattern. You can click again
on 'Test prediction pattern' to define irregularities, and then click on
'Save subscription'.

Now you can check the serials module still works correctly:

 - Check the subscription detail page to confirm that nothing is
   missing. Especially the 'Frequency' and 'Number pattern' infos
 - Try to receive some issues. Check that the serial number is correctly
   generated and if irregularities you have defined are taken into
   account (if you have defined some).
 - Check that receiving is blocked once you have reached the number of
   issues you have defined in subscription length (or once you have
   reached the subscription end date)

In serials menu (to the left of almost each page of serials menu) you
have two new links: 'Manage frequencies' and 'Manage numbering
patterns'.

'Manage numbering patterns' lead to a page which list all numbering
patterns and allow you to create, edit or delete them. The interface is
almost the same as numbering pattern modification in subscription-add.pl

'Manage frequencies' lead to a page which list all frequencies and allow
you to create, edit or delete them.

Try to create a new frequency:
 - Click on 'Manage frequencies' link in the serials menu and then click
   on 'New frequency':
 - Fill in the description (mandatory).
 - Unit is one of 'day', 'week', 'month', year' or 'None' ('None' is for
   an irregular subscription)
 - If unit is different from 'None' you have to fill the two following
   fields (Issues per unit, and Units per issue)
 - Note that at least one of those must be equal to 1
 - Issues per unit is the number of received issues by 'unit' and Units
   per issue is the number of 'unit' between two issues
 - Display order is used to build the drop-down list. Leave empty and it
   will be set to 0 (top of the list)
 - Then click on 'Save'
 - Check that this new frequency appears in the frequencies table and in
   the drop-down list in subscription-add.pl

Subscription history has been moved in its own page. To test if it still
works, choose a subscription with manual history enabled (or modify an
existing subscription to turn on manual history).

 - On the detail page, tab 'Planning', you should have a link 'Edit history'.
 - Click on it
 - Modify history and click on Save
 - In tab 'Summary' you should have the infos you just entered

And finally, you can check that old subscriptions (by old I mean
subscriptions that existed before the update) are correctly linked to an
existing numbering pattern and an existing frequency. Numbering patterns
should be named 'Backup pattern X' where X is a number.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Great development! Work as described. No koha-qa errors
(with all patches applied). Please QA this fast.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-22 22:14:28 -04:00
Fridolyn SOMERS
13bebe6b34 Bug 8443: Suggestions publication year and copyright date (follow-up 1) Comments corrections
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-01-15 22:10:59 -05:00
Jonathan Druart
c39380ed4e Bug 8782: Close a subscription
If a subscription is no longer enough published (or we are not waiting
for a new periodical) we are allowed to close it.
If a subscription is closed, we are not able to receive or generate a
new serial.

On the serial module, we can now
- close a subscriptionn
- reopen a closed subscription

On serial search 2 tabs is displayed (opened and closed subscriptions).

This patch adds:
- a new field subscription.closed in DB
- a new status for serials (8 = stopped)

Test plan:
- search subscriptions
- close a subscription and check that you cannot receive or generate a
  new serial
- launch another search and check that the closed serial is into the "closed"
  tab.
- You are allowed to reopen a subscription on the subscription detail
  page and on the subscription result page. A javascript alert ask you
  if are certain to do this operation.
- Check the serial status "stopped" everywhere the status is
  displayed (catalogue/detail.pl, serials/claims.pl,
  serials/serial-issues-full.pl, serials/serials-collection.pl,
  serials/serials-edit.pl, serials/serials-recieve.pl,
  serials/subscription-detail.pl and opac-full-serial-issues.pl)
- The report statistics does not include the closed subscriptions if you
  don't check the "Include expired subscriptions" checkbox.

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

Bug 8782: Followup: add some minor modifications

- Show 'closed' information in biblio detail page
- Add a column in serials report table
- Search subscriptions on title words instead of string
- Prevent serials editing when subscription is closed
- Don't change status of "disabled" serials

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

Bug 8782 - Close a subscription - Followup - Fix updatedatabase.pl

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-30 08:14:24 -05:00
33ae9c9185 Bug 6679 - [SIGNED-OFF] fix 5 perlcritic violations in C4/Serials.pm
- Subroutine prototypes used at line 161, column 1.  See page 194 of PBP.  (Severity: 5)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 12:01:37 +02:00
Jonathan Druart
214fd0fbd1 Bug 5357: Adds a new page for searching subscriptions
Test plan:
- go on the serial module
- click on the 'Advanced search' link (right of subscriptions search in
the header)
- Search subscriptions (by ISSN, title, EAN, Publisher, Supplier and/or
  Branch)
- Check results are correct

Signed-off-by: Corinne HAYET <corinne.hayet@bulac.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 22:37:11 +02:00
Jonathan Druart
82dc7b55a8 Bug 4321: clean C4::Biblio::GetBiblio and uses
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-18 12:11:54 +02:00
Meenakshi.R
d88307264e Bug 6655 - Sorting order of serial issues in OPAC
Works as advertised.

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-02 12:09:33 +02:00
e31b55de31 Bug 7839 [ENH] : Add tab in patron record to show patron's routing lists
dcook: fixed SQL error and removed blank targets

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Thanks. Works as described. Valuable addition on patron information
page.

Ideas of enhancement:

- For some library, and some patron, the routing lists table could be
  very long, and a paged table would be a plus.
- In the table, a new Vendor column.
- The possibility to sort the table entries by Title and Vendor column.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-08-02 11:26:43 +02:00
Colin Campbell
bcde875b47 Bug 8227 Fix deprecated construct compile time warning in Serials
The perl parser no longer fools itself into sometimes thinking
qw( ... ) is a ( qw( ... )) this adds the required parentheses
for the foreach expression silencing the compile time warning

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-20 10:38:25 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
Matthias Meusburger
7f957077dd Bug 5337: EAN management : Adds ean for various searches
- in various acquisition pages and serials home
  - in database : biblioitems.ean
  - adds ean and its mapping in default english bibliographic framework
  - adds ean mapping in default french bibliographic framework
  - ean search is not enabled for MARC21

The required mapping between the ean marc field and the biblioitems.ean
database field will be automatically added on an existing unimarc installation.

However, if you already have records with ean, you will have to
run misc/batchRebuildBiblioTables.pl to populate biblioitems.ean

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Passed QA at second run. Removed a merge marker only.
2012-06-09 18:26:34 +02:00
Colin Campbell
6dda8a6379 Bug 8176 [SIGNED-OFF] Assign an intial value to $sqlwhere
warnings in log because of undefined value in
string concatenation
variable should be initialized to empty string rather
than left undefined

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Removes a warning in logs

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-05 17:03:51 +02:00
Jared Camins-Esakov
98c59fc357 Bug 7701: Error when sending serial alerts
Probably due to bug 6875, C4::Letters is no longer used by C4::Serials, so that
when SendAlerts is called (exactly when this happens is a mystery to me), you
will get an error. Adding a "require C4::Letters;" and prefixing SendAlerts to
C4::Letters:: should fix it.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch fixes the perl error. Steps to reproduce:

1) Create a subscription and set patron notification to "Routling list" -
this is necessary, so that a link to email notifications shows up in the OPAC.
2) Search for the serial record in the OPAC and click on the more details
view from the subscriptions tab. Subscribe to email notifications.
3) Go back into the serials module and receive and issue for the serial.
Before the patch a nasty perl error will be shown, after the patch
receiving works.

I couldn't confirm that the email was sent out with my setup, but this patch
certainly fixes serial receive.

[Update 2011-02-29] Fixed the typo and retested. Looks good, but couldn't check
if the mail was actually sent.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-29 11:13:04 +02:00
Paul Poulain
49b167e848 Bug 6875 de nesting C4::Biblio
C4::Biblio is used in many many places. The goal of this cleaning is to do from C4::Biblio a package with as many dependancies as possible.

* C4::Heading is called only in 1 place, highly rarely used (only in 1 misc/link_bibs_to_authorities.pl), moving to require
* PrepareItemrecordDisplay is a sub that is more related to Items, moving it here. It means some scripts that used this sub must be checked against use C4::Items
* C4::Items is needed in EmbedItemsInMarcBiblio, moving it only in this sub, and switching to require
* 2 subs are totally useless z3950_extended_services and set_service_options, removing them

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
No test plan included, but tested some opac and cataloging functions.
Code looks good. Marked as Passed QA.
2012-02-20 16:35:17 +01:00
Paul Poulain
c52f0b7fdf Bug 6875 de-nesting C4/Serials
* use C4::Branch is loaded only to call GetBranchNAme in PrepareSerialsData
  and set branchname in the hashresult. This sub PrepareSerialsData is used
  in the following scripts :
opac/opac-serial-issues.pl:    my $subscriptioninformation=PrepareSerialsData($subscriptions); => no use of branchname after
serials/serials-collection.pl:   $subscriptions=PrepareSerialsData(\@subscriptioninformation); => no use of branchname after
=> we can remove the ->{branchname} from the result, and remove the C4::Branch dependancy
* moves use C4::Items to require C4::Items, to call AddItemFromMarc, when
  receiving a serial, with Recieving create an item set in the subscription.
* removed use C4::Letters and C4::Search, that are useless

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-02-15 14:58:38 +01:00
Julian Maurice
2916ddae4a Bug 6838: Add pagination and filtering on subscriptions table
Use dataTables plugin

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-13 16:49:35 +01:00
Colin Campbell
d2c24f3bbf Bug 6790: Remove unnecessary variable from getroutinglist return
getroutinglist returns a count variable to indicate how many elements
are in the array. This is almost always a serious code smell. (We are
programming in a list manipulating language) The routine was executing
am unnecessary loop just to maintain that var.
Removed the variable from the routine and perldoc
refactored calls of the routine removed the c-style loops for
more idiomatic and maintainable for loops
renamed some opaquely named variables
removed a call to the routine where nothing was done with the data
moved some html out of the calling script and into the template

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-23 17:59:27 +01:00
Adrien Saurat
cb1a946693 Bug 7357: display serial title instead of '---'
The full title of a serial is now displayed even
if several lines have the same title.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-17 16:08:32 +01:00
Christophe Croullebois
32317878c0 Bug 7105: Bad request in GetSubscriptions
If $string or $issn is passed to GetSubscriptions, the request is false.
See Bug 5864, especially the last comment from Frédérick Capovilla.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-03 08:21:21 +01:00
bada2e4c36 Bug 6321 Add a 1/4 months frequency
Thanks Stefano Bargioni for the typo fix

[2011.09.16] Thanks Paul for catching the display error.
[2011.10.11] Thanks Katrin for finding display error on OPAC.

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested prediction pattern and display in OPAC.
No problems found.
2011-11-17 16:56:28 +01:00
Colin Campbell
968a6af37d Bug 6315: Fix depreciated constructions in C4::Serials
Perl 5.14 will issue warnings in cases where it is assumed that
() will magically appear around qw() as the interpreter
will stop fooling itself that they are there
Added the missing () in the couple of cases they were required

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-05-15 20:42:08 +12:00
Colin Campbell
6a56ada2f1 Bug 6236 : When checking for expiry don't try to process 0 dates
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-22 07:35:11 +12:00
Colin Campbell
7c09c12e6a Remove redundant variable
The 'first' element in the structure PrepareSerialsData
was only used in the opac template. Remove assignment
as it is now obsolete (and potentially confusing )

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-19 13:30:44 +12:00
Colin Campbell
aaa80a54dc Bug 5932 Remove itemdata sub from C4::Serials
C4/Serials does not need to retrieve full item data
just to check if barcode is unique. Replace with
a lighter weight subroutine make code logic clearer and
cleaner

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-27 20:48:53 +13:00
MJ Ray
74cdd57ecb bug 1953: Reduce risk of possible tainted supplierid call to C4::Serials::GetLateIssues
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-02-26 20:02:25 +13:00
Colin Campbell
d22a4d2038 Bug 5026 Undefined dates formatted poorly in serials-edit
Don't display junk in empty fields
Don't generate errors

Merged some changes to make variable names moremeaningful in loops ( within loops)

Thanks to M De Rooy for spotting a couple of issues in the original patch

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-17 21:22:14 +13:00
Chris Cormack
2529527597 Bug 5508 : Updating copyright statements 2010-12-16 11:49:36 +13:00
Henri-Damien LAURENT
9bfcf01abd MT3801: Serials not received issues cannot be claimed
waiting issues which where planned for an old date were not "claimable"
This also fixes a bug from commit

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 16:52:56 +00:00
Henri-Damien LAURENT
63a8c5bc9d MT3801 followup : Cannot claim for issues
was missing an opening (
Adding test script

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 13:30:47 +00:00
Paul POULAIN
c401514b95 MT2743 : add filter on subscription branch to subscription claims
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 13:17:13 +00:00
Nahuel ANGELINETTI
99c0d2bf74 (MT #3110) fix repetable titles
This fix in serials search, for repeatables titles.
Now we use biblionumber to detect repeated serials.

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 12:13:04 +00:00
Henri-Damien LAURENT
04dbd152f8 (MT 3035) subscription created expired
Subscription expiration date was not calculated on creation of a subscription
(cherry picked from commit 263e9217c8cd736924f66d699981949e29b4c200)

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
2010-12-15 11:55:00 +00:00
Colin Campbell
aa6ce934d9 Bug 5022 Supplements were not saved correctly
No subscription id was set
Also entered a default arrived date on the supplement
And removed errors due to bad dates returned from GetSerials

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-12 20:13:59 +13:00
27bb768cad bug 5086: fix setting claim date
Also removed a locus for SQL injection.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:45:41 -04:00
Colin Campbell
c19a56f9cd bug_5245 Fix SQL syntax in GetItems
Routine never executed query due to syntax error
and returned undef
made the call to fetchrow_array explicit as the old fetchrow alias
is no longer documented in perldoc DBI

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:05:33 -04:00
Colin Campbell
ebf7f0cad0 Bug 5021 Formatting of undefined serials dates
Routine was checking undefinedness but such dates were
normalized on retrieval to 0000-00-00
Also planned/received date should also be checked

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-07-16 08:34:44 -04:00
7c0e441d50 replace references to defunct info email address
Now links to Koha project website.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
64daee5495 fix a common "developement" typo
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 14:38:38 -04:00
Colin Campbell
885d094090 Bug 4507 Don't return null vendor to claims processing
The empty vendor created by the select if any subscriptions
have no associated vendor generates a 'wrong-looking' display
and selecting it gives no options

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-17 08:57:16 -04:00
Garry Collum
fbd04fab63 Bug 3883: Fixes blank line in routing list.
The blank line was being caused by the SELECT statement in the getroutinglist fuction of C4::Serials.  The LEFT join in the select statement was creating a single row result of NULL.  Changed the LEFT join to an INNER join.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-03 07:35:38 -04:00
Colin Campbell
cfbd0c847e Check value is defined before splitting it
splitting an undef generates a warning
2010-04-08 22:36:16 +01:00
Colin Campbell
5226371ea3 Remove bottleneck making claims page unuseable
While the idea of showing the number of late serials against the
vendor name was nice it does not scale and on large sites selecting claims
was just timing out. Improved the speed of the initial query but have removed
the big query for each user just to get a count.
Check for 0000-00-00 dates so that C4::Dates does not log error
Removed a variable that was never set and the bit of template used
if the impossible happened
2010-04-08 18:05:42 +01:00
Colin Campbell
bf0eed8d31 Clean up Pod Documentation
Ensured returns were documented
Fixed some language issues
Removed the host of podchecker warnings about missing lists
added a couple of explicit returns when subroutines
'fell off the end' to remove any ambiguity
2010-04-08 14:44:39 +01:00
Colin Campbell
d027e4dcd6 add warnings to Serials.pm
Change obvious warning generators:
     ( use of string comparisons in numeric comparison)
     ( declaration of variable in comnditional )
also some errors caused by undefined values:
    abouttoexpire was not checking for undef values
    Pass a valid planneddate in generation of next expected
    (undef here causes odd results)
Add a basic test script
    test is minimal but I fell over a bug this would have caught
2010-04-08 13:28:40 +01:00