Commit graph

2109 commits

Author SHA1 Message Date
d0f850b51a Bug 10407: [QA Follow-up] Hashref process_batch params
As requested by Mark Tompsett. Hope this guarantees a signoff now..

Note: For consistency four additional parameters were needed to no longer
use file level vars in this subroutine.

Test plan:
Import a file with stage_file.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Imported a marc file and a marcxml file with stage_file.pl.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 16:00:13 +00:00
3badc57c93 Bug 10407: Add marcxml import (follow-up)
This patch makes the following changes:

[1] Based on the groundwork of the former patch, add call to
    RecordsFromMARCXMLFile in stage-marc-import. Use format param.
[2] Add format to the template. Use file extension to determine.
    If you use .xml or .marcxml as extension, MARCXML is selected.
[3] In stage-marc-import.tt mark UTF-8 encoding as UTF-8 not as utf8.
[4] BatchStageMarcRecords: do not call plugin if you have no records.
[5] RecordsFromISO2709File: also return errors in an array.
[6] In misc/stage_file.pl also use UTF-8. Handling of errors from [5].

Test plan:
[1] Import an empty file as MARC or MARCXML (with Tools/Stage..import).
[2] Import an non-empty file with invalid contents as MARC or MARCXML.
[3] Export a few records with Tools/Export as MARC and MARCXML.
[4] Import these two files. Check selected format versus file extension.
[5] Import a MARCXML file with misc/stage_file.pl.

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 16:00:13 +00:00
Olli-Antti Kivilahti
aa5bf4d3cc Bug 10407: Allow MARCXML records to be imported via GUI (groundwork)
Patch from Olli, manual rebase by Marcel (July 7, 2016).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Needs follow-up. Test plan in the third patch.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 16:00:13 +00:00
Colin Campbell
af49b42219 Bug 17141: Call config method to retrieve logdir
Incorrect method call is causing runtime error and not
retrieving the correct logdir value
Change retrieves the value correctly

To test:
1) Run edi_cron.pl, notice error
2) Apply patch and run edi_cron.pl again, should work as expected

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note: I did not test but changes make sense.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 15:49:12 +00:00
30a0df493d Bug 11144 [QA Followup] - Let each script run in sequence even if one fails
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Tested the A;B;C variant here. If A fails, B will run. Since we can safely
assume that A (or B) will not fail on a daily basis, this seems to be better
than running them in the wrong order every day.

As the comments on Bugzilla show, several people support this improved
(reordered) scheme and look forward to improved error handling on another
report (obviously not that simple).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 13:51:32 +00:00
Katrin Fischer
596ddef3c3 Bug 11144: Fix sequence of cronjobs: automatic renewal - fines - overdue notices
The patch changes the sequence of cronjobs in the crontab example
file and in the cron.daily file of the packages.

This is why:
1) Renew automatically
   ... only when we can't renew, we want to
2) Calculate fines
   ... once the fine are calculated and charged
   we can print the amount into the
3) Overdue notices

Before the change it could happen that you'd charge for an item,
that would then be renewed. Or that you'd try to print fine
amounts into the overdue notices, when they would only be
charged moments later.

To test:
- configure your system so you have items that should
  - be charged with fines
  - renew automatically
- configure your crontabs according to the example file
  or switch the cron.daily in your package installation with
  the new one
- configure your overdue notices so that one should be generated
  <<items.fine>>
- Wait for the cronjobs or schedule them to run earlier
- Verify all is well and as it should be

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-02 13:51:32 +00:00
d368059fd5 Bug 14504: (followup) Make deletion conditional on --commit
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:27 +00:00
Barton Chittenden
b14b7988f9 Bug 14504: (QA followup) Change argument --criteria to --where
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:27 +00:00
Barton Chittenden
d28562c60f Bug 14504: (QA followup) Fix error causing item not to be deleted
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:27 +00:00
11ddbc817d Bug 14504: (QA followup) Fix delete_records_via_leader.pl call to DelItemCheck
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:26 +00:00
Barton Chittenden
6e452b520f Bug 14504: (QA followup) fix test transaction, book_on_loan
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:26 +00:00
Barton Chittenden
c02b33e425 bug 14504: (QA followup) fixing DelItemCheck arguments
Remove $dbh as argument to C4::Items::DelItemCheck
and C4::Items::ItemSafeToDelete, also change all
calls to these functions throughout the codebase.

Also remove remaining reference to 'do_not_commit' in
t/db_dependent/Items_DelItemCheck.t

Fixed doubled "$$" in C4/ImportBatch.pm

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:26 +00:00
Barton Chittenden
59ac9be07e Bug 14504: (QA followup) use TestBuilder, remove do_not_commit
Use t::lib::TestBuilder in t/db_dependent/Items_DelItemCheck.t

Remove the option 'do_not_commit' from C4::Items::DelItemCheck.

Whitespace cleanup.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:25 +00:00
Barton Chittenden
5aa1808423 bug 14504: use C4::Items::DelItemCheck in delete_items.pl
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:25 +00:00
Barton Chittenden
93504aea26 Bug 14504: (QA followup)
* Fix POD warning.
* Remove redundant 'use stric' and 'use warnings'
* Remove $VERSION and --version option.
* Remove --dry-run option
* Split test for --help and check for @criteria into two separate pod2usage calls,
    enabling -msg on the latter.
* Fix 'target_tiems' typo.
* Test for holds on items to be deleted.
* Fix whitespace
* Fix test for holds.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:25 +00:00
Barton Chittenden
c8eeadf664 Bug 14504: Add delete_items.pl: a command line batch deletion tool
http://bugs.koha-community.org/show_bug.cgi?id=14504

Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-26 12:07:25 +00:00
Julian Maurice
1f71fe9eb5 Bug 16212: Add script minifySwagger.pl
This patch introduces the misc/devel/minifySwagger.pl script that
loads the Swagger files, follows references and produces a compact
("minified") version of the swagger file which is suitable for
distribution.

The wiki page should be updated with instructions on how to regenerate
it so the Release Manager does it on each spec upgrade.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

My name is Olli-Antti Kivilahti and I approve this commit.
We have been using the Swagger2.0-driven REST API on Mojolicious for 1 year now
in production and I am certain we have a pretty good idea on how to work with
the limitations of Swagger2.0

Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>

My name is Johanna Räisä and I approve this commit.
We have been using Swagger2.0-driven REST API in production successfully.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-08-25 12:43:05 +00:00
6122b8fe6e Bug 16830: (followup) Remove weird character from warning in rebuild_zebra.pl
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-08-04 19:41:42 +00:00
0e9c3d446d Bug 15451: Do not considered a Resultset as a Result
The previous calls were wrong, but there is something bad with the DB
structure: export_format.profile should be a unique key.
This patch fixes the previous calls and add a FIXME not to forget to fix
the DB structure.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Previous test where done with all patches applied,
including this one, and all worked.
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:36 +00:00
f3d7f27107 Bug 15451: Koha::CsvProfiles - Remove the residue
This patch erase all traces of C4::Csv since it's not used anymore.
All occurrences have been replaced by previous patches to use
Koha::CsvProfiles.

Note that GetMarcFieldsForCsv was not used prior this patch set.

Test plan:
  git grep 'C4::Csv'
should not return any result.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No more traces of the file.
This produces a koha-qa fail, due to the missing file.
No other errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:36 +00:00
bea95dace6 Bug 15451: Koha::CsvProfiles - Remove GetCsvProfileId
This subroutine returned the export_format_id for a given profile name.
This can be done easily with the Koha::CsvProfiles->search method.

Test plan:
Export records using the misc/export_records.pl script and the
export tool.
If you are exporting using the MARC format, the profile filled in the pref
ExportWithCsvProfile will be used (or the one passed in parameter of
misc/export_records.pl).
If you are exporting using the CSV format, you can choose a profile in
the dropdown list.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Exported using tool & cmd, marc & csv. Pref is used.
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-22 17:18:35 +00:00
Morgane Alonso
a1285ba9c0 Bug 12509 - Fix Untranslatable Restriction added by overdues process
Changes the value of the "comment" column in "borrower_debarments" table
from "Restriction added by overdues process yyyy-mm-dd hh:mm:ss" to
"OVERDUE_PROCESS yyyy-mm-dd hh:mm:ss" in the overdue_notices.pl. Then in
the templates "moremember.tt", "circulation.tt", "memberentrygen.tt",
"opac-reserve.tt" and "opac-user.tt" the value of "comment" is
check, if it's an automatical comment due to overdue process it'll
write "Restriction added by overdues process yyyy-mm-dd hh:mm:ss",
then if there is a customizable comment it will be written without
modification. Like this, the comment "Restriction added by overdues
process" is written in the po files and can be translated later.

