koha.git
8 years agoBug 14660: Fix 3 other cataloguing plugins
Jonathan Druart [Wed, 19 Aug 2015 08:12:04 +0000 (09:12 +0100)]
Bug 14660: Fix 3 other cataloguing plugins

These 3 should use C4::Output not to explode.

Test plan:
Link the plugins with the correct fields
They should not log an error when calling them

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14660: Fix stocknumberam123.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:33:54 +0000 (00:33 +0200)]
Bug 14660: Fix stocknumberam123.pl cataloguing plugin

The cataloguing plugin stocknumberam123.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
 - Link a subfield to the plugin - usually it's 952$i or the UNIMARC
   equivalent in your MARC frameworks
 - Create a new item, set the inventory number to: A 0000000002
 - Start to catalog another item, enter A into inventory and
 - Enter A as stocknumber and activate the plugin by clicking on
   ... at the end of the field
 - The number will not get added - Firebug shows an error:
   Undefined subroutine CGI::output_html_with_http_headers
 - Apply patch
 - Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14660: Fix stocknumberAV.pl cataloguing plugin
Katrin Fischer [Thu, 6 Aug 2015 22:20:09 +0000 (00:20 +0200)]
Bug 14660: Fix stocknumberAV.pl cataloguing plugin

The cataloguing plugin stocknumberAV.pl is broken and no
longer generating numbers - this patch fixes it.

To test:
- Link a subfield to the plugin - usually it's 952$i or the UNIMARC
  equivalent in your MARC frameworks
- Set up a new authorised value INVENTORY, the code is an uppercase
  prefix - "B"
- The Descriptions is your starting number - 1
- The OPAC description remains empty
- Catalalog an item
- Enter B as stocknumber and activate the plugin by clicking on
  ... at the end of the field
- The number will not get added - Firebug shows an error:
  Undefined subroutine CGI::output_html_with_http_headers
- Apply patch
- Verify numbers are now generated and no errors are shown

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14644: unbreak SIP2 terminal login when using telnet transport
Galen Charlton [Tue, 4 Aug 2015 15:59:39 +0000 (15:59 +0000)]
Bug 14644: unbreak SIP2 terminal login when using telnet transport

This patch fixes breakage introduced by the patch for bug 13506
that prevented SIP2 clients from authenticating themselves over
the telnet transport. Attempts to do so would manifest by the
SIPServer backend crashing and the connection getting closed.

To test:

[1] Use the stock SIPServer config, etc/SIPconfig.xml, and ensure
    that the database contains a staff user whose username is 'term1'
    and password is 'term1' that has the circulate permission.
[2] Start SIPServer, telnet to port 8023, and attempt to log in.  The
    connection will be aborted:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Connection closed by foreign host.

[3] Apply the patch and restart SIPSever, then repeat step 2.  This time,
    the login should succeed:

    $ telnet localhost 8023
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    login: term1
    password: term1
    Login OK.  Initiating SIP

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14574: Fixing error messages on staff client so they make more sense
Aleisha [Tue, 21 Jul 2015 00:29:52 +0000 (00:29 +0000)]
Bug 14574: Fixing error messages on staff client so they make more sense

To test:
1) Go to cgi-bin/koha/errors/errornumber.pl to see the error messages which currently don't make sense (ie cgi-bin/koha/errors/401.pl etc). Have only made changes to 401, 403 and 404
2) Apply patch
3) Go to cgi-bin/koha/errors/401.pl --> Check that it now says "This error means that you aren't authorized to view this page." and "Please log in and try again.". Check that 'log in' redirects to the log in page (mainpage.pl).
4) Go to cgi-bin/koha/errors/403.pl --> Check that it now says "This error means that you are forbidden to view this page."
5) Go to cgi-bin/koha/errors/404.pl --> This page should be very different. Check that the 'Error 404' is now in italics and not bold. Check that the page gives a list of reasons the user may have been given this error and some options for their next step.

Signed-off-by: Catherine <cnorthcott.work@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tab with 4 spaces.
Note: I am not sure the em tag is useful here.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14517: List shelves list is broken for translated interfaces
Jonathan Druart [Tue, 14 Jul 2015 15:26:36 +0000 (16:26 +0100)]
Bug 14517: List shelves list is broken for translated interfaces

The translation script adds quotes ("") around translated string (Edit
for instance).
Which breaks the json structure.

Example:
"dt_action": "<a style=\"cursor:pointer\"><form action='shelves.pl'
method='get'><input class="editshelf" value="Editar" type="submit"
/></form></a>"

Test plan:
1/ On the staff interface create a private list
2/ Go to More > Lists ('Your lists' tab)
3/ Translate the templates to any language like:
  $ cd misc/translator/
  $ perl translate install es-ES
4/ Enable the translated templates on the sysprefs
5/ Switch to the translated language
6/ Go to the lists page (Mas > Listas in es-ES)
The list should be displayed correctly.

Note: There is a limitation. If a translated string contains a simple
quote ('), it will also break the json.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14529: The new list permission is 'lists', not 'shelves'
Jonathan Druart [Tue, 18 Aug 2015 11:43:27 +0000 (12:43 +0100)]
Bug 14529: The new list permission is 'lists', not 'shelves'

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14529: Allow user to delete lists
Jonathan Druart [Mon, 13 Jul 2015 16:53:06 +0000 (17:53 +0100)]
Bug 14529: Allow user to delete lists

Bug 13417 allows a librarian to delete any lists if he has the
permission (delete_public_lists).

There is a mismatch in the perm check.
A user can delete a list with the ability to edit (manage) it.

Test plan:
1/ Create a list A with user A
2/ Create a list B with user B
3/ A should be able to manage and delete the list A.
He cans delete B only if he is superlibrarian or has the
delete_public_lists permission.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: Make the tests pass even if issues exist in the DB
Jonathan Druart [Tue, 18 Aug 2015 15:51:19 +0000 (16:51 +0100)]
Bug 11229: Make the tests pass even if issues exist in the DB

This is not introduced by the previous patches of this patchset.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: (followup) makepartialpayment fix
Tomas Cohen Arazi [Thu, 13 Aug 2015 15:03:15 +0000 (12:03 -0300)]
Bug 11229: (followup) makepartialpayment fix

makepartialpayment() wasn't logging the branch either. This patch
fixes that too.

To test:
- Run (with the regression tests applied)
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because makepartialpayment is not logging the branch code
- Apply the patch
- Run
  $ prove t/db_dependent/Accounts.t
=> SUCCESS: tests pass
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: makepayment doesn't log branch in statistics correctly
Katrin Fischer [Mon, 8 Jun 2015 01:51:02 +0000 (03:51 +0200)]
Bug 11229: makepayment doesn't log branch in statistics correctly

This patch fixes makepayment() so it correctly logs the branch code
to the statistics table.

To test:
- Run (with the regression tests applied)
  $ prove t/db_dependent/Accounts.t
=> FAIL: makepayment() tests fail because logging is wrong
- Apply the patch
- Run
  $ prove t/db_dependent/Accounts.t
=> SUCCESS: tests for makepayment now pass
(Note: makepartialpayment tests still fail as they need the next patch)

Original commit message relying on the UI to test:

There are several ways of paying fines, not all of them
recorded the branch the payment was made at correctly:

1) Pay button next to an individual fine
2) Checkbox + pay amount
3) Checkbox + pay selected

For each of those, check if the payment registered in
the table statistics contains the branchcode before
and after the patch.

