Commit graph

2393 commits

Author SHA1 Message Date
991f51b272
Bug 24397: Remove out of sync script populate_db.pl
populate_db.pl from koha-misc4dev must be used instead.
This script existed before the creation of koha-misc4dev, it does no
longer make sense to have it in Koha.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-23 09:07:52 +00:00
4e8ecf0d3d
Bug 21466: Catch any values that should be defined in the AV but are not
Let's expand the idea of the first patch to catch the wrong values for
any others AV.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-13 13:57:52 +00:00
e48d396002
Bug 21466: Search for items.location inconsistencies
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-13 13:57:42 +00:00
263c013121
Bug 23377: (QA follow-up) Use OVERRIDE_SYSPREF
SYSPREF_OVERRIDE unfortunately is not supported ;)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-10 10:56:41 +00:00
Ian Walls
f036038318
Bug 23377: use ENV syspref override instead of complete disable
In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog
and AuthoritiesLog to 0.  It does this by disabling syspref caching and saving
the changes to the database (then replacing the original values at completion).

Unfortunately, this disables other key sysprefs from being cached, and results in
a 50% increase in processing time for the script.

This patch instead utilizes the ENV variable override feature of sysprefs, which
preempts the cache in C4::Context->preference().

To test:
1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do)
2. Note the time taken to complete
3. Apply patch
4. Revert the biblio load performed
5. Perform another bulkmarcimport with the same biblios and commandline options
6. Note the time taken to complete
7. Compare times.  The time from step 6 should be about 33% less than the time from step 2
8. Check Cataloguing and Authorities Logs to verify imported records were not logged
9. Profit!

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-10 10:56:32 +00:00
c121a53dd7
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)
If elastic is used as search engine, the bulkmarcimport.pl will not
handle correctly UTF-8 encoded MARCXML

Koha::SearchEngine::Search->new uses a require statement to load the correct Search module.
This is done l.257 of bulkmarcimport.pl:
  257 my $searcher = Koha::SearchEngine::Search->new

Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before:
  216     $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8';

  220     $MARC::File::XML::_load_args{RecordFormat} = $recordformat;

An easy (but dirty) fix could be to move the declaration of my $searcher before in the script.
The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment.

This patch is the easy, and dirty, fix

