Commit graph

1535 commits

Author SHA1 Message Date
Jonathan Druart
b9f74eaf41 Bug 10419: (follow-up) add branchcode parameter to patron deletion script
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-03 21:41:27 +00:00
Jonathan Druart
497795f32a Bug 10419: (followup) - tidy up cronjob for deleting patrons
This followup adds:
- execute flag (+x) for the cronjob script.
- replaces --dry-run with --confirm (according with existing scripts).
- changes output text (remove 'first person' style).
- updates the doc and simplifies the dates parameters.
- changes flags PrintError and RaiseError for the dbh in order to catch
  something if an error occurs...

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-03 21:41:14 +00:00
Jonathan Druart
231ed790e4 Bug 10419: new cronjob for deleting patrons
This patch provides a cronjob script for deleting patrons.

It takes 3 options:

--not_borrowed_since
--expired_date
--category_code

See the perldoc misc/cronjobs/delete_patrons.pl.
Use the -v flag for a verbose mode.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-03 21:33:04 +00:00
Jonathan Druart
f2c0fe0ca1 Bug 10806: make the staff benchmark script check authentication failure.
Currently, if you launch the script
misc/load_testing/benchmark_staff.pl, it always displays
"Authentication successful" or continue to execute the script even if
nothing is done.

This patch checks if the url is right and if the authentication is
correctly done.

Test plan:
Suppose that a correct login/pwd is koha/koha
1/
perl misc/load_testing/benchmark_staff.pl --steps=1
--url=http://admin.koha.local/cgi-bin/koha/
--password="koha" --user="koha"
should produce:
  Authentication successful
  ...
  Step 1
  ...

2/
perl misc/load_testing/benchmark_staff.pl --steps=1
--url=http://admin.koha.local/cgi-bin/koha/
--password="KOHA" --user="KOHA"
should produce:
Authentication failure: bad login/password

3/
perl misc/load_testing/benchmark_staff.pl --steps=1
--url=http://admin.kobe.local/cgi-bin/koha/
--password="koha" --user="koha"
should produce:
Authentication failure:
    500 Can't connect to admin.kobe.local:80 (Bad
    hostname)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Works as described, detects bad url and user credentials.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and gives better error messages.
There are some warnings output when running the script before
and after applying the patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-02 15:30:49 +00:00
Meenakshi.R
0005f6bad3 Bug 7639: add option to forgive overdue fines when declaring items lost
This patch adds functionality to forgive overdue fine when an item is
set to lost status.  Fines are forgiven only when the syspref
WhenLostForgiveFine is set to yes. Item can be set to lost status from:

- catalogue/moredetail.pl
- cataloguing/additem.pl
- tools/batchMod.pl
- misc/cronjobs/longoverdue.pl

Changed subroutine C4::Circulation::LostItem to forgive fines on the
item depending on the value of syspref WhenLostForgiveFine. This
routine is currently used to return an item and charge a replacement
cost.

Also added a new syspref in C4::Circulation::LostItem -
WhenLostChargeReplacementFee.  The replacement fee will now be charged
only if this syspref is set to yes.  The default value of the
WhenLostChargeReplacementFee is yes, meaning that current behavior
will not change during upgrade.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Alex Hatley <alexh@cctexas.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes on last patch in series.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-17 15:10:46 +00:00
Galen Charlton
fc84903dfb Bug 9372: (follow-up) tidy whitespace in new lines
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-16 18:38:50 +00:00
Sophie Meynieux
6dbfe1512d Bug 9372: replace carriage return with <br /> in printed HTML files for overdues
For PDF generation, HTML files need explicit <br /> HTML tags. With
this patch, carriage return are replaced by <br /> when letters are
written into HTML files.

Test plan :
- Ensure you've got at least one reader with overdue triggering notice
- Ensure that your notice template got HTML checked
- Run misc/cronjobs/overdue_notices.pl -v -n -html <dirname>
  and misc/cronjobs/printoverdues.sh <dirname>

Without patch, the content of the letter is all on one line in PDF file
With the patch, PDF file is correctly formated

