koha.git
10 years agoBug 5349: Create a table for order line transfers
Julian Maurice [Tue, 2 Jul 2013 10:46:37 +0000 (10:46 +0000)]
Bug 5349: Create a table for order line transfers

This allow to keep transfers informations without having untranslatable
strings in database.

Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5349: Use DB transaction/rollback in unit tests
Julian Maurice [Tue, 2 Jul 2013 08:12:02 +0000 (08:12 +0000)]
Bug 5349: Use DB transaction/rollback in unit tests

Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5349: Add unit tests for TransferOrder
Julian Maurice [Thu, 13 Jun 2013 12:44:11 +0000 (12:44 +0000)]
Bug 5349: Add unit tests for TransferOrder

Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signing off on this because a following patch fixes the test to use
transactions

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5349: Fix a logical test in TransferOrder
Julian Maurice [Fri, 14 Sep 2012 14:32:48 +0000 (16:32 +0200)]
Bug 5349: Fix a logical test in TransferOrder

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5349: (follow-up) run transferorder.pl in a popup
Julian Maurice [Mon, 11 Jun 2012 11:56:58 +0000 (13:56 +0200)]
Bug 5349: (follow-up) run transferorder.pl in a popup

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5349: add ability to transfer order lines from one basket to another
Julian Maurice [Fri, 6 Apr 2012 14:57:12 +0000 (16:57 +0200)]
Bug 5349: add ability to transfer order lines from one basket to another

On basket.pl and parcel.pl there is a 'Transfer' link which allow you to
transfer order lines from a basket to another.

The link leads to a new page which allow you to search for a bookseller,
then display this bookseller's baskets. Then you can pick a basket and
the transfer will be done.

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: sonia <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10678 - Update addbooks help page
Tomas Cohen Arazi [Fri, 2 Aug 2013 21:36:19 +0000 (18:36 -0300)]
Bug 10678 - Update addbooks help page

The button's name changed, and a caret was added.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
If you click the button directly, the default framework is still used.
If you use the split button functionality to select another framework,
this framework will be used for the imported record.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10678 - Allow framework selection when creating from Z39.50
Tomas Cohen Arazi [Fri, 2 Aug 2013 18:22:43 +0000 (15:22 -0300)]
Bug 10678 - Allow framework selection when creating from Z39.50

If we are creating a new record, we are forced to use the default framework
and then change it after we have the cataloguing form filled. This patch
adds the option to choose (from a splitted button dropdown) which framework
to use.

To test:
- Apply the patch.
- Go to More > Cataloguing
- Check there's a nice split button that says "New from Z39.50"
a) Click the button, the usual Z39.50 search popup should appear and work as expected
   (check the URL parameters and see frameworkcode= has no value
b) Click on the dropdown arrow, choose a framework and the usual Z39.50 search popup should
   appear, this time frameworkcode= should have the chosen value.

Edit: fixed a small bug that prevented the default framework to be called. Thanks Owen for testing.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: (follow-up) remove stray merge conflict marker
Galen Charlton [Sun, 8 Sep 2013 20:45:22 +0000 (20:45 +0000)]
Bug 10320: (follow-up) remove stray merge conflict marker

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10640: (follow-up) bump up the number of expected tests in Bookseller.t
Galen Charlton [Sun, 8 Sep 2013 20:37:19 +0000 (20:37 +0000)]
Bug 10640: (follow-up) bump up the number of expected tests in Bookseller.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10640: give ModBookseller() an explicit return value.
Kenza Zaki [Thu, 25 Jul 2013 08:18:11 +0000 (10:18 +0200)]
Bug 10640: give ModBookseller() an explicit return value.

Before, ModBookseller always returns undef. This patch modifies it in
order to be more explicit.

Now it returns :

1 -> If a modification has been done
0E0 -> If the given ID doesn't exist
undef -> If no ID given

It also fixes one of the tests which didn't pass before
in t/db_dependent/Bookseller.t

To Test:
prove t/db_dependent/Bookseller.t
Bookseller.t .. 1/54
[Some warnings about uninitialized values]
t/db_dependent/Bookseller.t .. ok
All tests successful.
Files=1, Tests=54,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.46 cusr  0.04 csys =  0.53 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Change is logical and passes new and old tests.
Fixed the author line to have Kenza's correct email address.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10630: give DelBookseller() a return value
Kenza Zaki [Thu, 25 Jul 2013 07:37:34 +0000 (09:37 +0200)]
Bug 10630: give DelBookseller() a return value

This patch makes DelBookseller returns the number of suppliers it has
deleted or undef if an error has occurred.

It also fixes a test which doesn't pass before in t/db_dependent/Bookseller.t

To test:
prove t/db_dependent/Bookseller.t
t/db_dependent/Bookseller.t .. 1/54
All tests successful.
Files=1, Tests=54,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.48 cusr  0.02 csys =  0.52 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Logical change and makes another test pass :)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10718: fix items with no checkouts report
Fridolyn SOMERS [Tue, 13 Aug 2013 12:55:32 +0000 (14:55 +0200)]
Bug 10718: fix items with no checkouts report

Bug 8124 has commented the option to download results items with no
checkouts report into a file.  But the perl code of this page uses
the export into a file has default behavior since the input "output"
is no more present.  The consequence is that there are never results
in page.

This patch removes the code concerning file output from template and perl.
Such a feature exists in guided reports.

Test plan :
Play with cgi-bin/koha/reports/catalogue_out.pl form and see if you get results

Bug 10718 - select user branch as default

In cgi-bin/koha/reports/catalogue_out.pl report, select in library filter the user logged-in.

Test plan :
- Log into intranet with a normal user
- Got to "Items with no checkouts" reports
=> Your branch is selected
- Run report
=> You see "Filtered on : Branch = <your branch>"
- Come back to report
- Select "Any library"
- Run report
=> You do not see "Filtered on : Branch"

Bug 10718 - items with no checkouts report permission is execute_reports

This report only executes SQL to change reports/catalogue_out.pl permissions from all reports subpermissions to reports/execute_reports.

Test plan :
Test you can access and run this report with only execute_reports subpermission into reports permission.

Bug 10718 - redefine limit input

In reports/catalogue_out.pl form, the limit input is by defaut none.
So by default the report queries all the catalogue.
This may take a very long time (fall into timeout) and since now the results are displayed in page, the page may be huge.

This patch modifies limit input to removes the "none" option.
Also reduces the number of options (same options as guided reports results per page).

Test plan:
- Go to reports/catalogue_out.pl
=> first value "10" is selected
- Launch report
=> You see "Filtered on: limit = 10"

Bug 10718 - perltidy on reports/catalogue_out.pl

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tested all of these things, all ok - squashed patch for neatness.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Fixed a tab in one of the comments.
Improves script, but more work needed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10817: return hold items info in SIP Patron Info Response
Colin Campbell [Wed, 4 Sep 2013 10:18:11 +0000 (11:18 +0100)]
Bug 10817: return hold items info in SIP Patron Info Response

When requested by the summary flags the sipserver
should return in the patron info response barcodes of
the relevant titles.

For available holds this is the barcode of the captured items.

For unavailable holds ( i.e. current unsatisfied holds ),
we need to send a barcode so that the unit can use this to
request the title info. The barcode could be any one
belonging to the title.

This patch also corrects the erroneous return of empty items
in the patron information response. If the unit supplies a
range 1 - 100 unless the title has a hundred or more copies the
unit expects all copies. The server was erroneously stuffing
the returned arrays with null copies so that all summary requests
returned 100 copies (mainly without barcodes)

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes:
Using the test script provided on the bug report, but changed it
to match sip user and patron existing in my database.

Before applying the patch the SIP responses show the behaviour
pointed out above regarding the 100 items. After applying the
patch and restarting the SIP server responses are much more clean
not returning empty IDs.

64 Patron information response
AS = hold items
  hold items count is correct.
  AS contains barcodes of waiting holds.
  Before patch, all AS were empty.
AT = overdue items
  overdue items count is correct.
  AT contains barcodes of overdue items.