The patch should fix 1).
2) and 3) are ok with and without the patch.

Important: Don't change the amount, pay individual fines.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Note: i fixed the commit message, because this is a fix for makepayment

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11229: (regression tests) makepayment and makepartialpayment should log correctly
Tomas Cohen Arazi [Thu, 13 Aug 2015 14:32:49 +0000 (11:32 -0300)]
Bug 11229: (regression tests) makepayment and makepartialpayment should log correctly

This patch introduces tests for makepayment and makepartialpayment to check
they are correctly logging to the statistics table.

To test:
- Run
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because statistics are not correctly logged.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14592: Export data bad encoding
Frédéric Demians [Thu, 23 Jul 2015 07:47:15 +0000 (09:47 +0200)]
Bug 14592: Export data bad encoding

Tools > Export data produces a file badly encoded, when marc/xml file
format is chosen. It works with CSV.

To test:

1. Tools > Export data
2. Choose a limited interval of biblionumber
3. Export in marc/xml/csv.
4. Check files exported at 3: csv file is ok. marc/xml files are
   corrupted, ie badly encoded.
5. Apply the patch
6. Repeat steps 3&4, and confirm that all file formats are valid.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13485: DBRev 3.21.00.018
Tomas Cohen Arazi [Tue, 11 Aug 2015 18:09:54 +0000 (15:09 -0300)]
Bug 13485: DBRev 3.21.00.018

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13485: Use the Koha template plugin to access syspref values
Jonathan Druart [Wed, 5 Aug 2015 11:52:12 +0000 (12:52 +0100)]
Bug 13485: Use the Koha template plugin to access syspref values

And remove the useless use of the KohaDates plugin

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13485: Add a page to display links to restricted sites
Simith D'Oliveira [Fri, 19 Dec 2014 19:44:48 +0000 (14:44 -0500)]
Bug 13485: Add a page to display links to restricted sites

To test:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add other ip that your machine ip.
4) Validate: cgi-bin/koha/opac-proxypage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-proxypage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.

Followed both scenarios, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 [QA Followup]

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 13485 - Atomic Update + Rename Proxy page to Restricted page

Test plan:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add a diffrent ip.
4) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.

new file:   installer/data/mysql/atomicupdate/Bug13485_RestrictedSitesPage.sql
modified:   installer/data/mysql/sysprefs.sql
modified:   koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
renamed:    koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-proxypage.tt -> koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-restrictedpage.tt
renamed:    opac/opac-proxypage.pl -> opac/opac-restrictedpage.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: (follow-up) unit tests
Jonathan Druart [Thu, 2 Jul 2015 09:20:13 +0000 (10:20 +0100)]
Bug 13853: (follow-up) unit tests

Specify the reference, we should receive Koha::Object.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: (QA followup) Add unit tests for branch getting methods
Kyle M Hall [Thu, 25 Jun 2015 18:56:18 +0000 (14:56 -0400)]
Bug 13853: (QA followup) Add unit tests for branch getting methods

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: Add tests for is_waiting
Jonathan Druart [Fri, 19 Jun 2015 16:16:27 +0000 (18:16 +0200)]
Bug 13853: Add tests for is_waiting

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13853: Show waiting hold expiration date for waiting holds in holds ajax datatable
Kyle M Hall [Tue, 17 Mar 2015 14:09:28 +0000 (10:09 -0400)]
Bug 13853: Show waiting hold expiration date for waiting holds in holds ajax datatable

We should show the expiration date for waiting holds in the holds
datatable that appears in circulation.pl and moremember.pl

Test Plan:
1) Ensure ReservesMaxPickUpDelay is set
2) Place a hold on a record
3) Place a second hold and set it to waiting by checking it in
4) Place a third hold with an expiration date
5) View the holds tab on circulation.pl and moremember.pl
6) Note the first hold has no expiration date
7) Note the second hold has an expiration date of today + ReservesMaxPickUpDelay days
8) Note the thrid hold has an expiration date of whatever you set it to

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>
Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13030: Remove the unnecessary double call
Jonathan Druart [Fri, 19 Jun 2015 16:05:37 +0000 (18:05 +0200)]
Bug 13030: Remove the unnecessary double call

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13030: Show waiting hold expiration date for waiting holds on circulation.pl
Kyle M Hall [Wed, 8 Oct 2014 16:04:35 +0000 (12:04 -0400)]
Bug 13030: Show waiting hold expiration date for waiting holds on circulation.pl

We should show the date a waiting hold is set to expire for each hold in
the list of waiting holds in circulation.pl

Test Plan:
1) Apply this patch
2) Find a waiting hold for a patron, browser to circulation.pl
   for that patron
3) Set system preference ReservesMaxPickUpDelay to 5
4) Refresh circulation.pl, note the waiting holds now display a
   "waiting until" part with the waiting date plus 5 days
5) Set system preference ReservesMaxPickUpDelay to 0 ( or empty
   string )
6) Refresh circulation.pl, note the waiting hols no longer have a
   "waiting until" line.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Followed test plan successfully. Automated tests successful.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>
Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Bug 13030 [QA Followup] - Fix unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 11325: Focus not on "Add Item" in Lists
Fridolin Somers [Tue, 16 Jun 2015 07:40:41 +0000 (09:40 +0200)]
Bug 11325: Focus not on "Add Item" in Lists

When viewing a list, the focus/cursor is no longer on the "add items" field below the list.

This patch moves the "Add Item" form at left part of page so that it is always shown (usefull when there are a lot of items). And adds focus to barcode input so you can enter several items with a barcode scanner.

Test instructions:
1. Create a list
2. Make sure you have an object with an assigned barcode
3. Go to the list
=> The barcode entry interface should be at left and has the focus
4. Enter the barcode and press enter (or use a scanner)
=> The item is added to the list

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
I like the new position.
Works well, focus on input box
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: DBRev 3.21.00.017
Tomás Cohen Arazi [Fri, 7 Aug 2015 19:04:46 +0000 (16:04 -0300)]
Bug 6874: DBRev 3.21.00.017

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (RM followup) DBIx updates
Tomas Cohen Arazi [Fri, 7 Aug 2015 19:07:08 +0000 (16:07 -0300)]
Bug 6874: (RM followup) DBIx updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 6874: (QA followup) upload_path missing in koha-conf.xml.in
Tomas Cohen Arazi [Tue, 11 Aug 2015 13:54:18 +0000 (10:54 -0300)]
Bug 6874: (QA followup) upload_path missing in koha-conf.xml.in

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (QA followup) Warnings in about page
Tomas Cohen Arazi [Fri, 7 Aug 2015 19:22:22 +0000 (16:22 -0300)]
Bug 6874: (QA followup) Warnings in about page

This patch introduces checks on the about.pl page so the user is warned
for a deficient configuration.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: [QA Follow-up] Last adjustments for future developments
Marcel de Rooy [Thu, 28 May 2015 09:54:56 +0000 (11:54 +0200)]
Bug 6874: [QA Follow-up] Last adjustments for future developments

This patch does:

[1] Some trivial template changes. Modified some comments (POD lines).
[2] Converted plugin to new style.
[3] Table updates: renames id to hashvalue, adds a autoincrement id,
    adds filesize, timestamp, owner and category.
    RM: This db rev is in a separate sql file in atomicupdate.
