Bug 8682 - Renewals do not appear on quick slips

To test:
Issue two books to a patron.
Do a renewal on one of them.
update the issuedate on the item that has been renewed to something before today (renewals on the same day will work even without this patch)
I did: select * from issues;
update issues set issuedate="2013-01-25 14:00:00" where itemnumber = 948; (itemnumber is variable depending on your test data.)

Print a quick slip before the patch - the renewal will not show up as one of today's issues.
Print a quick slip after the patch - the renewal will show up as one of today's issues.

If you need reasoning as to why a renewal should show up on the quick slip, think of it as a record of everything
a borrower did today, without the hassle of overdues.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9663 - Individual bibliographic record "Save" option requires export permission

This patch corrects permission on the export option available on
catalogue pages in the staff client (detail.pl, MARCdetail.pl, etc) so
that users no longer require "export_catalogue" permission.
"export_catalogue" permission is required only for tools/export.pl.

This patch also corrects some crazy nearby indentation. Sorry, couldn't
resist.

To test, visit a page like detail.pl with and without "export_catalogue"
permission. It should be possible to save the record as MODS, MARCXML,
MARC, etc. without error.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 5333 - z3950 normalization should apply only on UNIMARC

It's been a while since this bug is around. This normalization is only
used for UNIMARC and yields a fatal error when those variables are set
on (at least) MARC21 setups.

Regards
To+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: update comment
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9520 -[Revised] - Update default LOC Z39.50 target

This patch updates (if present) target settings
of Library of Congress Z39.50 server.

Revision: Was trying to update wrong column 'type',
now correct column 'syntax'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: add the SetVersion call
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	installer/data/mysql/updatedatabase.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bumping database number
Bug 9574: Plack fixes for serials/subscription-add.pl

This patch fixes the following warnings under Plack:
* Use of uninitialized value $firstissuedate in string eq at \
    /home/jcamins/kohaclone/serials/subscription-add.pl line 92.
* Use of uninitialized value $firstissuedate in substr at \
    /home/jcamins/kohaclone/serials/subscription-add.pl line 105.
* Use of qw(...) as parentheses is deprecated at \
    /home/jcamins/kohaclone/serials/subscription-add.pl line 95.
* Variable "$firstissuedate" is not available at \
    /home/jcamins/kohaclone/serials/subscription-add.pl line 338.

To test:
1) Create a subscription. Ensure that setting the first issue's
   publication date works.
2) Edit a subscription. Ensure that the first issue's publication
   date shows up.
3) Sign off.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
No regressions found, all tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8620: Any index in DOM mode sensitive to -x flag of rebuild_zebra.pl

The definition of the Any index was sensitive to whether
spaces were present between (say) subfield elements in the
MARCXML representation of the bib being indexed.  When using
the -x option to rebuild_zebra.pl, spaces would be present
because of how MARC::File::XML emits MARCXML.

When not using the -x option, spaces would not be present
and the contents of a field would be run together, potentially
as one big token.

The visible behavior was that doing a keyword search by
item barcode would sometimes not work.

To test:
0) Make sure Zebra is using DOM mode
1) Create an item record.
2) Reindex using rebuild_zebra.pl -b -z, *without* -x
3) Do a keyword search by the barcode of the item just
   added; the search shouldn't work
4) Apply patch.
5) Update the following two files:
    etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl
    etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl
6) Reindex
7) Do a search that was previously failing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the problem for me - formerly not working callnumbers
and barcodes are now found in keyword (any) searches.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(revised commit description to better explain why it fixes the problem)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Passes all my tests, happy to sign off
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9656: Make logging to a file optional (for fines)

To test:
1/ Before the patch run misc/cronjobs/fines.pl
   Notice that a file has been written to /tmp

2/ rm the file

3/ Apply the patch and run the script again
   Notice the file is not created

4/ run the script with -l
   Notice the file is created again

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

Comment: Now it work as described. No errors.
Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9656: Followup Make logging to a file optional (for fines)

The -log option become optional if the -output_dir is given.

