Commit graph

1808 commits

Author SHA1 Message Date
Amit Gupta
21d0e014ad Bug 6810: Fix QA failures
- remove DateTime->now()
    - use Koha::DateUtils->dt_from_string;
    - use Pod2usage for the usage
    - use Modern::Perl
    - use branches table
    - Change letter code from MEMEXP to MEMBERSHIP_EXPIRY
    - review comments implemented
    - fix qa script comments

Bug 6810 - Fix QA failures

    - MembershipExpiryDaysNotice system preferences arragned alphabetical order.

Bug 6810 - Add sample notices

    - review comments implemented
    - default value of is_html field in letter table is 0

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:42 -03:00
Alex Arnaud
e5caccb17a Bug 6810: Add new systempreference (MembershipExpiryDaysNotice)
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Bug 6810 - Fix QA failures

- Use KohaDates to convert dateexpiry
- remove MYSQL specifics methods for date handling in
  GetUpcomingMembershipExpires
- make the script membership_expiry.pl write in Koha system logs
- add tests

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Bug 6810 - Fix QA failures:

  - use Koha::DateUtils instead of Koha::Template::Plugin::KohaDates,
  - Add test with syspref MembershipExpiryDaysNotice equals 0 and undef,
  - fix (new) test failure (when MembershipExpiryDaysNotice is undef).

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:19 -03:00
Amit Gupta
764b8b7e90 Bug 6810: Send membership expiry reminder notices.
A new crontab based perl script to send membership expiry reminders. A
system preference controls the number of days in advance of membership
expiry that the notices will be sent on.

To Test:
1) Create a new Patron and set membership expiry date 14 days from the
   date of registration.
2) Check your systemprefence ( MemExpDayNotice to 14 days default value)
3) Manual testing Run ( perl membership_expiry.pl -h)
    It would give you various option:
    This script prepares for membership expiry reminders to be sent to
    patrons. It queues them in the message queue, which is processed by
    the process_message_queue.pl cronjob.
    See the comments in the script for directions on changing the script.
    This script has the following parameters :
     -c Confirm and remove this help & warning
     -n send No mail. Instead, all mail messages are printed on screen.
        Useful for testing purposes.
     -v verbose
    Do you wish to continue? (y/n)
4) Choose option for ex: perl membership_expiry.pl -c
5) Go to your koha database and check message_queue table you see some
   results.
6) Run (perl process_message_queue.pl) it will send email to those
   patron whose membership after 14 days from today.
7) Cron testing: (10   1 * * *  $KOHA_CRON_PATH/membership_expiry.pl -c)
8) Set your 15   * * * *  $KOHA_CRON_PATH/process_message_queue.pl
9) After running membership_expiry.pl, (process_message_queue.pl will
   send emails to those patron whose membership after 14 days from
   today).

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:08 -03:00
Barton Chittenden
1acb998beb Bug 14858: removed record length limit test
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 10:28:29 -03:00
01abfbd702 Bug 11368: [QA Followup 2]
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 12:40:52 -03:00
165da52e78 Bug 11368: [QA Followup]
* Fix QA failures
* Fix copyright
* Add file format documentation
* Add -c --confirm option
* Add -t --test option
* Add -h --help option

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 12:40:36 -03:00
2eeb2de909 Bug 11368: Add script to import Lexile scores
Koha needs a script to automate the importing of Lexile score data for
titles that have available scores but are not currently in the title's
record.

This script will take a CSV file of Lexile scores, and locate any
matching records in the Koha database ( by ISBN ). If the record already
has a score, it will be updated. If not, the Lexile score field will be
created.

Test Plan:
1) Apply this patch
2) Catalog a record for each of the following ISBNs:
   0789170191
   9780673779410
3) Download the file LexileTitlesTruncated.txt attached
   to this bug report
4) Run the script from the command line:
   ./misc/migraction_tools/import_lexile.pl -v --file /path/to/LexileTitlesTruncated.txt
5) View those records in Koha
6) Note those records now have valid Lexile scores
7) Edit the Lexile score ( 521$a ) and change the value to something else
8) Repeat step 4
9) Note the original Lexile score has been restored

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 12:39:23 -03:00
1acddd0f1b Bug 6756: Add info messages
NOTE: Before patch "./misc/cronjobs/batch_anonymise.pl --help" had no
      message, and neither did the anonymizing tool in the staff client.
      After the patch, both had informative messages.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:55:42 -03:00
Julian FIOL
bb4b7f46d1 Bug 13585: Add a cronjob which send UsageStats monthly.
This patch introduces entries for monthly running the share_usage_with_koha_community.pl
script to the packages and also the crontab.example file for manual
installs use.

Edit: I fixed the Copyright line

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 10:47:06 -03:00
ca341f6840 Bug 11190: sitemap.pl -- Generate a Catalog sitemap
Add a script sitemap.pl to process all biblio records from a Koha
instance and generate Sitemap files complying with this protocol as
described on http://sitemaps.org. The goal of this script is to be able
to provide to search engines direct access to biblio records. It avoid
leaving search engine browsing Koha OPAC and so generating a lot of
traffic, and workload, for a bad result.

Thanks Magnus for testing, and helping to improve the script design.

[2015.04.16] Switch from Moose to Moo.

[2015.08.20] Add complete (more) UT.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
All options to the script work as expected and the output looks
good. Nice enhancement!

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I signed-of my own patch after fixing various QA errors.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tabs with spaces.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 11:05:24 -03:00
Ulrich Kleiber
d873ed3b5d Bug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized value $borrowernumber
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

To test:

1/ Run the overdue_notices.pl script (don't do this on production
obviously :))
2/ Notice the warns
3/ Apply patch
4/ Run again
5/ Notice no warns, but notices are still generated ok

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:20:03 -03:00
e12127127f Bug 13049: [QA Follow-up] Remove unneeded module
The call to cronlogaction is done in cleanup_database. So there is no use
in keeping the module here.

Test plan:
Run or compile (perl -c) script delete_expired_opac_registrations.pl.
Run or compile (perl -c) script delete_unverified_opac_registrations.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:24:02 -03:00
5c3c679728 Bug 13049: Merge selfreg cron jobs into cleanup_database
This patch moves the core code of two selfreg cron jobs into the Members
module. The new routines are called from cleanup_database with two new
parameters. The old cron jobs are now wrappers to cleanup_database.
As a bonus, we can add a unit test now.