Test plan:
Use the command line tool to import MARXCML records that contains unicode characters into Koha

Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML`

Without this patch you will notice that unicode characters will not be displayed correctly

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-10 08:27:47 +00:00
2aedb2dfa6
Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script
I am not sure what happened here, but adding strict for TmplTokenizer.pm
breaks a test for translation.

It has been caught by a failing test:
 % prove xt/author/translatable-templates.t
will display lines "invalid multibyte sequence"

I did a diff between the generated files and found:
< msgid "Ã rbok"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-07 15:07:31 +00:00
dc5fe323d2
Bug 24217: use Modern::Perl for modules when strict is missing
We absolutely need that for modules.
We are enabling strict by using Modern::Perl.
Note that other modules from C4 use strict and warnings, instead of
Modern::Perl

Test plan: git grep 2505 **/*.pm should not return any results

And let's see later what needs to be fixed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-03 10:45:46 +00:00
Bernardo Gonzalez Kriegel
6e3e8fef6a
Bug 18688: Warnings about UTF-8 charset when creating a new language
This patch removes some warnings when creating new languages,
those related with uft8 and two not related.

Tipical messages are:
>Warning: Can't determine original templates' charset, defaulting to UTF-8
>Warning: Charset Out defaulting to UTF-8
>...
>Removing empty file /../xx-YY-marc-NORMARC.po
>I UTF-8 O UTF-8 at /../kohaclone/misc/translator/tmpl_process3.pl line 365.
>Use of uninitialized value $pref_name in concatenation (.) or string at /.../misc/translator/LangInstaller.pm line 197.
>Created /../misc/translator/po/xx-YY-messages.po.

First four are 'normal' messages
The fifth one correspond to an unquoted preference string
The sixth one is a normal output message from msgint command
We will hide them unless verbose '-v' option is selected,
and fix the error.

To test:
1) Go to misc/translator
2) Create new language files
  $ perl translate create xx-YY
3) Check warnings and messages
4) Apply the patch
5) Remove created files, and create them again
   Ther must be no messages
6) Repeat 5) with verbose option '-v', check
   old messages

7) BONUS: without the patch update a language,
   for example de-DE:
   $ perl translate update de-DE
   Note (git status) a new file, po/de-DE-messages.po~
   This is a backup file from msgmerge command
   With the patch this backup is removed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-12-23 12:02:15 +00:00
a72417f04f
Bug 24268: Break assignment and warn into separate actions
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-12-20 12:06:00 +00:00
Radek Šiman
f497008d7f
Bug 24235: DUEDGST not sent if PREDUDGST checkbox is off
DUEDGST notice required PREDUEDGST to be on, but both messages have to
be generated independently

Test plan:
0) Do not apply the patch and reproduce the bug
    - turn OFF sms PREDUEDGST and turn ON sms DUEDGST for a given borrower
    - Sms version of DUEDGST is never generated into the message queue.
1) Apply the patch
2) Ensure that the bug is fixed

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-12-16 21:01:08 +00:00
0553463d04
Update release notes for 19.11.00 release
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-28 18:25:06 +00:00
2135352417
Translation Fixes
Correct some fatal errors in the translation files

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-27 15:54:31 +00:00
Koha translators
d5a386db8e
Translation updates for Koha 19.11.00
(cherry picked from commit bc938166712f17d731a1f190628c27593a082419)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-27 15:54:31 +00:00
Bernardo Gonzalez Kriegel
7657163d8f
Bug 23452: Multiple select options in system preferences are not translatable
Translate script ignores multiple options in system preferences,
this patch fix that.

To test:
1) Apply the patch
2) Go to misc/translator
cd misc/translator
3) Update your preferred language
perl translate update xx-YY
4) Updated pref file must contain new strings, eg.
egrep "when cataloguing an item" po/xx-YY-pref.po
5) Edit & translate that string
6) Install the updated translation
perl translate install xx-YY
7) Check that the translated pref file has
a) multiple options present
b) the message from 5) is translated
see for example circulation.pref
en: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
xx: koha-tmpl/intranet-tmpl/prog/xx-YY/modules/admin/preferences/circulation.pref

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-26 11:45:41 +00:00
Magnus Enger
1f3a9722e4
Bug 24072: Typos in advance_notices.pl causes DUEDGST not to be sent
There are two typos in advance_notics.pl that cause DUEDGST messages
not to be sent. See Bugzilla for full details.

If you think the typo is sufficiently obvious, you can just eyeball the
patch and sign off, methinks. Otherwise, testing can be done something
like this:
- Make sure you have enabled enhanced messaging preferences, and a
  patron with "Email" and "Digests only" set for "Item due" messages
- Issue an item to this patron, with due date today
- Run something like this to generate advance notices:
  $ sudo koha-shell -c "perl \
  /home/vagrant/kohaclone/misc/cronjobs/advance_notices.pl -n -c" kohadev
- See that no notices are shown (-n means messages will go to stdout,
  instead of into the message queue).
- Apply the patch and run advance_notices.pl again, as before. A DUEDGST
  message should now be displayed.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-25 08:44:27 +00:00
Magnus Enger
5df9c63eea
Bug 24064: DUEDGST typoed as DUEGST
Bug 20478 introduced a typo where the letter code DUEDGST was changed
to DUEGST. This patch fixes it.

To test:
- Run "grep -r DUEDGST *" on the Koha git repo. Notice that this letter
  code is used in e.g. sample notices.
- Run "grep -r DUEGST *" and notice that this code only occurs twice,
  in misc/cronjobs/advance_notices.pl.
- Aply this patch.
- Run "grep -r DUEGST *" again, and notice there are no more occurences
  of this typo.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-19 15:16:58 +00:00
cce358f9af
Bug 23846: Handle exception gracefully at the OPAC
I do not think we should have the same trick as the intranet, and
display a message. This should be enough.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 08:04:23 +00:00
1e1c5d17a2
Bug 23846: Add a check to the data inconsistencies script
This may be quite long for big catalogue, but I think it is a good one
to have.

Test plan:
Same as first patch, then execute search_for_data_inconsistencies.pl
Notice the error.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-11-13 08:04:20 +00:00
a6117a187d
Bug 23903: Replace OPAC icons with Font Awesome
This patch replaces CSS-based background image icons with Font Awesome
icons. This will eliminate the use of sprite.png altogether.

To test, apply the patch and regenerate the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Because JavaScript events are often triggered by class, the changes made
in this patch require testing of JavaScript-driven behavior as well as
visual confirmation of the changes.

Enable OPAC features to expose them for testing: Login, Holds, Article
requests, Tags, Cart, Search term highlighting.

 - Perform a search in the OPAC
   - In the header at the top of the search results, check the
     'Unhighlight/Highlight' link.
   - Select some search results and verify that the multi-item controls
     are enabled: Add to cart/Lists; Place hold; Tag. Check that these
     controls work correctly.
   - Verify that the following links look correct and work correctly:
     'Place hold,' 'Request article,' 'Log in to add tags,' 'Add to
     cart.'
   - Log in to the OPAC and return to the search results page. Check the
     'Add tag' and 'Save to lists' links.

 - View the lists page
   - Test the 'Edit' and 'Delete' controls.
   - View the contents of a list. Test the following:
      - Controls at the top of the table of results ('New list,'
        'Download list,' 'Send list,' 'Print list,' 'Edit list,' and
        'Delete list').
      - Multi-selection operations: 'Place hold,' 'Tag,' and 'Remove
        from list.'
      - Controls for each item on the list: 'Place hold,' 'Add tag,'
        'Save to another list,' 'Remove from this list,' and 'Add to
        cart.'

   - View the bibliographic detail page for any search result
     - In the right-hand sidebar menu, verify that these controls look
       correct and work correctly: 'Place hold,' 'Print,' 'Request
       article,' 'Save to your lists,' 'Add to your cart,'
      'Unhighlight,' 'Send to device,' 'Save record,' and 'More
      searches.'
     - Test the shelf browser by clicking 'Browse shelf' under the call
       number for any of the holdings.
       - Test the 'Next' and 'Previous' controls.
     - Check the tabs for switching between 'Normal,' 'MARC,' and 'ISBD'
       views and verify that they look correct on each of those pages.

 - Add some items to the Cart and open the Cart
   - Test the cart controls at the top: 'More details/Brief display,'
     'Send,' 'Download,' 'Empty and close,' 'Hide window,' 'Print.'
   - Test the multiple-selection controls: 'Remove,' 'Add to list,'
     'Place hold,' and 'Tag.'

 - Log in to the OPAC as a user who has items checked out which can be
   renewed. On the 'Your summary' page, on the 'Checked out' tab, test
   the 'Renew selected' and 'Renew all' links.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 15:40:25 +00:00
Andrew Isherwood
780f79ae1a
Bug 15260: Modify next/prev_open_day
We require next_open_day & prev_open_day to be more flexible. We could
create a separate sub, but that's not very DRY given that they'll do
pretty much the same thing.

So next_open_day becomes next_open_days and prev_open_day becomes
prev_open_days and both functions accept an additional parameter which
determines how many days they add or subtract.

All calls of these two functions have been modified accordingly.

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-31 11:52:26 +00:00
fe5c65c5cd
Bug 22826: Allow indexing of individual authorities in Elasticsearch
To test:
1 - perl misc/search_tools/rebuild_elastic_search.pl -h
2 - Note it indicates the bn option can be passed to index individual authids
3 - perl misc/search_tools/rebuild_elastic_search.pl -a -bn 92 -v
4 - Note the error
5 - Apply patch
6 - perl misc/search_tools/rebuild_elastic_search.pl -h
7 - Note new option ai|authid for indexing individual authids
8 - Note updated text for bn|biblionumber option
9 - perl misc/search_tools/rebuild_elastic_search.pl -a -bn 92 -v
10 - No errors, but no records indexed
11 - perl misc/search_tools/rebuild_elastic_search.pl -a -ai 92 -v
12 - 1 record indexed
13 - perl misc/search_tools/rebuild_elastic_search.pl -ai 92 -bn 92 -v
14 - 1 authority record and 1 biblio record indexed

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-28 12:45:28 +00:00
c1fe8d1206
Bug 17168: (follow-up) QA concerns and rebase issues
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:22 +01:00
3cc10b7e97
Bug 17168: Remove j2a.pl
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:18 +01:00
006107c429
Bug 17168: Add Koha:Script -cron, remove Dumper
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:14 +01:00
436ad74399
Bug 17168: (follow-up) Address QA concerns and update for strict mode
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:07 +01:00
424df02e23
Bug 17168: (follow-up) Clean up QA errors
Cleanup variable names
Remove Dumper

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:20:00 +01:00
c7226ad5ea
Bug 17168: (follow-up) Tidy, clean params/options, use date tools
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:19:54 +01:00
af15cbbe1b
Bug 17168: Add a command line script for updating patron category based on status
This patch adds a new script update_patrons_category.pl which allows for
updating patron categories in a batch upon meeting provided criteria.
This script additionally can replace j2a.pl.

To test:
1 - perl update_patrons_category.pl -h
2 - Ensure help text makes sense and covers all options
3 - Test converting patrons supplying only fromcat and tocat
    perl update_patrons_category.pl -f PT -t J -v --confirm
    perl update_patrons_category.pl -f J -t PT -v --confirm
4 - All patrons should have been switched to and from Juveniles
5 - Try without --confirm switch
    perl update_patrons_category.pl -f PT -t J -v
6 - Should list all patrons but not update
7 - Set the age for juvenile patrons to be outside the range provided in
categories (or set the upper age limit for juveniles to '2')
8 - Test with verbosity and with without --confirm
    perl update_patrons_category.pl -f J -a -t PT -v
    perl update_patrons_category.pl -f J -a -t PT -v --confirm
9 - Repeat above and verify linked/unlinked guarantors are removed in above scenario
10 - Test various fine and registration limits
11 - Test matching on specific fields i.e. --field surname=acosta
12 - Sign off

Sponsored by: Round Rock Public Library
(https://www.roundrocktexas.gov/departments/library/)
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-25 13:19:47 +01:00
d661141890
Bug 23049: Update existing code to use debit_type
* Update C4::Accounts::chargelostitem
* Update C4::Accounts::manualinvoice
* Update C4::Circulation::_FixOverduesOnReturn
* Update C4::Circulation::_FixAccountForLostAndReturned
* Update C4::Overdues::UpdateFine
* Update C4::Overdues::GetFine
* Update C4::Overdues::GetOverduesForBranch
* Update Koha::Account->pay
* Update Koha::Account->add_debit
* Update Koha::Account->non_issues_charges
* Update Koha::Account::Line->apply
* Update Koha::Account::Line->adjust
* Update controller scripts
* Update reports scripts
* Update tests

Test Plan
1) Run the test suit and ensure everything still passes
2) Test reports/cash_register_stats still works
3) Test that adding manual invoices still works
4) Test that making payments still works
5) Test that lost item fee handling still works
6) Test that invoice printing still works
7) Test that the sco still works

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:24:15 +01:00
72e10519e3
Bug 23049: Add debit_type
* Add account_debit_types table
* Add ac_debit_types_branches table
* Add account_debit_types defaults
* Add Koha::Account::DebitType and Koha::Account::DebitTypes
* Prevent deletion of defaults
* Migrate MANUAL_INV values
* Remove MANUAL_INV references
* Migrate accounttype values

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-24 17:23:48 +01:00
Julian Maurice
82e6052b5d
Bug 20434: Add default authority type
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:47 +01:00
Julian Maurice
5e0c2164d6
Bug 20434: Add missing fields
018 - [Reserved for other International Standard Numbers]
033 - Other System Persistent Record Identifier
183 - Coded Data Field: Type of Carrier
203 - Content Form and Media Type
231 - Digital File Characteristics
283 - Carrier Type
338 - Funding Information Note

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:43 +01:00
Julian Maurice
422bcea5b2
Bug 20434: Add missing authority types
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:40 +01:00
Julian Maurice
109d527ccd
Bug 20434: Add UNIMARC field 214 and its subfields
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:37 +01:00
Julian Maurice
9e76fe8ee5
Bug 20434: Update UNIMARC framework - script
Test plan:
1. Take a look at files in misc/migration_tools/ifla/data. It
   contains all data that will be inserted into Koha. Its content is
   based on the previous patches.
2. Run the script misc/migration_tools/ifla/update.pl and verify
   that it effectively added the new fields, subfields, authorised
   values and authority types.
3. Run the script again and see that it doesn't update existing fields
4. Run with --force and verify that it update existing fields (you can
   modify unimarc_ifla.yml to see changes)
5. Run with --force --po-file misc/migration_tools/ifla/language/fr.po
   and verify that the labels are now in french

There is a POT file in misc/migration_tools/ifla/language/template.pot,
use it to create PO files for other languages.

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:33 +01:00
Julian Maurice
affbf289da
Bug 20434: Update UNIMARC framework - translations
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:30 +01:00
Julian Maurice
185d9f36f3
Bug 20434: Update UNIMARC framework - auth (WORK)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:27 +01:00
Julian Maurice
12cd02f9b2
Bug 20434: Update UNIMARC framework - auth (TU)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:23 +01:00
Julian Maurice
2119cb5f4f
Bug 20434: Update UNIMARC framework - auth (TM)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:20 +01:00
Julian Maurice
b3f17ffdb4
Bug 20434: Update UNIMARC framework - auth (SNG)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:17 +01:00
Julian Maurice
9b7afbde43
Bug 20434: Update UNIMARC framework - auth (SNC)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:13 +01:00
Julian Maurice
a92c417883
Bug 20434: Update UNIMARC framework - auth (SAUTTIT)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:08 +01:00
Julian Maurice
45187cea0d
Bug 20434: Update UNIMARC framework - auth (PUB)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:02:01 +01:00
Julian Maurice
aa5588adda
Bug 20434: Update UNIMARC framework - auth (PERS)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:57 +01:00
Julian Maurice
ed089d5f98
Bug 20434: Update UNIMARC framework - auth (PA)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:54 +01:00
Julian Maurice
dc1c3dca78
Bug 20434: Update UNIMARC framework - auth (NTWORK)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:51 +01:00
Julian Maurice
ca9904a28a
Bug 20434: Update UNIMARC framework - auth (NTEXP)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:48 +01:00
Julian Maurice
9b04c3dbac
Bug 20434: Update UNIMARC framework - auth (NP)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:45 +01:00
Julian Maurice
d076873390
Bug 20434: Update UNIMARC framework - auth (GENRE/FORM)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:42 +01:00
Julian Maurice
f7738abbf4
Bug 20434: Update UNIMARC framework - auth (FAM)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:39 +01:00
Julian Maurice
43cf2dfb68
Bug 20434: Update UNIMARC framework - auth (EXP)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:36 +01:00
Julian Maurice
7bbb7386b5
Bug 20434: Update UNIMARC framework - auth (CO)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:33 +01:00
Julian Maurice
4c5055fddd
Bug 20434: Update UNIMARC framework - auth (CLASS)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:30 +01:00
Julian Maurice
9a5722224a
Bug 20434: Update UNIMARC framework - auth (default)
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:27 +01:00
Julian Maurice
b2566b9799
Bug 20434: Update UNIMARC framework - authtypes
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:24 +01:00
Julian Maurice
1c98871d27
Bug 20434: Update UNIMARC framework - biblio
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:20 +01:00
Julian Maurice
e75da5b00a
Bug 20434: Update UNIMARC framework - authorised values
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:16 +01:00
Julian Maurice
1ea8ef809f
Bug 20434: Update UNIMARC framework - defaults
Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-17 15:01:10 +01:00
Ere Maijala
5af4cc2e65
Bug 13937: Add support for Z39.50 responder to the Debian scripts
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:40:07 +01:00
Ere Maijala
ac28d8043d
Bug 13937: Add support for SRU and Elasticsearch
Splits Session to GenericSession and ZebraSession where Generic supports any
search backend via the SearchEngine classes and Zebra maintains the direct
channel to the Zebra server.

Adds config files required for mapping BIB-1 attributes to Koha search fields
and SRU indexes to BIB-1 attributes.

Adds PODs.

Sponsored-by: National Library of Finland
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:53 +01:00
Ere Maijala
925db0baef
Bug 13937: Fix issues found in QA
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:50 +01:00
c4e5d079bf
Bug 13937: (follow-up) Pass through yaz switches and don't ignore case
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:47 +01:00
Jesse Weaver
f089d393dc
Bug 13937: Add a Z39.50 daemon that can inject item status MARC subfields
This creates a new daemon, misc/z3950_responder.pl, which can respond to
Z39.50 requests. By default, it just proxies searches to Zebra.

If desired, however, it can also add a subfield to the item tags on
outgoing records with a textual description of the item's status
(checked out, lost, etc.). This is useful for certain ILL systems. These
strings can be translated using the 'Z3950_STATUS' authorized value.

Test plan:
  1) Start the Z39.50 server using `perl misc/z3950_responder.pl`.
  2) Connect to the server using `yaz-client 127.0.0.1:9999/biblios`.
  3) Run a search, such as `find @attr 1=1016 book`.
  4) Fetch the results both one at a time with `show 1` and in a batch
     using `show 1+5`.
  5) Turn on MARCXML using `format xml` and `elements marcxml`, and
     verify that the records are still correctly fetched.
  6) Enable the item status subfield by restarting the server with the
     option `--add-item-status=k`.
  7) Search for and fetch records, and verify that a $k subfield is
     added to the item tags as appropriate. It should show some
     combination of "Checked Out", "Lost", "Not For Loan", "Damaged",
     "Withdrawn", "In Transit", or "On Hold" as appropriate, or
     "Available".
  8) Add an authorized value named "Z3950_STATUS" with any of the keys
     "AVAILABLE", "CHECKED_OUT", "LOST", "NOT_FOR_LOAN", "DAMAGED",
     "WITHDRAWN", "IN_TRANSIT" or "ON_HOLD", and verify that their
     descriptions are used instead of the default values above.

Signed-off-by: George Williams <george@nekls.org>
Signed-off-by: Stefan Berndtsson <stefan.berndtsson@ub.gu.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:39:30 +01:00
d66432cafd
Bug 22540: (QA follow-up) fixes
borrowernumber is not an accessor for C4::SIP::ILS::Patron, access is
via hashref

Add ability to specify the pickup location using a command line
parameter

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: frederik chenier <frederik.chenier@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:33:34 +01:00
7d5d9f9d5a
Bug 22540: Add ability to place holds using SIP CLI emulator
Test Plan:
1) Place a hold using the following arguments:
   sip_cli_emulator.pl -a <address> -p <port> -su <sip_user> -sp <sip_password> -l <location_code> --patron <cardnumber> --item <barcode> -m hold
2) Note the hold was placed in Koha

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: frederik chenier <frederik.chenier@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-08 14:33:33 +01:00
Olli-Antti Kivilahti
e26ab5d790
Bug 17851: Add Elasticsearch config to koha-conf.xml - Add missing entries to koha-install-log
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Johanna Raisa <johanna.raisa@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 14:09:10 +01:00
Björn Nylén
a4bee10d0b
Bug 21343: Respect patron language preference in automtic renewals
To test:
1) Set up different automatic renewal notices for Default and one other language
2) Make sure you have checkouts due for auto-renewal to patrons with non-Default language pref
3) Run automatic_renewals.pl . All patrons will get the default-language notice
4) Apply patch.
5) Repeat 2)
6) Run automatic_renewals.pl . Patrons will receive notices according to their language preference.

Sponsored-by: Lund University Library
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-07 12:21:12 +01:00
e2ec92a9e6
Bug 23711: Change icons and remove unused SVG
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-03 10:58:10 +01:00
Martha Fuerst
3cb66af150
Bug 21180: Allow Talking Tech outbound script to limit based on patron home library branchcode
A library system has requested the ability to limit which patrons are sent to Itivia for phone notices.

Test Plan:
1) Enable phone notices for two patrons with overdues
2) Run the misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl with the new --patron-branchcode option
3) Note only the patron whose homebranch you specified is in the output file

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-09-09 11:32:53 +01:00
Agustin Moyano
c8ff1e4701
Bug 14570: (follow-up) fix table name in j2a.pl
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-20 16:05:08 +01:00
109334102f
Bug 14570: Make it possible to add multiple guarantors to a record
This patch adds the ability to set an unlimited number of guarantors
for a given patron. As before, each guarantor may be linked to another
Koha patron, and all the behavior that applies to a given guarantor
remains the same.

Test Plan:
 1) Apply this patch
 2) Run updatedatabase.pl
 3) Find some patrons with guarantors, verify the still have their guarantor
 4) Test adding and removing guarantors on a patron record, both Koha users and not
 5) Verify the "Add child" button works
 6) Verify NoIssuesChargeGuarantees still works
 7) Verify tools/cleanborrowers.pl will not delete a guarantor
 8) Verify the guarantors are displayed on moremember.pl
 9) Verify the guarantor is removed by members/update-child.pl
10) Verify the guarantor is removed by misc/cronjobs/j2a.pl
11) Verify import patrons converts guarantor_id, relationship, contactfirstname,
  and contactsurname into a guarantor
12) prove t/Patron.t
13) prove t/db_dependent/Circulation.t
14) prove t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
15) prove t/db_dependent/Items.t
16) prove t/db_dependent/Koha/Patrons.t
17) prove t/db_dependent/Members.t
18) prove t/db_dependent/Patron/Relationships.t

Signed-off-by: Kim Peine <kmpeine@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-20 16:04:48 +01:00
e66ccaa3a7
Bug 16219: (QA follow-up) Tiny regex change
The parameter <<>> does not work. There should be text inside.
The construction .*? does not look good completely.
Replacing it by the stricter [^>]+ So, no greater than's and at least one.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-13 11:55:17 +01:00
52587b4319
Bug 16219: (follow-up) Nicer message if params missing and note that they are not combined
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-13 11:55:04 +01:00
72197a9574
Bug 16219: Add 'params' parameter to runreport.pl
To test:
 1 - Apply patch
 2 - Write a report that takes no variables
 3 - Run this using runreport.pl
    perl misc/cronjobs/runreport.pl 1
 4 - Confirm results as expected
 5 - Write a report that takes one or more variables
 6 - Run using runreport.pl, but pass no params
 7 - You should get a SQL error
 8 - Now run passing the correct number of params
    perl misc/cronjobs/runreport.pl --param first --param=2nd 2
 9 - Verify results as expected
10 - call runreport with no parameters
    perl misc/cronjobs/runreport.pl
11 - Verify documentation is correct and helpful

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-13 11:54:54 +01:00
Ere Maijala
0e4f36b653
Bug 11529: Simplify and optimize batchRebuildBiblioTables.pl
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-05 15:03:17 +01:00
Bernardo Gonzalez Kriegel
0f5d14f707
Bug 10492: Translation problems with TT directives in po files
This patch implements the replacement of TTvariables
'[%...%]' with normal placeholders '%s' for text
inside HTML tags (eg. img, meta, input)

The replacement is done in two files:
* xgettext.pl, used on create/update, so TTvars are not
found on the text to translate (msgid)
* tmpl_proccess3.pl, used on install time, so the correct
translation is found (msgstr) and the right TTvar is put on
the translated text.

To test:
Before applying the patch
1) Update your favorite language
   cd misc/traslator
   perl translate update xx-YY

2) Build a list (ini.txt) of 'msgid' to do a comparison
   msgcat --no-wrap --use-first po/xx-YY-*po -o - | egrep "^msgid" | sort > ini.txt

3) Apply the patch

4) Update your favorite language, again
   cd misc/traslator
   perl translate update xx-YY

5) Build a final list (end.txt) of 'msgid' to do a comparison
   msgcat --no-wrap --use-first po/xx-YY-*po -o - | egrep "^msgid" | sort > end.txt

6) Compare both files, you must find (most) TTvars replaced by '%s'
   diff ini.txt end.txt

   for example:
   < msgid "Translate item type [% itemtype.itemtype | html %]"
   > msgid "Translate item type %s"

   < msgid "Holds on this item: [% item_loo.item_holds | html %] / Total holds on this record: [% item_loo.holds | html -%]"
   > msgid "Holds on this item: %s / Total holds on this record: %s"

   < msgid "tag_anchor_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"
   > msgid "tag_anchor_%s_%s%s"

   < msgid "[% innerloo.tag_lib | html %] - Click to Expand this Tag"
   > msgid "%s - Click to Expand this Tag"

7) Translate one of the examples, with more than one variable if
possible, for example this text in xx-YY-staff-prog.po
   > msgid "Holds on this item: %s / Total holds on this record: %s"
Check it's not marked as 'fuzzy'

8) Apply the translation
   perl translate install xx-YY

9) Check the translated string has all variables in the right order
   edit koha-tmpl/intranet-tmpl/prog/es-ES/modules/tools/batchMod-edit.tt
   around line '187', first '[% item_loo.item_holds | html %]', then
   '[% item_loo.holds | html -%]' on this case,
   or use another example

If approved this patch can be backported to current stable
versions.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-05 11:32:49 +01:00
68eeefa07e
Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls
Test plan:
Run tests, at least:
    t/db_dependent/Biblio.t
    t/db_dependent/Biblio/TransformHtmlToMarc.t
    t/db_dependent/Charset.t
    t/db_dependent/Circulation/GetTopIssues.t
    t/db_dependent/Filter_MARC_ViewPolicy.t
    t/db_dependent/ImportBatch.t
    t/db_dependent/Items.t
    t/db_dependent/Items/AutomaticItemModificationByAge.t
    t/db_dependent/Items/GetItemsForInventory.t
    t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
    t/db_dependent/Serials.t
    t/db_dependent/XISBN.t
    t/db_dependent/FrameworkPlugin.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-07-15 11:28:08 +01:00
Pasi Kallinen
fc53c88ad4
Bug 20364: Show languages from MARC21 field 041 in intranet
Show the language names coded in field 041, in intranet search
results and in detail view.

Test plan:
1) Apply patch
2) Do a search, and check the results look correct
3) Check some biblio detail pages that they look correct
4) Add some 041 subfields (a, b, d, h, j) in any combinations
5) Repeat 2 and 3

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-07-15 11:28:07 +01:00
d5fd85da18
Bug 23193: Make set_password.pl use Koha::Script
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-28 14:34:13 +01:00
6c773a8917
Bug 23191: (follow-up) Improve output
This patch adds a check of what plugins installed before the script run
and outputs only those plugins that have been installed for the first
time or upgraded during this run.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:19:56 +01:00
6538de6397
Bug 23191: Add commandline script to install plugins
This adds an initial skeliton script to enable plugin installation at
the commandline.

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:19:38 +01:00
35093039df
Bug 22566: (QA follow-up) Fix pod complaint
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:33 +01:00
b3795df801
Bug 22566: Add 'branch' key to GetPreparedLetter
The branch key was missing from the subsitution call to
GetPreparedLetter.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:29 +01:00
4e4f0b637c
Bug 22566: Clarify intent of reports and add warnings
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:25 +01:00
7e226ba3c0
Bug 22566: Rename 'report_email' to 'report_by_branch'
To clarify the intention of this routine, lets rename it

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:21 +01:00
2b392a6db2
Bug 22566: Accept 'all' in the branch params
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:17 +01:00
4f3413f0d2
Bug 22566: Fix some more issues
1) Fix warning for undefined value in sprintf when no items have the
indemand flag set.
2) Corrections to report_full for bad ternary in string construction
3) Perldoc corrections

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:11 +01:00
b62473d192
Bug 22566: Fix some problems
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-25 17:01:01 +01:00
0141b797d7
Bug 22509: (RM follow-up) Add use of Koha::Script base class
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:08:33 +01:00
0b78378370
Bug 22509: Clarify with an example the usage of --unless-exists
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:06:47 +01:00
da12cf7551
Bug 22509: Add more POD and fix --where
We should not need the "WHERE" keyword to have the same behavior as
existing script (rebuild_zebra.pl)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:06:39 +01:00
7f3c98478a
Bug 22509: Fix POD error
1. "Apparent command =item not preceded by blank line"
2. Display the options for help
3. Do not run if no --field passed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:06:34 +01:00
e8a4f97e95
Bug 22509: Add the --unless-exists option to the script
It will avoid to create the fields several times if it is not needed.

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:06:23 +01:00
e54e887b58
Bug 22509: Add new script to add MARC fields with date formatted stringsto bib records
Say you want to add, into a new MARC fields, the following string:
  2/2019/Mar-03/13
Depending on today's date.

Test plan:
Use the script after with the different options (see --help option for the list)

Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-06-24 15:06:02 +01:00
1b5635bebd Update release notes for the 19.05.00 release
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-30 15:29:07 +00:00
Koha translators
7142895922 Translation updates for Koha 19.05.00
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-30 10:28:33 -03:00
Hayley Mapley
7d42e29c8b Bug 20537: Added checks to remove warning from overdue_notices.pl
When executing overdue_notices.pl on borrowers that lack a surname, we
see this error:
Use of uninitialized value in concatenation (.) or string at
/usr/share/koha/bin/cronjobs/overdue_notices.pl line 575.

This patch fixes this issue by setting the $borr variable
based on the information that has been defined.

To test:
1) Create a borrower and set its surname to null
2) Checkout an item to the borrower and set it to be overdue
3) Navigate to kohaclone/misc/cronjobs and enter a koha-shell
4) Run the script: ./overdue_notices.pl
5) Observe the error appears
6) Apply the patch
7) Repeat steps 3-4
8) Observe the error is gone
9) Sign off!

Sponsored-by: Catalyst IT

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-30 10:20:12 +00:00
e9aa9b84fc Bug 20436: (RM follow-up) Use Koha objects instead of mysql
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-23 15:45:01 +00:00
Colin Campbell
d9248c8802 Bug 22875: Document verbose option in import_patrons
Docs did not state that verbose can be repeated or that you
need more than 1 repetition to see lines that have failed

To test:
- Run ./import_patrons.pl -h
- Verify the additional documentation for -v is shown.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-15 12:10:53 +00:00
9bc386a98f Bug 22892: Remove warning from rebuild_es if --processes not passed
Use of uninitialized value $processes in numeric lt (<) at
misc/search_tools/rebuild_elasticsearch.pl line 199.

We want the number of processes to be set to 1 by default, and then
assign it to $slice_count

Test plan:
Run the script with and without --processes and confirm that the warning
went away.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-15 12:10:53 +00:00
Liz Rea
f550977f73 Bug 20436: (QA follow up) - reference and typo fixes
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 18:56:42 +00:00
0c02332600 Bug 20436: Add ability to specify itemtypes for longoverdue.pl
It would be nice if we could filter long overdues based on itemtype the same way we can already filter based on borrower category code.

Test Plan:
1) Set up a number of overdues of various itemtypes
2) Run longoverdue.pl with --list-itemtypes to show itemtypes
3) Run longoverdue.pl with --itemtype to verify it only operates on that itemtype
4) Run longoverdue.pl with multiple --itemtype switches, verify it only operates on those itemtypes
5) Run longoverdue.pl with --skip-itemtype to verify it does not operate on that itemtype
6) Run longoverdue.pl with multiple --skip-itemtype switches, verify that it does not operate on those itemtypes

Signed-off-by: Jesse Maseto <jesse@bywatersolution.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 18:56:42 +00:00
David Gustafsson
88eb0c5904 Bug 20485: Don't account for items timestamps when items not included
If combining "--dont_export_items" and "--date" options
in export_records.pl, don't include items modification/deletion
timestamp in biblio query conditions.

How to test:
1) Delete or modify a biblio item.
2) Run export_records.pl with "--dont_export_items" and "--date"
   options with a date value before item was deleted or modified,
   but after the biblio was modified.
3) The biblio for which an item was changed should not be included in
   the export.

Sponsored-by: Gothenburg University Library
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 17:22:27 +00:00
Ere Maijala
45c1cd1b66 Bug 21872: Fix name of rebuild_elasticsearch.pl
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 12:31:50 +00:00
David Gustafsson
f7e47847e4 Bug 21872: Simplify conditions and exit on invalid combination of arguments
Change to zero based indexing for slice index to simplify some
conditions. Exit with error message if trying to combine processes
and biblio numbers arguments.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 12:31:49 +00:00
Ere Maijala
abe7081109 Bug 21872: Add multiprocess support to Elasticsearch indexing utility
Test plan:
1. Time execution without -p parameter
2. Time execution with -p 2 or -p3 or -p 4 depending on CPU core count

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 12:31:49 +00:00
6fa21ef939 Bug 22755: Fix pod in patron_emailer.pl
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-24 10:43:55 +00:00
f11bda8136 Bug 22755: Import Koha::Script into patron_emailer cronjob
Test plan:
Run patron_emailer.pl cronjob to ensure it is not broken after this
patch

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-24 10:43:55 +00:00
0bbebced9d Bug 16149: Generate and send custom notices based on report output
Ths patch add an EmailReport function to C4::Reports::Guided

It accepts a notice (module, code, branch) and a report and attempts to
email notices to patron, generating content using report content.

Notice must be in template toolkit syntax, only columns in report are
available for notice.

To test:
1 - Specify various options
2 - Ensure errors are returned if options are incomplete or incorrect
3 - Pass a report containing 'from' and 'email' and 'borrowernumber'
columns and ensure message queue populated as expected

Signed-off-by: Jessica Ofsa <jofsa@vt.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-19 14:37:32 +00:00
e600ae6c4b Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker
To test:
1 - prove -v t/db_dependent/Biblio.t
2 - Set BiblioAddsAuthoorities and AutoCreateAuthorities
3 - Modify a biblio to add a heading with no existing auth record
4 - Ensure the record was created on saving
5 - Ensure that editing works as normal otherwise
6 - Run link_bibs_to_authorities
7 - Ensure results are as expected

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-18 10:02:03 +00:00
dc62187ebf Bug 22521: Update fines handling to use accountline.status
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 16:49:36 +00:00
Katrin Fischer
9ebdfb1ed1 Bug 22580: Remove deprecated delete_expired_opac_registrations.pl cronjob
Removes the deprecated script and changes the hint on the
PatronSelfRegistrationExpireTemporaryAccountsDelay sytem preference.

To test:
- Make sure the script misc/cronjobs/delete_expired_opac_registrations.pl
  was deleted
- Make sure the hint on the PatronSelfRegistrationExpireTemporaryAccountsDelay
  system preference is correct
- Make sure there are no other reference to the removed script

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 12:25:25 +00:00
2ca2585b1c Bug 21336: Adjust cleanup_database.pl
Add the new Patron routines to this cron job. Actions are performed only if
preferences are set.

Note: No specific command line flags for these actions are added here
(and probably not needed too). So no crontab changes too.

Test plan:
Add a new patron.
Enable GDPR_Policy and refuse consent on OPAC for this patron.
Set only the first delay to zero (0) for immediate action.
Run cleanup_database.pl --logs (or any other flag) for the first time.
Check lock and expiration.
Set the second delay to zero (0) for immediate action.
Run cleanup_database.pl --logs for the second time. Check anonymization.
Set the third delay to zero (0) for immediate action.
Run cleanup_database.pl --logs for the third time. Check removal.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Added the warn $@ line in cleanup_database.pl

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-17 12:25:24 +00:00
083f789b95 Bug 20937: Truncate items for print notices when user has an email
To test:
 1 - Set PrintNoticesMaxLines to 1
 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a
notice
 3 - Make sure the patron has an email
 4 - Make sure the notice you are sending is set to 'print' as the type
 5 - Run overdue_notices.pl without the 'nomail' option
 6 - Find the message and note all items have been added
 7 - Apply patch
 8 - Clear the message queue
 9 - Re-run overdue_notices.pl
10 - Confirm the message now has only 1 item.
11 - Set PrintNoticesMaxLines to 0
12 - Clear the message queue
13 - Re-run overdue_notices.pl
14 - Confirm the message has 2 items as expected

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-11 11:47:59 +00:00
d2e189ca1c Bug 22600: Set 'commandline' interface appropriately
This patch change Koha::Cron to be a more generic Koha::Script class and
update all commanline driven scripts to use it.

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-10 19:43:11 +00:00
125de75517 Bug 22600: Add 'cron' to interface types and set appropriately
This patch adds 'cron' as a valid interface and sets it appropriately for
existing cron scripts.

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-10 19:43:11 +00:00
e8eb0cf0f2 Bug 22518: Remove references to 'O' accounttype
I went back over 12 years to and still only found "FIXME: What are these
accounttypes" concerning the 'O' type and I couldn't find anywhere where
it was being set.

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-29 11:38:12 +00:00
f68fec12df Bug 22516: Remove remaining calls to lastincrement
A few places still set lastincrement and the tests still checked for
correct values. But nowhere in the code still uses lastincrement for
anything meaningful.

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 17:57:15 +00:00
3ef48c8708 Bug 17746: (QA follow-up) Make set_password.pl generate a password if required
This patch makes the set_password.pl script generate the password if it
is not passed as an argument.

It also changes the behaviour of set_password.pl: it will now print the
userid and password (generated or not) to mimick the behaviour from
koha-reset-passwd.

The koha-reset-passwd gets simplified as it doesn't generate the random
password anymore, it passes the responsability to set_password.pl

To test:
- Follow the steps from the original platch
- Verify all behaves as expected

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

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 11:58:20 +00:00
e2f6542e1e Bug 17746: Add misc/admin/set_password.pl script
This patch introduces a script that allows changing a patron's password.
The change overrides the defined password enforcement policy.

If multiple conditions are passed to match on the patron, they all need
to match. Otherwise an error message is printed.

Attributes to search the patron on:
- cardnumber
- patron_id (a.k.a. borrowernumber)
- userid

we usually know some of them, but if we specify more than one, they need
to match a patron, together.

To test:
1) Apply this patch
2) Have a known patron (i.e. you know the cardnumber, the borrowernumber
   and the userid).
3) Run:
  $ kshell
 k$ perl misc/admin/set_password.pl --cardnumber <the_card_number> \
                                    --password a_password
4) Verify you can login with the new password
5) Repeat 3) through 5) with --patron_id and --userid
=> SUCCESS: You can login in all cases
6) Try combining some or all the parameters
=> SUCCESS: It fails when it should, it succeeds when it should
7) Sign off :-D

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-28 11:58:20 +00:00
ce49552e6d Bug 20478: Fix qa complaints
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:56:18 +00:00
Andreas Jonsson
e7e27a934a Bug 20478: Have the cronjob script advance_notices.pl send digest messages per branch.
Desired behavior of the script advance_notices.pl is that the sender
address on the notice message is that of the branch of the issues in
question.  Thus, the solution is to generate digest messages per
branch.

To test:
1) Inspect unit test in t/db_dependent/cronjobs/advance_notices_digest.t and note that:
   - There are three libraries
   - There is a borrower
   - The borrower is registered at library1
   - The borrower has message preference wants_digest set to 1
   - The borrower has message preference days_in_advance set to 1
   - The content of the letter PREDUEDGST is '<<count>> <<branches.branchname>>'
   - There are three items
   - There is one issue per item
   - There is one issues at library2
   - There are two issues at library3
   - The date_due of the issues are set to tomorrow
   - For the default case (no -digest-per-message)
      - It is asserted that there is one message in the message queue after running the script
      - It is asserted that there are three items in the message.
      - It is asserted that the branchname is that of the borrower's home library.
   - For the case where -digest-per-message is enabled
      - It is asserted that there are two messages in the message queue after running the script
      - It is asserted that the item count of the message corresponding to library2 is 1
      - It is asserted that the item count of the message corresponding to library3 is 2
      - It is asserted that the branchnames are correct.
2) Run unit test: prove t/db_dependent/cronjobs/advance_notices_digest.t

Sponsored-By: Bibliotek Mellansjö, which is a cooperation between
Sponsored-By: Gullspångs kommunbibliotek
Sponsored-By: Hjo stadsbibliotek
Sponsored-By: Karlsborgs bibliotek
Sponsored-By: Mariestads stadsbibliotek
Sponsored-By: Skövde stadsbibliotek
Sponsored-By: Tibro bibliotek
Sponsored-By: Tidaholms stadsbibliotek
Sponsored-By: Töreboda kommunbibliotek

Signed-off-by: Andreas Jonsson <andreas.jonsson@kreablo.se>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Adding the --digest-per-branch switch turns the digest into one digest per
library. I think it makes perfect sense to keep the default behaviour
and hide this new functionality behind a command line switch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:46:31 +00:00
Andreas Jonsson
e18626b6f1 Bug 20478: Refactor to remove code duplication.
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-22 19:46:29 +00:00
bb231e6208 Bug 21683: (follow-up) Polish the change - based on feedback
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 18:19:22 +00:00
6e3da5397e Bug 21683: Remove accountlines.accountno
Test plan:
1) Play with fines, should work OK
2) Try to print receipts on fines - prinfeercpt.pl, printinvoice.pl
3) git grep getnextacctno -> no occurences
4) git grep accountno should return only:
  installer/data/mysql/atomicupdate/bug_21683_remove_column_accountno.perl
  installer/data/mysql/update22to30.pl
  misc/release_notes/release_notes_3_10_0.txt
  misc/release_notes/release_notes_3_22_0.txt
5) prove
  t/db_dependent/Accounts.t
  t/db_dependent/ILSDI_Services.t
  t/db_dependent/Stats.t
  t/db_dependent/Koha/Account.t

Rescued-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-21 18:19:22 +00:00
d7c0547bd2 Bug 21846: Fix pod2usage return values
According to existing pattern.
However I am not sure it makes sense to return an errno (and print to STDERR)
if --help is passed.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:27:44 +00:00
293eee9959 Bug 21846: (follow-up) Add maintenance script
This patch adds a maintenance script that generates the missing
tags_approval entries based on the tags_all table, and then recalculates
the weights for both tags_approval and tags_index tables.

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

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:27:44 +00:00
639ad97d84 Bug 21560: (follow-up) move use at the top
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:02:46 +00:00
ffb40290f8 Bug 21560: create Koha::Util::OpenDocument with subroutine for ODS generation
There is nearly the same code in misc/cronjobs/gather_print_notices.pl and reports/guided_reports.pl.
This patch creates a new module with subroutine called by both scripts.

If file path or content is undefined, subroutine will just return undef.
If content is an empty arrayref, empty ods file is still generated.

Unicode encoding is kept outisde because it may not be necessary.

Note that for print notices the first line of message is always the column names so it is extracted only from first message.

Test plan :
Run previous patches test plans and check ODS files are the same.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:02:46 +00:00
5d4f80feac Bug 21560: Optimize ODS export of gather_print_notices.pl
Like previous patch, the call on OpenOffice-OODoc lib can be optimized.
Based on https://grep.metacpan.org/search?qci=&q=expandTable&qft=&qd=OpenOffice-OODoc&f=examples%2Ftext2table

Test plan inspired from Bug 11679.

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-out 2 items using a due date in order to generate the overdue notices
- check-in these 2 items
- launch the script /misc/cronjobs/overdue_notices.pl
- the 'message_queue' table should now contain 2 new entries
- launch the gather_print_notices cronjob :
  perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=:
- A ods file should be generated in your /tmp/test directory
- Compare times with and without patch

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-03-15 12:02:46 +00:00
31c29fd31f Bug 21206: Replace C4::Items::GetItem
Note: This is here for information purpose, feel free to test it if you
wan to play with it.

TODO: C4::Reserves::_get_itype is not longer in use

No more GetItem must be returned by:
git grep GetItem|grep -v GetItemsAvailableToFillHoldRequestsForBib|grep
-v GetItemsForInventory|grep -v GetItemsInfo|grep -v
GetItemsLocationInfo|grep -v GetItemsInCollection|grep -v
GetItemCourseReservesInfo|grep -v GetItemnumbersFromOrder|grep -v
GetItemSearchField|grep -v GetItemTypesCategorized|grep -v
GetItemNumbersFromImportBatch|cut -d':' -f1|sort|uniq

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-26 13:24:07 +00:00
9ce71f34ee Bug 19164: (QA follow-up) Minor whitespace cleanup
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:15 +00:00
Jon Knight
1513c97b59 Bug 19164: Add MARC modification template support to misc/stage-file.pl.
https://bugs.koha-community.org/show_bug.cgi?id=19164

Bug 19164 - Allow MARC modification templates to be used in staged MARC imports

Patch checks for duplicate MARC modificiation templates and if only one is
found that matches the name given on the command line, submits the batch
staging of the input files using that template.

Test plan:

1) In the staff web client got to "Home › Tools › MARC modification templates" and create a MARC Modification Template called "Test Bug 19164". Set the action to be "Copy field 999$l to 998$l using RegEx s/NASH/FLASH/ if 999$l matches NASH"

2) Download the test MARC record from this bug into a file called marc1.mrc into your koha dev user's home directory.

3) Run misc/stage_file.pl with the command line:

   misc/stage_file.pl --file ~/marc1.mrc --add-items --marcmodtemplate "Test Bug 19164" --item-action replace --comment "testing MARC mod templates on batch staging"

4) In the staff client, go to Home › Tools › Manage staged MARC records and check that the file is visible and in status "Staged"

5) Click on the filename to bring up details of the staged batch, and then click on "Basic Christianity. Stott, John R. W. (0802811892)". Note that there is a 998$l field with the value "FLASH" that has been created using the MARC Modification Template.

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:15 +00:00
83fe95d0c5 Bug 22323: cronjob runreport.pl CSV add encoding
Cronjob runreport.pl runs SQL reports and can export as CSV.
This export needs to be UTF-8 encoded.

This pathes replaces use of Text::CSV_XS by Text::CSV::Encoded like in other places like tools/viewlog.pl.
It adds a decode of headers bcause they will be encoded lika other lines.

Test plan:
1) Create a new item with itemnotes 'accentué'
2) Create a SQL report with :
SELECT barcode,itemnotes AS itè FROM items WHERE itemnotes LIKE 'accenté'
3) Run this report
4) You see well encoded header and content
5) Run from command line (replace X by report number) :
misc/cronjobs/runreport.pl X --format=csv --csv-header --store-results
6) You well encoded header and content
7) Go to saved reports table
8) Look at saved results of report
9) You well encoded header and content

Signed-off-by: Mikaël Olangcay Brisebois <mikael.olangcay-brisebois@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 13:52:14 +00:00
Katrin Fischer
2cf573ab34 Bug 22299: Fix typo in option of import_patrons.pl
Fix typo in 'p|preserve-extended-atributes' option of
the import_patrons.pl script.

To test:
- Use the script to import patron data.
- Verify behaviour is the same with and without the patch
  concerning the preserve-extended_at(t)tributes option

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:48 +00:00
Magnus Enger
b7b4694666 Bug 12488: Make bulkmarcimport.pl -d use DELETE instead of TRUNCATE
On MySQL >= 5.5 bulkmarcimport.pl with the -d (delete) switch gives
an error like "Cannot truncate a table referenced in a foreign
key constraint". This patch proposes to replace the offending
TRUNCATE with DELETE. Auto incerement counters are reset to 1 to
preserve the functionality from TRUNCATE.

To test:
- Make sure you havae a test database with some records and items
- Run bulkmarcimport.pl with the -d switch
- Observe the error described above
- Apply this patch
- Run bulkmarcimport.pl with the -d switch again
- Observe the lack of an error
- Verify that the newly imported records and items have biblionumber
  and itemnumbers starting with 1

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-15 18:42:46 +00:00
fb62e8d1fc Bug 22236: Translation should generate tags with consistent attribute order
When running misc/translator/translate, the order of attributes in the translated templates is not consistent and may vary. This is caused by the random order of hash keys in perl.

This causes things like this in run 1:
<input type="submit" class="btn" value="Plaats aanvraag" />
And this in run 2:
<input value="Plaats aanvraag" type="submit" class="btn" />
As you can see, there is actually no difference apart from the order.

When comparing the result of various translation runs, I would rather get rid of such noise and only see the real changes.

The needed change is not trivial to find, but only requires a simple addition to a sort operation in tmpl_process3.pl. The current sort only makes sure that the '/' comes at the end. We should sort the names of the keys too when this value is 0 (just meaning: no end tag symbol).

Test plan:
[1] Run a translation without this patch and set a few templates aside.
[2] Run a translation with this patch.
[3] Run a compare (diff) on the templates copied in step 1. Verify that the
    only changes are found in the sort order of attributes in html tags.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-04 14:40:46 +00:00
fd30cac85a Bug 22155: Adapt uses of biblio_metadata.marcflavour to schema
This patch makes the code using Koha::Biblio::Metadata->marcflavour use
->schema instead for all interactions.

To test:
- Update the DB structure:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Notice all the places in which biblio_metadata is used
  $ cd kohaclone
  $ git grep biblio_metadata
=> SUCCESS: They all use `schema` instead of marcflavour
- Notice all the places that use Koha::Biblio::Metadata:
  $ git grep Koha::Biblio::Metadata
=> SUCCESS: They all use the schema attribute when they used to use
marcflavour
- Run all the modified tests and scripts
=> SUCCESS: We are all good
- Sign off :-D

Note: while this seems like a minor change, the places in which plain
SQL is used really require understanding the queries and how they are
used, because some query results might be passed to some other method
that in turn uses the marcflavour attribute. I of course took that into
account but errare humanum est :-D

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-30 11:35:34 +00:00
3cd669e527 Bug 22049: Make MarkIssueReturned rely on returndate only
This patch changes the params accepted by
C4::Circulation::MarkIssueReturned by removing the $dropbox_branch
param.

This passed branchcode was only used to initialize the Koha::Calendar
object, but the date arithmetic has already taken place in a couple
places before we reach this point. This logic needs to be simplified
(bug 14591), and this is the starting point.

To test:
- Apply this patch
- Run:
  $ git grep MarkIssueReturned
=> SUCCESS: Check all the uses of the function either originally passed
undef, or now pass the same date that would've been calculated anyway,
in the returndate param.
- Run:
  $ kshell
 k$ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests pass!
- Sign off :-D

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

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:46:47 +00:00
aefd2bc2f6 Bug 22048: Use set_password in create_superlibrarian.pl
Use $patron->set_password instead of update_password. In this case the
'skip_validation' param needs to be set as no password strength checks
are expected.

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

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 20:15:30 +00:00
Olivia Lu
b93c5dcbfd Bug 21855: Changed "deprecated delete_unverified_opac_registrations.pl cronjob" to "cleanup_database"
To Find Fix:

1. Go to Koha Administration
2. Search PatronSelfRegistrationVerifyByEmail
3. Verify that NOTE now says "system preference requires the
cleanup_database ..."

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Mikael Olangcay Brisebois <mikael.olangcay-brisebois@inlibro.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-25 17:39:41 +00:00
morgane alonso
cffb47ac5d Bug 17047: subscriptions management with Mana-KB
- add a class SharedContent.pm to communicate with Mana-KB server
- add a link in serials-menu.inc to serials_search.pl to open
a mana-subscription research form
- modify the research form in serials-search.tt to show the right fields
for Mana-KB
- create datatable in mana-subscription-search-result.inc to show
results from a research on Mana-KB
- modify serials-search.pl to manage research on Mana-KB

- add a mana_id to subscription table
- add a share button on serials-toolbar.inc and a modal to ask
the language of the share and to alert if the subscription is
already link to a Mana-KB subscription model
- add function in C4/Serials to get all the info for a subscription
sharing
- modify subscription-detail.pl to manage sharing to Mana-KB

- modify subscription-add.tt and subscription.pl to manage a
import from Mana-KB during a subscription creation
- add 2 script in svc for ajax calling from subscription-add.tt
to communicate with Mana-KB server during a asubscription creation
- add a function in Subscription.pm to have all the info for a Mana-KB research
from a biblionumber
- modify functions used by subscription-add.pl in C4/Serials to manage a
frequency which came from Mana-KB server and not already created on the
koha database, and modify the tests of the said functions

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

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

Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04)
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-23 14:39:26 +00:00
aa71519660 Bug 21753: Remove all reference of chargename from scripts
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-04 03:13:49 +00:00
3853014017 Bug 21915: Add a cli script to reconcile balances
This patch adds a CLI script, reconcile_balances.pl that takes care
of calling the reconcile operation for all patrons that have outstanding
credits.

A weird situation has been spotted in the wild, in which a debit ends up
actually being a credit, because amount outstanding is tweaked in
dropbox-mode returns. Until we figure what to do about that (probably a
new account type, etc), we catch any exceptions and warn about the
situation.

To test:
- Have patrons with outstanding credits and debits
- Run the script:
  $ kshell
 k$ perl misc/cronjobs/reconcile_balances.pl --verbose
=> SUCCESS: Notice patrons got their balances reconciled, and useful
            information is output.
- Add new outstanding credits and debits to patrons you con easily
identify
- Run:
 k$ perl misc/cronjobs/reconcile_balances.pl
=> SUCCESS: Notice balances are reconciled, but no output
- Run:
 k$ perl misc/cronjobs/reconcile_balances.pl --help
=> SUCCESS: Usage information is printed.
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-04 03:13:41 +00:00
Julian Maurice
875f3162c8 Bug 21908: (QA follow-up) Remove useless parentheses in query
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-12-11 19:19:47 +00:00
a1b08269a7 Bug 21908: Add DISTINCT biblionumber to rebuild_zebra.pl
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
When using table=items we should use DISTINCT(biblionumber) to avoid indexing several times the same biblio record when it has several items.
This patch adds DISTINCT(biblionumber) in all cases it does not harm if its already unique.

Test plan :
1) Be sur you have a biblio record with biblionumber 1 with 3 items
2) Run misc/migration_tools/rebuild_zebra.pl -v -b --table items --where="biblionumber=1"
3) Without patch you see "Records exported: 3", with patch only one
4) Check indexing works well

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-12-11 19:19:46 +00:00
c36597bc0c Bug 21908: Add biblio_metadata to rebuild_zebra.pl tables
Zebra indexing script misc/migration_tools/rebuild_zebra.pl as a table arg to allow filtering.
It is missing biblio_metadata to allow filtering on MARCXML with ExtractValue.

Test plan :
1) Be sur you have a biblio record with biblionumber 1
2) Run misc/migration_tools/rebuild_zebra.pl -h
3) You see : --table specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
4) Run misc/migration_tools/rebuild_zebra.pl -v -b --table biblio_metadata --where="biblio_metadata.biblionumber=1"
5) Check you dont have SQL errors

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-12-11 19:19:46 +00:00
Julian Maurice
d8531b8fcb Bug 21895: Fix path to POT file
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-11-29 17:57:54 +00:00
Julian Maurice
bd81f0418c Bug 21895: Fix translation for package install
The string extraction process was not taking into account the fact that
standard/package install have a completely different directory structure
than the dev install

This patch tries to keep the exact same behaviour for dev installs,
while making it work for standard install by using opachtdocs,
intrahtdocs, opacdir and intranetdir from $KOHA_CONF

Test plan:
1. Follow test plan in
d708255c7a
2. Do a standard install and repeat step 1 on this new install
3. If you know how to build the Debian package, build it, install it and
verify that koha-translate works as expected
4. prove t/LangInstaller.t

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-11-29 17:57:54 +00:00