To test:
1) create a patron with automatical restriction due to overdue process;
2) apply patch;
3) run misc/cronjobs/overdue_notices.pl;
4) verify if the comment "Restriction added by overdues process" is well
   written and translatable on the following page :
    - opac patron home page (opac-user.tt);
    - opac item reservation page (opac-reserve.tt);
    - pro patron page (moremember.tt);
    - reservation item for a patron (circulation.tt, memberentrygen.tt);
5) try to translate the comment in po files;
6) sign off.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-07-08 12:41:47 +00:00
3e566de51f Bug 16751: What is sitemaper?
s/sitemaper/sitemapper/

Test plan:
Run t/db_dependent/Sitemapper.t

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 13:19:06 +00:00
d69d874a3f Bug 16644: Plack: Use to_app to remove warning about Plack::App::CGIBin instance
Using Plack with the debian psgi file, I get lots of warnings like:
WARNING: Automatically converting Plack::App::CGIBin instance to a PSGI code reference. If you see this warning for each request, you probably need to explicitly call to_app() i.e. Plack::App::CGIBin->new(...)->to_app in your PSGI file.

This patch is aimed to eliminate the warns.

Test plan:
Run Plack with plack.psgi or koha.psgi and verify if you do not see these
warnings anymore.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I tested on Jessie and I see no regressions.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 13:06:37 +00:00
1e39ecc7f1 Bug 16708: Fix authority reindex for ElasticSearch
The changes made to Koha::Authority has not been correctly fixed.
The code of Koha::Authority has been moved bo
Koha::MetadataRecord::Authority by bug 15380.

Test plan:
  perl misc/search_tools/rebuild_elastic_search.pl -a -v
should success

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 11:59:40 +00:00
8fac12d7f1 Bug 16672: Fix typo unqiue vs unique
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 15:45:54 +00:00
a98a3bea2a Bug 16672 [QA Followup] - Convert negative days to positive days
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 15:45:54 +00:00
bf63009758 Bug 16672 - Add ability to remove expired holidays from special_holidays
It would be very helpful if the cleanup_database.pl script had the
ability to delete holidays from the special_holidays table there were
older than a given number of days in the past.

Test Plan:
1) Apply this patch
2) Create some unique holidays in the past of varying ages
3) Test the new switch '--unique-holidays DAYS' for cleanup_database.pl
4) Verify only holidays older then the specified number of days are removed

NOTE: The language 'unique holdays' is used in the interface to match
      it's use in the staff web interface.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-17 15:45:54 +00:00
f01a07a25e Bug 16088: Introduce Koha::Cache::Memory::Lite to cache the language
The goal of this patch is to avoid unecessary flush of the L1 cache on
creating a new CGI object each time C4::Languages::getlanguage is called
without a CGI object.

The new class Koha::Cache::Memory::Lite must be flushed by the CGI
constructor overide done in the psgi file. This new class will ease
caching of specific stuffs used by running script.

Test plan:
At the OPAC and the intranet interfaces:
Open 2 different browser session to simulate several users
- Clear the cookies of the browsers
- User 1 (U1) an User 2 (U2) should be set to the default language
  (depending on the browser settings)
- U1 chooses another language
- U2 refreshes and the language used must be the default one
- U2 chooses a third language
- U1 refreshes and must be still using the one he has choosen.

Try to use a language which is not defined:
Add &language=es-ES (if es-ES is not translated) to the url, you should
not see the Spanish interface.

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-06-04 07:43:22 +00:00
Brendan Gallagher
625e1b77ae Release Notes for 16.05.00
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-05-26 19:09:36 +00:00
Bernardo Gonzalez Kriegel
9111db96fa Translation updates for Koha 16.05.00 release
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-05-25 22:56:09 -03:00
6c65b64c84 Bug 16505: Make sure $as_xml will not be used later
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:29:23 +00:00
5dd1b1bb66 Bug 16506: Remove warning for UNIMARC installs
Use of uninitialized value in numeric eq (==)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:29:12 +00:00
6c7a8c57e7 Bug 16506: (followup) Fix wrong option switch warning message
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:29:12 +00:00
7f22619001 Bug 16506: (Followup) remove warnings
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:29:12 +00:00
0b3b53e4f2 Bug 16506: Make rebuild_zebra.pl use XML as default
This patch deprecates the -x switch, making XML the default serialization format
used by rebuild_zebra.pl. It doesn't remove the option switch, but raises a warning
for the end user about the deprecation so they fix their cronjobs. Later we could remove it.

To test:
- Disable all indexing (daemon/cronjob)
- Create 2 records
- Edit one of them, delete the other one
- Verify they are queued for updates in zebraqueue
- sudo koha-mysql kohadev
  > SELECT * FROM zebraqueue WHERE done=0
...
| 265 |                265 | specialUpdate | biblioserver |    1 | 2016-05-13 14:23:45 |
| 266 |                  1 | recordDelete  | biblioserver |    1 | 2016-05-16 14:14:33 |
| 267 |                  2 | specialUpdate | biblioserver |    1 | 2016-05-16 14:15:06 |
+-----+--------------------+---------------+--------------+------+---------------------+
- Now go to koha-shell
  $ sudo koha-shell kohadev ; cd kohaclone
- Run:
  $ misc/migration_tools/rebuild_zebra.pl -k -b -z

  You will get something similar to this:
NOTHING cleaned : the export /tmp/jI0OeHy6Tn has been kept.
You can re-run this script with the -s  and -d /tmp/jI0OeHy6Tn parameters
if you just want to rebuild zebra after changing the record.abs
or another zebra config file
- Verify
  * less /tmp/jI0OeHy6Tn/del_biblio/exported_records
  * less /tmp/jI0OeHy6Tn/upd_biblio/exported_records
=> FAIL: They contain the records you added/modified/deleted but they are in
         USMARC format
- Apply the patch
- Mark your records for indexing (in koha-mysql kohadev)
  > UPDATE zebraqueue SET done=0 WHERE id > 264
- Run:
  $ misc/migration_tools/rebuild_zebra.pl -k -b -z

  You will get something similar to this:
<WARNINGS> [1]
NOTHING cleaned : the export /tmp/jI0OeHy6Tn has been kept.
You can re-run this script with the -s  and -d /tmp/jI0OeHy6Tn parameters
if you just want to rebuild zebra after changing the record.abs
or another zebra config file
- Verify
  * less /tmp/jI0OeHy6Tn/del_biblio/exported_records
  * less /tmp/jI0OeHy6Tn/upd_biblio/exported_records
=> SUCCESS: Data is correctly in XML format
- Run:
  $ misc/migration_tools/rebuild_zebra.pl -k -b -z -noxml

  You will get something similar to this:
<WARNINGS> [1]
NOTHING cleaned : the export /tmp/jI0OeHy6Tn has been kept.
You can re-run this script with the -s  and -d /tmp/jI0OeHy6Tn parameters
if you just want to rebuild zebra after changing the record.abs
or another zebra config file
- Verify
  * less /tmp/jI0OeHy6Tn/del_biblio/exported_records
  * less /tmp/jI0OeHy6Tn/upd_biblio/exported_records
=> SUCCESS: Data is correctly in USMARC format
- Sign off :-D

[1] Warnings covered by a followup

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
On top of Bug 16505
Work as described following test plan, usmarc default pre patch,
post patch xml default and usmarc on request.
No errors (all patchset)

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:29:12 +00:00
7a178fd262 Bug 16505: <collection> is missing the marc namespace and updates fail if -x is passed
Using rebuild_zerba.pl with the -x option switch, produces an incorrect output in
terms of what our XSLTs expect for indexing. This patch introduces the right namespace information
on the exported records so indexing succeeds.