In time, we can obsolete the selfreg cron jobs. For now, the code is in one
place and behavior does not change.
A next step (as described on the Bugzilla report) would be: remove the Delay
pref for self regs.

Test plan:
Run the unit test t/db_dependent/Members.t.
Test the two new parameters of cleanup_database.pl.
Verify if delete_expired_opac_registrations.pl still works.
Same for delete_unverified_opac_registrations.pl.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
. Fixed minor merge confict on UT & cleanup_database.pl
. UT ok
. The two deprecated scripts still work as before, with a warning
  message.
. cleanup_database.pl do the deletion job, calling new C4::Members
  function rather that doing it directly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:24:02 -03:00
fdbd5ebabe Bug 13014: [QA Follow-up] Few typos in cronjob
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2015-06-24 11:49:13 -03:00
Jonathan Druart
7ae328cb6f Bug 13014: Notify budget owner on new suggestion - cronjob
Test plan:
0/ Create a new notice suggestions > TO_PROCESS
You can use the one defined in the other patch.
1/ Create a suggestion and link it to a fund
2/ Add a owner to this fund and make sure this patron has an email
address (the email address used should be the one defined in the
AutoEmailPrimaryAddress syspref).
3/ Execute the cronjob script with the -v and without the -c argument
4/ The output should tell you that an email will be sent
5/ Execute the cronjob script with the -v and with the -c argument
6/ Verify the notice is generated in the message_queue table and it is
correctly formatted.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2015-06-24 11:41:43 -03:00
Stefan Weil
63c1589685 Bug 14383: misc: Fix some typos in comments and documentation
Most of them were found and fixed using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:45 -03:00
Dobrica Pavlinusic
3cd086b6b6 Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere
This is major problem for plack installations with utf-8 encoding.

In this case, we are overriding CGI->new to setup utf-8 flag and
get correctly decoded $cgi->params, and reset syspref cache using
C4::Context->clear_syspref_cache

Test scenario:
1. under plack try to search with utf-8 charactes
2. try to find patron with utf-8 characters

Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-04 11:13:46 -03:00
Bernardo Gonzalez Kriegel
e365e6e535 Bug 14285: Bengali locale needs to be re-defined
This patch renames translation files for Bengali
language, from ben-* to bn-IN-*.
Also adds India as region

To test:
1) Apply the patch
2) Run updatedatabase
3) Install Bengali language
cd misc/translator
perl translate install bn-IN
enable

Check correct description

4) Create and install a fake Bengali variant
cd misc/translator
perl translate create bn-XX
perl translate install bn-XX
enable both variants

Check correct rendering of region

Results comply with expected test plan outcome. Signed off for bn-IN
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 15:22:27 -03:00
Jonathan Druart
5a58caad50 Bug 11603: Change the output filenames
The output filename is notices_all_<date>.[html|csv|ods] if no
letter_code parameter is given.
If 1 is given: notices_<letter_code>_<date>.[html|csv|ods]
If 1+ are given:
noties_<letter_code1>_..._<letter_codeN>_<date>.[html|csv|ods]

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:24 -03:00
Jonathan Druart
aecf9179a6 Bug 11603: (follow-up) pod
The filenames will change

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:24 -03:00
Katrin Fischer
1a3364519c Bug 11603: Some minor documentation changes
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:24 -03:00
b0140ece44 Bug 11603: Add --send|--nosend, fix stuf
Fix --html without --letter_code
Fix --ods which was producing a 2 lines ods file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:15 -03:00
Jonathan Druart
30ed77dae6 Bug 11603: Fix encoding issues (bug 11944 is now pushed)
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  No more encoding issue with html file, no problem with csv|ods

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:02 -03:00
Jonathan Druart
5e4633a3cc Bug 11603: If a letter code is given, filenames should contain it
If you choose to generate print notices for a specific letter code, the
generated files should be distinct.

The use case is: you want to process print notice for letter codes:
overdue1, overdue2 and overdue3.

The cronjobs will be:

perl misc/cronjobs/gather_print_notices.pl
/tmp --letter_code=overdue1 --csv --ods --html --delimiter=";"

perl misc/cronjobs/gather_print_notices.pl
/tmp --letter_code=overdue2 --csv --ods --html --delimiter=";"

perl misc/cronjobs/gather_print_notices.pl
/tmp --letter_code=overdue3 --csv --ods --html --delimiter=";"

without this patch, the 2 first files will be erased.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:02 -03:00
Jonathan Druart
9234b66038 Bug 11603: Gather print notices - add a ods parameter
This patch adds:
- the ability to generate an ods file

From now you are able to generate a ods file for print notices.

You would like to generate a csv file and not a html file.

Test plan:
- same as previous patch but test the following parameters:
 perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods
 --letter_code=OVERDUE -d=:
you should get an error because csv2ods is not installed.
Follow the installation instructions and try again the command.

A ods file should be generated in your /tmp/test directory.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:02 -03:00
Jonathan Druart
66ba71752a Bug 11603: Gather print notices - add a csv parameter
This patch adds:
- the ability to generate a csv file instead of a html file.
- a letter_code parameter.

From now you are able to generate a csv file for print notices.

Imagine a template notice defined as:
cardnumber:patron:email:item
<<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>>

You would like to generate a csv file and not a html file.

Test plan:
- define your ODUE notice for the print template as:

cardnumber:patron:email:item
<<borrowers.cardnumber>>:<<borrowers.firstname>> <<borrowers.surname>>:<<borrowers.email>>:<item><<items.barcode>></item>

- define overdues rules for a patron category
- check 2 items out using a due date in order to generate the overdue
  notices
- check these 2 items in
- launch the overdue_notices script
- the message_queue table should now contain 2 new entries
- launch the gather_print_notices cronjob with the following parameters:
 perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv
 --letter_code=OVERDUE --letter_code=CHECKIN
you should get an error

 perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv
you should get an error

 perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv
 --letter_code=OVERDUE -d=:
 will produce 1 csv file in your /tmp/test directory