[4] Code references to computed hash renamed to hashvalue instead of id.
[5] Removed some code pertaining to exposing upload dir structure. The user
    now may choose a category; the uploader takes care of storage.
    The list of upload categories is now taken from authorised values; this
    might become a separate table in the future. (If there are none,
    the upload process creates one default fallback.)
    We can add e.g. permissions later, subdir structure, etc. (So dir will
    not necessarily be category anymore.)

Test plan:
[1] Run the db revision.
[2] Upload new file. Check the record in the table. Delete it again; check.
[3] Run t/db../UploadedFiles.t.
[4] Run t/db../FrameworkPlugins.t -incl cataloguing/value_builder/upload.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: [QA Follow-up] Adjustments for opac-retrieve
Marcel de Rooy [Wed, 27 May 2015 11:52:25 +0000 (13:52 +0200)]
Bug 6874: [QA Follow-up] Adjustments for opac-retrieve

Adds httpheaders sub to UploadedFiles; this will be extended on a new
report. (Idea is to add configurable headers for file extensions.)
Trivial unit test added.
Small cosmetic changes to opac-retrieve-file.

Test plan:
Run test UploadedFiles.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Catch warnings for clean tests.
Mark Tompsett [Sun, 12 Apr 2015 03:57:43 +0000 (23:57 -0400)]
Bug 6874: Catch warnings for clean tests.

I hate noisy tests, so I cleaned them up.

MEGA TEST PLAN
--------------
git checkout -b bug_6874 origin/master
git bz apply 6874
-- yes, it should all apply smoothly.
I intentionally restored an old backup from a couple months ago to force the upgrade.
staff client:
-- upgrade
-- login
Koha administration
MARC Bibliographic framework
MARC structure (for BKS)
Search for 856
Subfields
Edit (for u)
Other options
Plugin: upload.pl
Save changes
Search the catalog tab
{choose a word, any word. I used fancy, because I knew we had a cookbook}
click first link
Edit
Edit record
8 (that's the tab name)
click the name for 856
scroll down to u and click the plugin icon
-- Correctly got a configuration error message.

At a command prompt:
vi ~/koha-dev/etc/koha-conf.xml
/enable_plug
-- add in:
<upload_path>{appropriate path. I used /home/mtompset/uploads}</upload_path>
:wq
mkdir {appropriate path used}
-- I even added some subdirectories
sudo chown -R -v www-data.www-data {appropriate path used}

Back in staff client:
click the plugin icon again
-- this time an upload screen pops up
click the 'Upload file' button
-- message about no file or destination
browse for a file, select one
click the 'Upload file' button
-- message about no destination
click the 'Cancel' button
click the plugin icon
click a destination radio button
click the 'Upload file' button
-- message about no file
browse for a file, select one
click the 'Upload file' button
-- message about success
click the 'close' button.
-- the text box has been filled in with a nice URL
click the plugin icon
click cancel
click the plugin icon
click delete
-- the test box should be blanked, and a success message given
click Close
-- reupload a file properly
click the plugin icon
click delete
click upload file
browse for a file, select a destination, click upload file
click close on success message
click 'Clone this subfield'
click the second plugin icon
click delete
click close
click the first plugin icon
-- Nice error message about a URL which points to nothing.
click cancel
In the second 856$u type in a URL (eg. www.google.com)
click the second plugin icon
-- this jumps immediately to the upload screen, but does not give an error message, because the URL does not have opac-retrieve-file in it.
click save (we need to save the bibliographic record)

In OPAC:
search for the same word (I used fancy)
find the entry you just updated with links
click the two links. The dangling entry should give you a 500 error, and the other link should work just fine.
get back to the detail page

In staff client:
edit
edit record
8
change the 856$u to a valid file in the first link.
save

In OPAC:
refresh the detail page, and click the first link again
this time it should get downloaded nicely.

From a command line:
prove -v t/db_dependent/UploadedFiles.t
perldoc C4::Biblio
perldoc C4::UploadedFiles

One more round of tests tomorrow, and this should be ready. :)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested on top of 5010

Followed mostly mega test plan, seems to work :)
Can upload, delete, modify, etc
Test runs Ok
No koha-qa errors

I view this as valuable addition, dangling since 2011!
As with 5010, I consider this can be pushed (for 3.22)
and we can fix anything wrong later.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: id based on contents, filename, and directory.
Mark Tompsett [Thu, 17 Apr 2014 00:49:02 +0000 (20:49 -0400)]
Bug 6874: id based on contents, filename, and directory.

This patch corrects the inability to upload the same file to a
different directory, or even a renamed file to the same
directory. By including the filename and directory as part of
the $id SHA generation, only identical files in the same
directory with the same file name will generate the same $id.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Clean up file URL generation
Mark Tompsett [Wed, 16 Apr 2014 04:23:40 +0000 (00:23 -0400)]
Bug 6874: Clean up file URL generation

This adds a dependency on bug 5010, in that the protocol is
assumed in the OpacBaseURL system preference. It also adds
improved error handling.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: License Text Update
Mark Tompsett [Tue, 15 Apr 2014 03:54:07 +0000 (23:54 -0400)]
Bug 6874: License Text Update

This updates the license text for
- C4/UploadedFiles.pm
- cataloguing/value_builder/upload.pl
- opac/opac-retrieve-file.pl
to GPL v3 as per the
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
text.

TEST PLAN
---------
1) Don't apply this patch as part of 6874.
2) Run the koha qa test tool.
   -- It will FAIL for those three file.
3) Apply this patch
4) Run the koha qa test tool.
   -- License problem is corrected, no FAILs.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: kohastructure.sql, jquery.js, refocus, and more
Mark Tompsett [Thu, 26 Sep 2013 15:45:19 +0000 (11:45 -0400)]
Bug 6874: kohastructure.sql, jquery.js, refocus, and more

Two problems were discovered while doing a fresh install
of Koha. These problems in the kohastructure.sql file are
addressed with this patch.

Clicking the plug-in icon should cause the popup window
to refocus.  This adds the refocus code to the upload.pl file.

The path to the jquery.js script was wrong in the
upload_delete_file.tt file. Changed [% themelang %] to
[% interface %].

If a user clones 856$u after uploading a file, deletes the file,
and then clicks the plugin icon on the first 856$u, this will go
immediately to the upload screen with an informative error
message.

After some validation was added, it was extended to include
other cases. This serves to patch 6874 to a state where sign
off should be possible.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Force user to select a directory
Julian Maurice [Mon, 30 Sep 2013 07:34:01 +0000 (09:34 +0200)]
Bug 6874: Force user to select a directory

This patch adds a javascript and a server-side checks

Test plan:
1/ Choose a file, leave the radios not selected and submit
2/ You have a javascript alert which prevents form to be submitted
3/ Disable javascript and repeat step 1
4/ Form is submitted but form is redisplayed with an error message
telling you to choose a directory.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: (QA followup) Attach files to bibliographic records
Kyle M Hall [Wed, 25 Sep 2013 07:07:44 +0000 (09:07 +0200)]
Bug 6874: (QA followup) Attach files to bibliographic records

* Renames uploadPath to upload_path to follow the standard naming
  conventions in koha-conf which use underscores rather than camel case
* Remove reference to intranet-tmpl and replace with [% interface %]
  required to pass qa

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Move uploadPath syspref to koha-conf.xml
Julian Maurice [Wed, 12 Jun 2013 13:12:51 +0000 (13:12 +0000)]
Bug 6874: Move uploadPath syspref to koha-conf.xml

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Add unit tests for C4::UploadedFiles
Julian Maurice [Thu, 11 Apr 2013 12:36:27 +0000 (12:36 +0000)]
Bug 6874: Add unit tests for C4::UploadedFiles