AU = charged items
  charged items count is correct.
  AU contains barcodes of charged items.
AV = fine items
  Judging from behaviour seen and comment in
  Patrons.pm currently not implemented.
BU = recall items
  Recalls are not implemented in Koha yet.
CD = unavailable hold items
  unavailable items count is correct.
  CD contains barcode for item level holds and is empty
  for title level holds where  no item can be determined.
  Before patch, all CD were empty.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10564 - use OPACURLOpenInNewWindow in UNIMARCslim2OPACResults.xsl
Fridolyn SOMERS [Wed, 10 Jul 2013 09:06:39 +0000 (11:06 +0200)]
Bug 10564 - use OPACURLOpenInNewWindow in UNIMARCslim2OPACResults.xsl

When using UNIMARC XSLT for OPAC detail page, if record has an 856$u,
its content is displayed as a link. The syspref OPACURLOpenInNewWindow
adds the option of opening in a new window (attribute target="_blank").

856$u is also used in UNIMARC results XSLT but the use of
OPACURLOpenInNewWindow syspref is missing. It exists for MARC21.

This patch adds the use of OPACURLOpenInNewWindow in UNIMARCslim2OPACResults.xsl.

Test plan :
- In a UNIMARC catalog, enable XSLT for OPAC results page
- Create a record with a link in 856$u and set second indicator to 0
- Set OPACURLOpenInNewWindow syspref on
- At OPAC, perform a search that contains the record
=> You should see the link : "Click here to access online"
- click on it
=> You shoud get to a new window (or tab depending on your browser configuration)
- Set OPACURLOpenInNewWindow syspref off
- re-perform the search
- click on the link
=> You shoud stay in same window

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described, no koha-qa errors
Tested following plan after applying patch

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
XSLT change only, works as described.
To test: Catalog 856$u and $a, 2nd indicator = 0.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10331 - Little errors in unimarc_field_4XX.pl (punctuation)
Janusz Kaczmarek [Fri, 24 May 2013 11:38:10 +0000 (14:38 +0300)]
Bug 10331 - Little errors in unimarc_field_4XX.pl (punctuation)

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Copying the test plan from the bug report:

A.
1) have $a active in one of the linking fields (like 461, 463, etc.).
2) have a biblio record with the field 700 $a, $b, $f filled up
3) go to cataloguing -> field 4XX of your choice, use the plugin to
  fetch data from biblio rec. mentioned in 2)
4) see the punctuation in $a -- it will be wrong (no closing bracket)

B.
1) have $a active in one of the linking fields (like 461, 463, etc.).
2) have a biblio record with the field 700 $a, $b, $c, $f filled up
3) go to cataloguing -> field 4XX of your choice, use the plugin to
   fetch data from biblio rec. mentioned in 2)
4) see the punctuation in $a -- it will be wrong (dash instead of
   semicolon between original $c and $f, no closing bracket)

C.
1) have $a active in one of the linking fields (like 461, 463, etc.).
2) have a biblio record with the field 702 $a, $b, $c filled up
3) go to cataloguing -> field 4XX of your choice, use the plugin to
   fetch data from biblio rec. mentioned in 2)
4) see the punctuation in $a -- it will be wrong (unnecessary semicolon
   after original $c, n.b. lacking space).

D.
1) have $a active in one of the linking fields (like 461, 463, etc.).
2) have a biblio record with the field 712 $a, $b filled up
3) go to cataloguing -> field 4XX of your choice, use the plugin to
   fetch data from biblio rec. mentioned in b)
4) see the punctuation in $a -- it will be wrong (unnecessary opening
   bracket at the end).

Test plan, all tests and QA script pass.
Thx Bernardo for his testing and explanations!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9924: (follow-up) ensure that correct error message is displayed
Galen Charlton [Sun, 8 Sep 2013 07:37:04 +0000 (07:37 +0000)]
Bug 9924: (follow-up) ensure that correct error message is displayed

(Apparently) unlike HTML::Template::Pro, Template Toolkit doesn't like
template variables that are entirely numeric -- in conditionals, it
consider them integers, most of which are Perl true.

This patch changes this by setting the error variable to the error
value.

To test:

[1] Run the test plan from the previous patch.  In each
    case, verify that the error message is specifically applicable
    to the test.  For example, if you try uplaoading a patron image
    that is larger than 500KB, the error message displayed should
    specifically say so.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Thank you Galen for catching this. Error messages showing up
now are much more specific and according to the error codes given.
I testd uploading a file larger then 500KB and triggered several
error messages giving the error code in the URL:
/cgi-bin/koha/patroncards/manage.pl?card_element=profile&error=201

All tests and QA script pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9924 - Simplify and rename patron card creator error message include
Owen Leonard [Mon, 25 Mar 2013 16:22:33 +0000 (12:22 -0400)]
Bug 9924 - Simplify and rename patron card creator error message include

The patron card creator error message include uses a non-standard method
for displaying error messages, and is poorly-named.