To test:
- On current master, have some records on your db
- Run:
  $ sudo koha-shell kohadev
  $ cd kohaclone
  $ misc/migration_tools/rebuild_zebra.pl -r -b -k -x
=> you will get a message like this:

NOTHING cleaned : the export /tmp/NL5ufjUfpp has been kept.

- Run
  $ less /tmp/NL5ufjUfpp/biblio/exported_records
=> FAIL: The first line looks like this

<?xml version="1.0" encoding="UTF-8"?><collection><record

- Now run:
  $ xsltproc \
     /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
     /tmp/NL5ufjUfpp/biblio/exported_records
=> FAIL: No output
- Apply the patch
- Run:
  $ misc/migration_tools/rebuild_zebra.pl -r -b -k -x
- Take a look at the result file:
  $ less /tmp/asdiouqwiue/biblio/exported_records
=> SUCCESS: The start of the file looks like this:
<?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim">

- Run:
  $ xsltproc \
     /etc/koha/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl \
     /tmp/asdiouqwiue/biblio/exported_records
=> SUCCESS: There is actually indexing data :-D
- Sign off :-D

Edit: I changed qq{} for q{} as suggested by Jonathan.

Sponsored-by: American Numismatic Society

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-23 17:04:04 +00:00
Bernardo Gonzalez Kriegel
3d458abfd8 Translation updates for Koha 16.05 (beta) release
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-05-06 00:49:49 -03:00
52d30fba7b Bug 15543: Use another notice in membership_expiry.pl
This patch adds a letter parameter to the cron job membership_expiry.
It is used to substitute the default notice by another one.
This could be handy if you e.g. send a reminder after the first notice.
In any case, it allows for more flexibility.

Apart from this new parameter, this patch removes the sub parse_letter from
the code. The call to GetPreparedLetter is moved to the for loop and the
call to getletter is removed (no longer needed). If there is no letter
found, the Letter module already warns you. So we just exit the loop.

Test plan:
[1] Run membership_expiry.pl -c -n -v -let NOT_EXIST
    Check if you see a warning (coming from Letters.pm)
[2] Check if you have some soon expiring patrons or add before/after
    parameter to include some.
    Run membership_expiry.pl -c -n -v [-before ?] [-after ?]
[3] Create a new notice MEMBERSHIP2. Copy the text from the original notice
    and make some adjustments.
[4] Run membership_expiry.pl -c -v -let MEMBERSHIP2 [-before ?] [-after ?].
    Be aware that this call generates email messages.
    Verify that the email contained the adjusted text.

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

On top of Bug 14834
Work as described, tested using '-n' to see messages on terminal, e.g.
membership_expiry.pl -v -n -c -before 3 -branch BC -after 2 --letter MEMEXP2
No errors

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 16:58:58 +00:00
51be8ecd9d Bug 14834: Make membership_expiry cronjob more flexible
This patch adds three parameters to the cron job: -before and -after, and
-branch.

You can run the cronjob now in an adjusted frequency: say once a week with
before 6 or after 6 (not both together). If your pref is set to 14, running
before=6 will include expiries from 8 days to 14 days ahead. When you
use after=6, you would include 14 days to 20 days ahead, etc.

You could also rerun the job of yesterday by setting before=1 and after=-1;
this could help in case of problem recovery.

Obviously, the branch parameter can be used as a filter.

NOTE: Why are these parameters passed only via the command line?
Well, obviously the branch parameter is not suitable for a pref.
The before/after parameter allows you to handle expiry mails different from
the normal scheme or could be used in some sort of recovery. In those cases
it will be more practical to use a command line parameter than editing a
pref.

NOTE: The unit test has been adjusted for the above reasons, but I also
added some lines to let existing expires not interfere with the added
borrowers by an additional count and using the branchcode parameter.

Test plan:
[1] Run the adjusted unit test GetUpcomingMembershipExpires.t
[2] Set the expiry date for patron A to now+16 (with pref 14).
    Set the expiry date for patron B to now+11.
[3] Run the cronjob without range. You should not see A and B.
[4] Run the cronjob with before 3. You should see patron B.
[5] Run the cronjob with before 3 and after 2. You should see A and B.
[6] Repeat step 5 with a branchcode that does not exist. No patrons.

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

New parameters work with one (-) or two(--) dashes, no problem
with that but convention suggest that 'long' options use two-dashes.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 16:57:51 +00:00
74e28c02f9 Bug 9004: Use Koha::Calendar instead of C4::Calendar
This patch tries to make the code more readable using Koha::Calendar
instead of deprecated C4::Calendar and Date::Calc

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 12:01:24 +00:00
dafbd180a0 Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Add holidays check
Signed-off-by: Chris William <chrisw@pascolibraries.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 12:01:23 +00:00
1cdc1ae3d6 Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Perltidy script.
Signed-off-by: Chris William <chrisw@pascolibraries.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-04-29 12:01:19 +00:00
6c4415a873 Bug 9004: Use Koha::Calendar instead of C4::Calendar
This patch tries to make the code more readable using Koha::Calendar
instead of deprecated C4::Calendar and Date::Calc
2016-04-29 11:55:53 +00:00
fd4f2f88a6 Bug 9004: (QA followup) Fix pod 2016-04-29 11:55:53 +00:00
86015eefb4 Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Add holidays check
Signed-off-by: Chris William <chrisw@pascolibraries.org>
2016-04-29 11:55:52 +00:00
af32e3a475 Bug 9004 - Talking Tech doesn't account for holidays when calculating a holds last pickup date - Perltidy script.
Signed-off-by: Chris William <chrisw@pascolibraries.org>
2016-04-29 11:55:52 +00:00
Robin Sheat
282ea1cdb4 Bug 12478: abort early if there's no elasticserch definition
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:10 +00:00
Robin Sheat
52c4b55a48 Bug 12478: fix errors from rebase and new upstream version
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:09 +00:00
Robin Sheat
0b9483a691 Bug 12478: fix some issues on rebase
There were rebase conflicts that it was just easier to postpone until
afterwards.

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:09 +00:00
2aa72529c0 Bug 12478: Fix error on indexing a specific record
% perl misc/search_tools/rebuild_elastic_search.pl -bn 42
Can't locate object method "idnumber" via package "MARC::Record" at
misc/search_tools/rebuild_elastic_search.pl line 171.

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:09 +00:00
c6ef16a50f Bug 12478: Fix pod in the rebuild_ES.pl script
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:08 +00:00
8dd3901080 Bug 12478: Fix the verbose flag on reindexing
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:08 +00:00
2ee681c630 Bug 12478: Change the commit count to 5k
It will improve the indexing time.

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:08 +00:00
Robin Sheat
374f1e6384 Bug 12478: ES is now updated when records are updated/deleted
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:07 +00:00
Robin Sheat
b4392018bc Bug 12478: make things using SimpleSearch use the new version
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:07 +00:00
Robin Sheat
0536ef37cc Bug 12478 - authorities can now be stored in ES
(Not fetched yet though.)

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:03 +00:00
Robin Sheat
7dbd13e66f Bug 12478 - pile of elasticsearch code
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:03 +00:00
c564f30155 Bug 16169: Change prototype for C4::Biblio::TransformMarcToKoha
subroutines should not take $dbh in parameter.
C4::Biblio::TransformMarcToKoha has it and does not use it.

Test plan:
Look at the patch and confirm that all occurrences of
TransformMarcToKoha have been modified.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-04-07 00:04:21 +00:00
Bernardo Gonzalez Kriegel
c8f6d8d009 Bug 16194: Do not consider xslt as valid theme dir in LangInstaller.pm
Bug 15527 add an xslt dir, LangInstaller.pm must ingnore that dir.

To test:
1) Verify the problem on current master
Update translation for any lang, will see errors

2) Apply the patch

3) Update again, no errors

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-05 15:18:06 +00:00
ea4a2436e2 Bug 15967: Use the email template if the print template does not exist
From commit 581759e985
 Bug 14133: Print notices should be generated with the print
 template

"""
IMPORTANT NOTE: This test plan does not take into account the notices
generated for the staff ("These messages were not sent directly to the
patrons."). However the behavior will also change, the print template
will be used in all cases. Is it what we want?
"""

