]> git.koha-community.org Git - koha.git/log
koha.git
8 years agoBug 17249: Remove GetKohaAuthorisedValuesFromField - (follow-up) inventory
Jonathan Druart [Mon, 5 Sep 2016 15:12:56 +0000 (16:12 +0100)]
Bug 17249: Remove GetKohaAuthorisedValuesFromField - (follow-up) inventory

Before this patch set, the tests in
t/db_dependent/Items/GetItemsForInventory.t were executed in 4s. But
with the previous patch, it was in 45sec(!)
To make sure decrease this execution time to what it was before, this
patch introduces a local to avoid the same query to be executed several
times.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17249: Remove GetKohaAuthorisedValuesFromField - inventory
Jonathan Druart [Wed, 10 Aug 2016 11:10:09 +0000 (12:10 +0100)]
Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory

This patch deals with the inventory files calling
GetKohaAuthorisedValuesFromField.

Test plan:
  prove t/db_dependent/Items/GetItemsForInventory.t
should still return green

Use the inventory tool, on the result page the AV descriptions should
correctly replace the codes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field
Jonathan Druart [Wed, 10 Aug 2016 10:36:40 +0000 (11:36 +0100)]
Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field

This patch adds a new Koha::AuthorisedValues->search_by_marc_field
method.
It will permit to replace several subroutine from C4::Koha dealing with
authorised values.
It also uses this new methods to replace an occurrence of
GetKohaAuthorisedValuesFromField in C4::Record::marcrecord2csv

Test plan:
  prove t/db_dependent/AuthorisedValues.t
should return green

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17249: Remove GetKohaAuthorisedValuesFromField - add tests
Jonathan Druart [Wed, 10 Aug 2016 10:28:40 +0000 (11:28 +0100)]
Bug 17249: Remove GetKohaAuthorisedValuesFromField - add tests

This patch adds a few tests to C4::Record::marcrecord2csv
The subroutine was not covered enough to validate that this patch set
won't add regressions.

Note that the patch set will fix an issue: If 2 subfields of a field are
linked to AVs and you want to display them in a CSV, they won't be
replaced with their descriptions.

Test plan:
Apply the patch, and make a copy of t/db_dependent/Record/marcrecord2csv.t
Checkout master and prove marcrecord2csv.t
Tests should fail
Checkout the branch with the whole patch set applied
The tests should pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s]
Jonathan Druart [Wed, 10 Aug 2016 08:07:26 +0000 (09:07 +0100)]
Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s]

This patch adds the 2 Koha::Object based classes for the
marc_subfield_structure table

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17173: Quick jump to subfield edition form
Jonathan Druart [Tue, 23 Aug 2016 17:50:20 +0000 (18:50 +0100)]
Bug 17173: Quick jump to subfield edition form

There are too many clicks to jump to the edit form of a specific
subfield.

This patch adds a hidden feature (i.e. will not be polished or
documented).

When searching for a tag field from a marc framework structure, it's not
possible to search for a tag subfield to jump directly to the subfield
edition form.

Test plan:
On /admin/marctagstructure.pl?frameworkcode=FRAMEWORKCODE
Search for a subfield (952$d)
you will be redirected to the subfield edition form

There is no check if the subfield does not exist.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17154 (QA followup) replace tabs with spaces
Nick Clemens [Fri, 14 Oct 2016 08:52:54 +0000 (08:52 +0000)]
Bug 17154 (QA followup) replace tabs with spaces

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17154 : Note column is missing on account lines receipt
Sophie Meynieux [Mon, 22 Aug 2016 10:02:11 +0000 (12:02 +0200)]
Bug 17154 : Note column is missing on account lines receipt

    When displaying Fines > Account tab for a patron, you can see on screen a Note column that is missing if you click on Print

    Test plan :
    * Find a patron with accountlines or add them manually (Create manual invoice/credit).
    * Be sure some of them got a Note
    * Clik on Print fior those lines

    Without patch, the printed receipt does not show the Note column
    with the patch, the printed receipt shows a Note column and Note content is correctly printed for accountline with a note.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17404: Patron deletion page: Fix title and breadcrumb
Marc [Wed, 5 Oct 2016 14:08:52 +0000 (16:08 +0200)]
Bug 17404: Patron deletion page: Fix title and breadcrumb

Title and breadcrumb of patron deletion page (deletemember.pl) say:
"Can't Delete Patron". This should be changed to "Delete patron".

To verify:
- Go to a patron's detail page
- Toolbar : More : Delete
Result: You get a question: "Are you sure...", but title and breadcrumb say:
  "Can't Delete Patron" rsp "Cant delete patron"

To test:
- Apply patch
- Repeat steps above.
- Verify that title and breadcrumb display properly, including patron's name

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17084 debian/control updates (master)
Mirko Tietgen [Wed, 12 Oct 2016 13:15:27 +0000 (15:15 +0200)]
Bug 17084 debian/control updates (master)

Dependencies for Bug 16885 and 17425

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17411: Remove 3 other occurrences of exit 1
Jonathan Druart [Tue, 18 Oct 2016 16:14:58 +0000 (17:14 +0100)]
Bug 17411: Remove 3 other occurrences of exit 1

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17411 - Change exit 1 to exit 0 in acqui/basket.pl to prevent Internal Server...
Marc [Thu, 6 Oct 2016 12:37:14 +0000 (14:37 +0200)]
Bug 17411 - Change exit 1 to exit 0 in acqui/basket.pl to prevent Internal Server Error

Note: Same situation as in Bug 17403

To test:
- Verifiy that code change makes sense.