This patch converts the method of displaying error messages for various
patron card creator options to the standard one ('<div class="dialog
alert">') and renames the include file to make it clear that it relates
only to patron card creator operations.

To test, perform various operations:

- Go to 'manage images' and try to upload a file which exceeds the
  500KBfile size limit
- Go to the edit batch page and manually append an error code to the
  URL:  /cgi-bin/koha/patroncards/edit-batch.pl?op=new&error=403
- Go to one of the manage pages and manually append an error code to the
  URL:
  /cgi-bin/koha/patroncards/manage.pl?card_element=profile&error=201

Correct display of an error message indicates that the include file is
being found.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes test plan, test suite and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9943: activate "Pay selected" button only when at least one fine is selected
Owen Leonard [Fri, 9 Aug 2013 17:43:21 +0000 (13:43 -0400)]
Bug 9943: activate "Pay selected" button only when at least one fine is selected

If you select no fines but click the "pay selected" button the resulting
screen offers to let you pay against all fines, which is confusing. To
simplify things this patch disables the "pay selected" button if no
lines are selected.

To test, apply the patch and find a patron with outstanding fines. From
the "pay fines" page (members/pay.pl) try selecting and deselecting
checkboxes and using the "select all" and "clear all" links. When no
item is selected the "Pay selected" button should become disabled.
Confirm that the form submits correctly when one or more fines is
selected.

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works nicely in my tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: (follow-up) handle OverDrive authentication failure more gracefully
Galen Charlton [Sun, 8 Sep 2013 06:58:49 +0000 (06:58 +0000)]
Bug 10320: (follow-up) handle OverDrive authentication failure more gracefully

When calling the overdrive_proxy service, if for some reason the
credentials are not accepted by OverDrive, return HTTP status 400
(as intended) rather than an internal server error.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: DBrev 3.13.00.017
Galen Charlton [Sun, 8 Sep 2013 06:49:19 +0000 (06:49 +0000)]
Bug 10320: DBrev 3.13.00.017

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: (follow-up) tidy up new system preferences
Galen Charlton [Sun, 8 Sep 2013 06:47:18 +0000 (06:47 +0000)]
Bug 10320: (follow-up) tidy up new system preferences

- added to sysprefs.sql
- fixed typo in updatedatabase.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: (follow-up) correct license statement
Galen Charlton [Sun, 8 Sep 2013 06:42:10 +0000 (06:42 +0000)]
Bug 10320: (follow-up) correct license statement

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320: (follow-up) Fix copyright and style errors
Jesse Weaver [Tue, 30 Jul 2013 16:49:57 +0000 (10:49 -0600)]
Bug 10320: (follow-up) Fix copyright and style errors

This patch fixes a copypasta'd copyright statement, and some incorrect
POD and indentation.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoFollowup for bug 10320: minor bugfixes and style improvements
Jesse Weaver [Thu, 18 Jul 2013 15:48:19 +0000 (09:48 -0600)]
Followup for bug 10320: minor bugfixes and style improvements

Switch to the new method of showing star ratings. Also, fix some
translation bugs, an error that occurred when caching was disabled and
add a stub unit test.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10320 - Integrate OverDrive search into OPAC
Jesse Weaver [Thu, 16 May 2013 23:11:15 +0000 (17:11 -0600)]
Bug 10320 - Integrate OverDrive search into OPAC

Show any relevant results from the OverDrive ebook/audiobook service
on the OPAC search. This is done by showing a link with "Found xx
results in the library's OverDrive collection" at the top of search
results and linking to a page that shows the full results.

This requires an OverDrive developer account, and is enabled by
setting the OverDriveClientKey and OverDriveClientSecret
system preferences.  In addition, this patch adds the
OverDriveLibraryID system preference.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Henry Bankhead <hbankhead@losgatosca.gov>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10619 - fix errors in sco.css for the CCSR OPAC templates
Owen Leonard [Thu, 1 Aug 2013 14:09:51 +0000 (10:09 -0400)]
Bug 10619 - fix errors in sco.css for the CCSR OPAC templates

sco.css is not missing from CCSR, but some image paths in the CSS are
incorrect, resulting in some missing images. This patch corrects those
broken paths.

This patch also hides the Cart/Lists/login region of the template which
should not be visible in self checkout.

To test, enable self-checkout and switch to the CCSR theme. Load a
patron for self-checkout and confirm that images associated with buttons
appear correctly: By the help link in the upper-right, on the 'Finish'
button, etc. Try checking out an item which is already checked out to
that patron to see more examples.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
CSS changes only, works nicely.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10769 - Simplify clearing of input fields when duplicating a patron
Owen Leonard [Tue, 20 Aug 2013 13:07:25 +0000 (09:07 -0400)]
Bug 10769 - Simplify clearing of input fields when duplicating a patron

When duplicating a patron record an onclick event is added to many
fields in order to make then clear when focused. This patch updates the
template so that the logic for this can be simplified. A template
variable is set based on the 'opduplicate' variable, and a class added
to the relevant fields. All fields with that class are cleared on focus.

Also changed are several markup issues which were causing validation
errors.

To test, find or create a patron record which has all standard text
fields filled with data. Use the "duplicate" button on the detail view
of that patron to initiate the duplication process.

Focus on each field in the patron entry form in succession. Fields which
contain data should be cleared in the same way they were before the
patch.

Also test a regular edit operation to confirm that fields are not
cleared.

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10027: (follow-up) improve display of fine details on printed invoice
Kyle M Hall [Thu, 5 Sep 2013 19:27:58 +0000 (15:27 -0400)]
Bug 10027: (follow-up) improve display of fine details on printed invoice

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

Checked invoice is correctly printed for
- partially paid fines
- paid fines
- unpaid fines

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10027: (follow-up) tidy members/printinvoice.pl
Kyle M Hall [Wed, 10 Apr 2013 17:49:16 +0000 (13:49 -0400)]
Bug 10027: (follow-up) tidy members/printinvoice.pl

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10027: include fine details when printing a fine
Kyle M Hall [Wed, 10 Apr 2013 17:45:18 +0000 (13:45 -0400)]
Bug 10027: include fine details when printing a fine

Previously printing a fine invoice would result in a page with both the
single item charge and the total outstanding amount. Right now only the
total outstanding is printed.

Test Plan:
1) Print a fine, note the fine doesn't show, only the total
2) Apply patch
3) Print a fine, not the fine does show

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9252 - Add option to send patron's home branch in AF field - QA Followup
Kyle M Hall [Mon, 8 Jul 2013 12:03:11 +0000 (08:03 -0400)]
Bug 9252 - Add option to send patron's home branch in AF field - QA Followup

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9252 - Add option to send patron's home branch in AF field
Kyle M Hall [Mon, 10 Dec 2012 13:54:24 +0000 (08:54 -0500)]
Bug 9252 - Add option to send patron's home branch in AF field

This patch gives you the option of sending a patrons home branch code
in an AF field for patron status requests. It is controlled at the account
login level, so it can be enable on a per-sip-login basis.

Test Plan:
1) Apply patch
2) Edit SIPconfig.xml, add the parameter 'send_patron_home_library_in_af="1"'
   to the login you will be using to test.
3) Start your SIP2 server.
4) Connect to it via telnet ( something like: '9300CNterm1|COterm1|CPCPL|' )
5) Send a patron status request ( like: '2300120121110    82925AOCPL|AA23529000035676|ACterm1|ADletmein' )
6) Examine reponse you should see something like this:
      "24              00120121210    085332AEHenry Acevedo|AA23529000035676|BLY|CQN|AFGreetings from Koha. |AFMPL|AO|"
   Note the second AF field with the value MPL.

Signed-off-by: George Williams <georgew@latahlibrary.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9845: correct SIP 08checkin.t
Adrien Saurat [Thu, 21 Mar 2013 10:58:29 +0000 (11:58 +0100)]
Bug 9845: correct SIP 08checkin.t

The tests were too restrictive. It should be possible to pass
a checkin/checkout test with different values defined for
magnetic media.

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>
10 years agoBug 9531: Make SIP2 message terminator configurable via SIPconfig.xml
Kyle M Hall [Fri, 1 Feb 2013 15:40:50 +0000 (10:40 -0500)]
Bug 9531: Make SIP2 message terminator configurable via SIPconfig.xml

Add a terminator option to SIPConfig.xml, choices for 'terminator' are
'CR' or 'CRLF'.  The default continues to be 'CRLF' if 'terminator' is
undefined.

Test Plan:
1) Apply patch
2) Start SIP server
3) Run C4/SIP/t/04patron_status.t
4) Stop SIP server
5) Add terminator="CR" for account login 'term1'
6) Run 04patron_status.t again, you should see no change

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Adrien Saurat <adrien.saurat@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7478: fix template translation problem in catalogue_out.tt
Owen Leonard [Fri, 9 Aug 2013 13:50:49 +0000 (09:50 -0400)]
Bug 7478: fix template translation problem in catalogue_out.tt

The items with no checkouts template has a sections that uses DEFAULT to
set some strings: [% DEFAULT loopro.itemcallnumber="No Call Number" %]
This appears to be untranslatable with our current translation tool.

This patch changes the template so that it uses a simple [% IF %] block
to display the default text if no value is set. Added is use of the
Branches template plugin to show library name instead of code.

This patch also fixes an error introduced in my fix for Bug 8124 causing
the page to default to CSV download instead of output to screen.

To test, apply the patch and confirm that the default text appears
onscreen in reports which include results that have a missing barcode,
title, or call number. Results should be displayed on screen correctly.

Run "perl translate update" for any language and confirm that the newly
generated po file includes "No call number," "No barcode," and "NO
TITLE" for catalogue_out.tt

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, thx Owen!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10325: (follow-up) restore case-insensivity of syspref cache
Galen Charlton [Sun, 8 Sep 2013 05:08:51 +0000 (05:08 +0000)]
Bug 10325: (follow-up) restore case-insensivity of syspref cache

Case-insensitivity of the system preference cache was introduced in
the patch for bug 6132.  This patch corrects some breakage that
occurred.  Longer-term, IMO a hard look needs to be taken at
using a case-insensitive collation for syspref codes, and coded
values in general.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10325: (follow-up) add test for overriding system preferences
Galen Charlton [Sun, 8 Sep 2013 02:28:45 +0000 (02:28 +0000)]
Bug 10325: (follow-up) add test for overriding system preferences

To test:

[1] Verify that prove -v t/db_dependent/sysprefs.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10325: (follow-up) fix typos and whitespace in httpd.conf example
Galen Charlton [Sun, 8 Sep 2013 02:16:59 +0000 (02:16 +0000)]
Bug 10325: (follow-up) fix typos and whitespace in httpd.conf example

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10325 - QA Followup - Fix typos
Kyle M Hall [Thu, 15 Aug 2013 17:49:07 +0000 (13:49 -0400)]
Bug 10325 - QA Followup - Fix typos

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10325 - Allow system preferences to be overridable from koha-httpd.conf
Kyle M Hall [Fri, 24 May 2013 10:56:50 +0000 (06:56 -0400)]
Bug 10325 - Allow system preferences to be overridable from koha-httpd.conf