- remove your reader email
- Run misc/cronjobs/overdue_notices.pl -v -html <dirname>
  and misc/cronjobs/printoverdues.sh <dirname>

Without patch, the content of PDF file is all on one line
with the patch, PDF file is correctly formated.

- restore reader email
- run misc/cronjobs/overdue_notice.pl -v -html <dirname>

Verify that the a message has been generated in message_queue table
With or without patch, the message is the same

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-16 18:37:47 +00:00
Magnus Enger
b54e33c1f6 Bug 10810 - Fix synopsis for -html option to overdue_notices.pl
The synopsis for the -html option used to be:
  -html <filename> Output html to file
but the argument to this option should actually be a directory,
not a filename. This patch fixes the synopsis.

To test:
- Run perldoc misc/cronjobs/overdue_notices.pl
- Check that the synopsis is as shown above
- Apply this patch
- Run perldoc misc/cronjobs/overdue_notices.pl
- Check that
  - the synopsis asks for a directory, not a filename
  - that the description of the -html option further down in the
    perldoc now mentions the filename that the HTML file will be
    created with.

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

If feeded with a filename -html option fails with many messages like
print() on closed filehandle $html_fh at misc/cronjobs/overdue_notices.pl line 384.
Perhaps it could be improved, but that was the old behavior.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Improves documentation, no negative side effects found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-16 15:40:30 +00:00
Galen Charlton
ad5d9ca169 Bug 10771: remove disused statistical reports cronjobs
This patch removes three cronjobs that are believed to be
unused for the following reasons:

[1] The commit message that introduces them indicates that they
    were written for a particular library.  A staff member from
    that library has confirmed that they are not in use.
[2] The scripts have received essentially no patches since they
    were introduced except for being caught up in a broader
    code-improvement patch.
[3] They refer to a column that no longer exists in biblioitems.
[4] They no longer adhere to guidelines for command-line utilities,
    and there's been no sign that anybody has felt the urge to
    correct that.
[5] They are not referenced by another code or the manual, and
    the mailing list archives do not include any substantive discussion
    of their use.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-06 18:26:35 +00:00
Sophie Meynieux
30b32d9938 Bug 10727: Replace carriage return with <br /> when printing hold notices
This patch replaces carriage return with <br /> in the content of
hold notices for printing. This is necessary to convert html file
into well formatted pdf file.

Test plan :
  - check in an item reserved by a borrower
    that has not activated email notification
  - verify in message_queue table that you've got a
    new HOLD_PRINT notice with status 'pending'
  - run gather_print_notices.pl <directory>

Without the patch, the script generates a html file without <br /> tags.
If you run printoverdues.sh <directory>, the text in the resulting PDF
file is all on one line

With the patch, the script generates a html file with <br/> tags and
the PDF file created by printoverdues.sh is well formatted.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-06 16:52:59 +00:00
Mirko Tietgen
1d5a4a0a81 Bug 10361: Add option to cleanup_database.pl to purge OPAC search history
Add an option to cleanup_database.pl to purge the search_history
entries older than X days.

Test plan:

- Apply patch
- Check that your test DB has some entries a little older than 30 days
  and a few ones even older than that in search_history:

  SELECT * FROM search_history WHERE time < DATE_SUB( NOW(), INTERVAL 30 DAY );

  If not, modify some existing entries.

- Run cleanup_database with a fixed number of days (replace XX with
  something higher than 30)

  /misc/cronjobs/cleanup_database.pl --searchhistory XX

- Check that entries older than XX days got deleted from search_history
- Run without the day parameter
  /misc/cronjobs/cleanup_database.pl --searchhistory
- Check that entries older than 30 days got deleted from search_history

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-09-04 14:22:50 +00:00
e476378323 Bug 10664 [QA Followup] - fix error in overdue_notices.pl if there is no active currency
Fixes the following koha-qa.pl error:
 FAIL   misc/cronjobs/overdue_notices.pl
    OK     pod
    OK     forbidden patterns
    OK     valid
    FAIL   critic
               # Variables::ProhibitConditionalDeclarations:

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 14:39:02 +00:00
Sophie Meynieux
a9a3bb7b3d Bug 10664: fix error in overdue_notices.pl if there is no active currency
If there is no active currency, when running overdue_notices.pl
you get a sofware error "Can't use an undefined value as a HASH
reference" on GetCurrency() function call.