Test plan:
call the script with
1/ no one parameter : no log file
2/ -l : log file will be created in /tmp
3/ -o=/home/koha/var/log : log file with be created in the specified
4/ -o=/home/koha/var/log -l: Same as 3/

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

Comment: All combination of options tested. Works well. No errors.
Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9620: IncludeSeeFromInSearches and data in $9 subfields can break indexing

In Germany 020$9 is used to store the ISBN with hyphens. In rare cases this
can break indexing in combination with IncludeSeeFromInSearches.

To reproduce:
1) Change your frameworks:
  * Make sure 084 $a is visible
  * Create a 084 $9 that you link to PERSO_NAME authorities.
2) Create a record or edit an existing one:
  * Use the plugin on 084 to link the record to an authority.
  * Make sure 400 is filled in your authority record.

Preparations all done, now test indexing:

3) Make sure IncludeSeeFromInSearches is OFF
  * Reindexing should work without any problems.

4) Activate IncludeSeeFromInSearches
  * Reindexing should throw an error and stop:
    201.Subfields are only for data fields (generally,
    just tags >= 010 at /home/koha/Koha/Filter/MARC/EmbedSee
    FromHeadings.pm line 94

5) Apply patch and reindex.
  * No error should occur.
  * Test 4xx fields from other tags were properly indexed.

What causes the problem is the fact, that Koha tries to store
the date from the 400 in the bibliographic record for indexing.
For this it calculates a tag in the bibliographic record from the
tag it found the authority link in and the 4xx tags used in the
authority record. If you have an authority linked to a 0xx field
and the matching authority has a 4xx where xx < 10, the calculated
tag will be a control field. The attempt to add subfields to this
control field, is causing the error and breaks the indexing process.

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

Comment: Work as described, and is a long description :)
Test:
1) Enabled 084 (all subfields visible), added 084_9 (missing from
default framework) linked to PERSO_NAME
2) Edited authority record and added some data to 400
3) Edited bib record, linked 084 to previous auth record
4) With IncludeSeeFromInSearches OFF, re-index without problem
5) With IncludeSeeFromInSearches ON, re-index problems!!!
====================
exporting biblio
====================
1...Subfields are only for data fields (generally, just tags >= 010) at...
Abort
6) Applied patch
7) With IncludeSeeFromInSearches ON, re-index without problem
...
====================
5001....................................................................................................
Records exported: 5060
====================
...
====================
2001....................................................................................................
Records exported: 2024
====================
CLEANING
====================
Good!

*) That's "works as described", don't know if other tests are needed.

No errors from koha-qa

Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9570 - view plain not working in ccsr

The code in opac-showmarc.pl isn't smart enough to find the xsl files in
the "default" (prog) theme if the ccsr theme is enabled, so the "view
plain" option on opac-MARCdetail.pl fails ever time.

This patch copies some path-handling code from XSLT.pm to improve xsl
file path handling when dealing with a "sub-theme."

To test, view the MARC view in the OPAC and click the "view plain" link.
This should work correctly in prog and ccsr themes and with different
languages enabled (keeping in mind the ccsr theme will fail in general
for languages other than en).

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked plain view works in both prog and ccsr themes now.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9267 - Ubuntu 12.04 install docs broken

Current install instructions are broken in the (1.6) step. On amd64
architectures it breaks the whole dependency tree, pulling i386 packages.

This patch replaces the 'dpkg --set-selections' combo and replacess some spaces
for tabs in one line.

This should be cherry-picked for other releases that have 12.04 install instructions
as the problem is related to multiarch.

Regards
To+

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9586 - Remove $ENV{DEBUG} info from Member Template

Currently, if $ENV{DEBUG} is set (for example to 1), the debug level
will be printed on the Add/Edit Patron pages (memberentrygen.tt) in the
form of: "Debug is on (level 1)".

While many if not most folks might not set $ENV{DEBUG} on a production
system, there is no reason to have this information printing on the
member template(s).

No where else in Koha is there a template that prints $ENV{DEBUG}
information, with the exception of calendar.inc, although that doesn't
activate until at least debug level 2 or 5, so it might be worth holding
on to. It is certainly more complicated than simply printing the debug
level. I don't do development on the calendars, so I'm not going to
address that one.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>