For Koha installations with multiple OPAC URLs, It would be nice to be
able to override systeprefs from the http conf file. Case in point,
a library wants to have two separate opacs, one the is only viewable
from within the library that allows patrons to place holds, and a second
public one that does not. In this case, overriding the system preference
RequestOnOpac would accomplish this simply, and with no ill affects.

This feature would of course be should only be used to override
cosmetic effects on the system, and should not be used for system
preferences such as CircControl, but would be great for preferences
such as OpacStarRatings, opacuserjs, OpacHighlightedWords and many
others!

Test Plan:
1) Apply this patch
2) Disable the system pref OpacHighlightedWords
3) Do a seach in the OPAC, not the term is not highlighted
4) Edit your koha-http.conf file, add the line
     SetEnv OVERRIDE_SYSPREF_OpacHighlightedWords "1"
   to your koha-http.conf file's OPAC section.
   Also add the line
     SetEnv OVERRIDE_SYSPREF_NAMES "OpacHighlightedWords"
   to the Intranet section
5) Restart your web server, or just reload it's config
6) Do a seach, now your search term should be highlighted!
7) From the intranet preference editor, view the pref,
   You should see a warning the this preference has been overridden.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10333: Labels/t_Batch.t needs to create its own data
Jonathan Druart [Fri, 24 May 2013 12:51:14 +0000 (14:51 +0200)]
Bug 10333: Labels/t_Batch.t needs to create its own data

prove t/db_dependent/Labels/t_Batch.t
db_dependent/Labels/t_Batch.t .. 1/33 # Testing Batch->new() method.
db_dependent/Labels/t_Batch.t .. ok
All tests successful.
Files=1, Tests=33,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.34 cusr
0.00 csys =  0.37 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10550: DBRev 3.13.00.016
Galen Charlton [Sun, 8 Sep 2013 01:57:57 +0000 (01:57 +0000)]
Bug 10550: DBRev 3.13.00.016

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10550: (follow-up) correct one additional instances of 'wthdrawn'
Galen Charlton [Sun, 8 Sep 2013 01:56:52 +0000 (01:56 +0000)]
Bug 10550: (follow-up) correct one additional instances of 'wthdrawn'

This was introduced after Kyle's patch passed QA.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10550: Merge 2 updatedatabase entries into 1
Jonathan Druart [Mon, 19 Aug 2013 13:05:49 +0000 (15:05 +0200)]
Bug 10550: Merge 2 updatedatabase entries into 1

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10550: Fix database typo wthdrawn
Kyle M Hall [Mon, 8 Jul 2013 16:05:46 +0000 (12:05 -0400)]
Bug 10550: Fix database typo wthdrawn

This patch updates the wthdrawn field in items and deleteditems to be
withdrawn instead. No functional changes are made.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Save for translation files (that will be fixed on next release),
only occurrence of wthdrawn is on updatedatabase.pl
No koha-qa errors.

This touch many files, and I did not test everything,
but all seems normal. I think that any problem could
be fixed later.

Perhaps both entries in updatedatabase.pl could be joined
into one, but thats for QA.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10349 - Don't show empty Descriptions/Title notes tabs in OPAC and staff
Owen Leonard [Fri, 31 May 2013 16:05:49 +0000 (12:05 -0400)]
Bug 10349 - Don't show empty Descriptions/Title notes tabs in OPAC and staff

The descriptions/title notes tab appears on the detail page in both
staff client and OPAC even if there are no notes. This is probably a
relic of the pre-T:T days when it wasn't possible to use || in an IF.
This patch adds a check for the various variables which might trigger
the display of the tab.

To test, apply the patch and view records in the OPAC and staff client
which do and do not have title notes attached (whether that be in the
MARC record or in the biblio.notes column). In the OPAC Syndetics
content should also be tested if possible. The descriptions/title notes
tab should only appear if there is content.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
That's better - thx Owen!
Works nicely and passes all tests.
Tested in staff and OPAC, also in combination with NotesBlacklist
hiding all notes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10324: fix display of editorial series in normal view (UNIMARC / no XSLT)
Janusz Kaczmarek [Mon, 18 Mar 2013 20:16:22 +0000 (22:16 +0200)]
Bug 10324: fix display of editorial series in normal view (UNIMARC / no XSLT)

The patch corrects the issue -- the content of the field 225 shall be
displayes under Series now.

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comparing the XSLT with the normal view the patch seems to
work correctly. Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10272: (follow-up) add regression test
Galen Charlton [Sun, 8 Sep 2013 01:20:05 +0000 (01:20 +0000)]
Bug 10272: (follow-up) add regression test

This patch adds a regression test for this bug, effectively
implementing the manual test plan in the previous patch.

To test:

[1] Verify that prove -v t/db_dependent/Reserves.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10272: make CheckReserves respect ReservesControlBranch
Kyle M Hall [Fri, 17 May 2013 12:08:24 +0000 (07:08 -0500)]
Bug 10272: make CheckReserves respect ReservesControlBranch

CheckReserves was using the CircControl system preference to determine what
patrons an item can fill a hold for. It should be using ReservesControlBranch
instead.

Test Plan:
1) Set ReservesControlBranch to "item's home library".

2) Create an item at Library A, place holds for it for patrons at
   Library B, Library C, and Library A in that order,
   for pickup at the patrons home library.

3) Make sure the holds policy for Library A is set to
   Hold Policy = "From home library" and
   Return Policy = "Item returns home".

   Make sure the holds policies for the other libraries are set to
   Hold Policy = "From any library".

4) Check the item in at Library C, the hold for the patron at Library B
   should pop up, even though it's in violation of the circulation rules.
   Don't click the confirm button!

5) Apply this patch, and reload the page,
   now the hold listed should be for the last hold,
   the hold for the patron at Library A, which is correct.

This patch adds the subroutine C4::Reserves::GetReservesControlBranch as
an equivilent to C4::Circulation::_GetCircControlBranch.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed POD so that arguments and explanation match (C<$item>).
Also tested opac-reserves.pl for regressions.
Passes all tests, QA script, and Reserves.t.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10584 - Hide OPAC biblio details if all items are hidden
Mark Tompsett [Fri, 12 Jul 2013 03:13:42 +0000 (23:13 -0400)]
Bug 10584 - Hide OPAC biblio details if all items are hidden

If there are items for a given biblio number, and they are all
hidden, then biblio needs to be hidden. If the biblio needs to
be hidden, this is done by setting the biblionumber to 0, which
triggers the same output as if the biblionumber does not exist.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

10 years agoBug 10672 - Add subtitle to display of checkouts, overdues, and holds on the patron...
Owen Leonard [Thu, 1 Aug 2013 14:57:02 +0000 (10:57 -0400)]
Bug 10672 - Add subtitle to display of checkouts, overdues, and holds on the patron summary

In the OPAC, the patron summary page (opac-user.pl) should display
subtitle along with title in the lists of checkouts, overdues, and
holds. This patch adds it.

To test, log in to the OPAC as a patron who has checkouts, overdues, and
holds which include titles with subtitles. Titles should appear
correctly with and without subtitles.

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>
10 years agoBug 10721 - Improve DataTables configuration on transfers to receive report
Owen Leonard [Tue, 13 Aug 2013 18:50:06 +0000 (14:50 -0400)]
Bug 10721 - Improve DataTables configuration on transfers to receive report

I noticed this template used a hidden span to allow correct sorting of
titles--a relic of the previous table sorting plugin. I have removed
that and added an improved DataTables configuration.

To test apply the patch and view the transfers to receive report for a
library which has multiple transfers to receive. Sorting should work
correctly on all columns, including correct date sorting regardless of
dateformat system preference. Title sorting should correctly exclude
articles.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and works nicely.
Tested with different date formats.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10793: XSLT change 780/785 search queries to use ti,phr indexes like other linkin...
David Cook [Wed, 28 Aug 2013 01:55:02 +0000 (11:55 +1000)]
Bug 10793: XSLT change 780/785 search queries to use ti,phr indexes like other linking entries