Add unit tests for C4::UploadedFiles and move a variable
declaration at subroutine level instead of file level.
Add dependency to Test::CGI::Multipart

Still works, and the newly-provided unit tests have good test
coverage:
C4/UploadedFiles.pm 90.7    65.0    66.7    100.0   100.0    0.2    86.4

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: QA follow-up
Paul Poulain [Tue, 19 Mar 2013 09:48:08 +0000 (10:48 +0100)]
Bug 6874: QA follow-up

Squash of the following commits:
  return with explicit undef removed
  Follow-up for PBP fixes
  follow-up fix POD syntax
  follow-up jquery has moved

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: removed POD changes in Biblio.pm while rebasing.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 6874: Attach files to bibliographic records
Julian Maurice [Wed, 18 Jul 2012 14:47:54 +0000 (16:47 +0200)]
Bug 6874: Attach files to bibliographic records

New cataloging plugin upload.pl and new system preference 'uploadPath'.

upload.pl provide a way to upload files on the server and store a link
(url) to it in MARC
uploadPath is the absolute path on the server where the files will be
stored. It's possible to have a hierarchy of directories under this path
and the plugin will allow to choose in which directory to store the
file.
Stored value in MARC subfield looks like this:
<OPACBaseURL>/cgi-bin/koha/opac-retrieve-file.pl?id=<SHA-1 of the file>
So both 'uploadPath' and 'OPACBaseURL' sysprefs have to be set for this
plugin to work correctly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended/simplified the patch during QA: The changes to
GetMarcUrls are not really needed, and would have needed some
attention. Another link text can be supplied by the plugin too.

This also reduces the need for changes in basket.pl,
MARCdetail.pl, detail.pl, opac-basket.pl and opac-detail.pl.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Edit: more meaninfull commit subject

8 years agoBug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized...
Ulrich Kleiber [Wed, 15 Jul 2015 06:35:13 +0000 (08:35 +0200)]
Bug 14534: Stop overdue_notices.pl from issuing the warning: Use of uninitialized value $borrowernumber

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
To test:

1/ Run the overdue_notices.pl script (don't do this on production
obviously :))
2/ Notice the warns
3/ Apply patch
4/ Run again
5/ Notice no warns, but notices are still generated ok

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13663: (followup) fixes tab char QA test fails
Indranil Das Gupta [Sun, 14 Jun 2015 09:22:04 +0000 (14:52 +0530)]
Bug 13663: (followup) fixes tab char QA test fails

Fixes the tab char qa test suite fails in the following files:

1/ tools/upload-file-progress.pl
2/ tools/upload-file.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: tidy whitespaces
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl
Alex Arnaud [Thu, 11 Jun 2015 08:55:35 +0000 (10:55 +0200)]
Bug 13663: Fix permissions in upload-file.pl and upload-file-progress.pl

Test plan:
Verify that the circulate_remaining_permissions perm is enough to upload
.koc file.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14548: Typo in help file for 3.20 (batch_record_modification.tt)
Hector Castro [Thu, 16 Jul 2015 21:40:14 +0000 (15:40 -0600)]
Bug 14548: Typo in help file for 3.20 (batch_record_modification.tt)

Typo found in batch_record_modification.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/batch_record_modification.tt:20' and check the typo "critera" or go to Tools › Batch record modification, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14547: Typo in help file for 3.20 (basket.tt)
Hector Castro [Thu, 16 Jul 2015 20:35:52 +0000 (14:35 -0600)]
Bug 14547: Typo in help file for 3.20 (basket.tt)

Typo found in basket.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/acqui/basket.tt:24' and check the typo "susbscription" or go to Acqusitions > create or view an existing basket, open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 7143: New developers
Chris Cormack [Sun, 26 Jul 2015 07:07:19 +0000 (19:07 +1200)]
Bug 7143: New developers

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 7143: Add missing people to history.txt
Tomas Cohen Arazi [Wed, 27 May 2015 17:49:09 +0000 (14:49 -0300)]
Bug 7143: Add missing people to history.txt

Indranil Das Gupta needs to be included. Emmanuele Somma was
missed a while back, so adding ad shifting numbers for people after her.

Some tab fixes too, I don't have the time to fix them all.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12216: One should be able to override zebra config
Martin Renvoize [Thu, 8 May 2014 15:48:42 +0000 (15:48 +0000)]
Bug 12216: One should be able to override zebra config

One should be able to override zebra configuration on a per instance
basis.  This patch adds /etc/koha/sites/instance to the 'profilePath'
in the zebra config files such that that location is sources first
for any override config files.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Great catch Martin. I thought this was already pushed by the way.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
This will be useful.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13851: Fix typo in POD
Jonathan Druart [Thu, 18 Jun 2015 08:49:24 +0000 (10:49 +0200)]
Bug 13851: Fix typo in POD

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13851: (QA followup) Unit Tests
Kyle M Hall [Wed, 17 Jun 2015 02:53:10 +0000 (22:53 -0400)]
Bug 13851: (QA followup) Unit Tests

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13851: Replace waiting holds logic in circulation.pl with Koha Objects
Kyle M Hall [Tue, 30 Sep 2014 19:07:50 +0000 (15:07 -0400)]
Bug 13851: Replace waiting holds logic in circulation.pl with Koha Objects

This is the original patch for bug 12892 and replaces the older style of
fetching the holds data with Koha Objects. It will be used as a
foundation for future features.

Test Plan:
1) Apply this patch
2) Create a hold, set to waiting
3) Browse to circulation.pl for that patron
4) Note you see the list of waiting holds
5) Switch your logged in branch to a different branch
6) Note the "Waiting at" line is no longer emphasized.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us>
Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13948: DBRev 3.21.00.016
Tomas Cohen Arazi [Tue, 28 Jul 2015 13:32:31 +0000 (10:32 -0300)]
Bug 13948: DBRev 3.21.00.016

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13948: Prevent explosion when Template::Plugin::Stash not installed
Mark Tompsett [Fri, 15 May 2015 04:49:18 +0000 (00:49 -0400)]
Bug 13948: Prevent explosion when Template::Plugin::Stash not installed

TEST PLAN
---------
1) Install first two patches
2) do not install, or uninstall Template::Plugin::Stash
3) Upgrade to make sure system preference is added.
4) Set the system preference to turn it on for Staff and OPAC
5) Refresh staff -- kaboom
6) Load OPAC -- kaboom
7) Apply this patch
8) Reload staff and OPAC
   -- nice HTML comment about what is wrong.
9) run koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Neat, runs well. Tested with/without sysprefs and Template::Plugin::Stash
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 13948: (QA followup) Make dependency optional
Kyle M Hall [Tue, 12 May 2015 16:42:07 +0000 (12:42 -0400)]
Bug 13948: (QA followup) Make dependency optional

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 13948: Add ability to dump template toolkit variables to html comment
Kyle M Hall [Thu, 2 Apr 2015 15:14:45 +0000 (11:14 -0400)]
Bug 13948: Add ability to dump template toolkit variables to html comment

It would be incredibly helpful if we could easily enable Koha to dump
all Template Toolkit variables to a comment for debugging purposes.

Test Plan:
1) Apply this patch
2) Run updatedatabase
3) Enable the new system preferences DumpTemplateVarsIntranet and
   DumpTemplateVarsOpac