Note: Same situation as in Bug 17403
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Remove unecessary comment

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16687 - Translatability: Fix issues in Administration preferences
Marc Véron [Tue, 7 Jun 2016 15:29:22 +0000 (17:29 +0200)]
Bug 16687 - Translatability: Fix issues in Administration preferences

This patch fixes sentence splitting and other translation issues in
file koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
to avoid odd translations.

To test:
- Without patch, open Home > Administration > System preferences
  and go to tab 'Administration"
- Apply patch
- Open the same page in a new window and compare the text:
  - Verify  that no sentences are splitted
  - Verify that the text changes do not introduce misunderstandings
    and have the same meaning as without patch

Amended for comment #7 2016-07-12/mv

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Rebased to apply on master and re-inserted test (see comment #14) -2016-09-28/mv
Signed-off-by: Michael Kuhn <mik@adminkuhn.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel
Marcel de Rooy [Fri, 14 Oct 2016 08:01:12 +0000 (10:01 +0200)]
Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel

Position 7 of the leader is better referred to as biblevel.
(Pos 6 is record type.)
At the same time replacing some regex's by simple eq's.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
It seems that bib level in the UNIMARC leader only allows a subset of
the possible combinations for MARC21. This does not have bad side-effects
however in the new code that tests bib level to determine the type tag.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16245: RIS export file type incorrect
Hector Castro [Wed, 28 Sep 2016 21:29:37 +0000 (15:29 -0600)]
Bug 16245: RIS export file type incorrect

When exporting lists to a RIS file, the TY field of the RIS file is always
'book' even if the item being exported is a journal or serial.
Since unimarc and marc21 is coded in Koha, just a few references types are
included. This needs a much better code.

This bug changes only TY BOOK result. Other resources needs a case by case
basis.

To test:
-In advanced search limit by itemtype (books, music, continue resources, etc).
-Search and save result in Cart
-Export to RIS Format and notice about the new TY change with all materials
-Export record in bib record details page in OPAC and Intranet.
-Confirm that works as expected.
-Bonus test:
-Try to import the  RIS file in  http://www.myendnoteweb.com if you
have account or create one.
NOTE: According with previous comment, some values has changed.

Sponsored-by: Universidad de El Salvador
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17368: Update KitchenSinkPlugin.kpz
Jonathan Druart [Wed, 28 Sep 2016 13:45:21 +0000 (14:45 +0100)]
Bug 17368: Update KitchenSinkPlugin.kpz

The KitchenSinkPlugin plugin is used is t/db_dependent/plugins.t to test
if our system plugin is ok.
Currently this plugin is broken because it uses subroutines which have
been removed: GetBranchesLoop and GetBorrowercategoryList

A PR has just been made
(https://github.com/bywatersolutions/koha-plugin-kitchen-sink/pull/2)
This kpz has been generated on top of the following commit:

  commit 5d109c9e1a5d3d314b346a529f2059176778d05a
    Adapt code for versions > 16.06.00.018
    2 subroutines has been removed and the plugin does not work
    anymore.

with:
% zip -r KitchenSinkPlugin.kpz Koha

Test plan:
  prove t/db_dependent/plugins.t
should now be happy

Signed-off-by: Magnus Enger <magnus@libriotech.no>
prove t/db_dependent/Plugins.t fails before the patch
and passes nicely after applying the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455 - DBRev 16.06.00.034
Kyle M Hall [Fri, 21 Oct 2016 14:37:46 +0000 (14:37 +0000)]
Bug 10455 - DBRev 16.06.00.034

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455 (QA Followup)
Nick Clemens [Tue, 27 Sep 2016 17:37:45 +0000 (17:37 +0000)]
Bug 10455 (QA Followup)

Fix record matching in misc/cronjobs/delete_records_via_leader.pl

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Fix tests
Jonathan Druart [Thu, 25 Aug 2016 15:18:02 +0000 (16:18 +0100)]
Bug 10455: Fix tests

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Remove MARC21_utf8_flag_fix.pl
Jonathan Druart [Thu, 25 Aug 2016 13:54:09 +0000 (14:54 +0100)]
Bug 10455: Remove MARC21_utf8_flag_fix.pl

Is this script still in use?
It uses the biblioitems.marc field so if it's still useful it will need
to be rewritten.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: (follow-up 3) Remove biblioitems.marc
Jonathan Druart [Thu, 25 Aug 2016 12:43:44 +0000 (13:43 +0100)]
Bug 10455: (follow-up 3) Remove biblioitems.marc

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: (follow-up 2) Remove biblioitems.marc
Jonathan Druart [Thu, 25 Aug 2016 12:31:38 +0000 (13:31 +0100)]
Bug 10455: (follow-up 2) Remove biblioitems.marc

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: (follow-up) Remove biblioitems.marc
Jonathan Druart [Thu, 25 Aug 2016 10:26:45 +0000 (11:26 +0100)]
Bug 10455: (follow-up) Remove biblioitems.marc

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Remove biblioitems.marc - update delete_records_via_leader.pl
Jonathan Druart [Thu, 25 Aug 2016 09:21:37 +0000 (10:21 +0100)]
Bug 10455: Remove biblioitems.marc - update delete_records_via_leader.pl

Recently added, delete_records_via_leader.pl reads biblioitems.marc as a
text field and search for record to delete regarding the leader 5.
This can be acchieve doing the same thing on biblioitems.marcxml (will
certainly be slower) waiting for a patch on bug 15537.

Test plan:
Confirm that this script works as before, to do so the easiest way would
be to dump your DB before executing the update DB entry, execute the
script to delete records, reinsert the DB, execute the udpate DB entry
(remove biblioitems.marc), execute the script to delete records.
You should get the same number of records deleted.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Remove biblioitems.marc - rm MARC21_parse_test.pl
Jonathan Druart [Thu, 25 Aug 2016 09:02:50 +0000 (10:02 +0100)]
Bug 10455: Remove biblioitems.marc - rm MARC21_parse_test.pl

This script seems to be unused and it won't be of any usefulness after
the removal of biblioitems.marc

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Remove biblioitems.marc
Jonathan Druart [Thu, 25 Aug 2016 09:01:59 +0000 (10:01 +0100)]
Bug 10455: Remove biblioitems.marc

Any discussions about biblioitems.marc bring to the same conclusion:
This field is useless and should be removed.
We are storing MARC data into 2 different fields, that does not make
sense.

Test plan:
Add / update / export / import /delete records
should work as before

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10455: Remove biblioitems.marc - DB changes
Jonathan Druart [Thu, 25 Aug 2016 09:01:47 +0000 (10:01 +0100)]
Bug 10455: Remove biblioitems.marc - DB changes

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
8 years agoBug 17426: Do not set AutoCommit in tests
Jonathan Druart [Tue, 11 Oct 2016 12:15:27 +0000 (13:15 +0100)]
Bug 17426: Do not set AutoCommit in tests

  git grep AutoCommit t | grep 1

highlights that 1 test use AutoCommit set, it should not

The other change removes the FIXME should has been fixed.

Test plan:
  prove t/db_dependent/BackgroundJob.t
  t/db_dependent/Patron/Borrower_Discharge.t

should still return green

Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17405 Edit record uses Default framework
Rodrigo Santellan [Mon, 10 Oct 2016 08:20:12 +0000 (04:20 -0400)]
Bug 17405 Edit record uses Default framework

In detail view (catalogue/detail.pl), when clicking on Edit > Edit
record button, the record editor should be opened with the biblio record
framework. It isn't the case. The Default framework is used. Same issue
with Edit > Edit as new (duplicate).

TO TEST:

1. Find a biblio record using a framework which is not the Default one.
2. See the biblio record in detail view (catalogue/detail.pl).
3. Click on Edit > Edit record.
4. Click on Settings => you can see 'Default' as selected framework.
5. Apply the patch.
6. Repeat step 3-4. => the biblio record framework is selected.
7. Repeat 3-4 using Edit > Edit as new (duplicate).

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Added a test plan

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17393: Fix non-Latin chars handling in self reg
Jonathan Druart [Tue, 4 Oct 2016 07:29:30 +0000 (08:29 +0100)]
Bug 17393: Fix non-Latin chars handling in self reg

If you fill the patron self reg with non-latin characters, they will be
encoded with HTML entities (&eacute;)
This bug leads to generate a userid with weird behaviors:
é => eacute
ł => x

Test plan:
0/ Do not apply the patch
1/ Set up the Self reg feature
2/ fill surname, fistname with something like "Michał pouéàç"
3/ Save
4/ See the bad encoding/replacement on the screen and look at the data
The accentued chars are replaced with their html representation and the
non-Latin chars with a 'x'
in the DB
5/ Apply this patch
6/ Repeat steps 2, 3
7/ Everything should be ok
8/ Try to make sure this HTML::Entities escape was not useful:
fill surname with "surname <script>alert("xss?")</script>"
Save and look at the data

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17477: Duplicating a subfield yields an empty subfield tag
Hector Castro [Thu, 20 Oct 2016 14:57:46 +0000 (08:57 -0600)]
Bug 17477: Duplicating a subfield yields an empty subfield tag

The problem only when clone a textareas in 5XX

Steps to reproduce error:
- On the cataloging screen (basic screen), create a new record
- Go to the 5xx fields
- Put something on the 521$a subfield or other textareas (e.g. 520$u or
 583$x)
- Clone the subfield
=> FAIL: The subfield correctly doesn't include the original data,
BUT it doesn't have the subtield tag either.

- Apply patch
- Clean cache browser and reload page
- Repeat steps above
- Verify that works as expected

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10337: (followup) Upper case MARC flavour
Tomas Cohen Arazi [Tue, 18 Oct 2016 15:02:25 +0000 (12:02 -0300)]
Bug 10337: (followup) Upper case MARC flavour

This patch makes the populate_db.pl script upper case what gets passed
with the --marcflavour option switch. This is needed in order for this
to fit ``kohadevbox`` configuration files, and it is harmless for other
uses.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10337: (QA followup) Allow choosing MARC flavour
Tomas Cohen Arazi [Tue, 18 Oct 2016 12:47:26 +0000 (09:47 -0300)]
Bug 10337: (QA followup) Allow choosing MARC flavour

This patch enables the --marcflavour option switch so the user
can specify the desired marc flavour. The code for handling it
was already in place, just not used.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10337: Add a script to populate devs' DBs with sample data
Jonathan Druart [Mon, 17 Oct 2016 16:50:50 +0000 (17:50 +0100)]
Bug 10337: Add a script to populate devs' DBs with sample data

Executing the installer process and inserting all the sample data take a
lot of clics and time.
The idea of this script is to provide a quick way to insert all the
sample data easily to get a working Koha install asap.

Test plan:
- Set your database config to a non-existent DB
- Execute perl misc/devel/populate_db.pl
You will get an error
- Create an empty DB
- Execute perl misc/devel/populate_db.pl
It will insert all the MARC21 sample data
- Execute perl misc/devel/populate_db.pl
You will get an error because the DB is not empty (systempreferences and
borrowers tables)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 17216: Revert changes to ItemsSearchField schema file
Jonathan Druart [Tue, 18 Oct 2016 08:52:50 +0000 (09:52 +0100)]
Bug 17216: Revert changes to ItemsSearchField schema file

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17367 - Showing all items must keep show holdings tab in OPAC details
Fridolin Somers [Wed, 28 Sep 2016 12:49:32 +0000 (14:49 +0200)]
Bug 17367 - Showing all items must keep show holdings tab in OPAC details

In OPAC details page, when record as too many items (depending on syspref OpacMaxItemsToDisplay), they are not displayed in holdings tab.
You can click on link "Click here to view them all" to show them : page reloads with a new arg viewallitems=1.
Also you can choose which tab is shown by default using syspref opacSerialDefaultTab.

The bug is that when default tab is not holdings, clicking on link to show all items will show another tab. So one must reclick on holings tab to see all items.

This patch corrects by forcing holdings tab when arg viewallitems is defined.

Test plan :
- Create a serial record with more items than syspref OpacMaxItemsToDisplay (or decrease this syspref)
- Select "Subscriptions tab" for syspref opacSerialDefaultTab
- Go to opac details on this record : /cgi-bin/koha/opac-detail.pl?biblionumber=xxx
=> You see Subscriptions tab selected
- Click on Holdings tab
=> You see no items but a link "Click here to view them all"
- Click on this link
=> Without patch you see Subscriptions tab selected
=> Wih patch you see Holdings tab selected and the items

Signed-off-by: Juliette <juliette.levast@iepg.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17423 - patronimage.pl permission is too restrictive
Fridolin Somers [Tue, 11 Oct 2016 08:00:56 +0000 (10:00 +0200)]
Bug 17423 - patronimage.pl permission is too restrictive

Bug 14566 added the permission "borrowers" on patronimage.pl.
This perm is too restrictive because circulation pages also uses this page.

I propose to simply use "catalogue" perm.

Test plan
- Set an image to borrower xx
- Create a user with only catalogue permission
- Log with this user
- Go to page (replace xx by borrower number) : /cgi-bin/koha/members/patronimage.pl?borrowernumber=xx
=> Without patch you get the page saying you do not have the permission
=> With patch you get the image
- Log out and retest the page patronimage.pl
=> You get 403 error

Signed-off-by: remy <remy.gonzalves@iepg.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16358: Do not redirect to the editor when deleting records
Jonathan Druart [Tue, 13 Sep 2016 14:03:55 +0000 (15:03 +0100)]
Bug 16358: Do not redirect to the editor when deleting records

The "Delete record" button goes to addbiblio.pl?op=delete, which
incorrectly redirects to Rancor when selected.

Test plan:
0/ Enable EnableAdvancedCatalogingEditor
1/ Edit a record
2/ Switch to the Advanced editor
3/ click on "View the record"
4/ Delete the record
=> Without this patch you are redirected to the editor
=> With this patch you are redirected to the advanced search

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17430: Make MarkIssueReturned.t create its own data
Tomas Cohen Arazi [Wed, 12 Oct 2016 09:01:54 +0000 (11:01 +0200)]
Bug 17430: Make MarkIssueReturned.t create its own data

This patch makes MarkIssueReturned.t use t::lib::TestBuilder to create
the data it needs.

To test:
- On master, have a category with categorycode = C
- Run:
  $ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> FAIL: primary key problems make the tests fail
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/MarkIssueReturned.t
=> SUCCESS: Tests are green!
- Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17446: Typo seleted
Marcel de Rooy [Fri, 14 Oct 2016 09:29:44 +0000 (11:29 +0200)]
Bug 17446: Typo seleted

Built on top of bug 17441

Test plan:
Just have a look at the changes. Trivial.
Git grep seleted. No results.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17441: [QA Follow-up] Return value of SendAlerts
Marcel de Rooy [Fri, 14 Oct 2016 09:07:49 +0000 (11:07 +0200)]
Bug 17441: [QA Follow-up] Return value of SendAlerts

This patch makes the return value of SendAlerts more consistent.
It returns 1 on success, or undef || { error => 'msg' } on failure.
Needed to adjust one test in Letters.t too.
Adjusted one typo along the way (seleted).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested by running Letters.t.
Also tested SendAlerts from the interface with AutoEmailOpacUser and
memberentry (adding new patron).

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17441 - t/db_dependent/Letters.t fails on Jenkins
Katrin Fischer [Thu, 13 Oct 2016 17:05:48 +0000 (19:05 +0200)]
Bug 17441 - t/db_dependent/Letters.t fails on Jenkins

Run prove t/db_dependent/Letters.t

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
To improve consistency, adding a follow-up.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 11217: The # in accountlines descriptions makes them un-writeoffable
Marc [Fri, 7 Oct 2016 09:03:45 +0000 (11:03 +0200)]
Bug 11217: The # in accountlines descriptions makes them un-writeoffable

This patch adds escaping to url params in mambers/pay.pl

To test:
- Apply patch
- Go to Home > Patrons > Manual invoice and create an invoice with a
  description containing a #
- Go to tab "Pay fines"
- Write off the fine
Expected result: Fine is written off and does no longer display in pay tab.

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17365: Fix XSS in moremember.pl and memberentry.pl
Jonathan Druart [Thu, 29 Sep 2016 07:46:49 +0000 (08:46 +0100)]
Bug 17365: Fix XSS in moremember.pl and memberentry.pl

There are certainly hundred of places where they are not escaped...

Test plan:
Create a patron with "Arun <script>alert('code injection');</script>" in
some of the fields.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17389: Clear logs
Jonathan Druart [Mon, 3 Oct 2016 14:23:39 +0000 (15:23 +0100)]
Bug 17389: Clear logs

Logs are full of:
Use of uninitialized value in substitution (s///) at
C4/ImportExportFramework.pm line 282.
Use of uninitialized value in concatenation (.) or string at
C4/ImportExportFramework.pm line 283.

Some field are NULL in DB, we need to init the value to an empty string
to avoid these warnings.

Note: This fix is not related to the original bug
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Warnings avoided

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17389: (bug 16035 follow-up) Fix export non-default frameworks
Jonathan Druart [Mon, 3 Oct 2016 14:15:40 +0000 (15:15 +0100)]
Bug 17389: (bug 16035 follow-up) Fix export non-default frameworks

Trivial patch, no need to explain anything :)

Test plan:
Export default framework
Export other frameworks
=> The frameworkcode column should contain the framework code

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17392 - opac/svc/overdrive_proxy is not plack safe
Nick Clemens [Wed, 5 Oct 2016 13:26:09 +0000 (13:26 +0000)]
Bug 17392 - opac/svc/overdrive_proxy is not plack safe

This patch simply replaces the ';'  in the param passed to OverDrive
with '&'

To test:
1 - Enable overdrive (requires an account)
2 - Perform an opac search
3 - Note the number of overdrive results reported
4 - Click the link to view the actual overdrive results
5 - Note the result numbers don't match
6 - Apply patch
7 - Repeat 1-4 and note results numbers match and results are relevant
8 - Test a search with a ';' to ensure this patch isn't breaking
searches

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Verified by reading code - couldn't verify using Overdrive.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other
Kyle M Hall [Thu, 4 Feb 2016 19:41:57 +0000 (19:41 +0000)]
Bug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other

It appears that the LocalHoldsPriority feature and the Holds Queue are
fundamentally at odds with each other.

The problem appears to be that both are attempting to choose the best
way to fill holds. When you are using the holds queue and you check in
an item that has been selected by the holds queue builder, that part of
Koha where the LocalHoldsPriority feature lives doesn't get to see all
the holds in order to pick the best one. Instead only the hold selected
by the holds queue builder is returned so to the LocalHoldsPriority
feature, that is only one hold to pick from!

Test Plan:
1) Apply this patch
2) prove t/db_dependent/HoldsQueue.t
3) All tests should pass