This patch adds the ti,phr index to the search queries for the 780
and 785 MARC fields in the XSLT templates.

Test Plan:

1) Use a record with 780 and 785 MARC fields with data in the "a" or
"t" subfields. (You might need to add these fields to an existing
record, or create a new record. You might also need to change your
MARC Bibliographic Framework settings to not "hide" these fields in
your framework(s)).

N.B. The data in the "a" or "t" subfields should be a title that
exists in your database. Otherwise, this test might seem misleading.

2) Set the system preferences "XSLTDetailsDisplay" and
"OPACXSLTDetailsDisplay" to "default".

3) Go to your record (which contains the 780/785 fields), and look
for links with linktext derived from the "a" or "t" fields in the
record. These may or may not be prefaced with labels such as
"Continued by" or "Continues".

4) Note that the links are formatted "q=TITLE". Click this link
and note the possibly high number of results.

5) APPLY THE PATCH

6) Shift+Refresh your record page, and observe that the link should
now say "q=ti,phr:TITLE". Click this link and note that you are
either taken directly to the referenced article or that your
search results are considerably fewer.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
XSLT change only, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10218: Add individual CSS classes for bibliographic information in OPAC (UNIMARC)
Mathieu Saby [Thu, 13 Jun 2013 18:22:51 +0000 (20:22 +0200)]
Bug 10218: Add individual CSS classes for bibliographic information in OPAC (UNIMARC)

Follow-up for UNIMARC XSLT Display
This patch adds class to span markup in list and detail display.
XSLT are not build in the same way in MARC21 and UNIMARC, so I had
to add a parameter "spanclass" to 3 templates called in UNIMARC :
tag_title, tag_7xx, tag_comma

To test, apply the patch on a Koha instance with UNIMARC records, and
- activate sysprefs  OPACXSLTDetailsDisplay and OPACXSLTDetailsDisplay
- make a search on the OPAC. In the results, check the spans with
"results_summary" class have also more a precise class.
Ex : span class="results_summary publication"
- view some records in detailed view. If possible, a record with
a series, a record with some subjects, a record with different authors,
a record with a link in 856. Check the spans with "results_summary"
have also a more precise class.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Works exactly as described on results and detail.
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
XSLT only change.
Tested in a UNIMARC install, HTML source code looks ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10835: fix patron search for using "contains" search type
Kyle M Hall [Fri, 6 Sep 2013 17:10:19 +0000 (13:10 -0400)]
Bug 10835: fix patron search for using "contains" search type

The patron search type option "contains" works fine for multiple
strings, but returns no results for a single string search. For example,
the patron "Henry Acevedo" will be returned for a "contains" search
"en ev" but not for just "en" or "ev".

Test Plan:
1) Create 2 patrons named "Test One" and "Test Two"
2) Run a "contains" search for the term "est"
3) Note no results were found
4) Apply this patch
5) Repeat step 2
6) Note the patrons now display in the search results.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Also checked that 'starts with' still works as expected -
searching for ev will only return "Eva Dillon" from the
example patrons in this case.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 7143: history.txt and about page updates
Galen Charlton [Wed, 28 Aug 2013 16:27:43 +0000 (16:27 +0000)]
Bug 7143: history.txt and about page updates

- two new developers
- releases

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Reads all ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10742: improve converting simple search to Z39.50 search
Fridolyn SOMERS [Fri, 16 Aug 2013 13:10:56 +0000 (15:10 +0200)]
Bug 10742: improve converting simple search to Z39.50 search

In intranet, when search does not return results, there is a button
to perform the same search on Z39.50 servers.  This works well when
coming from advanced search.  But when using simple search from header,
in the Z39.50 search box "kw,wrdl" is added to the operand in title.

This patch simply adds kw as default value when the cgi does not have
idx parameter.

Test plan :
- In intranet, perform a search from header that does not return any
  result. For example "afalseword"
- Click on "Z39.50 Search"
=> you get a popup with the searched word in title. For example:
    Title: afalseword
- Go to advanced search page
- Enter the same word into first input and submit
- Click on "Z39.50 Search"
=> you get a popup with the searched word in title.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Small change, fixes an annoying problem.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10426: Remove unused sub GetCcodes from Koha.pm
Colin Campbell [Thu, 6 Jun 2013 10:42:24 +0000 (11:42 +0100)]
Bug 10426: Remove unused sub GetCcodes from Koha.pm

Remove uncalled sub GetCcodes

Also remove comment in opac-search.pl which is
remaining reference to it and serves no
useful purpose

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>
10 years agoBug 10771: remove disused statistical reports cronjobs
Galen Charlton [Tue, 20 Aug 2013 19:12:32 +0000 (19:12 +0000)]
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>
10 years agoBug 10727: Replace carriage return with <br /> when printing hold notices
Sophie Meynieux [Wed, 14 Aug 2013 13:51:10 +0000 (15:51 +0200)]
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>
10 years agoBug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL
Galen Charlton [Tue, 20 Aug 2013 17:18:13 +0000 (17:18 +0000)]
Bug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL

The OPAC description for an authorized value is not required to be
populated.  In particular, if it is NULL, the staff description is
displayed instead.

This patch makes sure that the sort order (in OPAC mode) uses either
the staff description or the OPAC description as needed for each
value.

To test:

[1] Make sure that AdvancedSearchTypes includes "ccode"
[1] Arrange your CCODE values so the sort order for staff labels
    is different from the sort order for OPAC descriptions.  Also,
    ensure that one of the OPAC descriptions is NULL.  For example,

    authorised_value | lib     | lib_opac
    --------------------------------------
    ZZZ              | A_STAFF | Z_PUBLIC
    DDD              | D_STAFF | NULL
    AAA              | Z_STAFF | A_PUBLIC

[2] Prior to the patch, any CCODE values where the OPAC description
    is NULL will sort first in the OPAC advanced search page, even
    if the displayed label shouldn't come first.
[3] Apply the patch.
[4] Verify that the collection list on the OPAC advanced search page
    is now correct.
[5] Verify that the sort order on the staff advanced search page
    has not changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, tested in staff and OPAC.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10656: improve sorting of shelving location and collections on OPAC advanced...
Owen Leonard [Thu, 1 Aug 2013 13:14:08 +0000 (09:14 -0400)]
Bug 10656: improve sorting of shelving location and collections on OPAC advanced search form

Collection codes and shelving locations are displayed in the OPAC and
staff client via GetAuthorisedValues which currently sorts results by
"lib, lib_opac." Consequently if lib (the description for the staff
client) doesn't match lib_opac (the description for the OPAC) sorting
will appear to be nonsensical in the OPAC. GetAuthorisedValues can be
passed an $opac parameter, so this should be used to switch how reuslts
are sorted. This patch implements such a switch.

To test, modify your collection code or shelving location authorized
values so that lib and lib_opac do not match. Set your
AdvancedSearchTypes system preference to display the modified authorized
values and view the advanced search page in the OPAC and staff client.
Sorting should be correct in each case according to the correct value
(lib in the staff client, lib_opac in the OPAC).

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested in staff and opac and it works perfectly!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10656: add regression test
Galen Charlton [Tue, 20 Aug 2013 16:59:06 +0000 (16:59 +0000)]
Bug 10656: add regression test

This patch adds regression tests to verify the sort
order when fetching authorised values in either staff
or OPAC mode.

This patch also wraps the Koha.t tests in a transaction, and
better handles skipping tests if Test::Deep is not installed.

To test:

[1] Verify that prove -v t/db_dependent/Koha.t passes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass with all patches applied.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10574 - mute the "upgrading from 3.2" message
Robin Sheat [Thu, 11 Jul 2013 11:58:34 +0000 (23:58 +1200)]
Bug 10574 - mute the "upgrading from 3.2" message

New installs get the message about running a script if upgrading from
3.2. They shouldn't. This silences this message in all cases except when
you actually are upgrading from 3.2.

Test plan:

There are three scenarios to test:
1) A fresh install should not cause the prompt.
2) An upgrade with or without the debconf entry set should not cause the
   prompt.