- verify the csv file is correct and contain only 1 csv header column.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
QA note: Keep in mind that you can use all placeholders for the
csv that you can use for the normal templates. If you normally
get the item information from <item></item> you need to use that.
If you can use <<item.barcode>> directly, you can also do so
in the csv.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:02 -03:00
Jonathan Druart
9f88fe0069 Bug 11603: Preparation step, cleaning up
This patch refactores and adds some good practices:
- use Modern::Perl
- use Pod::Usage
- add POD

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-06-01 14:25:01 -03:00
cee05ed04e Bug 13899: (QA followup) POD and usage message fixes
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

asd
2015-05-26 14:22:34 -03:00
Julian FIOL
00393b73e4 Bug 13899: Changing license to GPLv3
koha-qa should be good :

 OK	misc/devel/coverage.pl
   OK	  critic
   OK	  forbidden patterns
   OK	  pod
   OK	  valid

 OK	C4/Installer/PerlDependencies.pm
   OK	  critic
   OK	  forbidden patterns
   OK	  pod
   OK	  valid

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors.
Test plan not explicitly stated,
script run and generates a lot of data :)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-26 14:22:34 -03:00
Julian FIOL
99f74da951 Bug 13899: Add changes as asked in Comment 5
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fixed a small conflict on PerlDependencies.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-26 14:22:34 -03:00
Julian FIOL
54312cb595 Bug 13899: Adding misc/devel/coverage.pl
It's a script making a cover on all modules to see
which ones are not tested yet. It uses Devel::Cover

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-26 14:22:33 -03:00
a7f0cbbece Release notes for 3.20
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-05-22 12:44:35 -03:00
Bernardo Gonzalez Kriegel
446faf793f Translation updates for Koha 3.20.0 release
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-05-22 12:34:08 -03:00
c2d63e5e4e Bug 9892: [QA Follow-up] Typo and updated usage
Corrected specifield.
Updated usage statement on use of delimiter pref.
Clarified the CONDITION explanation somewhat..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 09:23:18 -03:00
Jonathan Druart
6517e9c16d Bug 9892: Make export_borrowers.pl using the delimiter pref
The original concern of bug 9892 was that this borrowers export script
cannot handle tabulation to separate columns.

With this patch, the delimiter preference is used as separator for the
output, to be consistent with others scripts.

This should be highlighted on the release, it can produce change in
behaviors.

Test plan:
Confirm that the 'delimiter' pref is used for the output, but you are able
to overwrite it with the 'separator' parameter

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as expected, respect preference but is supeseeded by cmd line
No koha-qa errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-19 09:23:17 -03:00
Colin Campbell
607b224f00 Bug 13591: Pass OPACBaseURL to rss creation process
Links in rss templates were hardcoded to library.org.nz. Should pass and
use the system's OPACBaseURL.

Tested and verified.

Signed-off-by: Eivin Giske Skaaren <eskaaren@yahoo.no>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-15 16:11:07 -03:00
925b4d9b2c Preliminary (beta) release notes for 3.20
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-12 10:16:23 -03:00
Bernardo Gonzalez Kriegel
eb1ccb313a Translation updates for Koha 3.20 beta
New languages: Esperanto (eo) and Georgian (ka)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-12 10:14:20 -03:00
Bernardo Gonzalez Kriegel
5caa05104d Bug 12192: Template toolkit code in HTML attributes is picked up into po-files
This patch gives a partial solution for this problem.
It ignores strings like "[% something %]", but not
"[% IF ( value )  %][% value %][% END %]"

We get 100+ strings less to translate

To test:
1) Update translation files for your preferred language
2) Apply the patch
3) Update again
4) Compare, you must find 100+ strings removed from
translation files

eg.
-msgid "[% SEARCH_RESULT.biblionumber |url %]"
-msgid "[% accepteddate | $KohaDates %]"
-msgid "[% amountoutstanding | format('%.2f') %]"
-msgid "[% authtypetext |html %]"
-msgid "[% barcode_llx |html %]"
-msgid "[% barcode_lly |html %]"
-msgid "[% biblio.quantity.length ? biblio.quantity : 1 %]"
-msgid "[% billingdate | $KohaDates %]"
-msgid "[% borname |html %]"
...

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified all strings removed from the po files were
pure TT.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-06 10:40:14 -03:00
ca167b32b4 Bug 12412: Add ability for plugins to convert arbitrary files to MARC from record staging tool
Many libraries would like to be able to import various types of files as
MARC records ( citations, csv files, etc ). We can add a new function to
the plugins system to allow that kind of behavior at a very custom
level.

Test Plan:
1) Ensure you have plugins enabled and configured correctly
2) Installed the attached version 2.00 of the Kitchen Sink plugin
3) Download the attached text file
4) Browse to "Stage MARC records for import"
5) Select the downloaded text file for staging
6) After uploading, you should see a new area "Transform file to MARC:",
   select "Example Kitchen-Sink Plugin" from the pulldown menu
7) Click 'Stage for import"
8) Click 'Manage staged records"
9) You should now see two new MARC records!

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described - interesting new feature.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-04 15:33:51 -03:00
Marc Véron
df87f507d9 Bug 13889: Add information about cron jobs to system log
This patch adds information about cron jobs performed and make it viewable
under Home > Tools > Logs ("Browse system logs")

To test:

Apply patch
- Got to system preferences and set 'CronjobLog' to:  [Log] information from
  cron jobs.
- Run some cron jobs
- Go to Home > Tools > Logs
- Verify that you have a selection 'Cron jobs' in drop-down 'Module'. Select it
  with Action "All" and Submit.
- Output should show Date/time and info about Cron jobs

Rebased to work on top of Bug 6911 (conflict in viewlog.tt)  /MV

Rebased after applying patch for Bug 6911 /MV
Conflicts resolved:
misc/cronjobs/overdue_notices.pl
misc/cronjobs/cleanup_database.pl

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  - Merge both patches, and fix updatedatabase.pl
  - Works as described. Provide intersting feedback from cronjob scripts.

--
Modified version taking in account syspref CronJobLog. Handling simplified by introducing a convenience sub cronlogaction in C4/Log.pm /MV
Amended to take in account comments #11, #12, #13 /MV

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-05-04 11:11:14 -03:00
Bernardo Gonzalez Kriegel
6974481f2b Bug 7939: (followup) Update translation files
Create/rename/update/fix translation files

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 11:27:57 -03:00
Bernardo Gonzalez Kriegel
47c321ea33 Bug 7939: Separate po files for different MARC dialects
This patch implements separate PO files for
different MARC dialects.

