Commit graph

120 commits

Author SHA1 Message Date
Nahuel ANGELINETTI
0960b9a030 (bug #3558) fix build_browser_and_cloud
This patch, permit to take care of similar entries, if there is some diacritics or not.
(cherry picked from commit 776c177e3debedaf08fec65fbf8111675ccc93e7)

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-14 23:01:43 -04:00
Sébastien Hinderer
f1f833c965 bug 3464: Takes columns country and B_country of table borrowers into account in related operations.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 18:19:20 -04:00
5ea0d6bb9b bug 3481: imporve cart_to_shelf.pl
Use revised CartToShelf() to insure that indexer
knows to reindex affected bib records.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 13:07:33 -04:00
Colin Campbell
e40e11ab0c bug 3481: Allow Item Temporary Locations for Processing and Shelving.
Allows temporary locations corresponding to 'in processing' and 'shelving'
so that newly-created items, and newly-returned items do not show
immediately as a available. Three new system preferences govern the usage
of these features.

NewItemsDefaultLocation. If system pref NewItemsDefaultLocation is set to a location code,
 all newly catalogued items will be set to the location set in this preference.
 Location code must be a valid LOC authorized value type.

InProcessingToShelvingCart. if the system pref InProcessingToShelvingCart is turned on,
any items run through returns.pl with a location code for 'PROC', will be modified to
have a new location code of 'CART'.

ReturnToShelvingCart.  If the syspref ReturnToShelvingCart is turned on,
all items returned other than confirmed holds will have a new location code of 'CART'.
Any item issued is automatically taken of the shelving cart.

Adds a cron script shelf_to_cart.pl which should be run hourly.
Updates all items with a location of CART to the item's permanent location.

The original location code is stored in the new items column 'permanent_location'.

Original Author: PTFS Contractor <dbavousett@ptfs.com>

This work co-sponsored by
  Middletown Township Public Library, Middletown, NJ USA  and
  East Brunswick Public Library, East Brunswick, NJ USA

Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-23 11:54:46 -04:00
James Winter
13bef6756e Modified write in fines.pl to silence message unless verbose is set.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-12 21:31:45 -04:00
7242939cf4 future hold request followup 3 - build_holdsqueue
Fixed the holds queue job so that it correctly
ignores hold requests that are not yet scheduled
to be filled.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-11 19:23:40 -04:00
J. David Bavousett
eb849c690a Created database-tidying cron script
This little script establishes a framework for database cleanup on some regular
schedule.  Initial implementation provides for brute truncation of the sessions
table, and selective-by-age cleanup of the zebraqueue.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-02 11:25:44 -04:00
J. David Bavousett
7468f49bd6 Modified fines.pl to not throw warning if --out not specified
It appears, in Ryan's patch, that he wants to throw a warning to the log if
the directory specified in --out is not present.  (Further messages will
be given when the open-or-die occurs a few lines later.)  However, it was
throwing the warning if --out was not specified at all, which is
undesirable.  This patch modifies that bit to check for the presence of
whatever directory is going to be used, either --out, ENV{TMPDIR}, or /tmp.
As before, if the write to the directory fails for any reason--including
its' non-existence--that is handled later, but this message will help
inform the troubleshooter.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-29 07:59:59 -05:00
Ryan Higgins
26a01d406e Add Getopt::Long to fines.pl, and option to specify log output directory.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-15 12:43:33 -05:00
Paul Poulain
1e19efadd6 (not new_acq related) smallfix to avoid a die in case of an invalid record
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-28 17:31:28 -05:00
Nahuel ANGELINETTI
bea9939047 (bug #3020) forgotten cronjob
this is the cronjob needed for grace period.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-22 13:46:36 -05:00
Michael Hafen
6c0dbfb86d offline_circ must use SQLite v2 - because Kyles PHP does
The Offline Circ tool by Kyle Hall uses PHP's SQLite, which is SQLite
v2.  Gnope, which Kyle links, ships with libSQLite v2.

Let's not count on libsqlite3 not being installed for perl.  If it is
installed DBD::SQLite will use it, where DBD::SQLite2 will not.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-21 15:26:21 -05:00
Joe Atzberger
84ff3747b8 Script to check for corruption of marcxml, and optionally to attempt fix.
When marcxml cannot be parsed into a MARC::Record object, the biblio is
undisplayable and it obviously breaks many features in Koha.  This script
can test to parse every marcxml, and alert on failures.  Optionally, the
marcxml can be replaced from the marc field.

See extensive perldoc for details.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-12 05:21:11 -05:00
Joe Atzberger
8695b7e84f Prevent fines failure on NULL borrowernumber.
The problem is that we do not ensure that the issues table has valid
borrowernumber in each line.  This is exacerbated by Getoverdues()
returning data sorted BY borrowernumber.  So one NULL borrowernumber
in issues prevented ALL fines from being assessed.  The actual error
from fines.pl cron log is:
  No branchcode argument to new.  Should be C4::Calendar->new(branchcode => $branchcode)
  at /home/user/kohaclone/misc/cronjobs/fines.pl line 98

This patch deals only with getting fines to avoid crashing.  It does
not fix the underlying data integrity problem.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-11 17:43:38 -05:00
Joe Atzberger
6b120d34a4 Cleanup, pod fix and FIXME's added.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-24 08:26:37 -05:00
Joe Atzberger
4e76d3c1bb Bug 3090 - Add perldoc details
This is half of the fix for 3090.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 12:30:53 -05:00
Joe Atzberger
14be4400d8 Bug 3066 - Overhaul guided reports
execute_query now refactored, returns reliable results, does
zero presentation-layer crap.  Arguments reduced, client scripts
adapted to new API and performance improved.  Text::CSV now used
to generate CSV output, ensuring portability, encoding and accuracy.

Replaced tools/runreport.pl with misc/cronjobs/runreport.pl:
    ~ security fixed
    ~ documentation improved
    ~ TODO: finish sendmail option.

Bug 3077 also fixed.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 20:17:55 -05:00
Joe Atzberger
1caa108ef0 runreport.pl and prep work on Guided.pm
The old location of runreport.pl was under tools, leaving it exposed
to web requests.  This is a security flaw since it does NOT check any
Auth and allows the user to request any Saved Report be run.  This is
not a problem under misc/crontab/ and it suggests the more appropriate use.

Guided.pm is not fixed here (see bug 3066), but it is prepared to be fixed
and made compatible with runreport as detailed in the perldoc.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 20:14:32 -05:00
Galen Charlton
0d590c1e30 bug 3028: remove reservefix.pl cronjob
Removed cronjob, which was written to work around
a bug in 2.2 that no longer applies and is specific
to a single library in any event.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 09:12:16 -05:00
Daniel Sweeney
52356dcd30 Fixed a typo that kept branches out of the Advance Notice and Item Due notifications.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:37:05 -05:00
Joe Atzberger
506363d7bf Remove outmoded (and possibly dangerous) cronjob.
This script is superceded by rebuild_zebra and the sync_items scripts.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 14:21:16 -06:00
Nahuel ANGELINETTI
aea15bca2a (bug #3011) csv export doesn't fill all the fields
This patch just fix the script which export to csv the overdue, and field the missing fields

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 08:00:15 -06:00
Joe Atzberger
b0a1759e92 Bug 2883 - longoverdue cronjob fails to implement required functionality.
This does not fix all problems recorded in 2883 (see all the FIXME's), but
it does improve the script's basic feedback to an intelligible level.
It also adjusts the documentation and examples to correct bogus usage
instructions.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-05 10:30:29 -06:00
Galen Charlton
b8d979abe7 minor corrections to check-url.pl
* removed ersataz YAML::XS dependency
* use 'return' instead of 'return undef'
* minor language changes

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-26 15:21:14 -06:00
64505d7118 URLs checker enhancement (bug #2959)
Improve URLs checker script in the way (half way) pointed out by Galen:

- A C4::URL::Checker class handle URL checking. This class is not yet
  in a separate file in C4 directory. This class would be easily
  extended to accomodate authorities URLs checking.
- Script output can now be formatted in CSV or HTML. HTML version
  link directly to MARC biblio record editor.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-26 15:06:22 -06:00
Galen Charlton
66d2e36fa3 bug 2988: apply correct hold policy
Item type was not retrieved in a query, leading to a case
where an item could be selected by build_holds_queue.pl
to fill a hold request even where forbidden by the
library and item type-level policy.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-26 14:14:46 -06:00
37c50c6e34 A new script to check URLs in 856$u field
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-12 15:25:14 -06:00
Galen Charlton
b50051a8e5 holds policies fixes
* use item branch instead of patron's branch to
look up the applicable hold policies - this makes
requesting in the OPAC consistent with the intranet.
* when generating pick list using build_holds_queue.pl, only match items
to patrons if request is allowed.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:30:41 -06:00
a777fb43d7 Fixes bug #2875
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 09:47:57 -06:00
Joe Atzberger
26d08662e7 Minor updates to minor cronjob script.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 09:47:54 -06:00
Galen Charlton
c7dec5b3df crontab.example - add back some useful comments
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 09:45:00 -06:00
Joe Atzberger
07245470f0 Expand crontab.example
Default overdues to "triggered" mode (-t).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 09:30:05 -06:00
Joe Atzberger
5102da0abc Revert "Updates to the example crontab"
This reverts commit def09f5a21.

As I emailed to the patches list Oct 06, 2008:

I suggest we need to revert Josh' commit def09f5a21.

The effect on the crontab example is to invalidate the lines being executed.  The lines were apparently copied in from a cron source, not crontab, despite the header describing it NOT being an example for cron.  It also runs longoverdue twice, instead of fines.pl.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 09:30:03 -06:00
62f3f59d8c Fixes bugs #2875-2879
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-29 19:59:44 -06:00
6345ddf493 A script generating keyword clouds from Zebra Indexes
See embedded perldoc to see how it works.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-22 16:41:53 -06:00
Galen Charlton
f74d63a1e5 bug 2864 [2/2]: move rss/* to misc/cronjobs/rss/*
As rss.pl is not a CGI script, moved it to join the
other cronjobs.  Full documentation of the script
is in misc/cronjobs/rss/rss.pl, but to summarize:

[1] rss.pl is run on the command line to produce
    an RSS XML document.  The output should be
    placed in a directory accessible to the OPAC
    (or staff) web interface so that users can download
    the RSS feed.  An example of usage:

    misc/cronjobs/rss.pl lastAcquired.conf

    Normally rss.pl should be run periodically (e.g., daily)
    to keep the feed up-to-date.

[2] The configuration file (e.g., lastAcquired.conf) lists

    * name of the template file to use
    * path of output file
    * SQL query

    rss.pl runs the SQL query, then feeds the output of the
    query through the template to produce the output file.

[3] The template file (e.g., lastAcquired.tmpl) uses
    HTML::Template syntax like any of the HTML
    templates for the web interface.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-17 08:02:34 -06:00
Nahuel Angelinetti
72c35aa328 bug 2827: better language check
This patch use a regexp instead 'eq' to find if french is an opaclanguage.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-11 10:03:54 -06:00
Joe Atzberger
4a3fcbbe0d Comment out unused variable.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-03 09:17:41 -06:00
Galen Charlton
aa686ee5ab bug 2606: reduce size of offline circ patron database
Reduce the size of the SQLite database produced by
create_koc_db.pl by emiting only the columns
actually used by Kyle Hall's offline circ client.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-18 16:46:21 -06:00
Ryan Higgins
4104c69757 Bug 2660: Add command-line options to overdue notice script.
This commit adds two options to the overdue_notices.pl script.
The notices are now generated in one of two modes: default or triggered.
In default mode, every time the script runs, a notice is generated if an item
is overdue within a notice date range.  This mode is suitable for a weekly cron
(or manual run), but the notice triggers should be syncronized with the cron script such that
the script is run once per notice date range.  Otherwise, duplicate messages will
be generated ( or no notice generated if a notice date range passes without the script being run).
Triggered mode is suitable for a nightly cron job: a notice is generated only on those
days that an overdue item enters a notice date range.  This mode is susceptible to message
loss when the cron script fails to run, or when notice triggers are edited.

A second flag is added: --list-all, which causes items.content to list all currently overdue items.
Without this flag, only items that are overdue within the given notice's date range are listed on
that notice.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-21 10:35:34 -05:00
Galen Charlton
9fd39af7a0 bug 2677: restore RandomizeHoldsQueueWeight and StaticHoldsQueueWeight
Restoring the functionality of these sysprefs as part of the
rework of build_holds_queue.pl:

* StaticHoldsQueueWeight is an ordered list of library codes.
  The order of the libraries in this list determines the order
  of libraries in which available items will be chosen to be
  targeted to holds.  Note that if this list does not include
  a library, items from that library will never be targeted to
  holds and staff will never be asked to retrieve items for
  title-level holds from those libraries.

* RandomizeHoldsQueueWeight is a Boolean parameter, indicating
  whether to randomize the libraries in the StaticHoldsQueueWeight
  list.

If neither RandomizeHoldsQueueWeight nor StaticHoldsQueueWeight is
set, then the libraries will be used to target items to holds in
alphabetical order by library code.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-16 09:50:52 -05:00
Pianohacker
861069e269 fix date formatting in overdue_notices.pl
This makes overdue_notices.pl format dates in fields that both start and end with 'date'.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-10-01 12:46:16 -05:00
720b31e0b4 Bugfix #2633
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-09-26 09:12:29 -05:00
Andrew Moore
00f35d2fde bug 2594: fixing SQL statement to populate patron information in offline circulation db
The offline circulation tool can use all of the patron information, not just their ID
numbers. This patch populates the offline circulation database with patron information.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-09-11 07:56:59 -05:00
Joe Atzberger
aa4c6ff62f Fines fixes: apparent problems with fines prevent processing.
CalcFine returned values that mismatched expectations in fines.pl.

fines.pl refactored: added debugging, prevent needless recreation of
Calendar objects by storing them in hash by branch.
Still outstanding problems with fines, including the output of a field
that has no other references in Koha (so is always undef) and the
incorrect description of FinesMode.

Calendar exported "new" erroneously.  I also cleaned up the queries to
avoid needlessly compiling additional statement handles.

Please test and consider application to 3.0 maintenance.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-29 20:31:41 -05:00
Joe Atzberger
586e8b0869 Usage option correction (-h not -n)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-28 09:22:55 -05:00
Vincent Danjean
c52357edc6 Still fixing permission and first line of scripts
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-20 20:23:54 -05:00
Vincent Danjean
2a9d85eade No 'BOM' marker for a script file
'#!' must be the first characters

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-20 20:23:54 -05:00
Andrew Moore
556d9cc43d bug 2503: refactoring and bugfixing on create_koc_db.pl
This is the script that generates the patron and holdings database for the offline circ module. I
touched up a few parts of it:

* fixed the database syntax to squash a bug or two
* extracted some methods for readability and reuse
* added some documentation
* added a --file and --force command line argument
* made it die if DBD::SQLite is not present. That module is required for this feature.

Here's an example crontab line that will generate the borrowers.db file each midnight.

0 0 * * * create_koc_db.pl --file /tmp/borrowers.db

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-20 17:05:25 -05:00
Andrew Moore
8c4a44ed67 bug 2503: moving offline circulation db generator to misc/cronjobs directory
This script generates a sqlite database of patron and holdings data for the offline circulation tool.
It's a cronjob, so it should go into misc/cronjobs

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-08-20 17:05:25 -05:00