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>
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>
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>
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>
Merge branch 'bug_5608' into 3.12-master
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>
Merge branch 'bug_9496' into 3.12-master
Update history with January and February 2013 releases
Bug 8365: Add a renewal duration in the issuing rules

Renew an issue for a number of days (filled in the issuing rules).

Test if rules work for any i[item]types and if there is no regression.

- new column issuingrules.renewalperiod
- remove all occurrences of an already removed syspref (globalDueDate)
- remove an unused routine (Overdues::GetIssuingRules)

How it works:
- On existing installations, the issuingrules.renewalperiod =
  issuingrules.loanlength. So the behaviour is the same before and after
  this patch.
- when you add a rule, you can choose a renewal period (the unit value
  is the issuingrules.unit). So you can have a renewal period in hours
  or days.
- The default value for the renewal period is 21 days (same as
  loanlength)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test comments on second patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8365: Add unit tests and fix QA issues

This patch adds some unit tests for CalcDateDue and GetLoanLength

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Tests done:
- Checked update works correctly for existing circulation rules.
- Adding, deleting and overwriting circulation rules works.
- Renewals work for different circulation rules and changes
  to the holiday calendar.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8365: Followup Force DateTime type for the datedue variable

Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
I tested one more time on a sandbox but I confirm the problem:
the due date doesn't change when you renew more than one time
with syspref renewalperiodbase turned on: "the old due date of
the checkout". The due date should change any time.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Added signed-off line and problem description from bugzilla.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8365: FIX Return issue values instead of item values

Before this patch, the GetItemIssue routine returns items.renewals
instead of issues.renewals

Signed-off-by: Broust <jean-manuel.broust@univ-lyon2.fr>
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>
Bug 8365: Increment version number

Database update for bug 8365 has been given version 3.11.00.112
Merge branch 'bug_8365' into 3.12-master
Bug 9257 - Add "groups" to normal search pulldown

This patch adds the ability to add groups to the library select
pulldown on the opac, if it is enabled.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Go to Administration › Libraries and groups
4) Create a new group, or edit an existing one
5) Ensure the 'Show in search pulldown' checkbox is checked
6) Save the group
7) Enable OpacAddMastheadLibraryPulldown if it is not already enabled
8) Load the OPAC, try the group search from the libraries pulldown menu

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Yes! Now this works, and well.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9257: Increment version number

Database update for bug 9257 has been given version 3.11.00.113
Merge branch 'bug_9257' into 3.12-master
Bug 9883 - Koha::Plugins::Base should not require koha-conf to load

Test Plan:
1) Run t/db_dependent/Plugins.t
2) Apply patch
3) Re-run t/db_dependent/Plugins.t

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
The tests pass both before and after the patch. I can see no
ill effects on the functionality (tried uploading and
accessing the Kitchen Sink plugin).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
After installing libmodule-bundled-files-perl from the
debian.koha-community.org I ran through Makefile.PL
updating my conf file successfully. Also all tests
and QA script pass now.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9883 - Add missing parameter to koha-conf.xml causing Plugins.t to fail

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 9883 - Koha::Plugins::* should not require koha-conf to load - Followup - Load C4::Auth at run time

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Unset KOHA_CONF variable and made sure t/00_load.t passed
Also ran Makefile.PL doing an update on my existing installation
and checked koha-conf.xml:

 <pluginsdir>/home/katrin/koha-dev/var/lib/plugins</pluginsdir>
 <enable_plugins>0</enable_plugins>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>