3) An upgrade from a 3.2 release to this should cause the prompt.

To remove the debconf entry that says the prompt has been seen:

echo 'unregister koha-common/3.2-3.4-upgrade-notice' | sudo debconf-communicate koha-common

This should be run before every test to make debconf forget that it's
shown the prompt. To get its current state:

sudo debconf-show koha-common

To test against the 3.2 version, an empty package that claims to be Koha
3.2.2 is attached to the bug.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10649 - Upgrade DataTables and move scripts out of theme directory
Owen Leonard [Fri, 26 Jul 2013 14:37:13 +0000 (10:37 -0400)]
Bug 10649 - Upgrade DataTables and move scripts out of theme directory

This patch adds an upgraded copy of the DataTables plugin to the jQuery
plugin directory outside the theme directories. Copies of the old
DataTables plugin scripts have been left in the old location while
templates are incrementally updated.

To test, visit each affected page in Acquisitions and confirm that table
sorting still words correctly:

- Acquisitions home
- Acquisitions -> Late orders
- Acquisitions -> Order search
- Acquisitions -> Ordered (from table of available funds)
- Acquisitions -> Spent (from table of available funds)
- Acquisitions -> Vendor search
- Acquisitions -> Vendor detail
- Acquisitions -> Vendor -> Basket
- Acquisitions -> Vendor -> Basket -> Add order from existing record
                                   -> Add order from suggestion
                                   -> Add order from subscription
                                   -> Add order from external source
                                   -> Add order from staged file
- Acquisitions -> Vendor -> Basket groups
- Acquisitions -> Vendor -> Uncertain prices
- Acquisitions -> Vendor -> Invoices
- Acquisitions -> Vendor -> Invoices -> Invoice
- Acquisitions -> Vendor -> Receive shipments
- Acquisitions -> Vendor -> Receive shipments -> Receipt summary (click
  invoice number)

Also test one or more pages which have not been modified to confirm that
old DataTables assets are still in place and working (ex: Circulation,
Quotes editor, Saved reports, etc.)

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Edit: Rebased on current master

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests und QA script pass. I found some smaller bugs, that
also appeared on master without the patch applied. For some datatables
I struggled with a result set of over 5.000 lines - there is room for
improvement where a lot of data can be shown.

testing notes:
    - Acquisitions home
      - Amounts don't sort correctly before and after the patch, see bug 10792.
    - Acquisitions -> Late orders
      - OK.
    - Acquisitions -> Order search
      - OK.
    - Acquisitions -> Ordered (from table of available funds)
      - OK.
    - Acquisitions -> Spent (from table of available funds)
      - OK.
    - Acquisitions -> Vendor detail
      - OK.
    - Acquisitions -> Vendor -> Basket
      - OK.
    - Acquisitions -> Vendor -> Basket -> Add order from existing record
      - Datatables seems not to be in use here?
                                       -> Add order from suggestion
      - OK.
                                       -> Add order from subscription
      - OK.
                                       -> Add order from external source
      - OK.
                                       -> Add order from staged file

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10737: (follow-up) make the new 'Closed' column sortable
Jonathan Druart [Thu, 5 Sep 2013 07:46:30 +0000 (09:46 +0200)]
Bug 10737: (follow-up) make the new 'Closed' column sortable

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10737: Add "Add to basket" link on vendor search results page
Owen Leonard [Thu, 15 Aug 2013 16:09:33 +0000 (12:09 -0400)]
Bug 10737: Add "Add to basket" link on vendor search results page

This patch adds an "add to basket" link to the vendor search results
page for each open basket associated with each vendor. Clicking it
triggers a modal window with the "add to basket" choices for that vendor
and basket.

Other changes in this patch:

- The add-to-basket include has been modified in order to make it more
  useful in this context.
- booksellers.pl has been modified to check for an existing budget so
  that the add-to-basket include can properly display a warning if there
  are none.
- "New basket" and "Receive shipment" buttons associated with each
  vendor search result have been converted to Bootstrap-styled buttons.
- Basket closed date has been moved into its own column so that the
  table can be sorted by that value.
- Table columns containing dates now use the "title-string" sort option,
  eliminating the need for a special date sorting algorithm.
- Converted some &'s to &amp;'s

To test, apply the patch and search for a vendor. For each vendor in
your search results baskets which are open should include an "add to
basket" link. Clicking it should open a modal dialog with the same "add
to basket" options offered on the basket page. The correct vendor ID and
basket number should be associated with each link.

The newly-styled "new basket" and "receive shipment" buttons should work
correctly. Table sorting should work correctly, including the new
"closed" column.

Since the add-to-basket include file was modified, the "add to basket"
button on the basket view page should also be tested (acqui/basket.pl).

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10539: Followup for removing KohaTest unit tests
Marcel de Rooy [Thu, 4 Jul 2013 07:51:31 +0000 (09:51 +0200)]
Bug 10539: Followup for removing KohaTest unit tests

Makefile.PL: Section for creating file t/test-config.txt removed.
Removes t/Makefile and t/rewrite-config-test too.
Modifies XISBN.t to remove two commented lines.

Test plan:
Grep for KohaTest, database_dependent, config-test, t/Makefile.
Run perl Makefile.PL and include running the test suite.
This may fail on t/00-valid-xml.t and t/QueryParser.t, but that is not the
result of this patch. Same for t/00-load.t with potential error on
Koha::Plugins::Base.
I had this result:

Test Summary Report:
t/00-valid-xml.t                  (Wstat: 1792 Tests: 381 Failed: 7)
  Failed tests:  10, 30-31, 169, 181, 201-202
  Non-zero exit status: 7
t/QueryParser.t                   (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=92, Tests=12385, 45 wallclock secs ( 1.74 usr  0.15 sys + 26.61 cusr  1.92 csys = 30.42 CPU)
Result: FAIL
Failed 2/92 test programs. 7/12385 subtests failed.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
All tests pass, and I find no mention of the removed test code.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10539: Remove unused unit tests in lib/KohaTest
Marcel de Rooy [Thu, 4 Jul 2013 07:58:19 +0000 (09:58 +0200)]
Bug 10539: Remove unused unit tests in lib/KohaTest

This patch removes all files in lib/KohaTest and the associated script
t/db_dependent/database_dependent.pl.
The second patch deals with a few consequences.

Note that bug 10540 has been opened to save some interesting code from these
unit tests and inject them in the currently used t/db_dependent suite.

Test plan:
See second patch.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9603 - Fix layout of Patron Card Creator Layout screen for display in IE
David Cook [Wed, 21 Aug 2013 02:12:36 +0000 (12:12 +1000)]
Bug 9603 - Fix layout of Patron Card Creator Layout screen for display in IE

Currently, the layout for the Edit/Add Layout screen of the Patron
Card Creator is in complete disarray, when viewed in Internet Explorer
(of any version).

The nav bar is pushed to the bottom of the page, every fieldset is
empty (as their contents have been pushed out into different parts
of the page), and the checkboxes don't work.

The cause appears to be some extraneous mark-up (a few extra fieldset
and li elements)and some missing mark-up (ol elements to wrap the list
elements, especially when nesting lists within each other and within
div elements).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I didn't test this in IE, but changes are fixing general
problems with HTML validity.

Checking the page with the W3C validator:
Before: 27 Errors, 7 warning(s)
After:  6 Errors, 7 warning(s)

All tests and QA script pass, page looks alright.
Would be nice to see the remaining problems fixed in
a follow-up.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10588: improve selection of default branch for OPAC popular items pag
Fridolyn SOMERS [Mon, 15 Jul 2013 10:14:53 +0000 (12:14 +0200)]
Bug 10588: improve selection of default branch for OPAC popular items pag

In OPAC most popular items page:
With user is logged-in his branch should be selected by default.
When a branch is manually selected and form is submitted, this branch
should be selected in results page.
When looking at HTML, you see that all options are selected in combobox.

This patch corrects by using the hidden input 'do_it' to distinguish
form display and no branch filter selected.

Test plan :
- Make sure there are issues on records created in the past 3 month
- Go to OPAC not logged-in
- Click on "Most popular"
=> You get to page with results, "All libraries" is selected
- Select a branch and submit
=> You get to page with results, the branch is selected [testing opac-topissues.inc from]
- Select a branch and perform a search that does not have results (for example an item type never issued)
=> You get to page without results, the branch is selected [testing opac-topissues.tt form]
- Log-in with a user
- Click on "Most popular"
=> You get to page with results, user's branch is selected
- Select "All libraries" and submit
=> You get to page with results, "All libraries" is selected [testing opac-topissues.inc from]
- Select "All libraries" and perform a search that does not have results (for example an item type never issued)
=> You get to page without results, "All libraries" is selected [testing opac-topissues.tt form]

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely and passes all tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10786: fix Javascript error on the parcel page
Jonathan Druart [Tue, 27 Aug 2013 10:04:14 +0000 (12:04 +0200)]
Bug 10786: fix Javascript error on the parcel page

The include of the yui json file generates a js error: YAHOO is not
defined.

This file seems not to be in use (patches for bug 8382 remove the use).

To test:
- go on acqui/parcel.pl?invoiceid=XXX
- verify the error occurs (with firebug)
- apply this patch
- refresh the page
- verify this error does not appear anymore
- Verify there is no regression on this page

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch fixes the javascript error pointed out by Firebug.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 5904: make patron search autocompletion respect IndependentBranches
Jonathan Druart [Thu, 27 Jun 2013 13:33:46 +0000 (15:33 +0200)]
Bug 5904: make patron search autocompletion respect IndependentBranches

Test plan:
- Add a staff user foo in a library A
- Add a staff user bar in a library B
- log in as foo and try to search 'bar'
- Switch on (Prevent) the syspref IndependentBranches
- the search returns no result
- log in as a superlibrarian
- Check that you are allowed to search all patrons.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10755 - Add "Keyword as Phrase" to staff client advanced search indexes
David Cook [Mon, 19 Aug 2013 01:29:13 +0000 (11:29 +1000)]
Bug 10755 - Add "Keyword as Phrase" to staff client advanced search indexes

This patch adds a "Keyword as Phrase" index to the search options in
the staff client.

Test Plan:

1) Go to the Advanced Search in the staff client and click on the "Keyword"
drop-down list.
2) Note that there is only a "Keyword" not a "Keyword as Phrase" option
3) Apply the patch
4) Reload the Advanced Search
5) Note that there is now a "Keyword as Phrase" option as well

