Commit graph

198 commits

Author SHA1 Message Date
73c5cb3277 Bug 7240: Cleaning up import tables and action_logs
This patch lets cleanup_database also purge older records from the (five) import tables and the action_logs table.
Two new command line parameters are introduced: --import and --logs.
If no number of days is specified for --zebraqueue, --import or --logs, it defaults to 30 days, 60 days resp. 180 days.
I did not add a default for --sessdays, because this parameter cannot be seen separately from parameter --sessions.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Adds new parameters and code, does not change existing behaviour

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-01-13 12:20:51 +01:00
Sophie Meynieux
940652a6c7 BUG 5607 : Adds parsing of issues fields in overdue letters
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch makes it possible to add fields from the issues table to overdue notices.

Template used for testing:
<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> , Checkout date: <<issues.issuedate>>, Due date: <<issues.date_due>> Fine: <fine>GBP</fine> Checkout date from items: <<items.onloan>></item>

Possible improvements:
- Dates are not formatted according to dateformat system preference

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 18:35:21 +01:00
Chris Cormack
525c7bc4af Bug 7370 : Missing use call
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 18:22:42 +01:00
Sophie Meynieux
1be4678a57 Bug 6292 : Followup 2. several letters where generated if a borrower had overdues with different due_date triggering the same level
This patch fixes the SQL request giving the list of borrowers

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-16 17:45:39 +01:00
Chris Cormack
410975a7f7 Bug 6292 : Overdue notices not being generated when borrower had an overdue older than the max value of the notice triggers
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2011-12-16 17:45:37 +01:00
Sophie Meynieux
d86d62adba Bug 6292 followup
selection of items to be listed in an overdue notice included
both limits (upper and lower). So items with an overdue equal
to a limit appeared on both notices. This patch fix this,
including lower limit and excluding upper limit for the selection.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
2011-12-16 17:45:36 +01:00
Ian Walls
1f5f4981c0 Bug 7326: longoverdue.pl hardcoded to 366 days maximum
Adds --maxdays command line flag to longoverdue.pl to allow the user to specify
their own $endrange value.  Because sometimes 366 isn't enough!

Also adds help documentation for both --quiet and --maxdays params

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Simple change, works well

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-15 17:13:24 +01:00
Sophie Meynieux
a1e3174668 Bug 7287 : Fix overdue notification if a branch given as parameter does not have rules
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-14 18:10:45 +01:00
Paul Poulain
00894ac495 Bug 2346 follow-up (UpdateBorrowerDebarred subroutine removed)
notifyMailsOp.pl is deprecated : is was written by and for Ouest Provence (thus the OP) and is not used anymore.

it's probably not working anymore.
Removing the script
2011-12-06 19:13:55 +01:00
Frédérick Capovilla
478c2b139c Bug 7251 : Corrects a problem in overdue_notices.pl when delimiter is set to tabulation
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
checked that others values for the separator are OK = it is (space, semicolon,... see syspref "delimiter")
2011-12-06 17:12:37 +01:00
Paul Poulain
7267ea91ac Merge remote-tracking branch 'origin/new/bug_5211' 2011-12-06 11:36:57 +01:00
Srdjan Jankovic
1713133fdd bug_5211: LostItem() - added charge_fee param to control fee charging
Pass charge_fee = yes wherever is LostItem() called, which effectively
means tha there's no change.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-06 11:36:34 +01:00
Paul Poulain
6d8ea30401 Bug 6926 : overdue_notices don't send itemcount to notification
In advanced_notices.pl you can return the number of due items using <<count>>
flag.
If you use this flag in overdue_notices, it does not work, no number is
displayed.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-03 07:49:39 +01:00
Paul Poulain
1fe3514c3c Bug 6328 fine in days does not work
Some code coming from BibLibre has been lost in the process of inclusion in
3.4. The result is that fine in days does not work at all (you can setup rules,
but it does nothing)

Step to reproduce:

- Koha > Admin > circ rules > set 1 day fine every day of overdue for default
  rule
- Issue a book return date last week
- check-in the book => no debarment is set

The following patch will fix all of those problems by :