Signed-off-by: Barton Chittenden barton@bywatersolutions.com
Signed-off-by: Dani Elder <dani@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBUG 17414 Add new GIR codes in Edifact
Colin Campbell [Fri, 7 Oct 2016 14:57:50 +0000 (15:57 +0100)]
BUG 17414 Add new GIR codes in Edifact

Add the 4 GIR codes which were added by Editeur since 1.2
So that the list of recognized GIR codes is now complete

And thse codes can be used in future development

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 15388 - Show Syndetics covers by UPC in search results
Nick Clemens [Fri, 26 Aug 2016 19:20:34 +0000 (19:20 +0000)]
Bug 15388 - Show Syndetics covers by UPC in search results

Syndetics code accepts UPC and OCLC numbers, however, we were only passing this if there
was an ISBN. This patch alters the code to search if either an ISBN or
UPC is present

To test:
Enable syndetics (will need an account)
Search for items with UPCs or OCLC numbers and no ISBN (DVDs)
Note there are no images in search results but there are in details
Apply patch
Note that items with images in details now also have images in results

Signed-off-by: Barbara.Johnson@bedfordtx.gov
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16850: Remove C4::Members::IsMemberBlocked
Jonathan Druart [Mon, 4 Jul 2016 11:21:19 +0000 (12:21 +0100)]
Bug 16850: Remove C4::Members::IsMemberBlocked