Yes, it is what we want. But if the print template does not exist, the
notice is not generated, we'd like to get the email template instead.

Test plan:
- Remove the print template for the letter you use for overdues
- Define an overdue rule to send an email
- Remove the email address for the patron which has overdues
- Execute the overdue_notices script
The staff should get an email notice and a print notice (using the
email template) should be generated for the patron

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-05 15:14:48 +00:00
faaa2cbcdb Bug 15967: Fix regression from bug 14133 - notify the library if patron is not
Regression introduced by bug 14133, see but 14133 comment 13.

Test plan:
Without this patch applied, if a patron cannot be notified (no email
address or sms number), the print notice generated for the library was
not.
With this patch applied, the print notice should be generated using the
print template

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-05 15:14:47 +00:00
fb0d0ddf39 Bug 15630 - Make Edifact module pluggable
Koha's EDIFACT module works great for many European vendors,
but does not work will for US vendors, which have a much different
interpretation of 'standard'. In fact, each vendor may require
different arrangements of values in EDIFACT messages. It would be
impossible to encompass all these requirements within Koha's EDIFACT
module itself. Instead, we should allow the module to be pluggable, so
versions of the module can be developed for vendors that require EDIFACT
messages that don't conform to the standard set by Koha's EDIFACT
module.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Enable Koha plugins
4) Install the Edifact stub plugin available at
   https://github.com/bywatersolutions/koha-plugin-edifact-stub
5) Edit the EDI Vendor account, assign the plugin to a Vendor EDI account
6) Test EDI functionality ( ORDER, INVOICE ), there should be no errors
   or changes to the EDIFACT message input or output

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 21:31:28 +00:00
Colin Campbell
10e5a58c5b Bug 7736 amend edi_cron.pl to use new style call to Context
Bug 9006 changed the api for retrieving config values
from C4::Context after the removal of Autoload
This changes the syntax used to retrieve logdir to reflect
the correct syntax

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 20:03:19 +00:00
Colin Campbell
e2e9916348 Bug 7736: Support Ordering via Edifact EDI messages
Add support for processing incoming Edifact Quotes, Invoices
and order responses and generating and transmission of
Edifact Orders.
Basic workflow is that an incoming quote generates an aquisition
basket in Koha, with each line corresponding to an order record

The user can then generate an edifact order from this (or another)
basket, which is transferred to the vendor's site

The supplier generates an invoice on despatch and this will
result in corresponding invoices being generated in Koha
The orderlines on the invoice are receipted automatically.

We also support order response messages. This may include
simple order acknowledgements, supplier reports/amendments
on availability. Cancellation messages cause the koha order
to be cancelled, other messages are recorded against the order

Which messages are to be supported/processed is specifiable on a
vendor by vendor basis via the admin screens

You can also specify auto order i.e. to generate orders from quotes
without user intervention - This reflects existing
workflows where most work is done on the suppliers website
then generating a dummy quote

Received messages are stored in the edifact_messages table
and the original can be viewed via the online

Database changes are in installer/data/mysql/atomicchanges/edifact.sql
Note new perl dependencies:
    Net::SFTP:Foreign
    Text::Unidecode

Signed-off-by: Paul Johnson <p.johnson@staffs.ac.uk>

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 20:03:17 +00:00
9658085d1e Bug 10612: (QA followup)
Rename not_borrowered_since to not_borrowed_since

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-04-01 19:52:14 +00:00
59266cbd61 Bug 14512 - Add support for AV field to Koha's SIP2 Server
Koha's SIP2 server should have support for the AV field ( field items ).
The biggest problem with this field is that its' contents are not really
defined in SIP2 protocol specification. All it says is "this field
should be sent for each fine item". Due to this, I think the contents of
the field need to be configurable at the login level, so that the
contents can be defined based on the SIP2 devices requirements for the
AV field.

Test Plan:
1) Apply this patch
2) Find a patron with outstanding fines
3) Run a patron information request using misc/sip_cli_emulator.pl using the new -s option with the value "   Y      "
4) Note there is an AV field for each fee containing the description and amount
5) Edit your sip config, add an av_field_template parameter to the login you are using such as
    av_field_template="TEST [% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]"
6) Restart your SIP server
7) Repeat the patron information request
8) Note your custom AV field is being used!

Signed-off-by: Chris Davis <cgdavis@uintah.utah.gov>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-31 20:29:18 +00:00
dda7a0a25f Bug 16044: Use the L1 cache for any objects set in cache
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 19:44:43 +00:00
798d38e4c7 Bug 16011: $VERSION - Remove comments
perl -p -i -e 's/^.*set the version for version checking.*\n//' **/*.pm

+ manual adjustements

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:29 +00:00
017699c345 Bug 16011: $VERSION - Remove the $VERSION init
Mainly a
  perl -p -i -e 's/^.*3.07.00.049.*\n//' **/*.pm
Then some adjustements

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

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-24 17:20:26 +00:00
c831b6deb3 Bug 16039: Remove useless exit
pod2usage will exit with the status given in parameter.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-23 20:57:22 +00:00
Srdjan
59e3b97a0c Bug 16039: Added -q flag to share_usage_with_koha_community.pl
To test:

With UsageStats syspref set to No:

* run misc/cronjobs/share_usage_with_koha_community.pl
  (without -q)
  - "The UsageStats system preference is not set." message
    with usage info should be output

* run misc/cronjobs/share_usage_with_koha_community.pl -q
  - the output should be quiet

NOTE: See comment #7.

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-23 20:57:22 +00:00
Colin Campbell
515e2d7c9d Bug 16106 Correct loose to lose in comment
Comment was using incorrect (but similarly spelled) word, obscuring
the meaning slightly. Also corrected the release note altering the
grammar there additionally as it should have been 3rd person singular
so that it now reads more clearly

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-22 01:47:53 +00:00
ec3387185d Bug 16010: follow-up of 15381 - FIX merge_authorities migration script
Caused by commit 7e70202d34
    Bug 15381: Remove GetAuthType and GetAuthTypeCode

If you execute perl misc/migration_tools/merge_authority.pl -f 1 -t 2
you will get:
Can't locate object method "authtypecode" via package "1" (perhaps you forgot to load "1"?)
 at misc/migration_tools/merge_authority.pl line 58.

GetAuthority does not return a Koha::Authority but a MARC::Record:
there is no authtype code method!

Test plan:
perl misc/migration_tools/merge_authority.pl -f X -t Y
Should not return any error.
Note that if the authid X or Y does not exist, the script will die.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-21 18:28:46 +00:00
55b78f1a5d Bug 11998: Clear L1 cache from psgi files
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-15 07:08:30 +00:00
d4039ce093 Bug 11998: Revert "Bug 13805: (Plack) Disable syspref cache"
This reverts commit ca00f0ddae.

Bug 13805 fixes an installer bug by disabling the syspref cache.
It was not a good idea, it introduced performance issues (see bug 13805
comment 14).

Test plan:
Test plan:
0/ Create a new database and fill the database entry in the koha conf
with its name
1/ Go on the mainpage, you should be redirected to the installer
2/ Try to log in
You should not get the login form again.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Test plan not followed by me for this patch, due to lack of working
plack setup, but I don't expect it to cause any problems, and performace
gain for plack will be tremendous

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-15 07:08:29 +00:00
f25e3ed90b Bug 11998: Do not clear syspref cache in psgi file
This in only in koha.psgi, it has been introduced by bug 13815 but
should not have been added by this patch.

Removing it should not introduce any changes.
Not that it won't impact debian packages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-15 07:08:29 +00:00
9820f9dfbd Bug 11998: Use Koha::Cache to cache sysprefs
At the moment, the sysprefs are only cache in the thread memory
executing the processus
When using Plack, that means we need to clear the syspref cache on each
page.
To avoid that, we can use Koha::Cache to cache the sysprefs correctly.

A big part of the authorship of this patch goes to Robin Sheat.

