Bug 13172 t/Koha_Email.t was database dependent

To test
1/ Stop your database server
2/ run t/Koha_Email.t
3/ Notice the errors
4/ Apply patch
5/ run t/Koha_Email.t again
6/ No errors

(Don't forget to restart your db server after)

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>

Verified that it fixes a package build.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tests pass now without database connection.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13173 - remove some operations that are no longer needed

Build was failing because some files that it expected had vanished.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13174 : XSLT fails if, and only if you have an author, linked to an authority

And only in MARC21

To test:

Only for MARC21 with XSLT on for detail

1/ Find a record that has an authority linked author in it
2/ View the detail page in the opac
3/ Notice bibliographic data is missing
4/ Apply patch
5/ Refresh notice bibliographic data is back

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

Works as described.

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

Works as describe, the details are back!

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13141: Add ability for biblio_framework to be a dropdown in Guided Reports

By tweaking the GetReservedAuthorisedValues function in
C4::Reports::Guided, biblio_framework can be added as a dropdown
list into the guided reports parameters.

The change in C4/Reports/Guided.pm required a test, which is
found in t/db_dependent/ReportsGuided.t

Code was then added to reports/guided_reports.pl to build the
appropriate hash to trigger the proper dropdown list.

TEST PLAN
---------
1) Apply patch
2) prove -v t/db_dependent/ReportsGuided.t
   -- all should pass, this confirms that both
      C4/Reports/Guided.pm and this test file work.
3) Log into staff client
4) Reports
5) Create from SQL
6) Enter appropriate information like:
Report name: Test 13141
-- no need to change Report group or Report is public or Notes or Type
SQL:
SELECT CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',
     biblio.biblionumber,'\">',biblio.biblionumber,'</a>') AS
     BiblioNumbers, title, author, frameworkcode
FROM biblio
WHERE frameworkcode=<<Enter the frameworkcode|biblio_framework>>

7) Save report
8) Run report
   -- The parameter entry page should have a drop down of
      framework codes.
9) Select a framework code, and click Run the report
   -- The displayed SQL should have a "frameworkcode=" portion
      matching the selected framework.
10) Run the koha qa test tool.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Test plan followed successfully.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13141: (QA Followup) Update number of unit tests

While updating the number of unit tests from 12 to 13,
the number of tests to skip due to a outdated version
of DBD::Mock was missed.

This patch retains the test number change, and corrects
the number of tests.

TEST PLAN
---------
1) prove -v t/db_dependent/ReportsGuided.t
   -- on an UBUNTU git (lacks DBD::Mock >= 1.45)
2) prove -v t/db_dependent/ReportsGuided.t
   -- on a DEBIAN git (has DBD::Mock >= 1.45)
3) compare results.
   -- skipped tests should be 8 (2 individual tests + 6 in the loop)
      under Ubuntu.
   -- non-skipped tests should align.
   -- everything should be 13 tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13164: Incorrect ISSN visualization on the normal view if invalid/cancelled ISSN present

Currently, 022$z (and 011$z for UNIMARC) occurences are not shown, but the XSLT
logic used introduces punctuation characters for those $z occurences.

This patch adds a check for the existence of subfield a, and only loops
on $a subfields.

To test:
- Create/have a record with 022$z (or 011$z on UNIMARC) but no 022$a (no 011$a on UNIMARC).
- Open the detail page for the record (on both OPAC and staff).
=> FAIL: the ISSN label and ';' and '.' characters incorrectly shown.
- Repeat mixing with 022$a occurences to notice the bug.
- Apply the patch, reload
=> SUCCES: ISSN label shows only on the presence of a $a, and $z are skipped.
           no matter how many ISSN fields you add.
- Sign off :-D

Regards
To+

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Works as described on an UNIMARC DB. Mimics what's done for ISBN field.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12995 - script update_totalissues.pl stops on corrupted record

When running update_totalissues.pl cronjob, it will stop on a corrupted
record.

This patch changes UpdateTotalIssues so that it return 1 if processing
record has succeded. Also, if mapping with biblioitems.totalissues does
not exist, the method has nothing to do so it stops and returns 1.

When processing a corrupted record, script now alerts about the error on
this biblionumber (if script is verbose) and process next record.
A total number of records with error will be printed at the end of the
script.

Test plan :
- Create a dabase with a few biblios and some issues
- Modify first biblio record (use direct sql update) : set empty value
  in biblioitems.marcxml
- Launch script : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v

=> Without patch : the script stops at first record
=> With patch : the script prints error for first record and processes
   all records

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I was able to confirm the problem before the patch and successfully
follow the test plan.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 12995 - script update_totalissues.pl stops on corrupted record - UT

This patch adds an unit test on C4::Biblio::UpdateTotalIssues method
call on non existing record

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I can't comment on the correctness of the test other than to say it ran
successfully.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Improves CLI script, works as described.

Note: A small improvement would be to output the problematic biblionumber.
Bug 11517: Braille and combination swapped in XSLT result lists

http://www.loc.gov/marc/bibliographic/bd007f.html