With this patch, if there is no active currency, fines are formated
by default 0.00 and notices are correctly generated.

Test plan :
- have at least one borrower with overdue that should trigger a notice
- verify that there is no active currency (Adminitration > Currency &
  Exchange rates)
- run misc/cronjobs/overdue_notices.pl -v -n (to get the notice directly
  on output)

=> without the patch you get the software error
=> with the patch, notices are correctly generated

If an active currency is defined, the script overdue_notices.pl runs
the same with or without patch

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-16 14:37:47 +00:00
Colin Campbell
40e6f6a8f2 Bug 10712: Save missing config variables to install log
The variables for AUTH_INDEX_MODE and ZEBRA_TOKENIZER were not
being saved to the koha_install_log file.  As a result when using the
--prev-install-log option in Makefile.PL the user was still prompted
to select them.

This patch adds the appropriate variables to the list saved in
the install log.

To test:

On a (non-package) system installed/upgraded without the patch running
'perl Makefile.PL --prev-install-log /path/to/koha-install-log' will
still prompt you to choose authorities indexing mode and select
between chr and icu, after upgrading with this patch applied the same
command should get the responses from the install log and not require
user intervention.

The values can be seen written into misc/koha-install-log

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-13 14:14:30 +00:00
Sophie Meynieux
04e9022e4f Bug 10127 : Printoverdues.sh should tar only pdf files
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

From the bug report:
At the end of printoverdues.sh, an archive is generated
containing all files present in  directory given as parameter.
As archives are generated in this given directory, they
contain previously generated tar files, creating oversized files.
Only .pdf files should be archived

All tests and QA script pass.
Worked ok in my tests, only packign PDF in the given directory.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-16 15:47:13 +00:00
Galen Charlton
93aee04405 bug 9998: (follow-up) use Modern::Perl as per coding guidelines
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-02 07:09:22 -07:00
aa4fde7d0d Bug 9998: new tool to import/export and compare system preferences
This patch adds a new maintenance script: cmp_sysprefs.pl

Test plan:
1 Run with -cmd backup -file zz01. Check that file.
  Run with -cmd test -file zz01. Check zz01.sav.
2 Run with -cmd compare -file zz01. No differences expected.
3 Edit zz01: delete two prefs, change two prefs and add two new prefs.
4 Run with -cmd compare -file zz01. Are all six changes reported?
5 Add local use preference zz02 in the staff client (no explanation, options).
6 Run with -cmd backup -file zz02.
7 Delete local use pref zz02 from the staff client.
8 Run with -cmd restore -file zz02. Check if local pref zz02 came back.
9 Delete local use pref zz02 again from the staff client.
10 Run with -cmd compare -file zz02 -add. Check if local pref zz02 came back.
11 Change the value of zz02 in the staff client.
12 Run with -cmd compare -file zz02 -add. Check the value: not updated?
13 Run with -cmd compare -file zz02 -upd. Check the value: updated now?
14 Edit file zz02. Add a comment line and delete the line for pref zz02.
15 Run with -cmd compare -file zz02 -del. Is pref zz02 deleted?
16 Add local use preference zz02 in the staff client (WITH explanation).
17 Run with -cmd compare -file zz02 -del. pref zz02 should not be deleted.
18 Run with -cmd compare -file zz02 -del -ign-opt. zz02 should be deleted now.

Do the next steps only on a restorable test db:
19 Create file zz03. Leave it empty.
   Compare with: -cmd compare -file zz03 -del -ign-opt.
   All prefs gone except Version?
20 Restore with: -cmd restore -file zz01.sav.
   Compare with -cmd compare -file zz01.sav. Nothing reported?
   Note: The explanation or options are not recovered. (See also BZ 10199.)
   This affects local use preferences only.
   If you need them, restore your test db. Remove the zz files.

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