This subroutine is only called once and can be replaced with a call to
is_debarred and has_overdues.
Note that prior to this patch, IsMemberBlocked copy/paste code from
HasOverdues, which did not make sense.

Test plan:
Debar a patron and make sure he is not able to checkout (the librarian
is asked to overwrite if OverduesBlockCirc is set to 'confirmation')
Remove the debarment and add overdues to this patron, same as
previously, the checkout should be blocked

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16850: Add test coverage for CanBookBeIssued
Jonathan Druart [Mon, 4 Jul 2016 11:19:46 +0000 (12:19 +0100)]
Bug 16850: Add test coverage for CanBookBeIssued

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17094: Make Koha::Virtualshelf methods return Koha::Objects-based objects
Jonathan Druart [Tue, 9 Aug 2016 15:26:07 +0000 (16:26 +0100)]
Bug 17094: Make Koha::Virtualshelf methods return Koha::Objects-based objects

Instead of DBIx::Class objects.

Test plan:
1/ Add content to a list and share it with another patron
2/ Try to view the list with the other patron
3/ download and send a shelf and check if the biblio list is correct
4/ prove t/db_dependent/Virtualshelves.t should return green

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17248 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValueLib
Jonathan Druart [Wed, 10 Aug 2016 12:04:48 +0000 (13:04 +0100)]
Bug 17248 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValueLib

The subroutine C4::Koha::GetKohaAuthorisedValueLib just retrieves a description
(lib) for a given authorised value.

We can easily replace it using:
  Koha::AuthorisedValues->search({ category => $cat, authorised_value => $av })->lib
or
  Koha::AuthorisedValues->search({ category => $cat, authorised_value => $av })->opac_description

Test plan:
- On the detail page of a bibliographic record, the description for notforloan,
restricted and stack (?) should be correctly displayed
- View a shelf, the location (LOC) description should be displayed
- On the search result page, the location description should be displayed in the
  facets
- Set AcqCreateItem=ordering and receiving items.
The description for notforloan, restricted, location, ccode, etc. field
should be displayed.
- When creating item in the acquisition module, the dropdown list for
  field linked to AV should display the AV' descriptions
- On the transfers page, the description of the location should be
  displayed.
- On the checkout list from the circulation.pl and returns.pl pages, the
  description for "materials" should be displayed
- Fill some OPAC_SUG AV and create a suggestion, the reason dropdown
  list should display the description of OPAC_SUG

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16520 (Follow up) Rebase fixes
Nick Clemens [Thu, 13 Oct 2016 08:35:24 +0000 (08:35 +0000)]
Bug 16520 (Follow up) Rebase fixes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16520: Add new Plack-SetEnv syntax to Apache configuration files
Jesse Weaver [Fri, 13 May 2016 22:40:11 +0000 (16:40 -0600)]
Bug 16520: Add new Plack-SetEnv syntax to Apache configuration files