4) Load a page in the staff intranet, view the html source
5) Note the template toolkit variables are embedded in an html comment
6) Load a page in the opac, view the html source
7) Note the template toolkit variable are embedded in an html comment

NOTE: I had to cpan2deb Template::Plugin::Stash to test.
      This is not optimal. Additionally:
      http://www.template-toolkit.org/docs/modules/Template/Plugin/index.html
      does not contain Stash. I suspect this was how it was
      introduced initially by TT.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13049: [QA Follow-up] Remove unneeded module
Marcel de Rooy [Wed, 20 May 2015 11:42:37 +0000 (13:42 +0200)]
Bug 13049: [QA Follow-up] Remove unneeded module

The call to cronlogaction is done in cleanup_database. So there is no use
in keeping the module here.

Test plan:
Run or compile (perl -c) script delete_expired_opac_registrations.pl.
Run or compile (perl -c) script delete_unverified_opac_registrations.pl.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 13049: Merge selfreg cron jobs into cleanup_database
Marcel de Rooy [Thu, 9 Oct 2014 07:52:44 +0000 (09:52 +0200)]
Bug 13049: Merge selfreg cron jobs into cleanup_database

This patch moves the core code of two selfreg cron jobs into the Members
module. The new routines are called from cleanup_database with two new
parameters. The old cron jobs are now wrappers to cleanup_database.
As a bonus, we can add a unit test now.

In time, we can obsolete the selfreg cron jobs. For now, the code is in one
place and behavior does not change.
A next step (as described on the Bugzilla report) would be: remove the Delay
pref for self regs.

Test plan:
Run the unit test t/db_dependent/Members.t.
Test the two new parameters of cleanup_database.pl.
Verify if delete_expired_opac_registrations.pl still works.
Same for delete_unverified_opac_registrations.pl.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
. Fixed minor merge confict on UT & cleanup_database.pl
. UT ok
. The two deprecated scripts still work as before, with a warning
  message.
. cleanup_database.pl do the deletion job, calling new C4::Members
  function rather that doing it directly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14240: Add '(All libraries)' to notice deletion form
Indranil Das Gupta [Thu, 21 May 2015 01:54:28 +0000 (07:24 +0530)]
Bug 14240: Add '(All libraries)' to notice deletion form

Trivial patch that shows (All libraries) instead of an empty cell
for notices that are applicable across all libraries.

Test plan
=========
1) Log in to staff client
2) Tools->Notices & slips
3) Add a dummy notice for all libraries
   -- test code, test description, email - test subject, test content
      Click Submit
4) Click Delete
   -- note that the Library column value is blank.
5) Click the no option
6) Apply this patch
7) Click Delete
   -- note that the Library column value is (All Libraries).
8) run koha qa test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 10961: (followup) Make query fields explicit and add regression tests
Stéphane Delaune [Thu, 23 Jul 2015 14:28:57 +0000 (16:28 +0200)]
Bug 10961: (followup) Make query fields explicit and add regression tests

add correct frameworkcode to _koha_marc_update_bib_ids parameters

add test, prove with : prove t/db_dependent/Biblio.t

TEST PLAN
---------
1) git checkout -b bug_10961 origin/master
2) git bz apply 10961
3) git checkout origin/master -- C4/Biblio.pm
4) prove t/db_dependent/Biblio.t
   -- was expecting failure, got failure.
5) git reset --hard origin/master
6) git bz apply 10961
7) prove t/db_dependent/Biblio.t
   -- success as expected.
8) Read over code.
   -- Noted it also grabs the framework code for the biblio, rather than uses default.
      And it also corrects an indentation issue.
      Test case looks like it attempts to cover the biblionumber!=biblioitemnumber case
      by adding 1.
9) run koha qa test tools.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 10961: Error in GetMarcBiblio can cause severe data loss
Kyle M Hall [Fri, 27 Sep 2013 16:53:39 +0000 (12:53 -0400)]
Bug 10961: Error in GetMarcBiblio can cause severe data loss

A bug in GetMarcBiblio can cause severe data loss if your database has
records where the biblionumber and biblioitemnumber do not match and the
script misc/batchRebuildBiblioTables.pl is run.

The Biblio::GetMarcBiblio makes a kall to
C4::Biblio::_koha_marc_update_bib_ids which passes the biblionumber as
both the biblionumber *and the biblioitemnumber*.

Thus, if your biblio and biblioitem numbers are not always equal, you
will end up with a record where the biblioitemnumber is incorrect in the
record!

This is usually not a severe issue, but since batchRebuildBiblioTables
uses that record to update the database tables, it ends up updating the
wrong biblioitem row!

NOTE: What a horrible, horrible typo that was. Tested this with the
      second patch.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14487: Noise best detected under Debian 8
Mark Tompsett [Fri, 3 Jul 2015 22:04:04 +0000 (18:04 -0400)]
Bug 14487: Noise best detected under Debian 8

The first error is caused by the fact that
$messages->{'IsPermanent'} is undefined.

The second error is caused by querying the CGI
parameter 'barcode' inside a function call. This is not required.
There is a variable $barcode set with the parameter. Changed to
use the variable.

TEST PLAN
----------
1) Test first patch.
2) Clear the log
3) Put in a barcode which is not checked out.
4) Check the log.
   -- should be two errors. One about a hash,
      the other will only be detectable under Debian 8.
5) Apply this second patch
6) Clear the log
7) Put in a barcode which is not checked out.
8) Check the log.
   -- should be empty.
9) run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14487: silence warns during checkin
Indranil Das Gupta [Fri, 3 Jul 2015 08:03:06 +0000 (13:33 +0530)]
Bug 14487: silence warns during checkin

Test plan
=========

1/ check out an item and then check it back in.
1/ check the logs after the check-in to see the warns from
   returns.pl line 623 of :
    (a) Use of uninitialized value $holdingBranch
    (b) Use of uninitialized value $collectionBranch
2/ apply patch
3/ check out and check-in again. no warns are recorded this time.

NOTE: Under Debian Jessie, there are other messages.
      Additionally, this only corrects the line 623 ones.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14107: Patron cards: Make barcode width and height scaling editable
Marc Véron [Sat, 2 May 2015 05:20:22 +0000 (07:20 +0200)]
Bug 14107: Patron cards: Make barcode width and height scaling editable

The size of the barcode in patron card creator was hardcoded to 1% of the card height and 80% of the card width.
This patch exposes both values in the layout editor. If no values are given, the previousely hard coded values (0.01 / 0.8) are used in order to work with existing card definitions.

To test:
- Go to Home > Tools > Patron card creator
- Export a patron card (PDF) from en existing definition
- Apply patch
- Export patron card again, compare results (should be the same)
- Go to Home > Tools > Patron card creator > Manage card layouts
- Edit the layout you use for testing and set barcode scaling values e.g. to 0.03 for height and 0.4 for widht
- Export patron card again, verify that barcode size changed

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14268: Followup - instruction for preftype selection
Indranil Das Gupta [Mon, 25 May 2015 21:17:00 +0000 (02:47 +0530)]
Bug 14268: Followup - instruction for preftype selection

removes the now redundant instruction "Note: you should have no
reasons to modify the following default values" and replaces it
with "Note: change the variable type to one of the dropdown values
as needed"