Amended patch
Only cosmetic stuff:
Perltidied with xt/perltidyrc.
Replaced most double quotes by single quotes around SQL statements.
Moved the usage into POD for pod2usage.
Passing no file shows help screen too.
Counting the db updates more accurately with return value of do.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-02 07:08:05 -07:00
Frédérick Capovilla
68b8b9d7a8 Bug 8584: cleanup_database.pl : Add a DAYS parameter for email purges.
You can now specify a number of days with the --mail parameter. Only
mails older than the specified number of days will be deleted.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-06-05 07:19:25 -07:00
Janusz Kaczmarek
9d02840967 Bug 10326: bulkmarcimport.pl doesn't restore value of CataloguingLog syspref
To test:

0) Don't apply the patch yet.
1) Have the CataloguingLog system preference set to 'Log'.
2) Import a file of bibliographic records with bulkmarcimport.pl.
3) Check the state of CataloguingLog system preference -- it will be
   set to 'Don't log'.
4) Apply the patch.
5) Repeat steps 1-3.  The CataloguingLog system preference
   will be 'Log'.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-31 07:30:25 -07:00
cd150a23bb Bug 9286 - Add script to add a bib to the zebra queue from the command line
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: No test plan, but works.
Tested adding auth, biblios or both, then rebuilding -z
No errors.

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

Test Plan

1/ run misc/mod_zebraqueue.pl -a 1
2/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for authority record id 1 has been inserted
3/ run misc/mod_zebraqueue.pl -b 1
4/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for biblio record id 1 has been inserted
5/ run misc/mod_zebraqueue.pl
Make sure the help is sensible
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-28 08:00:15 -07:00
Jonathan Druart
37234811a5 Bug 9161: Followup: the -f param does not work correctly
Without this patch, the -f param (for the translate script) add the
modified line in the po file BUT comment all lines from others files.

This patch concat the generated file with the previous one and merge
them. This way produce a pretty po file with all our strings :)

+ Modification in LangInstaller.pm to fix a bug when the -f param was not
given.

Test plan:
1/ Update your po file :
cd misc/translator
perl translate update fr-FR
git commit -a -m"TMP PO"
2/ Modification on 2 files:
ie.
catalogue/advsearch.tt:32 <h1>Advanced search Foo</h1>
catalogue/issuehistory.tt:38 <th>Patron Bar</th>

3/ Update your po file with only the first file:
perl translate update fr-FR -f advsearch.tt

4/ Edit your po file and check that only the foo string is present (or
git diff).

5/ Update your po file with only the second file:
perl translate update fr-FR -f issuehistory

6/ Edit your po file and check that 2 strings are present (or git diff).

7/ Change the translation for these 2 strings and delete the fuzzy
lines.

8/ Install the first file for your language:
perl translate install fr-FR -f advsearch.tt

9/ Edit your translated file and verify the string is translated. Check
that the issuehistory.tt file is not changed.

10/ Same for issuehistory:
perl translate install fr-FR -f issuehistory

11/ stash your modification in your tt files (or reset --hard):
git stash

12/ Check in your po file that the 2 strings are commented (git diff).

13/ To finish, install all template files and check that they are
replaced correctly:
perl translate install fr-FR

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

I have squashed the both follow-up patches.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-24 09:08:27 -07:00
Jonathan Druart
6525818076 Bug 9161: Translate only specific files
The previous version of tmpl_process3.pl says in the pod:

  -i, --input=SOURCE          Get or update strings from SOURCE file.
                              SOURCE is a directory if -r is also specified.

But is was not possible to specify one or more files.

This patch allows us to give one or more specific file with the -f
parameter.

for eg.:

perl tmpl_process3.pl install -i /home/koha/koha-tmpl/opac-tmpl/prog/en/modules/
    -o /home/koha/koha-tmpl/opac-tmpl/prog/fr-FR/modules/
    -s /home/koha/misc/translator/po/fr-FR-i-opac-t-prog-v-3006000.po
    -r
    -f opac-account.tt
    -f opac-main.tt