If you want to test the functionality...it will depend on your catalogue
data.

Basically, a phrase search will allow you to find "Keyword Adjacent To
Keyword" rather than a more scattershot search that finds the keywords
regardless of their position to each other.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Template change is correct, and in my tests the searching behavior was
correctly modified: Using "keyword as phrase" returned only results
where the terms were adjacent.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, trivial patch with no possible side effects.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10361: (follow-up) add tests for search history functions
Galen Charlton [Fri, 2 Aug 2013 16:22:41 +0000 (16:22 +0000)]
Bug 10361: (follow-up) add tests for search history functions

This adds tests for the new PurgeSearchHistory function and
AddSearchHistory.  GetSearchHistory is not tested due to its
current broken state (see bug 10667).

To test:

[1] Run prove -v t/db_dependent/Search_SearchHistory.t
[2] Verify that all tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10361: Add option to cleanup_database.pl to purge OPAC search history
Mirko Tietgen [Tue, 11 Jun 2013 13:35:44 +0000 (15:35 +0200)]
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>
10 years agoBug 10634 - Use datatables for course details items table
Kyle M Hall [Tue, 23 Jul 2013 16:39:03 +0000 (12:39 -0400)]
Bug 10634 - Use datatables for course details items table

We should make the course items table in the course details a datatable
to enable searching or sorting.

Test Plan:
1) Apply this patch
2) View the details page for a course with items
3) Verify the table displays and is now a datatable

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6594: (follow-up) remove TT directive embedded in tag
Galen Charlton [Wed, 28 Aug 2013 16:40:54 +0000 (16:40 +0000)]
Bug 6594: (follow-up) remove TT directive embedded in tag

To test:

Verify that prove -v xt/tt_valid.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 9782: hide cancel button when importing MARC bibliographic frameworks
Owen Leonard [Tue, 12 Mar 2013 19:55:32 +0000 (15:55 -0400)]
Bug 9782: hide cancel button when importing MARC bibliographic frameworks

When importing frameworks the "cancel" button should be hidden once an
import is initiated since it is not possible to cancel the import in
progress.

This patch uses this bug as an excuse to replace the old import/export
pop-ups with modal dialogs for all import/export functions.

To test:

- Try exporting both the default framework and at least one other
  framework.
- Try importing both a default framework and at least one other
  framework.
- When importing, observe that the modal dialog controls are hidden as
  soon as the import is initiated.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, passes all tests and QA script.
Also the modal works better on smaller screens.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10699: (follow-up) fix parameter test in DeleteBranchTransferLimits()
Galen Charlton [Wed, 28 Aug 2013 15:33:35 +0000 (15:33 +0000)]
Bug 10699: (follow-up) fix parameter test in DeleteBranchTransferLimits()

Need to check for definedness, not Perl truth.

Also adds description of the return value to the POD.

To test:

Run prove -v t/db_dependent/Circulation_transfers.t and verify that
the tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10699: add explicit return value for DeleteBranchTransferLimits()
Kenza Zaki [Thu, 8 Aug 2013 09:40:13 +0000 (11:40 +0200)]
Bug 10699: add explicit return value for DeleteBranchTransferLimits()

This patch adds return values to DeleteBranchTransferLimits:
1 if a Transfer Limit is deleted
undef if no parameters is given
0E0 if a wrong parameter is given

More, it fixes and adds some tests in t/db_dependent/Circulation_transfers.t