Test plan:
1/ Add/Update/Delete local use prefs
2/ Update pref values and confirm that the changes are correctly taken
into account

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Tested with plack with syspref cache enabled, there is some time between setting the syspref and applying it, but it takes just one reload of page, it shouldn't be problem, should it?
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Tested with CGI and CGI + memcache; some small issues still remain,
but it would be better to deal with them in separate bug reports
if necessary

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-15 07:08:28 +00:00
5439c71689 Bug 16031: (followup) Fix documentation
This followup fixes a tiny mistake in the script POD.

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-11 15:28:50 +00:00
41657a87f6 Bug 16031: sitemap.pl shouldn't append protocol to OPACBaseURL
Since bug 5010 was pushed, OPACBaseURL already contains the protocol. The
sitemap.pl script was written before this was pushed, and thus still concatenates
http:// in front of OPACBaseURL.

This patch removes this behaviour.

To test:
- Have OPACBaseURL set to (say) http://myopac.com
- Run the sitemap.pl script without specifying the --url param
=> FAIL: Notice URLs look like http://http://myopac.com/bib... in the sitemap files.
- Apply the patch
- Run the sitemap.pl script without specifying the --url param
=> SUCCESS: Notice URLs look correctly like http://myopac.com/bib...
- Sign off :-D

Regards

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-11 15:28:49 +00:00
3691bd8419 Bug 15548: Move new patron related code to Patron*
The 'borrower' should not be used anymore, especially for new code.
This patch move files and rename variables newly pushed (i.e. in the Koha
namespace).

Test plan:
1/
  git grep Koha::Borrower
should not return code in use.

2/
Prove the different modified test files

3/ Do some clicks in the member^Wpatron module to be sure there is not
an obvious error.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described. Tested with Circulation, Members/Patrons, Discharge,
Restrictions modules and the must common functionalities

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2016-03-03 14:38:26 -07:00
1538e9ecf4 Bug 15084: Replace C4::Budgets::GetCurrencies with Koha::Acquisition::Currencies->search
Most part of the code here is unnecessary complex. We should selected
the currency if it is selected, that's all :)

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-03 20:39:01 +00:00
Jonathan Druart
c631fa0924 Bug 11023: Automatic item modification by age (Was Toggle "new" status")
This patch adds:
- a new DB field items.new.
- a new page to configure this new status
  (tools/toggle_new_status.pl).
- a new cronjob script (misc/cronjobs/automatic_item_modification_by_age.pl
was misc/cronjob/toggle_new_status.pl)

Why this status is useful for some libraries ?
The use cases are:
- to know easily what are the new items (with a simple sql query).
- to display an icon in the search results.
- issuing rules can be adapt for new items. Automatically (using the
  cronjob script), the status change (depending the configuration) and
  the item can be issued, for example.
- a RSS/Atom feeds can be created on these new items.

Test plan:
- log in with a librarian having the tools > items_batchmod permission.
- navigate to Home > Tools > Automatic item modifications by age (was: Toggle new status)
- click on the edit button
- there are 3 "blocks":
  * duration: the duration during an item is considered as new.
  * conditions: the status will change only if the conditions are meet.
  * substitutions: if there is no substitution, no action will be done.
    You can add some change to apply to the matching items.
    E.g. ccode=3
         new=''
    If the value is an empty string (in other words, the input does not
    contain anything), the field will be deleted.
  You can create as many rules as you want.
- test the interface : add/remove rule, conditions, substitutions,
  submit the form, edit, etc.
  (There is a looot of JS everywhere, so certainly a looot of bugs...).
- when you have your rules defined, you can now launch the cronjob
  script without any parameter.
  A report will be displayed with the matching itemnumber and the
  substitutions to apply. Verify results are consistent.
- launch the script with the -c argument and verify values have been
  modified depending the substitution rules.

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: Add the ability to specify fields from biblioitems table.

Test plan:
Same as before but try with fields from the biblioitems table.

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: Add UT for C4::Items::ToggleNewStatus

Test plan:
prove t/db_dependent/Items/ToggleNewStatus.t

Signed-off-by: juliette et remy <juliette.levast@iepg.fr>

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

Bug 11023: FIX - condition on biblioitems table does not work

If a rule contains a condition on the biblioitems table, the match won't
work. This patch fixes this issue.

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

Bug 11023: Use DBIx-Class to retrieve column names

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

Bug 11023: Don't use the biblioitems fields for the subtitution

It's dangerous to allow a change on the biblioitems fields with this
feature.

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

Bug 11023: Rename the duration parameter with 'age'

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

Bug 11023: The age parameter should be a number

The template should check if the age parameter is correctly filled
(should be a number).

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

Bug 11023: Change the name of the feature

Originaly this feature only permits to update the "new" field.
Now all item fields can be updated.
The name of the feature is now "Automatic item modifications by age".

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

Bug 11023 [QA Followup]

* Update DB version
* Fix capitalization error
* Rename misc/cronjobs/toggle_new_status.pl to misc/cronjobs/automatic_item_modification_by_age.pl

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

Bug 11023 [QA Followup] - Complete the renaming of "toggle new status" to "automatic item modification by age"

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-03-02 22:56:31 +00:00
2398bfafc6 Bug 15675 - Add issue_id column to accountlines and use it for updating fines
Right now, fines are updated based on the fine description. There are a
number of areas where this can go wrong ( date or time format changing,
title being modified, etc ). Now that issues has a unique
identifier, we should use that for selection and updating of fines.

Test Plan:
1) Apply this patch
2) Test creating and updating fines via fines.pl
   and checking in overdue items. No changes should be noted.
3) prove t/db_dependent/Circulation.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 03:24:45 +00:00
cd9589681d Bug 15923: Fix --id_list_file option for misc/export_records.pl
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:43:11 +00:00
24e502e4a9 Bug 15923: Take the id list file into account when exporting records
When exporting records (tools/export.pl or misc/export_records.pl), a
file of ids (authid or biblionumber) can be passed to filter the
results.
Bug 14722 has broken this behavior.

Test plan:
Export records and specify a list of records to filter the results.
Prior to this patch, the record with the id 1 was exported.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-03-02 00:43:11 +00:00
d9dc15f21e Revert Bug 11081 - Port Koha::Contrib::Tamil indexer into Koha code base
It has been decided that Moose should not be a dependency for Koha, and
that this patch set should be reverted to avoid it's use.

This reverts commit 43bcc1c42c.
This reverts commit e5f4a0e3d5.
This reverts commit 6d44b0a91a.
2016-03-01 16:56:35 +00:00
4f5217314c Bug 15629: Koha::Libraries - Remove GetBranchDetail
C4::Branch::GetBranchDetail retrieved library infos, it could be easily
replaced with Koha::Libraries->find

When this change needs other big changes, the unblessed method is
called, to manipulate a hashref (as before) instead of a Koha::Library
object (for instance when $library is sent to GetPreparedLetter).

Test plan:
1/ Print a basket group, the library names should be correctly
displayed.
2/ Enable emailLibrarianWhenHoldIsPlaced and place a hold, a HOLDPLACED
notice will be generated (focus on the library name)
3/ Edit a patron and change his/her library
4/ Generate the advanced notices (misc/cronjobs/advance_notices.pl) and
have a look at the generated notices
5/ Same of overdues notices
6/ Set IndependentBranches and use a non superlibrarian user to place a
hold. The "pickup at" should be correctly filled.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-24 03:55:06 +00:00
0277c545b0 Bug 15742 [QA Followup] - Tidy script
Script does not appear to have any other modifying patches at this
time based on bz splitter. This is a perfect time to clean up this
script!

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-23 21:19:08 +00:00
cf04724789 Bug 15742: Remove unnecessary loop in j2a cronjob
If no branchcode is given, all the libraries are retrieved and the same
query (so without using the libraries loop) is executed for each
library.

Test plan:
Use the j2a.pl cronjob to change the category of a child patron
If a branchcode is passed to the script, only the children from this
branchcode should be updated.
But if it is not passed, all children of the DB should be updated.

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

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

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-23 21:19:08 +00:00
6d24219976 Bug 15687 [QA Followup] - Tidy sub to remove tab characters
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-03 23:01:07 +00:00
Julian Maurice
70112cfb81 Bug 15687: Fix xgettext.pl syntax errors
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-02-03 23:01:07 +00:00
8d072272fa Bug 15240: [QA Follow-up] Minor adjustments
This patch does:
[1] It removes some unused modules.
[2] It adds some options not listed in the synopsis.
[3] It removes an unused sql expression from one query.
    Note: In fines related code the third parameter of CalcFine sometimes
    is named as days_overdue too.
