Commit graph

1942 commits

Author SHA1 Message Date
317c377a32 Bug 17645 - Remove obsolete interface customization images
This patch removes three files which are obsolete following the removal
of the OPAC prog template.

To test, apply the patch and confirm that these files no longer exist in
misc/interface_customization:

- koha3-opac-button-background.png
- koha3-opac-button-background.psd
- koha3-opac-button-background.svg

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 14:16:08 +00:00
f4bd05d00d Bug 17567: Make populate_db.pl initialize ES mappings
To test:
- Have a clean install, no DB
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> FAIL: No mappings
- Delete the DB and create an empty one:
  $ mysql -uroot
  > DROP DATABASE koha_kohadev; CREATE DATABASE koha_kohadev;
  > GRANT ALL PRIVILEGES ON koha_kohadev.* TO
  'koha_kohadev'@'localhost';
- Run populate_db.pl:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ misc/devel/populate_db.pl
- Go to
  http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
=> SUCCESS: There are mappings!
- Sign off :-D

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-12 02:39:35 +00:00
8630e83ed1 Bug 17420 - record export fails when itemtype on biblio - followup
Same as previous patch for misc/export_records.pl.

Test plan :
- Use syspref item-level_itypes = biblio record
- Run misc/export_records.pl
=> Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ...
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Export Ok, no errors.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-12 02:32:41 +00:00
4a85117160 Bug 17544 - : Remove t::lib::Mocks dependency from populate_db.pl
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-04 11:09:34 +00:00
Chris Cormack
f9da6f9739 Bug 17459: Follow up
Adding POD and --userid and --password options

1/ To test, use the same routine as before, with no options.
2/ You should have a user with koha/koha as userid and passwords
3/ Delete that user
4/ Run the script with --userid <userid> --password <password>
5/ You should have a user in koha with userid/password set

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 16:55:44 +00:00
a462d46b02 Bug 17459: Add a script to create a superlibrarian user
This is for developers: it's quite long (many clics) to create a new
superlibrarian user.
This new script creates a new user with superlibrarian permissions with
the easy to remember credential koha/koha

Test plan:
  perl misc/devel/create_superlibrarian.pl
Log in to Koha using koha/koha

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 16:55:44 +00:00
dbab260afc Bug 16935 - launch export_records.pl with deleted_barcodes param fails
When launching misc/export_records.pl with this command line :

 misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc

You get this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at misc/export_records.pl line 189.

This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.

Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:44:58 +00:00
bfcc7cad70 Bug 17376 - rebuild_zebra.pl in daemon mode no database access kills the process
When running rebuild_zebra.pl in daemon mode, a while loop runs the script for ever.
But if something crashes inside the rebuild process, the all daemon crashes.
For example when it can not access database.
This problem may be temporary so daemon should keep running.

This patch add eval around the rebuild process to allow a run to fail without killing the daemon.
Also moves the DB handler get inside daemon loop because it is broken is DB stoppes.

This is a big issue for indexer running in a systemd service.

Test plan :
- run rebuild_zebra.pl in daemon mode :
/home/koha/src/misc/migration_tools/rebuild_zebra.pl -daemon -z -a -b -x --sleep 30
- stop the database
- wait a minute
=> you see an error on database connexion
=> the daemon is still running
- restart the database
- test the indexer by creating a new record (wait for a minute)

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:28:37 +00:00
947ab63bb7 Bug 17444: Enable exporting by time, not only date
Test plan:
1) Apply the patch
2) Edit a biblio
3) run export_records.pl with date time few minutes in the past
for example: --format=xml --record-type=bibs --date="2016-10-14 10:00:05" --filename="koha.xml"
4) look in the file and cofirm that the right record was exported
5) Try the same but with time after the biblio was edited, it shouldn't be exported

Signed-off-by: radiuscz <radek.siman@centrum.cz>

Bug 17444: Follow-up, don't change the name of parameter "date"

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 17:12:34 +00:00
c4a923bdf7 Bug 16907: Koha::Patrons - Move HandleDelBorrower to ->delete
This job should be done each time patron data are deleted. It's better
to do it just before deleting the patron than assuming the caller did
the job by itself.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 16:20:41 +00:00
26c034d1f5 Bug 16907: Koha::Patrons - Move DelMember to ->delete
This patch moves the C4::Members::DelMember subroutine to the
Koha::Patron module.
The delete method must be overwritten to permit handling of patron's
holds.

Test plan:
(With the 2 patches applied)
1/ Create a patron with holds and owner of lists
2/ Delete patrons using the web interface:
 - More > Delete on a patron page
 - Batch patron deletion tools
3/ and the cronjob script
 - perl misc/cronjobs/delete_patrons.pl -c [more options]

The patron should have been moved to the deletedborrowers table, his/her
holds and lists should have been deleted.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 16:20:41 +00:00
20c44f0051 Bug 16891: Move C4::Members::MoveMemberToDeleted to Koha::Patron->move_to_deleted
This patch removes the C4::Members::MoveMemberToDeleted subroutine in
order to replace it with the Koha::Patron->move_to_deleted method.
Next after this change, we will move C4::Members::HandleDelBorrower and
C4::Members::DelMember to the same module to simplify the code in
members/deletemem.pl and misc/cronjobs/delete_patrons.pl