- Catalog a record:
  * 007 - choose 'Tactile material'
  * Pos. 1 - choose b = Braille or C = combination
  * Reindex!
  * Verify the result list shows the format correctly.

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

Problem exist, fixed with this patch.
No koha-qa errors

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11876 - Add a diff view for staged MARC records.

New patch should apply correctly.

	modified:   C4/ImportBatch.pm
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt

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

Bug 11876 - Diff column is now displayed.

If a match is found, a 'View' link appears in the Diff column.

Old patch was not implementing datatables, and therefore was not compatible with this version of Koha.
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
	modified:   tools/batch_records_ajax.pl

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

These patches have some issues but I'm going to submit a follow-up which
I think will address them all and offer some improvements as well.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11876 - Ommited files in last patch

I forgot to include these files in the last patch

	new file:   tools/showdiffmarc.pl
	new file:   koha-tmpl/intranet-tmpl/prog/en/modules/tools/showdiffmarc.tt

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11876 [Follow-up] Add a diff view to staged MARC Records

This follow up makes some corrections to the previously added files and
adds some functionality to the diff: A Javascript diff plugin highlights
the differences between the records in the two columns.

Corrections made: Converted tab indentation to spaces, corrected GPL
statement.

File organization: Moved showdiffmarc.pl and .tt to /tools/ to match the
location of the page with which it functions,
tools/manage-marc-import.pl. Corrected permissions on showdiffmarc.pl
accordingly.

Updates to the template: Added standard includes inclucing header menu
and breadcrumbs; converted custom layout to YUI Grid standard.

To test, follow the test plan previously defined:

- Stage a MARC record batch which contains at least one record match for
  something already in your catalog.
- Locate the staged MARC record batch in Tools -> Manage staged records
  and click to view the contents.
- Find the record which matched an existing record and click the "View"
  link in the Diff column.
- The compare screen should include the header menu and breadcrumbs. The
  differences between your staged file and the existing record should be
  higlighted.
- You should be able to return to the MARC batch you were previously
  viewing by following the link in the breadcrumbs or the link at the
  bottom of the page.
- Confirm that the "About" page includes information about the new
  JavaScript plugin on the Licenses tab.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11876: (qa-followup) some minor changes

- GetImportBiblios: prepare the query is useless here
- use Modern::Perl
- Remove useless indentation level in pl file and redirect to 404 if
  required params are not given.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11876 [Unit test] Add a diff view to staged MARC Records

Unit test added

http://bugs.koha-community.org/show_bug.cgi?id=11876
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 643: Allow override of 'debarred' status

Add a button to temporarily override patron debarment.

To test:
1) Go to patron check out page
2) If patron has been debarred (eg. due to having fees),
   there is no way to check out to that patron.
3) Apply patch
4) A debarred patron check out page now has a button for
   "Override debarment temporarily" - clicking on it
   should allow checking out to that patron.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Rebased because patch did not apply

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with/without force_checkout and superlibrarian permission.
Also checked crafting a URL is no longer working.
No regressions found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 643: Followup: Display override button only if issuing staff member has force_checkout permission

To test:
Apply first patch
Apply this patch
Log in as superlibrarian
Go to Home > Patrons > Set permissions for issuing staff member
Disable circulate - force_checkout
Log in as issuing staff member
Try to checkout to a debarred patron
=> should not be possible
Log in again as superlibrarian
Enable circulate - force_checkout for issuing staff member
Log in as issuing staff_member
Try to checkout to a debarred person
=> You should get the button 'Override debarment temporarily'

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 643: QA Followup - server-side verification of permissions

Only allow $force_allow=1 if the logged in user has permissions.

TEST PLAN
---------
Attempt to intentionally override the checkout by passing an
appropriately handcrafted URL.
-- Regardless of the force_allow value, it should be not allowed
   for those lacking the force_checkout permission.

NOTE: I didn't test this. I figured Marc Veron could do that. :)
      (Sorry, couldn't easily get git bz to work with the accent)

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 643 [Template follow-up] Allow override of 'debarred' status

This minor followup makes two changes:

- Replaced instances of "Debarment" with "Restriction"
- Moved the override button into the block where the "View restrictions"
  button is, making the section slightly more compact.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Some small template changes, no problems found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 13065 - Receive shipment error message incorrectly styled

If there is an error during the receive shipment process the error
message is incorrectly styled. This patch fixes it.

To test you can trigger the error by accessing the page with incorrect
or missing parameters:

/cgi-bin/koha/acqui/parcels.pl?op=confirm

This should trigger the message. Apply the patch and confirm that the
error is now styled consistently with others in the staff client.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small template change, works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12955: The "show my funds only" should be take into account

The "Show my funds only" is not take into account if the checkbox is not
checked.
So there is no way to show all funds.
This has been introduced by bug 11578.

The default is not "only mine". The default is "show all funds".

Test plan:
- Create fund where you are the owner and others where you are not.
- Go on the fund list view and verify the checkbox "show my funds only"
  is take into account.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.

Note: In order to test this make sure you have funds owned by
another staff user.

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