[4] Corrects a few typos in comments or pod.

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-28 19:15:35 +00:00
0d36c27678 Bug 15240: Do not process issues with a date due later than today
There is no need to do this job in Perl, MySQL could do it instead.
The idea is to only retrieve the issues info which could be overdued.

To test:
1/ Run the script
2/ Apply the patch
3/ Run the script again, notice the exact same results but execution time is faster

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-28 19:15:34 +00:00
Bernardo Gonzalez Kriegel
e5f4a0e3d5 Bug 11081: (followup) Add license information
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 06:30:44 +00:00
6d44b0a91a Bug 11081: Port Koha::Contrib::Tamil indexer into Koha code base
Add two scripts for indexing: koha-index and koha-index-daemon.

Documentation:

  perldoc koha-index
  perldoc koha-index-daemon

New dependencies:

  MooseX::Getopt
  MooseX::RW
  AnyEvent::Processor

Available as a Debian package: libmoosex-getopt-perl

Test plan:

- Apply the patch
- Install dependencies, if necessary
- Reindex a whole biblio catalog:
  koha-index --verbose
- Reindex a whole authorities catalog:
  koha-index --source authority --verbose
- Modify 1 biblio record, and index it:
  koha-index --select queue
- Modifiy 1 authority record, and index it:
  koha-index --select queue --source authority
- Run indexing daemon, with a 15s timeout:
  koha-index-daemon --timeout 15
- Modify a biblio record: wait 15s, and see
- Modify an authority record: wait 15s, and see

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

Works well, followed test plan without problems

One comment: perhaps an option for koha-index-daemon
to work quietly, without printing information.

No koha-qa errors, but new files don't have license,
fixed in followup

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 06:30:44 +00:00
Natasha
4120e48b0f Bug 14624 - <<items.content>> for advance_notices.pl wrongly documented
To Test Check perldoc for misc/cronjobs/advance_noitces.pl
and see that the documentation matches.

Ran:
$ perldoc misc/cronjobs/advance_noitces.pl
Saw expected changes.
Koha QA test tools pass too.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Switched due date for the name of the database column
date_due as the parameter expects a list of database
column names.
2016-01-27 04:33:07 +00:00
581759e985 Bug 14133: Print notices should be generated with the print template
If the overdue notice to send is an email or a SMS and the patron does
not provided such information, a print notice is generated.
But it will be generated with the email or sms template, which is not
useful, especially in the SMS case.

The template to use should be the print one.

Test plan:
0/ Does not apply this patch and Correctly define the overdue rules to generate
an overdue notice to the message_queue table.
Check email + SMS
1/ Define an email address and a SMS number for a patron
2/ Generate the overdue notices (misc/cronjobs/overdue_notices.pl [-t])
3/ 2 notices should have been generated:
    mtt=email with the email template used
    mtt=sms   with the sms template used
4/ Truncate the message_queue table
5/ Remove the email address and repeat 2
6/ Only 1 notice should have been generated:
    mtt=print with the email template used
7/ Truncate the message_queue table
8/ Remove the sms alert number and repeat 2
9/ 2 notices should have been generated:
    mtt=print with the email template used (or sms I suppose)

10/ Apply this patch and repeat previous steps.
The print notices should be generated with the print template.

IMPORTANT NOTE: This test plan does not take into account the notices
generated for the staff ("These messages were not sent directly to the
patrons."). However the behavior will also change, the print template
will be used in all cases. Is it what we want?

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

Seems fine by me

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 02:18:07 +00:00
a60943bc1b Bug 15188: Do not remove unused auths if zebra is not reachable
Other conn errors should be checked (wrong user/pwd, etc.)

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 01:03:06 +00:00
Alex Arnaud
128e7f54b1 Bug 15188 - Fixes remove_unused_authorities.pl will delete all authorities if zebra is not running
Test plan:

1) Shut down zebra: koha-zebra-ctl.sh stop
2) Execute the script: remove_unused_authorities.pl (with -t if you don't want to really delete from your database).
3) Check that the script would have deleted all the authorities (eg: 31449 authorities parsed, 31449 deleted and 0 unchanged because used).
4) Apply patch
5) Run, notice that the script dies because zebra is unavailable

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2016-01-27 01:03:05 +00:00
7e70202d34 Bug 15381: Remove GetAuthType and GetAuthTypeCode
Test this patch with the previous one.

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 18:59:02 +00:00
03c89fa02e Bug 15380: Move Koha::Authority to Koha::MetadataRecord::Authority
The existing Koha::Authority does not use Koha::Objects and does not
exclusively deal with DB objects.
It makes much sense to move it to let the space free for a
Koha::Authority and Koha::Authorities modules based on Koha::Object.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2015-12-31 18:50:41 +00:00
Olli-Antti Kivilahti
d5e946d0ed Bug 12923 Improve error logging for advance_notices.pl
Show borrowernumber when no letter of type is found and force utf8
output when running advance_notices.pl with -n flag, diacritics run awol
in the console output!

Also when debugging which borrower requests undefined letter templates,
it is very handy to log the borrowernumber so we catch and fix bad
borrower message transport settings.

TEST PREPARATION:

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

::TESTS ARE (ALMOST) THE SAME AS IN bugg 12922::
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 letter of type 'PREDUEDGST'
   found. Please see sample_notices.sql at ./advance_notices.pl line
   366."
4. AFTER THIS PATCH: You get an error "no letter of type 'PREDUEDGST'
   found for borrowernumber 1104659. Please see sample_notices.sql at
   ./advance_notices.pl line 368."
   Makes life more worth living for!
   Also diacritics printed on screen are displayed properly.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  I confirm the diacritics issue and solution. borrowernumber is
  displayed with warning when the 'no letter...' message is displayed.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-31 16:11:54 +00:00
Barton Chittenden
8de21a52ce Bug 14292: Add patron category restrictions to longoverdue.pl
Squashed prevoius patch set.

Add command line options --category and --skip-category

Convert usage() to pod2usage. (This was previous FIXME)

Make borrower category handling more user friendly:

    Make --category and --skip-category mutally exclusive

    Check that categories specified by --category
    and --skip-category exist in categories table.

    Add --list-categories opttion to show available
    borrower categories.

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

QA Follow-up

QA fixes - wording and trailing whitespaces

Simplify the category list

Basically we have 3 lists of categories:
1/ The full one, in the DB
2/ The one we want and list with --category
3/ The one we don't want and list with --skip-category

The list of categories to process is:
 * 1 if none --category or --skip-category options are provided
 * 2 if --category is provided
 * 1 - 3 if --skip-category is provided

(follow-up) Make --category and --skip-category case insensitive

"my" variable $borrower_category masks earlier declaration in same scope
"my" variable $skip_borrower_category masks earlier declaration in same scope

Signed-off-by: hbraum@nekls.org

Signed-off-by: Barton Chittenden <barton@bywatersolutions.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-31 14:56:34 +00:00
Olli-Antti Kivilahti
37b0e2ce9c Bug 15080 - ./translate tool should tell if xgettext executable is missing
Just upgraded our Koha container to 14.04 and noticing the
misc/translator/translate doesn't work.  This is because of a missing
package gettext.

This patch makes ./translate die with a helpful suggestion to install
gettext if xgettext-program is missing.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  I can reproduce the bug by desinstalling 'gettext' package on a Debian
  box. I confirm that without this patch, 'translate' command fails
  miserably. Suggesting to install gettext package is welcomed.

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
2015-12-30 16:23:44 -07:00
265761c353 Bug 12544 - Send scheduled reports as an attachment
This patch adds the ability to add the report as an attached file
to the sent email.

Test Plan:
1) Email yourself a test report
2) Apply this patch
3) Repeat step 1, note there is no difference
4) Add the -a parameter, note your also recieve the report as an attachment

Sponsored-by: Briar Cliff University

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Julius Fleschner <Julius.fleschner@briarcliff.edu>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-30 21:37:22 +00:00
Joonas Kylmälä
b6880abc50 Bug 12289: (follow-up) fix the compilation error
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-30 21:11:16 +00:00
b31eca9787 Bug 12289: Add --no-create options to stage_file.pl
This patch adds the no-create options to the command line interface
for bulk loading of records.