Test plan:
1/ Delete a patron from the staff interface and make sure (s)he has been moved to
the deletedborrowers table.
2/ Use the "Batch patron deletion" tool (tools/cleanborrowers.pl) to
remove patron. Make sure the "Permanently delete these patrons" and "Move
these patrons to the trash" options work as before
3/ Same as previously but using the cronjob
misc/cronjobs/delete_patrons.pl.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested the delete_patrons.pl script and cleanborrowers.pl too.
Tests (are relevant and) pass and the qa scripts are happy too :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2016-10-21 16:20:27 +00:00
47b6f454ab Bug 10455 (QA Followup)
Fix record matching in misc/cronjobs/delete_records_via_leader.pl

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:35:02 +00:00
706f472642 Bug 10455: Remove MARC21_utf8_flag_fix.pl
Is this script still in use?
It uses the biblioitems.marc field so if it's still useful it will need
to be rewritten.

Signed-off-by: Mason James <mtj@kohaaloha.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:35:01 +00:00
bee79b014b Bug 10455: Remove biblioitems.marc - update delete_records_via_leader.pl
Recently added, delete_records_via_leader.pl reads biblioitems.marc as a
text field and search for record to delete regarding the leader 5.
This can be acchieve doing the same thing on biblioitems.marcxml (will
certainly be slower) waiting for a patch on bug 15537.

Test plan:
Confirm that this script works as before, to do so the easiest way would
be to dump your DB before executing the update DB entry, execute the
script to delete records, reinsert the DB, execute the udpate DB entry
(remove biblioitems.marc), execute the script to delete records.
You should get the same number of records deleted.

Signed-off-by: Mason James <mtj@kohaaloha.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:34:58 +00:00
236a8c3ebb Bug 10455: Remove biblioitems.marc - rm MARC21_parse_test.pl
This script seems to be unused and it won't be of any usefulness after
the removal of biblioitems.marc

Signed-off-by: Mason James <mtj@kohaaloha.com>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:34:58 +00:00
31cb200e0d Bug 10337: (followup) Upper case MARC flavour
This patch makes the populate_db.pl script upper case what gets passed
with the --marcflavour option switch. This is needed in order for this
to fit ``kohadevbox`` configuration files, and it is harmless for other
uses.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:08:07 +00:00
fab0bc9764 Bug 10337: (QA followup) Allow choosing MARC flavour
This patch enables the --marcflavour option switch so the user
can specify the desired marc flavour. The code for handling it
was already in place, just not used.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:08:06 +00:00
3635e8f826 Bug 10337: Add a script to populate devs' DBs with sample data
Executing the installer process and inserting all the sample data take a
lot of clics and time.
The idea of this script is to provide a quick way to insert all the
sample data easily to get a working Koha install asap.

Test plan:
- Set your database config to a non-existent DB
- Execute perl misc/devel/populate_db.pl
You will get an error
- Create an empty DB
- Execute perl misc/devel/populate_db.pl
It will insert all the MARC21 sample data
- Execute perl misc/devel/populate_db.pl
You will get an error because the DB is not empty (systempreferences and
borrowers tables)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-21 14:08:06 +00:00
Jesse Weaver
1e6df24d6c Bug 16520: Allow per-VirtualHost environment variables with Plack
This allows OVERRIDE_SYSPREF_* and others to work properly.

Test plan:

  1) Add the following line to your plack.psgi (near the bottom, just
     above "mount ..."):
       enable "+Koha::Middleware::Plack";
  2) Load the OPAC advanced search page (under Plack). The title should
    read "Koha online catalog" (or whatever your LibraryName syspref
    contains).
  3) Add the following to your Apache configuration:
       RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Potato\, Potato"
  4) Restart Apache.
  5) Refresh. The title should now read "Potato, Potato online catalog".

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-10-11 12:49:42 +00:00
a8376f99d9 Bug 17432: Remove minification
The swagger specification file is currently being minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec, so it can be copy&pasted into validation tools

Test Plan
1) Apply patch
2) Ensure api routes still function (applying the /cities patch might be
    helpful)
3) Ensure /api/v1/spec page exists (it should be the de-referenced
    swagger.json file)

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 06:57:38 +00:00
df3df9cf71 Bug 17372: Standardize Elasticsearch paths
What we currently have:
Koha/ElasticSearch.pm
Koha/ElasticSearch/Indexer.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchEngine/Elasticsearch/Search.pm

What we want:
Koha/SearchEngine/Elasticsearch.pm
Koha/SearchEngine/Elasticsearch/Indexer.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchEngine/Elasticsearch/Search.pm

Test plan:
  % git grep -i Koha::ElasticSearch
  % git grep ElasticSearch|grep -v Catmandu::Store::ElasticSearch
should not return any result