You can specify:
  -f advsearch.tt => translate all files with a filename containing
  'advsearch.tt'
or
  -f search => will translate acqui/histsearch.tt, acqui/z3950_search.tt, etc.

Bug 9161: Followup: Add a -f param for the translate script

Now you can directly call the translate script
(misc/translator/translate) with the -f parameter

eg.:
./translate install|create|update -f search.tt -f main.tt

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

I've squashed the 3 patches, and reported doc into 'translate' script.
It works as advertised.

Side note: It would be great to extend this functionnality in order to
be able to apply the translation to XSL files stored outside Koha
directories hierarchy. Useful to translate site-specific XSLs defined
with XSLTResultsDisplay, and other sysprefs.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-05-24 09:08:25 -07:00
Jared Camins-Esakov
7233475247 Update release notes for final 3.12.00 release
(cherry picked from commit 3b825dcf38)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-19 17:57:26 -04:00
Jared Camins-Esakov
f04b9ec326 Fix incorrect entities in PO files
There were numerous malformed HTML entities in the PO files for various
languages. No longer.
2013-05-19 08:12:40 -04:00
Jared Camins-Esakov
bacd4e834c Update release notes for Koha 3.12.0 RC3
(cherry picked from commit e8030f7f31)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-18 12:35:58 -04:00
D Ruth Bavousett
7b3652d8cc Translation update for 3.12.0
(cherry picked from commit a7dd685090)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-18 12:35:49 -04:00
Jared Camins-Esakov
6f9b5f3486 Update 3.12 release notes for Koha 3.12.0-rc2
(cherry picked from commit bbc4267296)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-15 22:14:14 -04:00
D Ruth Bavousett
63302e77b8 Language update for 3.12-RC
(cherry picked from commit 8e1e34f2fa)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-15 21:57:53 -04:00
9ce862e451 Bug 10214 Add header to syspref po files
With this patch, header is created when creating a new syspref .po file
for a new language (translate create), and is added if it doesn't
already exist when updating an existing language (translate update).

To test:

(1) Create a new language syspref file:

    ./translate create -p xx-XX

    Check that there is an header

(2) Update an existing syspref file without header:

    ./translate update fr-FR

    Check that fr-FR-pref.po has a header

(3) Update an existing syspref file with header:

    Modify fr-FR-pref.po. Add an email, or whatever.

    ./translate update fr-FR

    Check that fr-FR-pref.po has a header with the manual modification

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

Comment: Work as described. No errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Also tested that updated pref files can still be installed correctly.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-15 07:22:32 -04:00
2e103a018c Bug 10156 - Fix usr/bin/perl path for get_report_social_data.pl
Currently, the perl path for get_report_social_data.pl is "#!/bin/perl"
when it should be "#!/usr/bin/perl".

While I'm not entirely sure how to test this, rangi did mention:

23:47 (it wouldnt work on my debian install)
23:48  zsh: no such file or directory: /bin/perl

It's a pretty trivial change, so I'm not sure it needs much of a test
plan.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Before the patch "grep -r '#!/bin/perl' in the misc dir shows one file
with this line, and it is indeed get_report_social_data.pl. After the
patch there are no occurrences left.
Passed-QA-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-08 09:52:21 -04:00
Jared Camins-Esakov
4e13ddd4d6 Add release notes for 3.12.0-beta3
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-01 23:07:26 -04:00
Peter Crellan Kelly
571dab9c7c Bug 6506: When AnonymousPatron not set, deletion of issue history silently failed.
Remedied by:
- in Circulation.pm changing AnonymiseIssueHistory so that it returns ($rows, $err_history_not_deleted) instead of $rows
- consequential change to misc/cronjobs/batch_anonymise.pl to handle updated return value, and fail if there is an error
- consequential change to tools/cleanborrowers.pl although this still fails silently (raised as bug 9944)
- update of opac-privacy.pl to check return value and pass on error
- update of opac-privacy.tt to display error if appropriate

Note bug 9942 remains unfixed, which is a similar issue upon issue return.