To test
1/ Apply both patches
2/ Call the script with --no-create and your will find that new
records are not created when no match is found.  The default, of
create_new remains the same as before.

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

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-30 21:11:16 +00:00
826326064e Bug 9819 - 'stopwords'-related code removed
This patch removes code related to stopwords usage. The following methods are removed:

C4::Search->remove_stopwords
C4::Context->stopwords
C4::Context->_new_stopwords

And the buildQuery API was changed (removed the \@removed_stopwords return value).
A follow-up is provided for database changes, to make rebasing easier.

To test:
- Apply this patch
- Do some searches in both intranet and opac interfaces
- Nothing should break

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-30 15:49:35 +00:00
4c5892eff7 Bug 11084 [QA Followup] - Document limitations of test mode
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-29 19:32:20 +00:00
8a87434f7a Bug 11084 [QA Followup]
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-29 19:32:19 +00:00
cc735a7ca4 Bug 11084 - Delete biblios on Leader 05 == d
Position 05 of the leader in MARC 21 indicates the record's status.
A lower case 'd' indicates that the record is to be deleted
(http://www.loc.gov/marc/authority/adleader.html).

This patch adds a cronjob script that may be run nightly to delete
records where position 05 of the leader is set to 'd'.

Test Plan:
1) Edit one or more records, and set the leader position 05 to 'd'.
2) Run misc/cronjobs/delete_records_via_leader.pl -c -v
3) Those records should either be deleted, or an error message should
   state why they were not.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>

Works as advertised. Edited a record with an item to have leader05 = d,
then ran delete_records_via_leader.pl with -c and got a message that
the record could not be deleted because of the item. Removed the item
and the script deleted the record. Tried with another record with an
item, this time with the -i option and the record was deleted.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2015-12-29 19:32:19 +00:00
3410608b66 Bug 15193 - Perl scripts missing exec permission
Some perl scripts have 644 permissions instead of 755.

I think some are special like install-CPAN.pl.

This patch corrects some common perl scripts.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-11 16:36:08 +00:00
Julian Maurice
48df0b8a2d Bug 15325: Fix --table option of rebuild_zebra.pl
Option's value given on command line was never used and 'biblioitems'
was used instead.

Test plan:
1. git checkout master
2. perl misc/migration_tools/rebuild_zebra.pl -b -t items --where "price = 42"
3. You should see errors printed on screen about an unknown column
4. Apply patch
5. perl misc/migration_tools/rebuild_zebra.pl -b -t items --where "price = 42"
6. No errors \o/

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2015-12-11 16:15:50 +00:00
efd2f8c37c Release notes for 3.22
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-26 11:51:24 -03:00
Bernardo Gonzalez Kriegel
546593b234 Translation updates for Koha 3.22.0 release
Two new languages: Occitan and Malayalam

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-26 09:37:51 -03:00
571f10b839 Bug 15242: Missing subroutine in overdue_notices.pl
This patch changes the call to parse_overdues_letter to use the full
namespace to ensure the subroutine can be found.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-25 12:31:48 -03:00
Marc Véron
cf3986ea63 Bug 14870: (followup) Remove superfluous C4::Dates from fix_accountlines_rmdupfines_bug8253.pl
This patch removes C4::Dates from fix_accountlines_rmdupfines_bug8253.pl

To test:
- Apply patch
- Check code for uses of C4::Dates (date_format)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 13:05:06 -03:00
Hector Castro
f464af4141 Bug 14870: Remove C4::Dates from plack.psgi and koha.psgi
Remove C4::Dates from .psgi files from preloaded modules, placing
Koha::DateUtils instead

http://bugs.koha-community.org/show_bug.cgi?id=14870
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-19 13:05:06 -03:00
576155df65 Bug 14960: Simplify the date management in staticfines
There is no need to create a DT objcet, then display in string/iso
then recreate a DT object from this string.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 15:36:51 -03:00
Marc Véron
ef539cd035 Bug 14960: Remove C4::Dates from files in misc/cronjobs
This patch removes C4::Dates from following files:

- misc/cronjobs/batch_anonymise.pl
- misc/cronjobs/cleanup_database.pl
- misc/cronjobs/gather_print_notices.pl
- misc/cronjobs/serialsUpdate.pl
- misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl
- misc/cronjobs/overdue_notices.pl
- misc/cronjobs/staticfines.pl

To test:
- Carefully review code changes.
- Verify that the cronjobs behave as before.

Amended to make patch apply and follwoing comments on IRC by putti
http://irc.koha-community.org/koha/2015-11-06#i_1752803
(misc/cronjobs/gather_print_notices.pl is using still C4::Dates, line 84)
6.11.2015 /mv

Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-17 15:36:43 -03:00
9515db57bd Bug 15133: encode correctly email generated by runreport.pl
/misc/cronjobs/runreport.pl send badly encoded email in text/csv
(partially ok in HTML).

TEST:

1. Send by email a report containing a subject with accented characters
   and resultset with accented characters. For example:

   ./runreport.pl --subject="éèà" --to=me@home.org  1
   ./runreport.pl --format=html --subject="éèà" --to=me@home.org  1

   The first email contains badly encoded subject & message. The second email
   contains badly encoded subject, but correct message.

2. Apply the patch

3. Repeat 1 => No more strange characters.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Characters are correctly encoded now, thanks for that good spot.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-16 15:53:57 -03:00
Liz Rea
4f8476e09c Bug 15120: runreport.pl cronjob doesn't allow custom subjects anymore
To test, well do something like

misc/cronjobs/runreport.pl --subject="My fancy subject!" --to=you@youraddress.com 1
where 1 is the number of your favourite saved report.

Success is your email arrives with the subject "My fancy subject!" Failure is
(with --subject defined) you get either the description of the report, or "Koha
saved report" as the subject. This is success without --subject defined.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Bug repeatable and fixed by this patch.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-16 15:50:02 -03:00
9ca3406ec6 Preliminary (beta) release notes for 3.22
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-12 10:11:55 -03:00
Bernardo Gonzalez Kriegel
12051e3519 Translation updates for Koha 3.22.0-beta release
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-12 00:05:58 -03:00
ef0b3869a6 Bug 14998: Restore previous behavior
We want to convert a us or metric date formatted to the format defined in
the pref.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-11 11:07:27 -03:00
Marc Véron
79cedd3718 Bug 14998: Remove C4::Dates from installer and maintenance folders
- installer/data/mysql/updatedatabase.pl
- misc/maintenance/fix_accountlines_date.pl

To test for updatedatabase.pl

- perl installer/data/mysql/updatedatabase.pl
- review code. Difficult to test, because the code affects
  $DBversion = '3.03.00.035'

To test for misc/maintenance/fix_accountlines_date.pl
 - review code
 - The file seems to be a file used for an update, could it be obsolete?
   If yes, remove it in a follow-up

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Code OK. Tested updatedatabase.pl with an old DB backup: OK.
  fix_accountlines_date.pl still working after the patch. Could be removed from
  master IMO.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-11 11:07:20 -03:00
02c69b218a Bug 14402: (QA followup) Add notes to usage text about --fees
Added notes to usage in misc/cronjobs/cleanup_database.pl that
--fees DAYS requires DAYS to be greater than or equal to 1.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-09 15:00:02 -03:00
Barton Chittenden
ee6029c841 Bug 14402: Make purge_zero_balance_fees() delete fees with NULL balance.
Also, add notes to perldocs and usage that payments and
credits are not linked to fines and may be deleted
independently of the associated fine.

Signed-off-by: Nancy Keener <nkeener@washoecounty.us>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-09 14:58:51 -03:00
Barton Chittenden
9f6ac9be11 Bug 14402: Add option --fees to /misc/cronjobs/cleanup_database.pl
This will call C4::Accounts::purge_zero_balance_fees to remove all rows
from accountlines which have 0 balance, and are more than DAYS old.

Test plan:

  Run: t/db_dependent/Accounts.t

If all unit tests pass, the --fees option to /misc/cronjobs/cleanup_database.pl
should act as documented, because it is a straight pass-through to
C4::Accounts::purge_zero_balance_fees().

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