To test :
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=14, 19 wallclock secs ( 0.02 usr  0.01 sys +  0.39 cusr  0.02 csys =  0.44 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with patch for bug 10692 applied.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit()
Galen Charlton [Wed, 28 Aug 2013 15:16:28 +0000 (15:16 +0000)]
Bug 10693: (follow-up) fix parameter checking in CreateBranchTransferLimit()

There is nothing prevent '0' from being used as a library code.

To test:

Run prove -v t/db_dependent/Circulation_transfers.t and verify that
the tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should...
Kenza Zaki [Wed, 7 Aug 2013 14:35:35 +0000 (16:35 +0200)]
Bug 10693: CreateBranchTransferLimit's return value in C4::Circulation.pm should be more explicit

This patch test if the parameters $toBranch and $fromBranch are given.
If not, CreateBranchTransferLimit now returns undef.
This patch also fixes and adds some regression tests in
t/db_dependent/Circulation_transfers.t

NOTE:
Currently, we can add a transferlimit to nonexistent branches because
in the database branch_transfer_limits.toBranch
and branch_transfer_limits.fromBranch aren't foreign keys.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=15, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.42 cusr  0.00 csys =  0.45 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

10 years agoBug 10692: add unit tests for C4::Circulation routines about transfers
Kenza Zaki [Wed, 7 Aug 2013 13:54:01 +0000 (15:54 +0200)]
Bug 10692: add unit tests for C4::Circulation routines about transfers

The tests are wrap in a transaction.

NOTE: Currently, some tests should pass but don't because of incoherences in the code.
These tests are in comments and preceded by FIXME.

To test:
prove t/db_dependent/Circulation_transfers.t
t/db_dependent/Circulation_transfers.t .. ok
All tests successful.
Files=1, Tests=12, 18 wallclock secs ( 0.02 usr  0.01 sys +  0.37 cusr  0.06 csys =  0.46 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10566: (follow-up) fix HTML validation issues
Galen Charlton [Wed, 28 Aug 2013 15:07:09 +0000 (15:07 +0000)]
Bug 10566: (follow-up) fix HTML validation issues

These issues predated the previous patch, I just took
this chance to fix them.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10566 - Improve OPAC course reserves pages
Owen Leonard [Wed, 10 Jul 2013 13:51:26 +0000 (09:51 -0400)]
Bug 10566 - Improve OPAC course reserves pages

This patch makes various improvements to the OPAC course reserve pages:

- Descriptive page titles for both pages.
- More compact display of course information on course detail page
  (a list instead of a table, consistent with other displays of similar
  information in Koha).
- Correct capitalization.
- Added label and fieldset to course reserve search form.
- Added breadcrumb navigation to course reserve detail page as a path
  back to course reserves main page.

To test, apply the patch and confirm that the changes haven't broken
anything and are an improvement.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and improves the display.
Tested with only 1 course, 2 courses,
courses with and without items selected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10710: (follow-up) perltidy new code
Galen Charlton [Wed, 14 Aug 2013 16:37:49 +0000 (16:37 +0000)]
Bug 10710: (follow-up) perltidy new code

Also, I prefer the use of parentheses for function
calls, even when no arguments are being passed.
One missed comma turns

is(GetOfflineOperation, ...)

into

is(GetOfflineOperation ...)

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>
10 years agoBug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm
Kenza Zaki [Mon, 12 Aug 2013 12:16:46 +0000 (14:16 +0200)]
Bug 10710: add unit tests for OfflineOperation's routines in C4/Circulation.pm

This patch test AddOfflineOperation,GetOfflineOperation and
DeleteOfflineOperation in C4/Circulation.pm.

The tests are wrapped in a transaction.

Note: Currently, GetOfflineOperations is not tested because we cannot
mock C4::Context->userenv in unit tests

To test:

prove t/db_dependent/Circulation_OfflineOperation.t
t/db_dependent/Circulation_OfflineOperation.t .. ok
All tests successful.
Files=1, Tests=7, 19 wallclock secs ( 0.01 usr  0.01 sys +  0.33 cusr  0.02 csys =  0.37 CPU

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>
10 years agoBug 10767: (follow-up) remove FIXME comments
Galen Charlton [Wed, 28 Aug 2013 14:44:01 +0000 (14:44 +0000)]
Bug 10767: (follow-up) remove FIXME comments

The FIXME comments in the new test script were based on
an assumption that GetIssuingRules() should return
multiple rules if no or only partial parameters are
passed.  This is not the intent of that routine, whose
purpose is to return the *singular* rule that best
applies to a given loan situation.  In other words,
GetIssuingRule() is not a traditional accessor function.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10767: add unit tests for C4::Circulation routines that use issuingrules
Kenza Zaki [Tue, 20 Aug 2013 08:18:04 +0000 (10:18 +0200)]
Bug 10767: add unit tests for C4::Circulation routines that use issuingrules

The test are wrap in a transaction.

To test:
prove t/db_dependent/Circulation_Issuingrule.t
t/db_dependent/Circulation_Issuingrule.t .. ok
All tests successful.
Files=1, Tests=9, 17 wallclock secs ( 0.02 usr  0.00 sys +  0.34 cusr  0.04 csys =  0.40 CPU)
Result: PASS

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: No koha-qa errors
prove t/db_dependent/Circulation_Issuingrule.t run without errors

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10629: remove inappropriate uses of $sth->finish() in C4::Branch
Kenza Zaki [Tue, 23 Jul 2013 13:27:23 +0000 (15:27 +0200)]
Bug 10629: remove inappropriate uses of $sth->finish() in C4::Branch

Test plan :
Check if the regression tests still works
prove t/db_dependent/Branch.t
t/db_dependent/Branch.t .. 1/36 Using a hash as a reference is deprecated at t/db_dependent/Branch.t line 207.
t/db_dependent/Branch.t .. ok
All tests successful.
Files=1, Tests=36,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.12 cusr  0.00 csys =  0.16 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
From the man page

finsh()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10508: (follow-up) remove Perl 5.14 construct
Galen Charlton [Wed, 28 Aug 2013 14:24:34 +0000 (14:24 +0000)]
Bug 10508: (follow-up) remove Perl 5.14 construct

Also added parentheses to bare function calls.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10508: (follow-up) fix a typo
Chris Cormack [Mon, 26 Aug 2013 22:29:42 +0000 (10:29 +1200)]
Bug 10508: (follow-up) fix a typo

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Thx for the follow-up Chris!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10508: add unit tests for C4::Branch
Kenza Zaki [Tue, 2 Jul 2013 12:24:08 +0000 (14:24 +0200)]
Bug 10508: add unit tests for C4::Branch

Unit tests are wrap in a transaction.

To test:
prove t/db_dependent/Branch.t
t/db_dependent/Branch.t .. 1/36 Using a hash as a reference is deprecated at t/db_dependent/Branch.t line 207.
t/db_dependent/Branch.t .. ok
All tests successful.
Files=1, Tests=36,  1 wallclock secs ( 0.02 usr  0.02 sys +  0.13 cusr  0.01 csys =  0.18 CPU)
Result: PASS

http://bugs.koha-community.org/show_bug.cgi?id=10508
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10690 - Warn about trailing slashes in description of OPACBaseURL and staffClient...
Magnus Enger [Tue, 6 Aug 2013 14:00:01 +0000 (16:00 +0200)]
Bug 10690 - Warn about trailing slashes in description of OPACBaseURL and staffClientBaseURL

The descriptions for OPACBaseURL and staffClientBaseURL are not explicit
about including a trailing slash or not. This patch makes it explicit
that the trailing slash should *not* be included.

To test:
- Apply the patch
- Search for "baseurl" in the system preferences
- Check that the description of both sysprefs includes a warning about
  not including a trailing slash.
- Sign off

If you want to check that the trailing slash is in fact superfluous you
can do something like 'grep -r "BaseURL" *' and check that these
sysprefs are usually concatenated with some string that starts with a
slash.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changes to the description appear correctly on both system
preferences.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 10130: widen input fields for library configuration
Owen Leonard [Mon, 19 Aug 2013 18:48:00 +0000 (14:48 -0400)]
Bug 10130: widen input fields for library configuration

Most input fields in the library entry form (admin/branches.pl) have no
explicit width, so they display with a browser-default width. This patch
gives explicit widths to those fields, giving more room for entry.

Other fields have been given an explicit width and/or maxwidth according
to the database table structure.

To test, add or edit a library in Administration -> Libraries and
Groups. Form fields should be more comfortable for entry, and add/edit
actions should complete correctly.

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template changes only, works nicely.
Tested editing and adding libraries in administration.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6594: Schema.org span nesting improvements
Dan Scott [Thu, 22 Aug 2013 15:47:12 +0000 (11:47 -0400)]
Bug 6594: Schema.org span nesting improvements

So, it turns out that the <a href> was causing a new "chain" to be
invoked, thus nesting the <span> elements for properties within the <a
href> actually caused the properties to be attached to that new chain
rather than the containing object. Therefore, wrap the <span> elements
around the <a href> elements where applicable.

Thanks to Manu Sporny in #rdfa for helping me to sort this out.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
I tested by validating against the Google rich snippet tool,
validator.nu, and linter.structured-data.org. All were satisfied
with the microdata markup, and the properties that are set make
sense.

These patches are only for MARC21 XSLT view, but I think it is worth
pushing them even without the NORMARC and UNIMARC markup, so that
people can start to test out schema.org microdata in Koha, and
refine the implementation.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
FWIW I agree with Jared, it is essentially a no-op in terms of what
the user sees, so is safe.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6594: Correct schema.org context for item status
Dan Scott [Thu, 22 Aug 2013 15:29:28 +0000 (11:29 -0400)]
Bug 6594: Correct schema.org context for item status

We were inserting the <link> element inside an open <td> element, which
HTML parsers, even the most forgiving, do not like very much.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
10 years agoBug 6594: Move subject keywords schema.org markup into <span> element
Dan Scott [Thu, 22 Aug 2013 14:55:13 +0000 (10:55 -0400)]
Bug 6594: Move subject keywords schema.org markup into <span> element

Google's rich snippets tool gets confused by the <a property="keywords">
approach, so stuff another span inside the <a> element to remove
confusion with the href attribute.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>