Do a full reindex and search for records

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

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

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-10-11 01:07:03 +00:00
cf90317112 Bug 14435: Add the ability to store result's report
At one time it was possible to store the results of a report into the
saved_reports table.
This allowed the librarians to compare different results, from the Koha
interface.

This patch is a proof of concept and is not very polished (understood:
it cannot be pushed like that).

Test plan:
Execute the runreport.pl cronjob script with the new --store-results
option.
This will serialize into json the results and put it into the
saved_reports table.

On the "Saved report" list, the "Saved results" column is now populated
with a date (note that you can have several date for a given report).
If you click on this link, the data will be displayed in a simple table.

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

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-25 15:24:02 +00:00
9e22a9ced3 Bug 2389: (followup) Add documentation and fix use case
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-24 16:27:11 +00:00
71454b4263 Bug 2389: Add --test switch to overdue_notices.pl
This patch adds the --test option switch to the overdue_notices.pl script
so it can be ran without doing any actual action.

To test:
- Have a patron with overdue items (simulate a checkout for a past date. Note it implies
  that the circ rules are defined so the patron is overdue)
- Run:
  $ sudo koha-shell kohadev
  koha-dev$ misc/cronjobs/overdue_notices.pl --test
=> SUCCESS: The script is ran but the patron isn't debarred and no notice messages are queued.

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

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

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-24 16:27:10 +00:00
8a7a7a0344 Bug 17135: [QA Follow-up] Change location of new script to fix fines
The location of the script in misc/maintenance would be fine for
running it from the command line. But it will be a problem for several
install types when running it from the web installer.
Files from misc/maintenance go to bin/maintenance in a package install,
not to mention other installs than a dev install.

This patch moves the script to installer/data/mysql. Already there are two
other scripts run by upgradedatabase. I would rather move these three
scripts somewhere else, but we c/should do that on another report.

Fixed a small typo in a message too.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-16 10:47:03 +00:00
Jacek Ablewicz
4ddc863534 Bug 17135 - Some minor changes & fixes in the script
- all non-fatal output redirected to STDOUT (as there is an intention
to run this script from updatedatabase.pl)

- added borrowernumber and itemnumber equality checks to the SELECT
statement in getFinesForChecking() - accountlines.issue_id alone is not
entirely trustworthy (because InnoDB forgets it's highest auto_increment
after server restart), in some rare cases it may point to some random
issue for different patron and different item

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-16 10:47:03 +00:00
Jacek Ablewicz
812379bbc2 Bug 17135 - Fine for the previous overdue may get overwritten by the next one
External maintenace script for fixing unclosed (FU), non accruing fine
records which may still need FU -> F correction post-Bug 15675.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-16 10:47:02 +00:00
93ff61c10d Bug 16276: Make delete_patrons.pl deal with --last_seen
This patch modify the delete_patrons.pl cronjob to deal with the
last_seen option.

To test it, you just have to use the --last_seen option and pass a valid
date (iso format)

Example:
  perl misc/cronjobs/delete_patrons.pl --last_seen="1984-02-04" --confirm
will delete all the patrons who do not have been active since this date.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

https://bugs.koha-community.org/show_bug.cgi?id=12276

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-13 17:27:41 +00:00
6d8869e3b0 Bug 17197: Remove misc/batchupdateISBNs.pl
This script has not been updated for ages and is UNIMARC specific.
Since I am working on bug 17196 to move marcxml out of biblioitems
table, I'd like not to rewrite unused scripts (and lost my time...)
So if someone complains later, I will rewrite it on top of bug 17196.

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

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-12 09:48:53 +00:00
c840c93835 Bug 15758: Koha::Libraries - Ultimate duel for C4::Branch
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 14:36:04 +00:00
6ee8dd3a59 Bug 15407: Koha::Patron::Categories - replace C4::Category->all
The C4::Category module contained only 1 method to return the patron
categories available for the logged in user.
The new method Koha::Patron::Categories->search_limited does exactly the
same thing (see tests) and must be used in place of it.

Test plan:
- Same prerequisite as before
For the following pages, you should not see patron categories limited to
other libraries.
- On the 'Item circulation alerts' admin page
  (admin/item_circulation_alerts.pl), modify the settings for check-in
  and checkout (NOTE: Should not we display all patron categories on
  this page? If yes, it must be done in another bug report to ease
  backporting it).
- Search for patrons in the admin (budget) and acquisition (order) module.
- On the patron home page (search form in the header)

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 13:29:03 +00:00
9d1dbb96cb Bug 17189: Add the ability to define several memcached namespaces - Koha::Caches
We need to define several namespaces for our cache system.
For instance sysprefs, koha conf (koha-conf.xml) and unit tests
should be defined in a separate namespace.
This will permit to
- launch the tests without interfering with other cache values
- and flush the sysprefs cache without flushing all other values

To do so, we need to store different Koha::Cache objects at a package
level. That's why this patch adds a new Koha::Caches module.

FIXME: There is an architecture problem here: the L1 cache should be
defined in Koha::Cache

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

https://bugs.koha-community.org/show_bug.cgi?id=11921

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-09-08 10:24:46 +00:00
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