Signed-off-by: Tadeasm <tadeas.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14268: Use dropdown for variable types
Mark Tompsett [Mon, 25 May 2015 19:38:36 +0000 (15:38 -0400)]
Bug 14268: Use dropdown for variable types

The information needed to build the dropdown is already passed.
This patch uses it to build the variable type dropdown correctly.

TEST PLAN
---------
 1) Apply 14135
 2) In the staff client:
     Home -> Global system preferences -> Local use
 3) Click 'Edit' on any system preference.
 4) Note all the types listed.
 5) Click 'Cancel'
 6) Apply this patch
 7) Click '+New Preference'
 8) Enter data to have a decent 'Free' type preference.
 9) Click 'Save'
10) For each type noted in step 4 (do 'Free' again last)
    a) Click 'Edit' for the added system preference
       -- it should be the last saved variable type.
    b) Change the variable type to the next type.
    c) Click 'Save'
    d) Repeat steps (a) through (c) until all the types have
       been done.
    -- NOTE: Yes, there are other strange things here, but
             those are beyond the scope of this bug.
11) Run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Tadeasm <tadeas.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12906: DataTables: Use -1 to specify the last column
Jonathan Druart [Tue, 16 Jun 2015 16:46:54 +0000 (18:46 +0200)]
Bug 12906: DataTables: Use -1 to specify the last column

It will avoid further changes.

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 12906: Show shipment date in invoice search result list
Katrin Fischer [Mon, 8 Jun 2015 02:28:50 +0000 (04:28 +0200)]
Bug 12906: Show shipment date in invoice search result list

Patch adds the shipment as a new separate column to the
search results of the invoices search.

To test:
- Search for invoices in the acquisition module
- Verify the results table shows the shipment date
- Verify that sorting works correctly

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 5685: Add missing about information
Mark Tompsett [Thu, 30 Apr 2015 00:52:43 +0000 (20:52 -0400)]
Bug 5685: Add missing about information

In comment #20, Katrin requested the about page be updated
to reflect the addition of a jquery plugin.

TEST PLAN
---------
1) Apply all patches
2) Log in to Staff Client
3) Home -> About Koha -> Licenses
   -- jQuery Validation Plugin is now listed nicely.
4) Run koha qa test tools

License appears as expected, qa OK
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 5685: [OPAC follow-up] Validation of email address field
Owen Leonard [Thu, 23 Oct 2014 13:50:38 +0000 (09:50 -0400)]
Bug 5685: [OPAC follow-up] Validation of email address field

This patch makes a few changes to the way errors are handled in the
OPAC:

- The validation plugin has been moved from the global include file to
  the template itself. Since we aren't doing form validation on any
  other page yet it doesn't make sense to include it globally at this
  time.

- The error message which appears if you have JavaScript disabled and
  have submitted invalid emails was styled in a non-standard way.

- I have added in-page links to the error message which appears if you
  have JavaScript disabled so that you can click to jump to the field
  which contains the error.

- I have modified the error message language slightly to make it (I
  hope) read better.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 5685: [Compiled CSS] Validation of email address field
Owen Leonard [Thu, 23 Oct 2014 13:16:08 +0000 (09:16 -0400)]
Bug 5685: [Compiled CSS] Validation of email address field

This patch contains the recompiled opac.css file based on changes made
to opac.less in the previous patch.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
FIXED the compress. - mtompset

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 5685: Validation of email address field
Juhani Seppälä [Fri, 15 Aug 2014 09:11:17 +0000 (12:11 +0300)]
Bug 5685: Validation of email address field

This patch adds server-side & client-side validation for email
form fields in the members/memberentry -view and in the
opac/memberentry-view (bootstrap).

I recently added simple validation for phone number and email address fields
for our in-house koha and saw this old bug: I'm open to any ideas on how
to do this better. Validation for phone numbers would be easy to add on
top of this but I left it out since this bug is only about the email
fields.

To test:
1) Select a member and go to any of the edit forms with email fields
(Primary info, "Library use", "Alternate address", "Alternative
contact").
2) Disable javascript in the browser in order to test server-side
validation and try to input invalid emails in each of the email form
fields.
3) Confirm that an invalid address is catched from any of the email
fields, an alert shown for each invalid address and that the member's
information was not updated with invalid data.
4) Enable javascript in the browser.
5) Confirm that the jquery validation plugin caches invalid addresses
from any of the email fields and that you cannot send the form before
correcting the problem.
6) Perform the same tests for the opac-memberentry-view.

Note: as the jQuery validation plugin doesn't exist in the bootstrap
folder, I just copied it over from the staff-client folder -how to deal
with this?

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I have undone the changes to opac.css so that they can be submitted as a
separate patch. I have some other follow-ups to make as well.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14387: Merge reference selection has no effect when merging authorities.
mxbeaulieu [Mon, 15 Jun 2015 15:05:51 +0000 (11:05 -0400)]
Bug 14387: Merge reference selection has no effect when merging authorities.

This patch swaps the authority records according to the refenrece record selection.

To TEST:
Merge two authority records, select the second as merge reference.
The reference authority is always the first.

Apply the patch.
Repeat previous steps, the authority is now merged using the selected reference record.

modified:   authorities/merge.pl

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 11693: Default emailing preferences not loaded for self registering patron
Marcel de Rooy [Sun, 5 Jul 2015 11:17:02 +0000 (13:17 +0200)]
Bug 11693: Default emailing preferences not loaded for self registering patron

The call to AddMember_Opac does not take care of the messaging prefs
when enhanced messaging is enabled.
This patch adds the call to handle_form_action to do that.

Test plan:
Enable self registering patrons and enhanced messaging.
Check the (default) message prefs for the relevant patron category. At least
enable email for one notice.
Self-register a user with and without verification email enabled.
Check in both cases that the message prefs of the user conform to
those in the patron category. (So at least one enabled.)

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 8684: Add regression tests for SearchItemsByField
Jonathan Druart [Mon, 13 Apr 2015 08:12:03 +0000 (10:12 +0200)]
Bug 8684: Add regression tests for SearchItemsByField

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 8684: Fix duplicate check on creating items in the acquisition module
Jonathan Druart [Tue, 7 Apr 2015 12:14:18 +0000 (14:14 +0200)]
Bug 8684: Fix duplicate check on creating items in the acquisition module

The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.

To reproduce the issue:
1/ Fill the pref UniqueItemFields with "barcode" and AcqCreateItem with
"placing an order"
2/ Create a new basket
3/ Create a new order
4/ Close the basket
5/ Receive items and set barcode with one already in your DB
6/ Save
7/ Nothing happen on the interface, but an error should have been added
in your Koha log file:
  Can't use an undefined value as an ARRAY reference at
  /home/koha/src/acqui/check_uniqueness.pl line 48.

Test plan:
1/ Repeat steps 1-6
2/ You should see a warning on the interface

Note that this should also happen with AcqCreateItem set to "creating an
order".

Works well, no errors.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
Jacek Ablewicz [Wed, 24 Jun 2015 17:43:05 +0000 (19:43 +0200)]
Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields

If the system preference IncludeSeeFromInSearches is enabled, records
exported for zebra indexing are being additionally processed by
EmbedSeeFromHeadings record filter (right now used only in rebuild_zebra.pl
script). This filter embeds 'see from' fields (extracted from authority
records linked with the given biblio via $9 subfields) into target MARC
record, which is then subsequently indexed in zebra.