It depends on correct filenames, i.e. it will build PO
files using files with/without "unimarc|normarc|marc21"
on their names.

Changes:
A) LangInstaller.pm
Added definitions to create or update xx-YY-{MARCFLAVOR}.po,
minor change to create and install procedure, and modification
of install procedure to handle multiple target dirs.
Updated documentation.

B) Standarization of filenames
STAFF po file is now xx-YY-staff-prog.po
MARC dialects po files are xx-YY-marc-{MARCFLAVOUR}.po

To test:
1) Update po files for your preferred language, ej. nn-NO
cd misc/translator
perl translate update nn-NO

2) Do some copying/renaming
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-UNIMARC.po
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-NORMARC.po
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-MARC21.po
mv po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-staff-prog.po

(most MARC dialect strings are on staff, so we use that as basis)

3) Apply the patch

4) Update again to fix translation files, verbose
perl translate update nn-NO -v

5) Install language, verbose, verify translations
perl translate install nn-NO -v

6) Create translation files
rm po/nn-NO*
perl translate create nn-NO

we must have this list:
po/nn-NO-marc-MARC21.po
po/nn-NO-marc-NORMARC.po
po/nn-NO-marc-UNIMARC.po
po/nn-NO-opac-bootstrap.po
po/nn-NO-pref.po
po/nn-NO-staff-help.po
po/nn-NO-staff-prog.po

Additional tests:
7) Number of msgids
7.a) Before patch and after upgrade, extract and count msgids
for i in $(ls po/nn-NO-*po); \
do msginit -i $i -o nn-old.po --no-translator --no-wrap --locale=nn_NO; \
egrep ^msgid nn-old.po >> old; \
done
sort old | uniq | tee s-old | wc -l > n-old
s-old: have all msgids
n-old: number of msgids

7.b) After patch and after creation of new files
Repeat procedure, diferent files (s-new, n-new)

7.c) Compare (diff s-old snew), they are the same
(save for a strange UNIMARC char in my case, but
it's present on corresponding PO file)

8) Installed dirs/files
8.a) List of EN dirs/files
cd koha-tmpl
find | egrep "/en/" > en

8.b) List of nn-NO dirs/files. After patch and language install
cd koha-tmpl
find | egrep "/nn-NO/" | sed 's|/nn-NO/|/en/|' > nn

8.c) Compare (diff en nn), they are the same

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Followed the steps outlined by Bernardo, and everything works as
expected. I think the most important points are that "perl translate
create nn-NO" produces the right files, and translating anything in
them, then doing "translate install" makes the translations show
up in the interface. The numbers msgids in the nn-NO correspond
well wit the number of msgids in other sets of .po files.

I bet y'all will be happy when you don't have to see the stupid
Norwegian strings when you translate! ;-)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-30 11:22:03 -03:00
Stéphane Delaune
709488b8b6 Bug 11399: QA fixes
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-23 12:46:35 -03:00
Stéphane Delaune
b1b0265f73 Bug 11399: batch Rebuild Items Tables
You can/must use it when you change items mapping.
this script rebuilds the non-MARC DB items table from the MARC values

usage : batchRebuildItemsTables.pl [ -h ][ -c ][ -t ][ -where ]

Options:
   -h --help       (or without arguments) shows this help message
   -c              Confirm: rebuild non marc DB (may be long)
   -t              test only, change nothing in DB
   --where         add where condition on default query
                   (eg. -where 'biblio.biblionumber<100')

(copied test plan)
to test it :

create a test item (eg on biblionumber 3) with a non mapped subfield with a test value.
check real items DB row ( SELECT * from items where biblionumber=3 ) => non mapped value is in more_subfields_xml
map the non mapped subfield with unused items column
re-check in Db that nothing changes
run ./batchRebuildItemsTables.pl -c --where 'biblio.biblionumber=3'
check real items DB row ( SELECT * from items where biblionumber=3 ) => new mapped value is not in more_subfields_xml anymore but in the mapped column

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errors.
Add a new item to record, save with value in unmapped subfield ('x')
Change mapping, run script, value on newly mapped column

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-23 12:46:28 -03:00
c7dadf82ca Bug 13159 [QA Followup] - Remove unused call to localtime()
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 12:04:54 -03:00
Olli-Antti Kivilahti
62dcd12f83 Bug 13159 [QA Followup] - Fix transaction_date and undefined warning
cli-client doesnt respect the transaction_date format
  "YYYYMMDDZZZZHHMMSS"
Using timestamp() to generate the proper datetime format.

"String $value undefined"-warning in build_field() fixed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 12:04:52 -03:00
1f2ff757b5 Bug 13159 [QA Followup] - Move script back to it's original path
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 12:04:51 -03:00
0e7fd0252f Bug 13159 - Enhancements to the SIP2 command line emulator
I needed to be able to perform checkout operations for testing from the
command line. I ended up reengineering the SIP2 command line tester
quite a bit.

Enhancements:
* Moved message generation code to subroutines
* Added support for more messages
* Added command line switches for each supported message
* Enabled use of Sip::Constants to keep code DRY and more understandable
* Moved script from misc to C4/SIP
* Designed with an eye towards possibly moving some code to CPAN in the future
* Also designed to make adding new messages much easier in the future

Test Plan:
1) Apply this patch
2) Look at help via ./C4/SIP/sip_cli_emulator.pl --help
3) Test patron status request and patron information, should work as before
   except you need to pass the command line switche -m <message_name>
4) Test the new checkout option using -m checkout -i <item barcode>

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Worked as advertised, with one warning at renew only:

Trying 'renew'
Use of uninitialized value $value in concatenation (.) or string at ./sip_cli_emulator.pl line 462, <GEN0> chunk 1.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-22 12:04:46 -03:00
Jonathan Druart
ba0f84b46c Bug 9978: (followup) Replace license header with the correct license (GPLv3+)
There was another form of the v2.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:59:43 -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
dbd8602280 Bug 13975: Remove compilation warning about encoding pragma deprecation
Test plan:
0/ Does not apply the patch
1/ Launch the export_borrowers.pl script to export data with unicode characters
 % perl misc/export_borrowers.pl -w "borrowernumber=42" --field borrowernumber --field surname --field firstname
  Use of the encoding pragma is deprecated at misc/export_borrowers.pl
  7874,JOUBU,صةصةصة