* updating borrowers.debarred to a date field (instead of tinyint). It contains
  the limit of the debarment
* changing API of DebarMember and UpdateBorrowerDebarred to pass a date
* display debarrdate where applicable. Note that a debarrdate of 31/12/9999 is
  considered as unlimited and not displayed
* added a debarrcomment, usefull to explain why a patron is debarred (this is
  independant from debarrdate changes and can be used when placing an unlimited
  debarment too)

[2011-05-12] F. Demians. It works as described. And I can confirm this
functionality is impatiently awaited by French libraries since one year. Thanks
BibLibre for the good work and for contributing this code.

Bug 6328 Followup--update DB structure

Thanks Katrin.

Bug 6328: make comment a textbox / fix debar by notice trigger

Debarring by notice triggers was broken, because the new function
expects a date as second parameter.

The comment field in patron account details was a very long text field.
Patch changes it to be a textbox instead.

Bug 6328: Lift debarment leaves patron account

'Lift debarment' redirects to an empty circulation page.

BZ6328 follow-up 3

Fixes comment 23 from Fernando L. Canizo : when the patron was debarred and debar removed
he still could not check-out.

The changes in the IsMemberBlocked (that were on biblibre/master) were lost somewhere
The sub was still checking for old_issues instead of calling CheckBorrowerDebarred
to get a debardate if applicable

Note : this bug was appearing only is you had issuing rules defined for itemtype/categorycode/branch.
Seemed to work if you had only default rules. That's probably why it hadn't been spotted before

BZ6328 follow-up 4
Comments fron Zeno Tajoli: The patch is OK and I sign-off it. Two little changes done on
installer/data/mysql/kohastructure.sql and installer/data/mysql/updatedatabase.pl

Signed-off-by: koha <koha@kohabase.localdomain>
2011-11-25 14:00:47 +01:00
a7ee2993f0 7042 Improving cleanup_database.pl: handling quotes in a_session and interpreting sessdays parameter
Improving the cleanup_database.pl script in two aspects:
1) In some cases CGI::Session seems to place quotes around the atime and ctime
data in the a_session field. Two regexps now take this into account.
2) If the --sessdays parameter is used, the --sessions parameter is now
implicitly enabled too.

With thanks to Ian Bays and Tom Hanstra.

Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-21 04:39:24 +13:00
Chris Cormack
05c2f83817 Merge remote-tracking branch 'kc/new/bug_6094' into kcmaster 2011-10-21 04:32:31 +13:00
c56d12c721 6094 Follow up for cleanup_database
Adds purging completed entries from need_merge_authorities table.
If you set dontmerge to ON, you need to periodically remove records.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-21 04:30:22 +13:00
D Ruth Bavousett
885f016394 Bug 6572: Script batch anonymisation wrapper
This little script, given a --days numeric parameter, will anonymise checkouts
before that many days ago.  Useful for sites that want to automatically do this on
a periodic (cronnable) basis.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-20 13:57:14 +13:00
Srdjan Jankovic
4770555855 bug_5533: Slightly improved marking items as lost
Call LostItem() whenever item is lost.
LostItem() new arg - mark returned.
Disabled Lost Status on catalogue item edit.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

For follow up we need to explain how to hide the 952$1 (lost) from
the framework by putting it in the 'ignore' tab.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-18 09:01:39 +13:00
Jonathan Druart
cfe8b6bd9a Bug 6048: printoverdues.sh bash odities
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>

Note: this script really needs a rewrite, but this patch does fix up the
things it's supposed to fix up.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-07 14:14:53 +13:00
Chris Cormack
481f620455 Merge remote-tracking branch 'kc/new/enh/bug_5263' into kcmaster 2011-10-04 08:56:56 +13:00
Ian Walls
37c48ccfb2 Bug 5236 Followup: items table information being keyed by biblionumber instead!
This patch fixes an error with bugfix 5236; any item-table information in the PREDUE letter
was being parsed with biblionumber as the key, instead of itemnumber.  Unless itemnumber == biblionumber,
this will ALWAYS return the wrong information.