Currently all fields containing $9 are getting the same exact treatment
by this filter. But on the export stage when the filter is applied, MARC
record being processed already does have holdings data fields added in
the previous stage (usually 952 / 995, depending on the MARC format).
Problem is that holdings data fields use to have $9 subfields in them
as well (mapped to item.itemnumber by default). As a consequence, some
(great many in the typical setup) records exported for zebra indexing
may have surplus "see from" fields added erroneously in semi-random
fashion, so biblio searches would often return some completely
unexpected additional results.

EmbedSeeFromHeadings record filter should not process holdings fields
when dealing with MARC records intended for zebra indexing.

To reproduce:

1) database with as many sample or real-world biblio, item and authority
records as possible is recommended for testing purposes
2) enable IncludeSeeFromInSearches
3) export a bunch of biblio records for zebra (e.g.:
misc/migration_tools/rebuild_zebra.pl -I -b -x -k -length=1000),
inspect the result xml records in /tmp/<whatever> file; observe that at
the end of many records, here and there some extra "see from" (= 1st
indicator: 'z') fields tend to appear, which shouldn't be there ;)

To test:

4) apply patch
5) redo 3)
6) compare results from 3) and 5) with diff

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I introduced a regression test for this. You should run the tests
without/with the patch and verify that the patch actually fixes the problem.
Good job Jacek! I'm sure writing the regression test would take less time
than such a detailed commit message!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
Tomas Cohen Arazi [Wed, 22 Jul 2015 14:22:20 +0000 (11:22 -0300)]
Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings

This patch introduces a regression test for the situation in which
an itemnumber on a record matches the authid of an authority record
and the current implementation of the EmbedSeeFromHeadings filter
wrongly includes new holding fields with authority data...

To test:
- Apply the patch
- Run:
  $ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t
=> FAIL: The test 'Holdings fields not processed to introduce See-from heading'
   fails.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14545: Typo in help file (stage-marc-import.tt)
Hector Castro [Fri, 17 Jul 2015 19:42:38 +0000 (13:42 -0600)]
Bug 14545: Typo in help file (stage-marc-import.tt)

Typo found in stage-marc-import.tt file for Koha help in 3.20

Test plan:
1) Go to url 'koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/stage-marc-import.tt:28' and check the typo "precendence" or go to Tools > Stage MARC records for import and open up the help
2) Apply the patch
3) Repeat step 1 and check if the typo is fixed.

Sponsored-by: Universidad de El Salvador
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@theke.io>
8 years agoBug 14569: Typo borroewr|borow
Marcel de Rooy [Mon, 20 Jul 2015 09:38:56 +0000 (11:38 +0200)]
Bug 14569: Typo borroewr|borow

Trivial correction. Only touches comments.

Test plan:
Run git grep -E "borroewr|borow". You should not find anything now.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Typos in comments corrected.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: remove the log4perl.conf file from /etc for packages
Robin Sheat [Thu, 23 Jul 2015 23:36:38 +0000 (11:36 +1200)]
Bug 14167: remove the log4perl.conf file from /etc for packages

We don't need that file in the package build because it's generated on a
per-site basis from a template.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: package dependencies for Log::Log4perl
Robin Sheat [Thu, 23 Jul 2015 23:14:25 +0000 (11:14 +1200)]
Bug 14167: package dependencies for Log::Log4perl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14167: (QA followup) new entries in koha-conf.xml should be tested in about.pl
Tomas Cohen Arazi [Tue, 21 Jul 2015 14:54:17 +0000 (11:54 -0300)]
Bug 14167: (QA followup) new entries in koha-conf.xml should be tested in about.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) use warn instead of just STDERR
Tomas Cohen Arazi [Tue, 21 Jul 2015 13:50:17 +0000 (10:50 -0300)]
Bug 14167: (QA followup) use warn instead of just STDERR

This patch makes Koha::Logger use 'warn' instead of just printing
to STDERR. It introduces tests for this warnings too.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Tidy Koha/Logger.pm
Kyle M Hall [Thu, 25 Jun 2015 18:23:48 +0000 (14:23 -0400)]
Bug 14167: (QA followup) Tidy Koha/Logger.pm

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: Add a unit test for Koha::Logger
Marcel de Rooy [Fri, 26 Jun 2015 12:22:04 +0000 (14:22 +0200)]
Bug 14167: Add a unit test for Koha::Logger

Test plan:
Run the test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Making Koha::Logger bit more crash resistant
Marcel de Rooy [Fri, 26 Jun 2015 12:12:20 +0000 (14:12 +0200)]
Bug 14167: (QA followup) Making Koha::Logger bit more crash resistant

Moving the BEGIN block to _init for the most part. We only need to
initialize when we actually start using the logger.
Removed the third init part. If we do not have a log4perl_conf in the
koha config, we are not using it yet.
Method get uses hash parameters now. It calls init. If we do not have a
config or the logfile is not writable, we will not use log4perl.
Using AUTOLOAD as a wrapper around Log4perl in order to add some checks
that log4perl does not have.
If a logrotate would change file permissions on a default logfile, we
should catch that now too (see recheck).

Test plan:
Run the previous tests again.
Will still add a unit test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Embed default config into Koha::Logger
Kyle M Hall [Tue, 16 Jun 2015 17:32:53 +0000 (13:32 -0400)]
Bug 14167: (QA followup) Embed default config into Koha::Logger

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Add template and changes needed for packages
Kyle M Hall [Thu, 14 May 2015 11:04:19 +0000 (07:04 -0400)]
Bug 14167: (QA followup) Add template and changes needed for packages

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: upgraded DEBUG level to WARN in config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: (QA followup) Adjust category handling in Koha::Logger
Marcel de Rooy [Fri, 5 Jun 2015 08:08:22 +0000 (10:08 +0200)]
Bug 14167: (QA followup) Adjust category handling in Koha::Logger

The first patch makes the category parameter mandatory.
This patch makes it optional, falling back to the current package. This is
the expected log4perl model. It would not be necessary to pass the class
name everywhere (check subclasses..)
It also adds a delimiter between the interface and the class name.

This allows you to add config lines like:

log4perl.logger.opac.C4.Auth = DEBUG, OPAC
log4perl.logger.intranet.C4.Circulation = TRACE, INTRANET

The first line would make the logger more sensitive to C4::Auth log
messages while staying at the WARN level for other messages, etc. The
second line makes the trace visible from the renewal example.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14167: Add Koha::Logger based on Log4perl
Kyle M Hall [Thu, 7 May 2015 15:20:50 +0000 (11:20 -0400)]
Bug 14167: Add Koha::Logger based on Log4perl

Koha needs a better logger, and it seems like the best solution would be
to take advantage of Log4perl which is already a fully featured logger.
We use Log4perl to selectively decide what statements should be logged,
and where they should go!

Test plan:
0) Install Log::Log4perl via packages or cpan
1) Apply this patch and the example renewal patch
2) Copy etc/log4perl.conf to your koha conf directory, edit the paths
   to match your current error logs
3) Edit your koha-conf file and add the
   <log4perl_conf>/path/to/log4perl.conf</log4perl_conf> line
4) Watch your intranet and opac error logs
5) Perform a renewal via the staff interface, note there is nothing new
   in the log file
7) Update the log4perl.conf, change the log level from WARN to TRACE
   for both the staff and opac sides