2/ Apply this patch
3/ Repeat 1
 % perl misc/export_borrowers.pl -w "borrowernumber=42" --field borrowernumber --field surname --field firstname
  7874,JOUBU,صةصةصة

Note that the deprecated message is gone and the encoding is correct.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

  I confirm the warning (on Perl version above 5.14). And that the patch fix
  the warning.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-20 09:53:10 -03:00
1682815580 Bug 13166 - add all restrictions purge to cleanup_database.pl
Bug 12760 adds the ability to purge expired restrictions older than some days.

But if you want to purge all expired restrictions, using "--restrictions 0" does not work, it's like "--restrictions" so it uses default purge days.

This patch adds a new option "--all-restrictions" to purge all expired restrictions.

Test plan :
- Select a borrower
- Create a restriction with expiration date in the futur
- Create a restriction expired since 1 day
- Create a restriction expired since 10 days
- run without argument "misc/cronjobs/cleanup_database.pl"
=> You see help text for --all-restrictions option
- run "misc/cronjobs/cleanup_database.pl -v --restrictions --all-restrictions"
=> You get the message : You can not specify both --restrictions and --all-restrictions
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 30"
=> no restriction is removed
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 9"
=> restriction expired since 10 days is removed
- run "misc/cronjobs/cleanup_database.pl -v --all-restrictions"
=> restriction expired since 1 day is removed

Signed-off-by: Larry Baerveldt <larry@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-09 11:59:41 -03:00
cbb77c118d Bug 13068: [QA Follow-up] Remove the Talking-Tech-itiva file from atomicupdate
The file can be removed. The code is included in the db revisions
3.09.00.014 and 3.15.00.040.
Also I adjusted the text of TalkingTech.README and removed the reference to
the atomicupdate file.

NOTE: I open a new report for adding TalkingTechItivaPhoneNotification to
sysprefs.sql. Probably, the text inserted in the db revisions should have
been inserted into the sample notices sql text too. These corrections are
outside the scope of this report.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-31 11:30:54 -03:00
Thomas
482f2f31a8 Bug 13531 - Follow up
Add logging of errors.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
More errors are indeed showing up in the log.
(I took the liberty of changing the commit message a little bit.)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-31 10:56:26 -03:00
Thomas
002b79c200 Bug 13531: QA follow up
A minor QA comment.

::: misc/migration_tools/bulkmarcimport.pl
@@ +271,5 @@
>          my ( $error, $results, $totalhits ) = C4::Search::SimpleSearch( $query, 0, 3, [$server] );
> +        # changed to warn so able to continue with one broken record
> +        if ( defined $error ) {
> +            warn "unable to search the database for duplicates : $error";
> +            next;

For consistency with the rest of the script, should this perhaps be:

next RECORD;

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-31 10:56:14 -03:00
Thomas
e1cdb4ebfa Bug 13531 - bulkmarcimport bombs if no match is found Changed the die statment to a warn allowing the import to continue.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-31 10:56:08 -03:00
Jonathan Druart
39bb5fd43f Bug 11120: the date input should be in a iso format (YYYY-MM-DD)
Note that it cans also accept a date in the same format defined in the
dateformat system preference.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-30 13:43:59 -03:00
Katrin Fischer
e6d987180f Bug 11120: Follow-up: adding a hint about the date format
Adding 2 hints about the expected date format to the error
message and the help.

To test:
- Run overdue_notices.pl --date <someinvaliddate>
- Run overdue_notices.pl -man
- Verify hint about date format shows up

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-30 13:43:52 -03:00
Jonathan Druart
0f4a831344 Bug 11120: FIX the --date option for overdue_notices cronjob
Bug 7447 introduces the --date option for overdue notices.
This option has never worked: the code is waiting for a value but the
option is defined as a boolean.

This patch fixes the option and change the way to calculate the range of
dates.
This range is now managed in Perl instead of in the SQL query. To do it
in Perl allows to build dates simply using the DateTime and
DateTime::Duration modules.

To test this patch you should have a DB with a lot of overdues, (I
tested on a DB with 512 overdues).
A test plan could be:
1/ Dump your message_queue table
2/ Verify the number of overdues in the database before applying the
  patch:
  mysql> DELETE FROM message_queue;
  perl misc/cronjobs/overdue_notices.pl -v -t
  (the triggered option will generate overdue for today)
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 2A

  mysql> DELETE FROM message_queue;
  perl misc/cronjobs/overdue_notices.pl -v
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 2B

2/ Apply the patch
4/ Verify the number of overdues generated by the patched script:
  mysql> DELETE FROM message_queue;
  perl misc/cronjobs/overdue_notices.pl -v -t
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 4A

  mysql> DELETE FROM message_queue;
  perl misc/cronjobs/overdue_notices.pl -v
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 4B

  mysql> DELETE FROM message_queue;
  # The date should be defined depending your dateformat preference
  # and should be the date of the current day
  perl misc/cronjobs/overdue_notices.pl -v -t --date="YYYY-MM-DD"
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 4C

  mysql> DELETE FROM message_queue;
  # The date should be defined depending your dateformat preference
  # and should be the date of the current day
  perl misc/cronjobs/overdue_notices.pl -v --date="YYYY-MM-DD"
  mysql> SELECT COUNT(*) FROM message_queue;
  Note this value 4D

5/ Compare the values: All values generated with the -t options should
be equals. Same for values without the -t options.
=> 2A == 4A == 4C and 2B == 4B == 4D

6/ Go back to a normal activity for 3 days or manually change the
date_due for issues in the DB:
  mysql> update issues SET date_due = DATE_SUB(date_due, INTERVAL 3 DAY);
Do again step 4C and 4D with a date equals to today - 3 days.
Values should be the same as 4C and 4D.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with my own test data, checked generating overdues
with and without the --date option.
All worked as expected.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-30 13:43:48 -03:00
Bernardo Gonzalez Kriegel
1c8c8885f1 Fix printf errors on master PO files
This patch set as fuzzy some strings on translation files
that are incorrectly translated

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Makes translations work.
2015-03-30 12:51:57 -03:00
mxbeaulieu
c9a52f739c Bug 13794: Text input field values not translated
I left the code logic intact, and simply removed "text" from the regex.
Text input field values are now translated, no other logical changes are introduced.

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

Test:
1) Update, install and enable es-ES language
2) Go to Reports > Acquisition wizard
3) On page bottom, there is a text field with the word 'Export'
4) Switch language, the word is not translated
5) Apply the patch
6) Update and install again es-ES language
7) Reload page, text now reads 'Exportar'