I've moved the item table parsing line to within the if ($itemnumber) conditional check, and replaced
the key to use the itemnumber instead of the biblionumber.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-10-04 08:54:40 +13:00
6b8be20497 Bug 6755 Problems with switching languages
This patch solves the situation that news is in another language than
the Koha interface AND makes that themelanguage routine is always called
the same way in order to prevent mixed display.

It fixes also a bug related to language preselection based on web
browser prefered language.

September 9: Adjusted with input of Frederic Demians.

Septembre 10: Avoid circular dependency, as pointed by Chris Cormack.
Templates related functions are moved from C4::Output to C4::Templates

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-23 09:47:09 +12:00
Julian Maurice
a3e5547355 Bug 5098: Add csv headers in overdues
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-17 10:29:02 +12:00
Chris Nighswonger
57155db213 Bug 5263 - Add support for including fields from the ISSUES table in advanced due notices
Adding support for including fields from the Issues table in advanced due notices.
This is primarily to allow the inclusion of the due date for each item in the
advanced due notice, but will allow the inclusion of any field from the ISSUES
table.

This also adds code to exclude timestamp fields as these are irrelevant to the
end user in this context.

Note: Documentation should be updated to reflect the availability of the additional
fields in all circulation notices.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-02 12:44:42 +12:00
Liz Rea
1a17c0d6bd Bug 6478 -- add purge_suggestions.pl to the crontab.example
To test:
Verify that there is a listed job for purge_suggestions.pl in the crontab.example

Bug 6478 - adding --days support and help verbiage to the cronjob.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-16 20:23:20 +12:00
Ian Walls
358a3b364a Bug 5197: add <<today>> token to notices
implements for Overdue notices
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-07-12 19:52:59 +12:00
Ian Walls
5ae3a3aa4f Bug 5929: use branch admin email for advance_notice.pl emails
This squash commit takes the two patches from Srdjan and adds a minor fix to work with
template toolkit variable renames.

Squashed commit of the following:

commit 2cab669d1fd072600942e1e6fbf3378944255a68
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Thu Jun 2 14:08:40 2011 -0400

    Bug 5929: Fix advanced_notices to use new template-toolkit compatible message names

    Uses 'item_due' and 'advance_notice' for advance notices names; letters do not send otherwise

commit caded04702d5eebd0f63a3b93cdddce28257f092
Author: Srdjan Jankovic <srdjan@catalyst.net.nz>
Date:   Tue Mar 29 12:38:49 2011 +1300

    wr77490 (bug 5929): removed debugging leftover

commit 1944de0de40f937b1d8748500f24a119390db3f0
Author: Srdjan Jankovic <srdjan@catalyst.net.nz>
Date:   Tue Mar 22 19:05:23 2011 +1300

    wr77490 (bug 5929): use branch email in preference for due notices

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-06-04 19:41:26 +12:00
Alex Arnaud
4468aea43c Bug #6119 - Add biblioitems.itemtype in columns for items.content
Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-09 11:27:52 +12:00
Chris Nighswonger
d31c1603cc Bug 5251 : Enhancement: [3.2] (Resubmission) Adding code to support using gmail as an SMTP server
This patch adds support for using a gmail account as an SMTP server.
It includes a basic HOWTO.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-08 14:01:15 +12:00
0f7411ceee Partial fix for Bug 4870, Damaged status does not prevent items from being selected for reserves
This patch changes the holds queue build process in order to
require that items not be damaged in order to appear in the
holds queue report.