To test:
1. OPAC
- enable privacy mode (preference OpacPrivacy)
- leave anonymous patron set to zero (preference AnonymousPatron)
- attempt to delete user history
- observe error
- check history - still there
- change anonymous patron to a valid user
- attempt to delete user history
- observe success message
- check history - gone

2. cleanborrowers.pl
- test it functions as before.  bug 9944 has been raised for it continuing to silently fail.

3. batch_anonymise.pl
- enable privacy mode (preference OpacPrivacy)
- leave anonymous patron set to zero (preference AnonymousPatron)
- run script (I use --days -1 for testing)
- script should fail with a Carp message
- change anonymous patron to a valid user
- run script as before
- script returns quietly
- check history - gone

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-01 08:44:11 -04:00
Chris Cormack
3588e2820e Bug 6709 : Patch for testing translating .xml files
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment on second patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-01 06:53:38 -04:00
Aaron Wells
109f316efb Bug 9671: Make fines.pl help text more accurate
To test:

run kohaclone/misc/cronjobs/fines.pl --help and note the help text. It should match the settings in System Preferences.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Documentation change, passes all tests.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-26 18:35:40 -04:00
2eefd1f3a5 Bug 8745: General whitespace and tab tidy
http://bugs.koha-community.org/show_bug.cgi?id=8745
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
1) Runs not with root.
2) Runs with root and -run-as-root.
3) Runs using the normal koha user.

Note: Maybe the message should be clear about why
running as root is bad and which user you should
be running the script with?
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-21 09:41:34 -04:00
Barry Cannon
ef86a77801 Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user.
Added a check to warn users of execution as root user.
Added a 'runas-root' switch to allow users to force execution as root user.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-21 09:41:34 -04:00
Julian Maurice
357cf7fdd8 Bug 8746 [Follow-up] Replace == by eq in string comparison
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-21 09:23:23 -04:00
Julian Maurice
a4e8443691 Bug 8746: Fix indexation in DOM index mode
When in DOM index mode, files exported by `rebuild_zebra.pl -x` are
wrapped by '<collection></collection>' tag.
This is a problem because splitting files produces invalid files.
This is fixed by adding the missing <collection> tags in each generated
file.
Another problem was that the wrong zebra configuration file was used.
The script now uses C4::Context->zebraconfig($server)->{config} to know
which configuration file has to be used.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-21 09:23:22 -04:00
Julian Maurice
eef4b3f23c Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML
This avoid indexing failures due to "bad offset" or "bad length" error
with ISO2709 format

+ minor improvements:
  -  --length parameter is optional. If not given, it will execute the
     right sql query to find the number of records to index
  -  new parameter --reset-index. If set, index is reset before indexing

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described. No errors.

Test: Edit record to make it longer than 9999. Without patch rebuild_sliced
fails. With patches works.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-21 09:23:22 -04:00
Katrin Fischer
0454377380 Bug 8200: Follow up - Removing unused file stats.pl
Patch removes misc/translator/stats.pl that is no
longer used and references deleted script
update.pl in same directory.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-07 13:38:06 -04:00
3e72ec4acc Bug 8200 - removing misc/translator/update.pl - deprecated file
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch removes unused file.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-07 13:38:06 -04:00
f9c8f39c02 Bug 9609: Rebuilding zebra reports double number of exported records.
Test plan:
Clear the zebra queue (run rebuild). Update one biblio.
Rebuild zebra (again) with -z. Check zebra log: note 2 exported records.
Now apply patch, and repeat: You will see 1 exported record.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-02 08:41:40 -04:00
Will Stokes
cc62d0c4dd Bug 7938: Added description of -v/--verbose parameter
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
"perldoc misc/translator/translate" looks good and now mentions
the -v option.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-29 21:53:32 -04:00
Jared Camins-Esakov
c44ed57ea2 Update release notes for 3.12.00-beta1 2013-03-23 09:35:08 -04:00
Galen Charlton
151e22070a bug 9496: improve error checking in rebuild_zebra.pl
When using rebuild_zebra to index all records, skip over
bibliographic or authority records that don't come out
as valid XML.  Also, strip extraneous XML declarations when
using --nosanitize.