This was not added to the old etc/koha-httpd.conf because that file has
no infrastructure for Plack anyway.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16520: Initialize the sysprefs Koha::Caches on demand
Jesse Weaver [Fri, 13 May 2016 22:39:08 +0000 (16:39 -0600)]
Bug 16520: Initialize the sysprefs Koha::Caches on demand

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16520: Allow per-VirtualHost environment variables with Plack
Jesse Weaver [Fri, 13 May 2016 22:27:22 +0000 (16:27 -0600)]
Bug 16520: Allow per-VirtualHost environment variables with Plack

This allows OVERRIDE_SYSPREF_* and others to work properly.

Test plan:

  1) Add the following line to your plack.psgi (near the bottom, just
     above "mount ..."):
       enable "+Koha::Middleware::Plack";
  2) Load the OPAC advanced search page (under Plack). The title should
    read "Koha online catalog" (or whatever your LibraryName syspref
    contains).
  3) Add the following to your Apache configuration:
       RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Potato\, Potato"
  4) Restart Apache.
  5) Refresh. The title should now read "Potato, Potato online catalog".

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 7143 NEW added Kyle Hall as release manager.
Jesse Maseto [Wed, 12 Oct 2016 17:44:42 +0000 (17:44 +0000)]
Bug 7143 NEW added Kyle Hall as release manager.

Signed-off-by: Dani Elder <dani@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
8 years agoUPdating the DBREv for Bug 17216 - Add a new table to store authorized
Brendan Gallagher [Tue, 11 Oct 2016 11:18:50 +0000 (11:18 +0000)]
UPdating the DBREv for Bug 17216 - Add a new table to store authorized
value categories

8 years agoBug 17216: Move the AV cat list file to the top level
Jonathan Druart [Tue, 27 Sep 2016 12:44:13 +0000 (13:44 +0100)]
Bug 17216: Move the AV cat list file to the top level

This way it will get used for any languages.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Internal AV should be correctly handled when creating a new category
Jonathan Druart [Tue, 27 Sep 2016 08:24:57 +0000 (09:24 +0100)]
Bug 17216: Internal AV should be correctly handled when creating a new category

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Do no display the empty string category name
Jonathan Druart [Mon, 19 Sep 2016 11:35:40 +0000 (12:35 +0100)]
Bug 17216: Do no display the empty string category name

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Do not display branches, itemtypes and cn_source
Jonathan Druart [Mon, 19 Sep 2016 09:55:12 +0000 (10:55 +0100)]
Bug 17216: Do not display branches, itemtypes and cn_source

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Fix other tests
Jonathan Druart [Tue, 30 Aug 2016 16:03:59 +0000 (17:03 +0100)]
Bug 17216: Fix other tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Fix tests
Jonathan Druart [Tue, 30 Aug 2016 11:09:03 +0000 (12:09 +0100)]
Bug 17216: Fix tests

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Update DBIC schema for MSS
Jonathan Druart [Tue, 30 Aug 2016 11:02:15 +0000 (12:02 +0100)]
Bug 17216: Update DBIC schema for MSS

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Update DBIC Schema
Jonathan Druart [Tue, 30 Aug 2016 10:56:14 +0000 (11:56 +0100)]
Bug 17216: Update DBIC Schema

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Add FK on authorised_values.category
Jonathan Druart [Tue, 30 Aug 2016 10:55:52 +0000 (11:55 +0100)]
Bug 17216: Add FK on authorised_values.category

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Use Koha::AVC from mss.pl
Jonathan Druart [Mon, 29 Aug 2016 13:07:45 +0000 (14:07 +0100)]
Bug 17216: Use Koha::AVC from mss.pl

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Add FK on mss.authorised_value
Jonathan Druart [Mon, 29 Aug 2016 13:07:27 +0000 (14:07 +0100)]
Bug 17216: Add FK on mss.authorised_value

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Update the admin interface
Jonathan Druart [Mon, 29 Aug 2016 13:06:46 +0000 (14:06 +0100)]
Bug 17216: Update the admin interface

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: DBIC Schema changes
Jonathan Druart [Mon, 29 Aug 2016 13:05:51 +0000 (14:05 +0100)]
Bug 17216: DBIC Schema changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Add some other AV categories
Jonathan Druart [Mon, 29 Aug 2016 14:15:10 +0000 (15:15 +0100)]
Bug 17216: Add some other AV categories

Found in
installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Add new table authorised_value_categories and populate it
Jonathan Druart [Mon, 29 Aug 2016 13:04:53 +0000 (14:04 +0100)]
Bug 17216: Add new table authorised_value_categories and populate it