No koha-qa errors.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-03-15 09:22:05 -03:00
07f9dd9f8c Bug 13679 : Bug in listing overdues
To test
1/ Create some overdues and some issues due in the future
2/ Run the overdues script
3/ Notice item due in the future is in the list
4/ Apply patch
5/ Run script again
6/ Notice in the future not in the list

Signed-off-by: Nick <Nick@quechelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-20 10:19:36 -03:00
155ce56ad8 Bug 13240 [QA Followup]
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-10 14:08:02 -03:00
Jonathan Druart
18c28fe36c Bug 13240: Remove commented warns
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-10 14:08:00 -03:00
Jonathan Druart
5bd9482550 Bug 13240: Remove some code obfuscation
my $bar;
my $foo = $bar->{borrowernumber} ||= {};
$foo->{one} ||= 'something';
$foo->{two}++;

What does $bar contain?

$VAR1 = {
          'borrowernumber' => {
                                'two' => 1,
                                'bar' => 'something'
                              }
        };

Not really obvious.

Maybe something I did not see is hidden.

Test plan:
Verify the digest for DUE and PREDUE work as before.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-02-10 14:07:59 -03:00
Morag Hills
f831176787 Bug 13530: Typo in bulkmarcimport
GetFrameworkCode was incorrectly spelt as GetFrameworkcode on line 401.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-14 10:28:30 -03:00
Jonathan Druart
e20270fec4 Bug 11944: use CGI( -utf8 ) everywhere
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-13 13:07:21 -03:00
Olli-Antti Kivilahti
9d53118f55 Bug 12922 - Do not DIE the advance_notices.pl -cronjob if no letter of type is found!!
We failed to deliver advance_notices because a template for sms's is undefined, because we don't support
sending sms' as advance_notice.
This crashed the cronjob because digests are set to die instead of the warn used in non-digest.
And we get angry customers asking for compensation!

This patch replaces the die with warn.

TEST PREPARATION:

0. Edit the ODUEDGST letter, find an undefined letter for any trasport type.

TEST PLAN:

1. Find a borrower and from the messaging preferences set the "Advance notice" transport type to
   the undefined digest. Set the "Days in Advance" to 1.
2. Check-out something for that borrower and set the due date for tomorrow.
3. Run "misc/cronjobs/advance_notices.pl -c -n -v" from the terminal.
4. BEFORE THIS PATCH: You get an error
   "No circulation PREDUEDGST letter transported by sms at /home/koha/kohaclone/C4/Letters.pm line 609."
   and the script dies.
4. AFTER THIS PATCH: You get an error
   "No circulation PREDUEDGST letter transported by sms at /home/koha/kohaclone/C4/Letters.pm line 609."
   but the script keep on going!

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-10 16:15:44 -03:00
53923cbd02 Bug 11872 - Lost overdue items should not generate fines
An item can be marked as lost by longoverdue.pl, but left checked out to
the patron. In this case, the item will continue to accrue fines.

Test Plan:
1) Check out an item and back date it so it is overdue and should
   generate fines.
2) Mark the item as lost by either using longoverdue.pl, or just
   by setting itemlost to 1 by directly accessing the database
3) Run fines.pl
4) Note the overdue generated a fine
5) Repeat steps 1-2
6) Apply this patch
7) Run fines.pl
8) Note a fine was not generated

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-01-07 20:15:55 -03:00
36f56b8177 Bug 13447: Fixed HTML Email Reports
A tiny typo made in runreport.pl when updating it for bug 9530 lead to
no body being attached to html emails.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-28 20:43:00 -03:00
Bernardo Gonzalez Kriegel
0edebb12b4 Bug 13362: translate script creates dirs on update
A dir creation was uncommented (by me), the effect is
create a lang dir on 'update', which is no needed.

To test:
1) Update translation files for a uninstalled language
(cd misc/translator; ./translate update xx-YY)

2) Check new dirs
koha-tmpl/opac-tmpl/bootstrap/xx-YY/
koha-tmpl/intranet-tmpl/prog/xx-YY/
koha-tmpl/intranet-tmpl/prog/en/modules/help/xx-YY/

3) Clean all
git clean -f -d

4) Apply the patch

5) Repeat 1) (i.e. update)

6) Check no new dirs this time

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan, works as described.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-17 19:29:28 -03:00
6413eb9949 BUG 13468: Overdue notice lists all checked out books
This patch should fix the issue when running under 'triggered' mode

To test:

1) Run overdue_notices.pl -t -n [to output notices to command
line]
2) Note that the notices output, list ALL checked out items
3) Apply Patch
4) Run again
5) Note the difference

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: remove space changes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-17 19:26:05 -03:00
Robin Sheat
a8c975d951 Bug 13377: mark automatic_renewals.pl as executable
This script is called by a cron job, but was never marked as executable,
so will error every time it's called, which is no good. This also adds
an appropriate #! line to the top of the file.

To test:
* apply the patch
* make a package
* ensure that the installed
  /usr/share/koha/bin/cronjobs/automatic_renewals.pl
  is mode 755 and does something when run.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-12-03 09:35:24 -03:00
Bernardo Gonzalez Kriegel
d9b50a47b4 Translation updates for Koha 3.18.0 release 2014-11-28 13:01:28 -03:00
be183b3c6b Release notes for 3.18.0
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-28 13:01:16 -03:00
Bernardo Gonzalez Kriegel
2cb427008d Fix errors on Korean translation files
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Translation manager pull request so the po get updated correctly
for translation.
2014-11-27 14:20:46 -03:00
Bernardo Gonzalez Kriegel
d1e05b67d1 Bug 13328: Rename Kurdish translation files
Kurdish translation files use a variant of Arabic script,
they need to be displayed as RTL.

