Bug 7253: fast cataloging not always checking out

When using fast cataloguing to create a biblio and item on the fly, workflow looses datas when a duplicate is detected.
This comes from the use of a mix of circborrowernumber and borrowernumber in forms.

This patch corrects by using always circborrowernumber in fast cataloguing workflow.
Also adds html and uri escape for barecode where necessery.

Test plan :
With duplicate :
- Go to a borrower circulation page
- Enter a non existing barcode
- Enter a due date
- Click on "Check Out"
=> a message says the barcode was not found
- Click on "Fast cataloguing"
=> The biblio edition page appears with fast cataloguing framework
- Fill mandatory fields by using an existing ISBN
- Click on "Save"
=> a yes/no message says "Duplicate record suspected"
(Choosing yes will brake fast caloguing workflow, in this case librarian should create an item and checkout again)
- Click on "No"
=> The item edition page appears with barcode already filled
- Fill mandatory datas
- Click on "Add item"
=> Borrower circulation page appears again, check that item has been checked out with the specified due date

You may test without duplicate

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested following the plan and by fast cataloging a non-duplicate.
All works as expected.

Signed-off-by: koha.aixmarseille <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 7253: followup : manage toolbar for fastcataloging

During fast cataloging, hide some toolbar menus of biblio edition page :
- Save and view record
- Z3950 Search
- Framework change
Also display "(fast cataloging)" in biblio and item editon.

Signed-off-by: koha.aixmarseille <koha.aixmarseille@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Tested:
- adding a fast add with duplicate and without
- adding a new record, checked toolbar showed up correctly
- editing existing record, checked toolbar showed up correctly
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9585 - Fix spelling mistake in default tab conditional for opac-detail

There is just a small typo where one of the results of a conditional is
"subscription" rather than "subscriptions".

If this comes up, the correct tab (subscriptions) will not be chosen.

I'm not sure what will happen...it'll probably just have the
"holdings", "subscriptions", and "serial collection" tabs all default
to closed with none of them being open.

Test Plan:

The easiest way to test is just to double-check the other strings in the
conditional which say "subscriptions" rather than "subscription".

You can also look at opac-detail.tt where the param is shown, and note
that there is no condition for "subscription" - just "subscriptions".

Any tests other than that would be overly complex for such a trivial
patch.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
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 9545 - Fix import MARC bibliographic framework text label

This patch improves the labeling of import controls on the
MARC frameworks page by making import options more explicit. Other
changes:

- Form markup fixed to match standard form constructions
- JavaScript corrected to make more embedded English strings
  translatable.
- Form labels made clickable by making "for" attributes match unique
  form field ids.
- Some warning re-worded for readability and translatability.
- Large "loading" icon replaced with more proportional smaller one.

To test, view the MARC frameworks page (admin/biblio_framework.pl) and
test Export and Import functionality. Clicking each should display a
form with options clearly labeled. Import and Export operations should
complete correctly.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Works as described, although I see what Owen means about it being a good candidate for replacement with a modal dialog box in the future.

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 9545 - Followup Fix import MARC bibliographic framework text label

The export action for the default framework did not work.

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 9385 - patron add labels right aligned in chrome

The <legend> element has been given right alignment which seems to only
be respected by WebKit-based browsers. Users of Chrome and Safari see a
right-aligned legend while others see a left-aligned one. Given that the
legend is often applied to fieldsets spanning much of the screen it
seems wiser to have them left-aligned.

This patch removes "text-align:right" from the CSS so that <legend> will
inherit the default left alignment. To test, view any page with a legend
element, for instance the patron add form. In Firefox, Chrome, Safari,
IE, etc. the legend ("Patron identity," "Main address," etc.) should be
left-aligned in the fieldset.

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

Comment: Works as described. Tested in IE, Chrome, Firefox, Opera.
No errors.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass

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 9395: Problem with callnumber and standard number searches

This problem happens because there isn't a operator "phr" in the values
of callnumber and standard number search. So many results aren't the
corrects ones.

Test plan:

- Apply the patch
- In the dropbox search menu of OPAC main page header, the callnum
  should have only callnum
- In OPAC advanced search the callnumber and standard number options
  shouldn't have "phr"
- In staff client advanced search the callnumber and standard number
  options shouldn't have "phr"
- Change OPACNumbersPreferPhrase and IntranetNumbersPreferPhrase to "use"
- The options listed before should use now the operator "phr"
- This will resolve the problems with the searches of callnumbers and
  standard numbers in OPAC and staff client (spaces problems, no
  results, inconsistent results, etc...)

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

I don't know how to reproduce the searching problems described in the
bug, but I can confirm that the patch works correctly to enable/disable
the use of 'phr' in the searches described in the test plan.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
System preferences work as described, switching indexes in
OPAC and staff.
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	installer/data/mysql/sysprefs.sql
	installer/data/mysql/updatedatabase.pl
Bug 9651 - When deleting a fund, button is wrongly labelled with 'Delete this budget'

This patch change legends to approve/cancel deletion of a fund.
Changed to Delete/Cancel, same messages to delete a Budget.

To test:
1) When deleting a fund, confirmation messages said:
'Delete this budget XXX?' to approve
'No, do not delete' to cancel
2) Apply the patch
3) Now the messages are 'Delete'/'Cancel'

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works perfectly.

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 9655 - Capitalization wrong on 'Close and Print' button in basket groups

This patch fix button capitalization on basket groups for a vendor.

To test:
1) Go to Acquisitions, search for a vendor, click on vendor name,
Manage orders > Basquet groups
2) On Open tab, action button "Close and Print" has incorrect capitalization.
3) Apply the patch
4) Reload or repeat 1-2, capitalization fixed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works perfectly.

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 9658: Incorrect breadcrumb on report dictionary

Prior to this patch, the breadcrumb on the reports dictionary looks
like this: Home > Reports > Guided reports wizard Dictionary (notice
the lack of punctuation between "wizard" and "Dictionary").
This patch makes it consistent with the rest of the system so it looks
like this: Home > Reports > Guided reports wizard > Dictionary

I left dictionary bolded, since that seems to have been intentional,
even if I can't find a good reason for it.

To test:
1) View reports dictionary page before and after patch is applied,
   observing difference.

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

Comment: Trivial patch. Work as described. No errors
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 9650 - Show message if there are no notices

When there are no notices for the selected library, the
interface displays a table header with an empty table.

This patch adds a message which appears when there are no
notices for the selected library, or if no library selected
and there are no notices at all.

To test, visit the notices and slips page and
select a library for which there are no notices. A message
should be displayed, "There are no notices for this library."

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

Comment: Work as described. No errors.
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 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>