This patch set adds a new table authorised_value_categories to store
authori(s|z)ed value categories into a separate table.
The problematic is explained on bug 15799 comment 4:
We need FK to the AV categories but some may not have authorized values
yet.

What does this patch set:
- Add a new authorised_value_categories table
- Populate it with known categories
- Update FK items_search_fields.authorised_values_category
- Create a new FK marc_subfield_structure.authorised_value (FIXME should
  be authorised_value_categories instead)

They are some problems this patch set do not take into account:
- The .sql installer files won't insert correctly (will have to be
  updated when this patch set will be ready to be pushed)
- All the categories (even the ones without authorized values defined)
  are listed when you edit frameworks (marc_subfield_structure.pl)
- There is no way to delete a category (TODO). But to do so it would be
  good to have a authorised_value_categories.is_internal field to mark
  some categories as "cannot be deleted".

Test plan:
0/ Execute the DB entry to create and populate the new table and set the FK
1/ Create a new AV category from the admin module (admin/authorised_values.pl)
2/ Add/edit subfield linked to a AV category
(admin/marc_subfield_structure.pl)
3/ You won't be allowed to add AV for branches, itemtypes or cn_source.
They are used internally.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17216: Add Koha::AuthorisedValueCategory|ies classes
Jonathan Druart [Mon, 29 Aug 2016 12:56:02 +0000 (13:56 +0100)]
Bug 17216: Add Koha::AuthorisedValueCategory|ies classes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17432: Remove minification
Martin Renvoize [Wed, 12 Oct 2016 11:56:44 +0000 (11:56 +0000)]
Bug 17432: Remove minification

The swagger specification file is currently being minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec, so it can be copy&pasted into validation tools

Test Plan
1) Apply patch
2) Ensure api routes still function (applying the /cities patch might be
    helpful)
3) Ensure /api/v1/spec page exists (it should be the de-referenced
    swagger.json file)

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14899 - Convert links to buttons, add icons
Kyle M Hall [Mon, 10 Oct 2016 20:57:26 +0000 (20:57 +0000)]
Bug 14899 - Convert links to buttons, add icons

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14899: Add a reset option
Jonathan Druart [Thu, 29 Sep 2016 11:03:22 +0000 (12:03 +0100)]
Bug 14899: Add a reset option

For developpers only at the moment, if you want to reset your mappings,
you can hit:
  admin/searchengine/elasticsearch/mappings.pl?op=reset&i_know_what_i_am_doing=1

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14899: Add a link to the new page in the admin
Jonathan Druart [Fri, 25 Sep 2015 15:16:28 +0000 (16:16 +0100)]
Bug 14899: Add a link to the new page in the admin

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14899: Add the mapping configuration page in the admin module
Jonathan Druart [Fri, 25 Sep 2015 15:06:55 +0000 (16:06 +0100)]
Bug 14899: Add the mapping configuration page in the admin module

This new page (admin/searchengine/elasticsearch/mappings.pl) will permit
to manage the ES mappings.
For the biblios and authorities indexes, the different mappings can be
managed from this single page.
The interface let you add, remove and update mappings and search fields.
It's also possible to reorder the mappings, as the order can be important
in the indexation process. Note that the table can be displayed in a
different order that the one it was before saving, but the mappings are grouped
by search field and the order inside the search field is preserved.

Limitations:
- If something went wrong during the insertion/deletion/modification,
  the users will loose all these changes.

TODO:
- Add a specific permission (?)
- Add some data checks client side (JS)
- Use checkboxes for facet and suggestible (lazy today...)
- Understand the difference between the 3 values that sortable can have
  and improve the value for the options in the select box.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 14899: Add tableDND JS lib
Jonathan Druart [Fri, 25 Sep 2015 14:49:16 +0000 (15:49 +0100)]
Bug 14899: Add tableDND JS lib

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17226 - Fix unit tests
Kyle M Hall [Mon, 10 Oct 2016 17:30:43 +0000 (17:30 +0000)]
Bug 17226 - Fix unit tests

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17226: Make Koha::Object->get_column available
Jonathan Druart [Tue, 30 Aug 2016 15:22:53 +0000 (16:22 +0100)]
Bug 17226: Make Koha::Object->get_column available

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17226: Improve Koha::Object's AUTOLOAD method
Jonathan Druart [Tue, 30 Aug 2016 15:13:21 +0000 (16:13 +0100)]
Bug 17226: Improve Koha::Object's AUTOLOAD method

Following the path of bug 17091, Koha::Object needs to AUTOLOAD the
methods provided by DBIX::Class.
We already use in_storage, id and is_changed, but others are coming!

Test plan:
  prove t/db_dependent/Koha/Object.t
should return green

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoUping DBRev. Bug 17357 - WTHDRAWN is still used in installer files
Brendan Gallagher [Tue, 11 Oct 2016 04:52:13 +0000 (04:52 +0000)]
Uping DBRev.  Bug 17357 - WTHDRAWN is still used in installer files

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17357: Replace WTHDRAWN with WITHDRAWN in installer files
Jonathan Druart [Tue, 27 Sep 2016 09:52:17 +0000 (10:52 +0100)]
Bug 17357: Replace WTHDRAWN with WITHDRAWN in installer files

Some installer files still use WTHDRAWN instead of WITHDRAWN as an AV
category.

Test plan:
  git grep WTHDRAWN installer
should not return any results

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17358: Rename COU with COUNTRY and LAN with LANG
Jonathan Druart [Tue, 27 Sep 2016 12:38:34 +0000 (13:38 +0100)]
Bug 17358: Rename COU with COUNTRY and LAN with LANG