Currently that is inferred from language dir name after
translation, and that name use the language tag, so we
need to change it from 'ku' to 'ku-Arab'

To test:
1) Translate to Kurdish
(cd misc translator; ./translate install ku)
2) Enable Kurdish on opac/staff
3) Test staff/opac interface, they are displayed as LTR
which is wrong
4) Disable Kurdish language
5) Do a cleanup (git clean -f -d)

5) Apply the patch

6) Translate again
(cd misc translator; ./translate install ku-Arab)
7) Enable again
8) Test again, this time display is correct (LTR)

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Easy to test. Well spotted Bernardo.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
2014-11-23 10:05:41 -03:00
c44439bc7d Bug 8337: Small typo in usage statement for longoverdue.pl
The charge with the replacement price will only be made if the charge
parameter matches the lost value. The given example is faulty (as well
as some of the code, as it appears ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-21 18:55:52 -03:00
Frédérick
38deeea87b Bug 8337 System preferences for longoverdue cron
Patch to follow that adds 3 new system preferences to control the
parameters for the longoverdue script.
New prefs are DefaultLongOverdueChargeValue, DefaultLongOverdueLostValue
and DefaultLongOverdueDays.
These preferences are used when you call the longoverdue.pl script without
their parameters.

Sponsored-By: CCSR
Signed-off-by: Leila and Fridos help <koha.aixmarseille@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-21 18:55:40 -03:00
47e030ea75 Preliminary (beta) release notes for 3.18
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-17 14:27:21 -03:00
Bernardo Gonzalez Kriegel
d37d8c7f00 Translation updates for Koha 3.18.0-beta release
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-17 11:01:50 -03:00
Katrin Fischer
2669c51be4 Bug 10136: Remove outdated translation tool docs
Patch removes outdated translation tool documentation
from the misc/translator directory.

Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Removing these lines sounds like a good idea. I tested by
applying the patch and checking that the files in question
are gone.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-14 11:41:45 -03:00
65ab6c1416 Bug 13257: update_dbix_class_files.pl need a POD
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-14 11:38:48 -03:00
Magnus Enger
1be9f1a0e7 Bug 11401: QA followup
1) Be more careful when checking the NorwegianPatronDBEnable syspref.

Before:
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {

After:
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {

This should avoid complaints if the syspref is not initialized.

2) Fix some empty =head2 POD sections

3) Fix some indentation in patrons.pref, to make xt/yaml_valid.t happy

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I couldn't find any regressions with adding, editing and deleting members.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-14 09:42:45 -03:00
Magnus Enger
290341d8db Bug 11401: Add support for Norwegian national library card
This patch makes it possible to sync patron data between Koha and the
Norwegian national patron database, in both directions.

In order to use this, the following information is necessary:
- a username/password from the Norwegian national database of libraries
  ("Base Bibliotek"), available to all Norwegian libraries
- a special key in order to decrypt and encrypt PIN-codes/passwords,
  which is only available to Norwegian library system vendors
- a norwegian library vendor username/password

See http://www.lanekortet.no/ for more information (in Norwegian).

While this is of course an implementation of a specific synchronization scheme
for borrower data, attempts have been made to prepare the ground for other sync
schemes that might be implemented later. Especially the structure of the new
borrower_sync table might be reviewed with an eye to how it might fit other
schemes.

To test:

Since the password and cryptographic key needed to use this functionality
is only available to Norwegian library system vendors, only regression testing
can be done on the submitted code. Suggested things to check:

- Apply the patch and make sure the database update is done. This should add
  the new "borrower_sync" table and five new systmpreferences under the
  "Patrons" > "Norwegian patron database" category:
  - NorwegianPatronDBEnable
  - NorwegianPatronDBEndpoint
  - NorwegianPatronDBUsername
  - NorwegianPatronDBPassword
  - NorwegianPatronDBSearchNLAfterLocalHit
- Check that patrons can be created, edited and deleted as usual, when
  NorwegianPatronDBEnable is set to "Disable"
- Check that the new tests in t/NorwegianPatronDB.pm run ok, e.g. on a
  gitified setup:
  $ sudo koha-shell -c "PERL5LIB=/path/to/kohaclone prove -v t/NorwegianPatronDB.t" instancename
- Check that all the other tests still run ok
- Check that the POD in the new files itroduced by this patch looks ok:
  - Koha/NorwegianPatronDB.pm
  - members/nl-search.pl
  - misc/cronjobs/nl-sync-from-koha.pl
  - misc/cronjobs/nl-sync-to-koha.pl
  - t/NorwegianPatronDB.t

Sponsored-by: Oslo Public Library

Update 2014-09-18:
- Rebase on master
- Split out changes to Koha::Schema
- Incorporate new way of authenticating with NL

Update 2014-10-21:
- Rebase on master
- Use Module::Load to load Koha::NorwegianPatronDB in non-NL-specific
  scripts and modules
- Fix the version number of Digest::SHA
- Fix a missing semicolon in kohastructure.sql

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-14 09:42:23 -03:00
Jonathan Druart
3443056e15 Bug 8218: qa followup
This patch
- rename _entity_clean as _clean_ampersand
- rename the script to sanitize_records.pl
- add a --fix-ampersand switch (the only one FOR NOW, enabled by
  default) so it is obvious what the script does.
- make POD and usage reflect this changes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-11 15:39:05 -03:00
a7b41eac76 Bug 8218: Follow-up for some small typos
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-11 15:38:53 -03:00
Jonathan Druart
299a8a6997 Bug 8218 : Add a maintenance script to sanitize biblio records
This patch adds:
- a new maintenance script batch_sanitize_records
- a new subroutine C4::Charset::SanitizeRecord
- new unit tests for the new subroutine

Test plan:
1/ prove t/db_dependent/Charset.t
2/ Create a record containing "&amp;amp;" (could be follow with as many
'amp;' as you want) in one of its fields and the same for the field
linked to biblioitems.url.
The url should not be sanitized, it may contain "&amp;".
3/ Launch the maintenance script with the -h parameter to see how to use
it.
4/ Launch the script using the different parameters:
 --filename=FILENAME
 --biblionumbers='XXX'
 --auto-search

The auto-search permits to sanitize all records containing "&amp;amp;" in
the marcxml field.

Use the verbose flag for testing.
Without the --confirm flag, nothing is done.