Revision adds a check for the AllowHoldsOnDamagedItems preference to
determine whether a damaged item should be included in the holds
queue report.

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-06 20:21:07 +12:00
ruth@bywatersolutions.com
61e87362c4 Bug 5857: longoverdue.pl needs a quiet mode for batch runs
This patch creates a --quiet flag for longoverdue that will squelch
the summary at the end of the run.  It also silences an unnecessary
warn in C4/Acounts.pm

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-01 21:13:04 +13:00
Jared Camins-Esakov
412966eff0 Bug 5253: Add options to runreport.pl
This makes sending reports via e-mail with runreport.pl work properly. It also
adds a --format option to allow the user to select between text, html, csv, and
tsv. At the moment text is not implemented, and falls back to tsv, but that is
still more readable than the HTML that used to be produced.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-29 22:53:06 +13:00
Henri-Damien LAURENT
f7190f48aa Bug 5944 : (MT #3000) new cronjob script to delete old suggestions
This patch is a new script that delete suggestion that have be processed by librarians.
It take on argument, it's a number of days to keep suggestions. Suggestions olders than TODAY - $days will be deleted.
This script should be used to purge suggestions and clean the table in intranet.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-24 22:10:20 +13:00
Paul Poulain
ddbedbfc2f Bug 4330 : Adding some copyright BibLibre statements 2011-03-21 10:57:20 +13:00
Colin Campbell
cf28bf4785 Bug 3810: Ensure all calls to Mail::Sendmail handled consistently
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-16 20:57:12 +13:00
Katrin Fischer
224d2dee90 Bug 3009 - Change items.content field so it prints due date by default
<items.content> in overdue notices prints issuedate instead of duedate by default.
This patch changes default to issues.date_due.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-02-09 15:25:55 +13:00
Magnus Enger
af60ade73b Bug 5055 Use standard file paths in crontab.example
This is a revised patch, removing the lines pertaining to logrotate.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-01-12 12:34:17 +13:00
Ian Walls
31622bc6b3 Bug 5457: gather_print_notices.pl requires explicit stylesheet
Adds a conditional around the opening and closing of STYLESHEET, testing on whether the $stylesheet variable is set
or not.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-12-07 08:57:28 +13:00
Chris Nighswonger
c1463e7255 Bug 5381 - Fines in notices prints always 0.00
This was due to passing off the biblionumber to GetFines rather than the itemnumber.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-14 22:25:03 +13:00
Andrew Elwell
efa66f1f55 Bug 5385: POD Cleanups (part 2)
More podchecker cleanups to eliminate warnings / errors

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 10:06:56 +13:00
Andrew Elwell
9fa574f609 Bug 5385: POD Cleanups (part 1)
working through the master branch to eliminate all
podchecker warnings/errors

Actual improvement to the quality of the POD will
come later (hopefully with assistance of others)

Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-12 10:06:55 +13:00
072896d66b bug 5219: tidy cleanup_database.pl
Includes a bit of cleanup of the enhancement patch
for bug 5074 - adding comments about old and new
behavior isn't necessary for such small changes.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-08 15:14:15 +13:00
Katrin Fischer
9f688ad92b Bug 5370: Fix all references to koha.org
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-08 09:41:47 +13:00
Katrin Fischer
35cf30ef15 Bug 5370: Fix references to koha.org and other old websites
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-07 19:50:52 +13:00
5c4f27bd0d Enhancement 5074 (Adding possibility to cleanup_database.pl to purge only older sessions) [UPDATED for master]
Currently, the misc/cronjobs script cleanup_database truncates the session table (deleting all records, including active sessions).
With an additional parameter sessdays, this behavior could be changed or (perhaps better) extended. If the parameter sessdays is passed along with a number of days, the script only deletes older session records. This is accomplished by examining the values of lasttime, atime or ctime in the record.
So, calling the script like:
  ./cleanup_database.pl -v -sessions -sessdays 7
will only delete sessions records older than 7 days. The "old style" call
  ./cleanup_database.pl -v -sessions
still works too and truncates the table as before.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2010-11-02 11:02:15 +13:00
Robin Sheat
18a1c3db11 Bug 5139 - packages now do email and other cron jobs
By default the packages now set up the cron jobs to handle things like
overdues and email etc. By default, email is off, 'koha-email-enable'
and 'koha-email-disable' can manage this.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 08:12:14 -04:00
Colin Campbell
a5bdd61c73 Bug 5047 html option not in -help output
Add -html option to list in pod so that it shows up
in output of help

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 07:54:28 -04:00
c4601faf13 Bug: 4904: Problem with printing fines in overdue notices
my $formatted_fine = currency_format("$1", "$fine", FMT_SYMBOL);
is already utf-8.

Resend with additional change, removing 2 lines (no strict, use strict) from the code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-06 06:21:34 -04:00
cbc9858323 another FSF address fix
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-06 20:31:26 -04:00