8) Perform a renewal via the staff interface, note the logged lines
9) Perform a renewal via the opac, note the logged lines

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Moved the renewal stuff to a separate example patch.
And upgraded the DEBUG level to WARN in the log4perl config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12137: DBRev 3.21.00.015
Tomas Cohen Arazi [Mon, 20 Jul 2015 14:01:38 +0000 (11:01 -0300)]
Bug 12137: DBRev 3.21.00.015

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12137: Use Koha.Preference to access pref value
Jonathan Druart [Mon, 22 Jun 2015 13:45:13 +0000 (15:45 +0200)]
Bug 12137: Use Koha.Preference to access pref value

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 12137: followup sort <select> index by value
Indranil Das Gupta [Sat, 20 Jun 2015 12:52:32 +0000 (18:22 +0530)]
Bug 12137: followup sort <select> index by value

adds alphabetical sorting to <select> lists displayed by
preferences.tt. although added for sorting the days of the
week, this may have larger ramifications. haven't been
tested thoroughly, but no apparent breakage seems to be
happening in preferences.

NOTE: Nice tweak. Makes days of week in sensible order.
      Properly adds sorting based on documentation that
      is really hard to find.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
8 years agoBug 12137: Extend CalendarFirstDayOfWeek to be any day
Mark Tompsett [Thu, 24 Apr 2014 23:09:31 +0000 (19:09 -0400)]
Bug 12137: Extend CalendarFirstDayOfWeek to be any day

Mubassir Ahsan asked on the Koha mailing list:
Is there any option to set Saturday as the first day of
the week? Please help me.

CalendarFirstDayOfWeek is currently either Sunday|Monday.

By converting it to 0|1|2|3|4|5|6
(Sunday, Monday, ..., Saturday), we can allow any day of the
week to be the first day of the week in the date picker.

TEST PLAN
---------
1) Backup DB
2) In mysql:
   > DELETE FROM systempreferences;
   > SOURCE .../installer/data/mysql/sysprefs.sql
   > SELECT variable,value FROM systempreferences;
   -- It should say 'CalendarFirstDayOfWeek' and '0'
      May say '1' if you are using Norwegian.
3) Restore your DB
4) .../installer/data/mysql/updatedatabase.pl
   -- If your previous value for 'CalendarFirstDayOfWeek' was
      'Sunday', it should be '0'. For 'Monday', it should be '1'.
5) Test an installation with 'de-DE' as the language.
   -- The default value should be '1'.
6) Test an installation with 'nb-NO' as the language.
   -- The default value should be '1'.
7) In the staff client, confirm that any day of the week is
   available in the I18N/L10N system preferences for the
   CalendarFirstDayOfWeek dropdown.
   -- I'm aware they aren't in order, but I'm after
      functionality, not finesse.
8) In another tab, go to a staff place that has a datepicker.
   For example, Home -> Tools -> Inventory/stocktaking
9) For each possible value in the CalendarFirstDayOfWeek,
   go to the other tab, refresh the page after updating the
   system preference, and click the datepicker icon.
   -- The date picker should then start on the selected
      day of the week.
10) Log into OPAC
    -- This may require setting: opacuserlogin to 'Allow'.
11) Click the personal details tab on the left.
12) There is a date picker for the date of birth.
    -- The date picker should then start on the selected
       day of the week.
13) Run koha QA test tools.

NOTE: not an atomic update, since this is an old patch.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 12054: Inactive vendors should be inactive
Jonathan Druart [Tue, 28 Apr 2015 08:10:56 +0000 (10:10 +0200)]
Bug 12054: Inactive vendors should be inactive

This patch make inactive vendors really inactive.
That means an inactive vendor would not be able to add a basket / add an order.

Revised test plan
=================

1/ In the acquisition module create 2 vendors: 1 active and 1 inactive.

2/ On the acqui/booksellers.pl, acqui/uncertainprice.pl,
   admin/aqcontract.pl and acqui/supplier.pl (pages which include the
   acq toolbar), you should be able to, for both the 'active' as well
   as the inactive vendor :
     (a) add new basket
     (b) add order items to the basket

   Remark: This is *wrong*. You should be able to do so only for active
           vendor.

3/ Apply the patch

4/ Go to the links in step #2 above and select the inactive vendor
   you should no longer be able to:
   (a) add new basket
   (b) add order items to the basket

   Remark: This is the *correct* behaviour

5/ No change should be noted for vendor marked "active", and should
   be able to undertake operations 4 (a), 4 (b) and 4 (c).

   Remark: This is the *correct* behaviour.

6/ run koha qa tests tool

Bug 12054: (follow-up) Inactive vendors should be inactive

Don't display "add order""block and buttons if the vendor is inactive.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14404: Rename class no-show to noshow for consistency with nosort
Jonathan Druart [Thu, 9 Jul 2015 09:31:07 +0000 (10:31 +0100)]
Bug 14404: Rename class no-show to noshow for consistency with nosort

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons
Kyle M Hall [Tue, 16 Jun 2015 23:05:10 +0000 (19:05 -0400)]
Bug 14404: Checkouts default sort order for Self Checkout (SCO) confusing for patrons

Libraries are reporting that patrons are very confused during
self-checkout. The problem is they are expecting the list of checkouts
to be in the order they checked out the items ( first checkout on the
bottom, last item checked out on top ). However, the checkouts
table is sorted by title ( ascending ) then due date ( descending ).
This is not intuitive.

Test Plan:
1) Enable Koha's self checkout
2) Use the SCO to check out a random assortment of items,
   make sure you don't check them out in alphabetical order
3) Note the order of the items in the list is not based on the order
   you checked them out in
4) Apply this patch
5) Refresh the page
6) Note the items are now in the order you checked them out
   with the last on top and the first on bottom

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14445: Silences warns in letter.tt
Aleisha [Wed, 1 Jul 2015 01:36:00 +0000 (01:36 +0000)]
Bug 14445: Silences warns in letter.tt

When creating a new notice, warn is triggered "Argument "" isn't numeric in numeric gt (>) at line 400". Same warn is triggered when changing Koha module option to any other module.

To test:
1) Go to Tools, then Notices & Slips
2) Click 'new notice'. Notice warn in intranet-error.log
3) Change Koha module to another module. Notice warn is triggered for every change
4) Apply patch and reload page
5) Change Koha module to another module. Notice there are no longer warns
6) Go back to Notices & Slips and click 'new notice' again. Notice there are no warns

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14445: Silences warn in letter.pl
Aleisha [Wed, 24 Jun 2015 01:15:32 +0000 (01:15 +0000)]
Bug 14445: Silences warn in letter.pl

When changing Koha module to 'Circulation', there is a warn saying that $code is uninitialized. This patch sets $code to an empty string to silence the warn.

To test:
1) Go to Tools, the Notices & Slips
2) Click 'new notice' (This will trigger warns, but ignore these as they will be corrected in the next patch)
3) Change Koha module to 'Circulation'
4) Notice warn about uninitialized $code variable
5) Apply patch and reload page, change Koha module to 'Circulation'
6) Notice page still works and warns are gone

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
8 years agoBug 14121: Silence warnings t/db_dependent/Auth_with_cas.t
Mark Tompsett [Wed, 27 May 2015 20:11:38 +0000 (16:11 -0400)]
Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t

TEST PLAN
---------
1) $ prove t/db_dependent/Auth_with_cas.t
   -- CGI security warning
2) apply patch
3) $ prove t/db_dependent/Auth_with_cas.t
   -- no noise.
4) koha qa test tools

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Not able to reproduce the error on my setup, but the code
is a clear improvement over the previous version.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>