Some installer files use COU and LAN instead of COUNTRY and LANG.

To uniformise these AVs, it would be good to use the same code.

Note that I do not think we should update existing installations

Carefully compared code.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Add delete to the Koha::Objects AUTOLOAD method
Jonathan Druart [Tue, 9 Aug 2016 15:53:27 +0000 (16:53 +0100)]
Bug 17091: Add delete to the Koha::Objects AUTOLOAD method

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects
Jonathan Druart [Tue, 9 Aug 2016 15:34:15 +0000 (16:34 +0100)]
Bug 17091: In a first phase, restrict the usage of AUTOLOAD in Koha::Objects

To make sure the methods will be covered by tests and devs won't
overused this method, I think it may be a good idea to restrict its
usage.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
AUTOLOAD added. No Koha QA errors. Test passed successfully

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Remove explicit declaration of Koha::Objects->reset
Jonathan Druart [Tue, 9 Aug 2016 14:58:31 +0000 (15:58 +0100)]
Bug 17091: Remove explicit declaration of Koha::Objects->reset

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Remove explicit declaration of Koha::Objects->pager
Jonathan Druart [Tue, 9 Aug 2016 14:54:58 +0000 (15:54 +0100)]
Bug 17091: Remove explicit declaration of Koha::Objects->pager

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Remove explicit declaration of Koha::Objects->count
Jonathan Druart [Tue, 9 Aug 2016 14:48:05 +0000 (15:48 +0100)]
Bug 17091: Remove explicit declaration of Koha::Objects->count

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Remove explicit declaration of Koha::Objects->update
Jonathan Druart [Tue, 9 Aug 2016 14:46:48 +0000 (15:46 +0100)]
Bug 17091: Remove explicit declaration of Koha::Objects->update

Test plan:
  prove t/db_dependent/Koha/Objects.t
should return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17091: Add AUTOLOAD to Koha::Objects
Jonathan Druart [Tue, 9 Aug 2016 14:46:11 +0000 (15:46 +0100)]
Bug 17091: Add AUTOLOAD to Koha::Objects

Up to now if a Koha::Objects based object needs to call DBIx::Class methods, we
have to create a new method for Koha::Objects, something like:
  sub method {
    my $self = shift;
    return $self->_resultset->method
  }

To simplify and ease the call to DBIx::Class method, this patch defines an
AUTOLOAD to call the DBIx::Class method on the resultset we are encapsulating.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17372: Standardize Elasticsearch paths
Jonathan Druart [Thu, 29 Sep 2016 09:31:11 +0000 (10:31 +0100)]
Bug 17372: Standardize Elasticsearch paths

What we currently have:
Koha/ElasticSearch.pm
Koha/ElasticSearch/Indexer.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchEngine/Elasticsearch/Search.pm

What we want:
Koha/SearchEngine/Elasticsearch.pm
Koha/SearchEngine/Elasticsearch/Indexer.pm
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
Koha/SearchEngine/Elasticsearch/Search.pm

Test plan:
  % git grep -i Koha::ElasticSearch
  % git grep ElasticSearch|grep -v Catmandu::Store::ElasticSearch
should not return any result

Do a full reindex and search for records

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16838: ES - install mappings for new installs
Jonathan Druart [Thu, 29 Sep 2016 09:18:27 +0000 (10:18 +0100)]
Bug 16838: ES - install mappings for new installs

The yaml file is not used to populate ES mapping tables (search_field,
search_marc_map and search_marc_to_field) when doing a fresh install.

We need to insert them, otherwise ES will be unusable.

Test plan:
Create a new install and confirm that the ES tables (search_field,
search_marc_map and search_marc_to_field) are correctly populated.

Bonus points: Use an older DB (prior to 3.23.00.050), execute the
updatedatabase.pl script and confirm that the ES table are correctly
populated

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 17403: Internal Server Error while deleting patron
Marc [Wed, 5 Oct 2016 13:43:29 +0000 (15:43 +0200)]
Bug 17403: Internal Server Error while deleting patron

This patch fixes a Internal Server Error while deleting patrons.

To reproduce:

- Go to a patron's detail page
- Toolbar : More : Delete
- Confirm "Are you sure you want to delete..."

Result: Internal Server Error
Plack error log:
exited nonzero: 1 at /home/marc/koha/members/deletemem.pl
Note: Patron is deleted

Additional tests: Try to delete yourself, to delete a staff member
without having superlibrarian permission etc.

To test:

- Apply patch
- Re-start plack
- Try to reproduce steps above (with other patron)
Expected result:
No Internal Server Error, Redirect to Home > Patrons

Amended to include all occurences of 'exit 1'

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Good catch Marc

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16769: [QA Follow-up] Remove unsupported deepcopy parameter
Marcel de Rooy [Wed, 27 Jul 2016 14:00:43 +0000 (16:00 +0200)]
Bug 16769: [QA Follow-up] Remove unsupported deepcopy parameter

Routine C4/Koha/GetAuthorisedValues adds deepcopy => 1 to the options of
set_in_cache. This makes no sense (anymore?). Is not supported or passed
further. So better remove it.

Test plan:
Run t/db_dependent/Koha.t (with Test::Deep available to minimize confusion)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
8 years agoBug 16769: [QA Follow-up] Still found an occurrence
Marcel de Rooy [Wed, 27 Jul 2016 14:04:51 +0000 (16:04 +0200)]
Bug 16769: [QA Follow-up] Still found an occurrence

Script svc/report did contain one old-style call.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>