Signed-off-by: Nancy Keener <nkeener@washoecounty.us>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-09 14:56:52 -03:00
Julian Maurice
353ed5b914 Bug 8296: Add descriptive (text) published date field for serials
Add a new field serial.publisheddatetext for displaying published date
in another format that dateformat syspref permit.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-05 10:41:28 -03:00
6b62fb3970 Bug 14544: Get rid of GetSomeShelfNames
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-11-05 09:58:02 -03:00
78db3adda2 Bug 12933: (QA followup) Rename parse_letter to parse_overdues_letter
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 12:41:29 -03:00
e6127b1bc0 Bug 12933: Add ability to print overdue slip from staff intranet
Some librarians would like to be able to print an overdues slip from the
staff intranet. This slip would be defined as the print transport
version of the ODUE slip.

Test Plan:
1) Apply this patch
2) Locate a patron with overdues
3) Define a print version of the OVERDUES_SLIP slip
4) Try Print > Print overdues

Signed-off-by: Amy Purvis <APurvis@galencollege.edu>
Signed-off-by: Laurie McKee <lmckee@littleelm.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 12:41:29 -03:00
Katrin Fischer
4fb7a013c7 Bug 11678: QA follow-up - Fixing some typos in the documentation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:10:20 -03:00
Julian Maurice
72384b0c20 Bug 11678: Improve documentation of new parameter
Say --email is repeatable

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:10:20 -03:00
Jonathan Druart
ad8e8f335a Bug 11678: Gather print notices: add --email parameter
This patch add the ability to send generated files by email.

You can specify several emails.

Test plan:
- same as Bug 11603
- call the script misc/cronjobs/gather_print_notices.pl with the
  following parameters:

perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --ods --html
--letter_code=CHECKIN -d=: --email="email_one@example.org"
--email="email_two@example.org"

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  - Works as desribed. Rebased upon bug-11603.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-04 11:10:19 -03:00
03891d2edc Bug 14722: CSV is only available for biblio records
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-10-27 17:01:34 -03:00
d3c9dac7ac Bug 14722: Add POD for some options
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-10-27 17:01:34 -03:00
b99901136c Bug 14722: rename the script
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-10-27 17:01:34 -03:00
38f92df4e5 Bug 14722: Refactor the export tool
Why a refactoring was need for this script?
The export tool (tools/export.pl) can be called from the command line
and some parts of code were unnecessarity complicated (just look at the
code, you will understand).

Worse still, the script does not provide the same options for both
interface. For instance you cannot export records given a range of
biblionumbers, authids, callnumbers, etc. from the commandline.

What does this patch?
1/ Important: The script tools/export.pl does not work anymore if called from
the command line (should be in the release notes).
2/ The code used to generated a file (csv, iso2709 or xml) has been moved to a new
module (Koha::Exporter::Record) and tests have been provided.
3/ No change is done on the web interface
4/ Some new options have been added to the commandline script
(misc/export.pl):
    - starting_authid
    - ending_authid
    - authtype
    - starting_biblionumber
    - ending_biblionumber
    - itemtype
    - starting_callnumber
    - ending_callnumber
    - start_accession
    - end_accession
5/ There is a change in the behavior if an error occurs:
Can't call method "as_usmarc" on an undefined value at Koha/Exporter/Record.pm line 114.
record (number 5530) is invalid and therefore not exported because its reopening generates warnings above at Koha/Exporter/Record.pm line 117.

Before this patch, they were not displayed (using the command line).

What does not do this patch?
It does not provide the 'clean', 'timestamp' and 'deleted_barcodes' options to
the web interface (same as before).

What about the perfs?
With a DB with ~800 biblios (MARC21)
Before: perl tools/export.pl 14.79s user 0.83s system 71% cpu 21.905 total
After:  perl misc/export.pl  17.19s user 0.84s system 75% cpu 24.018 total

With a DB with ~6400 biblios (UNIMARC)
Before: perl tools/export.pl 26.55s user 0.76s system 76% cpu 35.498 total
After:  perl misc/export.pl  26.78s user 0.84s system 80% cpu 34.494 total

How to test this patch?
Test plan:
A. Web interface:
1/ On the current master, export some records, biblios and authorities (with
the 3 differents exports) playing with the different filters (item type,
libraries, callnumber, accession date, don't export items, remove
non-local items, don't export fields, etc.).
2/ Apply this patch, export again the same records, and compare the
generated files. They must be identical!
3/ Confirm that the export features on the checkout list
(circ/circulation.pl) works as before this patch.

B. The command line
1/ On the current master, export some records, biblios and authorities (with
the 2 differents exports) playing with the different options (date,
deleted_barcodes, clean).
2/ Apply this patch, export again the same records, and compare the
generated files. They must be identical!

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@theke.io>
2015-10-27 17:01:28 -03:00
Joonas Kylmälä
75cd02c048 Bug 10933: (follow-up) fix the previous patch to work with master
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 11:03:03 -03:00
Jonathan Druart
c4d3002995 Bug 10933: The PurgeSearchHistory should be merge into the C4::Search::History module
Since bug 10803 adds a C4::Search::History module, the
PurgeSearchHistory routine should be moved.

Test plan:
- run misc/cronjobs/cleanup_database.pl with the searchhistory param and
verify behavior is the same as before applying this patch.
- run prove t/Search/History.t

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 11:03:03 -03:00
Bernardo Gonzalez Kriegel
9a5b6528fd Translation files update
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-20 15:32:44 -03:00
Jonathan Druart
e8055c7ef6 Bug 12368: Die if the --table value is not allowed.
If the table given in parameter is not in the white list, the script
should die rathen than correct to a default value.

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@theke.io>
2015-10-09 14:25:58 -03:00
Jonathan Druart
2d9c221abc Bug 12368: Rebuild Zebra improvement: allow to specify a DB table
Currently the --where parameter only allow to specify a condition on
fields in the biblioitems table.
For some needs it would be great to specify a condition on the field in
the items table.

The use case is the following: you want to reindex biblios with items
modified since a specific timestamp.

Test plan:
1/ Pick an item randomly in your catalogue
2/ Edit it and save
3/ Note that the items.timestamp has been set to today but not the
biblioitems.timestamp
4/ launch rebuild_zebra without the new parameter
  perl misc/migration_tools/rebuild_zebra.pl -b -v --where
  "timestamp >= XXX"
where XXX is the today date (e.g. "2014-06-05 00:00:00").
Note that the biblio has not been indexed.
5/ launch rebuild_zebra using the new parameter:
  perl misc/migration_tools/rebuild_zebra.pl -b -v -t items --where
  "timestamp >= XXX"
Note the biblio has been indexed.

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@theke.io>
2015-10-09 14:25:58 -03:00
Jonathan Druart
ca00f0ddae Bug 13805: (Plack) Disable syspref cache
When going to the installer (without the DB structure), you have to log
twice before starting the installation.

Test plan:
0/ Create a new database and fill the database entry in the koha conf
with its name
1/ Go on the mainpage, you should be redirected to the installer
2/ Try to log in
Without this patch, you will get the login form again.
With this patch, you can start the installation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-09 14:22:00 -03:00
Amit Gupta
4fa33e055c Bug 14840: Added new cron script send membership expiry reminder notices in crontab.example file
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Added koha-common.cron.daily.
Note that the cronjob only does something when the pref is set now.
See corresponding change on bug 6810.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:21:18 -03:00
507f84f233 Bug 6810: [QA Follow-up] Exit cronjob if pref not set
As per suggestion of Robin on report 14840, it would be better to always
run the cronjob and only do something when the pref is set.
This patch adds a test in the cronjob and clears the former default of 14
days.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Removed the pref and ran the dbrev again: Fine.
Run the cronjob with -c -v -n: Prints exit warning.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:58 -03:00
c69203d0ad Bug 6810: [QA Follow-up] Some minor tidying up of cron script
Moved some POD lines and removed some duplicated POD lines.
Corrected some indentation.
Did some minor spelling changes, rewording.
Removed the C4::Dates module. No longer needed.
Removed a label in front of the for statement.
Removed the Do you wish to continue-code. Should not be in a cron job.

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:58 -03:00
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