Test plans
----------
Note that both plans assume that DOM indexing is turned on.

Test plan #1
============

[1] Run rebuild_zebra.pl with the -x -nosanitize options.  Without
    the patch, zebraidx should terminate early and complain
    about invalid XML.
[2] With the patch, the rebuild_zebra.pl should work without
    error.

Test plan #2
============
[1] Intentionally make a MARCXML record invalid, e.g, by running
    the following SQL:

    UPDATE bilbioitems SET marcxml = CONCATENATE(marcxml, 'junk')
    WHERE biblionumber = 123;

[2] Run rebuild_zebra.pl -b -x -r
[3] Without the patch, only part of the database will be indexed.
[4] With the patch, rebuild_zebra.pl will not export the bad
    record and will give an error message saying so, but will
    successfully index the rest of the records.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Larry Baerveldt <larry@bywatersolutions.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 22:25:03 -04:00
Paul Poulain
be82a5f942 bug 5608 follow-up: exit immediately if UNIMARC
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 22:15:56 -04:00
Michael Hafen
b395ac0805 Add license statement to switch_series_info CLI script
License and copyright statement added.
Thanks to Bernardo Gonzalez Kriegel for reminding me about this.

http://bugs.koha-community.org/show_bug.cgi?id=5608
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: add license information. No errors.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 22:15:56 -04:00
Michael Hafen
8cb3533ae6 Bug 5608 - command-line tool to switch information in 440 and 490 tags
With the MARC21 standard moving from the 440 tag to the 490, this tool is
to help libraries make the move.  It switches any information in 440 tags to
490 tags, and any information in 490 tags to 440 tags.  That seemed like the
best way to go to me.  There is also an option to create 830 tags for any 44
information, like authorities, that can't be represented in the 490 tag.

To Test:
locate some biblios with 440 or 490 tags filled.
run bin/migration_tools/switch_marc21_series_info.pl -c
observe that the information in the biblios has switched 4xx tags.

http://bugs.koha-community.org/show_bug.cgi?id=5608
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described. No errors.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 22:15:56 -04:00
Michael Hafen
eea7b9d20d Bug 5608 - command-line tool to switch information in 440 and 490 tags
With the MARC21 standard moving from the 440 tag to the 490, this tool is
to help libraries make the move.  It switches any information in 440 tags to
490 tags, and any information in 490 tags to 440 tags.  That seemed like the
best way to go to me.

To Test:
locate some biblios with 440 or 490 tags filled.
run bin/migration_tools/switch_marc21_series_info.pl -c
observe that the information in the biblios has switched 4xx tags.

http://bugs.koha-community.org/show_bug.cgi?id=5608
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Works as described. No errors.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 22:15:56 -04:00
Dobrica Pavlinusic
15b6a41a67 Bug 8378 - <fine> in overdues changed to <<items.fine>>
This patch reintroduces fines in overdue_notices.pl with minimal
changes to exsiting code.

It DOES changes template syntax, it used to be <fine>USD</fine> but
currency was not recalculated and used only to select format, so
now we are using active system currency because values are in it
anyway.

Example notify template:

<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>,
Barcode: <<items.barcode>> Fine: <<items.fine>> </item>

If your active currency doesn't have valid ISO code this code will
fallback to sprintf with two decimal digits, and you can insert
currency symbol in template itself (currency field is not editable
through web interface, so this fallback might be useful for existing
installations).

Test scenario:
1. configure fine amount under "Circulation and fines rules"
   for patron category and item type
2. checkout item with correct type to partron in correct
   category with due date set to yesterday
3. verify that overdue notice uses new <<items.fine>> tag
4. run ./misc/cronjobs/fines.pl to calculate fines
5. run ./misc/cronjobs/overdue_notices.pl -n
   and verify that fine amount is included

Notes: Tested using the default ODUE notice, changing:
<fines>USD</fines>
for
<<items.fine>>

Everything worked as expected with finesmode=production set.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-21 21:53:05 -04:00