5/ Use the --confirm flag and verify in the biblioitems.marcxml field
that the record has been sanitized.

6/ Try the --reindex flag to reindex records which have been modified.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-11 15:38:36 -03:00
Sophie Meynieux
40ece625bb Bug 13018 : Static fine should be charged only once
Test plan (see Bug 6858 for using staticfine.pl) :

For a user (of a given category and library) with several overdues, launch the script :

staticfines.pl --category CAT,AMOUNT --library LIB --delay DELAY

Then, check that the user has been charged of AMOUNT if the due date of the most late item plus the delay is *before* today.

One day later, re-execute the script with the same parameters and check that the fine has not been charged twice.

Without patch, the fine is charged twice, with patch the user already charged is skipped (see output in debug mode)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Without the patch, the fine will be applied every time the script is run.
With the patch the fine will only be applied once.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-11 09:44:01 -03:00
71c0b8226e Bug 12760 - add restrictions purge to cleanup_database.pl (followup 2)
Formatting :
perltidy
use q{} for SQL queries
add use Modern::Perl

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 11:32:31 -03:00
301b96e66d Bug 12760 - add restrictions purge to cleanup_database.pl (followup 1)
Remove unused $query var
Correct redefined $count var

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 11:32:29 -03:00
5f58431380 Bug 12760 - add restrictions purge to cleanup_database.pl
This patch adds to the database cleanup script an option to purge expired patron restrictions (debarments in code).

Test plan :
- Select a borrower
- Create a restriction with expiration date in the futur
- Create a restriction expired since 7 days
- Create a restriction expired since 14 days
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 14"
=> no restriction is removed for this borrower
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 13"
=> restriction expired since 14 days is removed
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 6"
=> restriction expired since 7 days is removed
- run without argument "misc/cronjobs/cleanup_database.pl"
=> You see help text for restrictions option
- run without days "misc/cronjobs/cleanup_database.pl -v --restrictions"
=> You get a purge on 30 days

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-07 11:32:22 -03:00
Admin User Koha
ccf4061324 Bug 12995 - script update_totalissues.pl stops on corrupted record
When running update_totalissues.pl cronjob, it will stop on a corrupted
record.

This patch changes UpdateTotalIssues so that it return 1 if processing
record has succeded. Also, if mapping with biblioitems.totalissues does
not exist, the method has nothing to do so it stops and returns 1.

When processing a corrupted record, script now alerts about the error on
this biblionumber (if script is verbose) and process next record.
A total number of records with error will be printed at the end of the
script.

Test plan :
- Create a dabase with a few biblios and some issues
- Modify first biblio record (use direct sql update) : set empty value
  in biblioitems.marcxml
- Launch script : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v

=> Without patch : the script stops at first record
=> With patch : the script prints error for first record and processes
   all records

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I was able to confirm the problem before the patch and successfully
follow the test plan.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2014-10-31 14:14:24 -03:00
407c2fe7c0 Bug 13028: Followup adding a -partial flag for partial compares
If you compare the database with a partial pref file, you may not be
interested in lots of lines saying that a pref is not in the file. You
were already aware of that ;)
If you add the -partial flag, these lines will be skipped.

Test plan:
Do as described above.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:24:07 -03:00
98a3aa4d8f Bug 13028: Resolve uninitialized value in string eq at cmp_sysprefs.pl line 194
If you use the restore option with a partial pref file not containing a version, you will have this error. Also the count of updated prefs will be one too high.

This is corrected by a better test of the hash value in the CheckVersionPref subroutine.

Test plan:
[1] Create a small pref file and remove the version pref (if present). You
could for instance do a pref backup and remove most lines.
[2] Use the restore option with and without this patch.
    So, something like:
        maintclone/misc/maintenance/cmp_sysprefs.pl -c r -f 9999crucial.pref
[3] Check on the error message and the pref count.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-30 00:24:00 -03:00
Bernardo Gonzalez Kriegel
0258d3a42d Bug 12535 - PROG/CCSR Deprecation: Make opac translation theme independent
This patch makes opac translation files theme independent
A side effect is that current prog translation file is
renamed.

But the renaming is not added, that gives a patch of ~60M!

Current list of languages are now obtained from pref files.

To test:
1) Apply the patch

2) For your preferred language, rename opac prog file
from 'xx-YY-i-opac-t-prog-v-3006000.po' to 'xx-YY-opac-prog.po'

3) Update that language, there must be no errors
cd misc/translation
./translate update xx-YY [-v]
Check updated po files

4) Install any language, there must be no errors
./translate install xx-YY
Check prog theme for that language

5) Create translation files. Remove a language or create new lang files
./translate create zz-WW
ls -l po/zz-WW*po
check there are 3 files (and *~) for opac

6) Check updated pod for LangInstaler.pm and translate script

When PROG/CCSR themes are removed, I'll add a Bug to remove
corresponding files.

Perhaps RM could add a followup to rename all files,
cd misc/translator/po
for old in $(ls *opac-t*); do
    new=$(echo $old | sed 's/-i-opac-t-prog-v-3006000/-opac-prog/');
    git mv $old $new;
done

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-29 22:00:22 -03:00
0a53d5e6b6 Bug 12651: DOM indexing is the default
On the 23 July development meeting it was decided to formally deprecate
GRS-1 indexing mode for Zebra. This patch makes code fallback to DOM
on the remaining places. No behaviour change should be noticed, as DOM
has been the default for a while.

Regards

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Also checked running Makefile.PL

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-27 12:35:44 -03:00
Chris Cormack
a063067b91 Bug 9530 Making changes to misc/cronjobs/runreport.pl
Note: mail from this doesnt work in current master, so you may not
be able to test this fully

To Test

1/ Edit the new systempreferences (ReplytoDefault and ReturnpathDefault)
2/ Optionally edit the branch the mail will be sent from, adding email addresses
3/ Test sending a mail from scheduled reports, note you will need to have the fix
   for 12031 applied
4/ Check that the mails have the correct From, Replyto and ReturnPath set
   The rules are
   If the values are set in the branch use that, else use the syspref

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-27 10:38:47 -03:00
Jonathan Druart
fbc4e94d7f Bug 11945: The script should die if the pref are not filled
If the 2 prefs are not defined, the script should die.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-24 10:02:01 -03:00