koha.git
8 years agoBug 12428: QA Follow-up: Wrap borrower's title in a span to make it possible to hide
Katrin Fischer [Sat, 24 Oct 2015 11:09:41 +0000 (13:09 +0200)]
Bug 12428: QA Follow-up: Wrap borrower's title in a span to make it possible to hide

I think showing the title with the user name is quite unusual for
Koha. Wrapping the title in a span with a unique class makes it
possible to hide it.

http://bugs.koha-community.org/show_bug.cgi?id=14248

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14248: Regression tests
Mark Tompsett [Thu, 22 Oct 2015 12:52:33 +0000 (08:52 -0400)]
Bug 14248: Regression tests

TEST PLAN
---------
1) apply patch
2) prove -v t/db_dependent/NewsChannels.t
3) run koha qa test tools.

Signed-off-by: Martin Persson <xarragon@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14248: Optionally display authorship for news
Martin Persson [Fri, 2 Oct 2015 06:06:06 +0000 (08:06 +0200)]
Bug 14248: Optionally display authorship for news

Test plan:

* Apply dependant patches 14246 and 14247.
* Apply current patch.
* Log into the Staff client, go to
 'Administration' -> 'Global Preferences' -> 'Tools',
  a new section titled 'News' should appear with a single option named 'NewsAuthorDisplay'.
  Available values should be 'Not at all', 'OPAC only', 'Staff client only' and
  Both OPAC and staff client'. By default the value should be 'Not at all'
  (to mimic existing behaviour, important!).

* Change the value to something different and save the changes.
* Go to 'Tools' -> 'News' and add some news items (at least 2).
* Use the MySQL command line tool to edit the opac_news table,
  removing the user id from one of the news items:
  $ mysql -u kohaadmin -p -D koha
  > SELECT `idnew`, `title`, `borrowernumber` FROM `opac_news`;
  * Make a mental note of one of the 'newid' numbers to change.
  > UPDATE `opac_news` SET `borrowernumber` = NULL WHERE `idnew` = <your-id-here>;
  * Now one of the news items will have no user id, and no author should be shown for it.
* Go to OPAC and Staff client and make sure the display modes works as intended.
  * Repeat for all values, making sure that the settings works as intended.
  * The changed news item should have no author info shown at any time.
  * The unchanged news item should show your own user name if the
    settings match the section where it is displayed.

Sponsored-By: Halland County Library
Tested on top of Bugs 1246 and 1247, works as advertised.
Note: Some whitespaces changed / removed in koha-news.tt to pass qa tools.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14247: DBRev 3.21.00.046
Tomas Cohen Arazi [Tue, 27 Oct 2015 19:12:51 +0000 (16:12 -0300)]
Bug 14247: DBRev 3.21.00.046

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14247: Rename sysprefs atomic update file
Martin Persson [Tue, 26 May 2015 13:58:45 +0000 (15:58 +0200)]
Bug 14247: Rename sysprefs atomic update file

This trivial patch changes the name of the SQL update
file to match the guidelines on the wiki.

Sponsored-by: Halland County Library
Signed-off-by: Marc Véron <veron@veron.ch>
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@theke.io>
8 years agoBug 14247: Add system preference for news display
Martin Persson [Mon, 25 May 2015 12:33:13 +0000 (14:33 +0200)]
Bug 14247: Add system preference for news display

Test plan:

* Apply dependant patch 14246 (if not done already).
* Apply current patch.
* Log into the Staff client, go to 'Administration' -> 'Global Preferences' -> 'Tools', a new section titled 'News' should appear with a single option named 'NewsAuthorDisplay'. Available values should be 'Not at all', 'OPAC only', 'Staff client only' and 'Both OPAC and staff client'. By default the value should be 'Not at all' (to mimic existing behaviour, important!).
* Change the value to something different and save the changes.
* Use the mysql command line client to connect to the Koha database:
  $ mysql -u kohaadmin -p -D koha
* Enter the following query:
  SELECT * FROM systempreferences WHERE variable = 'NewsAuthorDisplay';
* Check to make sure that the 'value' column has changed to reflect the choice you made in the above step.

Separate SQL testing (clean installation of Koha):
* Koha$ mysql -u root < create_koha_test_db.sql
* Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/kohastructure.sql
* Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/sysprefs.sql

Testing the update script works the same way:
* Koha$ echo "DELETE FROM systempreferences WHERE variable = 'NewsAuthorDisplay';" | mysql -u koha_test -D koha_test
* Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/atomicupdate/add_news_prefs.sql

Signed-off-by: Marc Véron <veron@veron.ch>
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@theke.io>
8 years agoBug 14246: DBRev 3.21.00.045
Tomas Cohen Arazi [Tue, 27 Oct 2015 19:02:33 +0000 (16:02 -0300)]
Bug 14246: DBRev 3.21.00.045

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14246: Adding Koha::Schema::Result differences
Mark Tompsett [Wed, 21 Oct 2015 23:55:08 +0000 (19:55 -0400)]
Bug 14246: Adding Koha::Schema::Result differences

Ran misc/devel/update_dbix_class_files.pl as shown on
wiki/Database_updates#updatedatabase.pl
However, only git added Borrower and Opacnews, since
those were the two affected by this patch.

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@theke.io>
8 years agoBug 14246: (fix) correct ALTER TABLE mysql syntax
Indranil Das Gupta [Sun, 14 Jun 2015 12:09:52 +0000 (17:39 +0530)]
Bug 14246: (fix) correct ALTER TABLE mysql syntax

Address bug 14246 comment 13 remark - correcting MySQL ALTER TABLE
syntax.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
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@theke.io>
8 years agoBug 14246: Update NewsChannel tests
Martin Persson [Mon, 1 Jun 2015 11:56:56 +0000 (13:56 +0200)]
Bug 14246: Update NewsChannel tests

This commit adds the new 'borrowernumber' field to the existing
test framework to make it pass. It does not include new tests.

Sponsored-by: Halland County Library
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
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@theke.io>
8 years agoBug 14246: Add borrowernumber, altered SQL
Martin Persson [Wed, 27 May 2015 05:36:33 +0000 (07:36 +0200)]
Bug 14246: Add borrowernumber, altered SQL

As suggested by kind reviewers, an AFTER statement was added to the atomic
upgrade script to ensure that the final field order is consistent is both
fresh and upgraded databases.

Also:
* UPDATE action changed to CASCADE to improve robustness.

Test plan:
* Apply first patch in this set.
* Apply this patch.
* Perform a database upgrade.
* Use mysql client to inspect field order.
  It should be identical to the kohastructure.sql order.

Sponsored-by: Halland County Library
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
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@theke.io>
8 years agoBug 14246: Add borrowernumber to koha_news
Martin Persson [Tue, 26 May 2015 11:23:34 +0000 (13:23 +0200)]
Bug 14246: Add borrowernumber to koha_news

This patch adds a new column to koha_news that links a
borrowernumber to each item. This allows Koha to display the
author for each entry which makes it suitable as a simple CMS.

Changes (from rejected patch):
* Added missing kohastructure.sql changes.
* Turned the atomic update file into a SQL file and changed name
  in accordance with wiki guidelines.
* Changed SQL syntax and naming to be consistent with existing code.
* Attached test plan to commit message.

Test plan:

* You need at least one news item, log in and add one from
  'Administration' -> 'Tools' -> 'News'.
* Apply the patch.
* Apply database upgrade (directly or indirectly).
* Go back to Staff interface and post a new news item.
* Use the mysql command line client to connect to the Koha installation's database:
  mysql -u kohaadmin -p -D koha (change username and database to values
  appropiate for your system).
* Execute the following query: SELECT title, borrowernumber FROM opac_news;
* Inspect the results, the 'borrowernumber' column should be NULL for all news items
  created before the patch was applied, and non-NULL for the new item created AFTER
  the patch was applied.

Optional: Remove database changes via:
  ALTER TABLE opac_news DROP FOREIGN KEY borrowernumber_fk;
  ALTER TABLE opac_news DROP COLUMN borrowernumber;

Sponsored-By: Halland County Library
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
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@theke.io>
8 years agoBug 10933: (followup of the followup) fix the previous patch to work with master
Jonathan Druart [Tue, 27 Oct 2015 16:05:36 +0000 (16:05 +0000)]
Bug 10933: (followup of the followup) fix the previous patch to work with master

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: (RM followup) DBIx update
Tomas Cohen Arazi [Tue, 27 Oct 2015 15:52:22 +0000 (12:52 -0300)]
Bug 14100: (RM followup) DBIx update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: (QA followup) fix wrong comment in kohastructure.sql
Tomas Cohen Arazi [Tue, 27 Oct 2015 15:50:32 +0000 (12:50 -0300)]
Bug 14100: (QA followup) fix wrong comment in kohastructure.sql

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: DBRev 3.21.00.044
Tomas Cohen Arazi [Tue, 27 Oct 2015 15:45:36 +0000 (12:45 -0300)]
Bug 14100: DBRev 3.21.00.044

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: Fix 3 occurrences more
Jonathan Druart [Mon, 19 Oct 2015 08:05:43 +0000 (09:05 +0100)]
Bug 14100: Fix 3 occurrences more

- opac-suggestions.pl
- opac-readingrecord.pl
- opac-reserve.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: Fix some missing occurrences
Jonathan Druart [Wed, 14 Oct 2015 08:38:05 +0000 (09:38 +0100)]
Bug 14100: Fix some missing occurrences

This patch fixes:
- reports/bor_issues_top.pl
- sort order
- adv search and search results
- opac-topissues.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: Move add form to the top
Jonathan Druart [Tue, 13 Oct 2015 08:52:54 +0000 (09:52 +0100)]
Bug 14100: Move add form to the top

Not sure this is the best: now the messages will make the table moves.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: Better errors handling
Jonathan Druart [Tue, 13 Oct 2015 08:49:55 +0000 (09:49 +0100)]
Bug 14100: Better errors handling

This patch mainly improves the errors handling.
It's now not possible to add several translations for the same entity-code-lang
combination.

It also:
- wording: Translate for other languages => into
- fixes encoding issues on add/update (was just display)
- add entity and code to the title of the pop-up window

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: (follow-up) Language overlay for item types
Jonathan Druart [Wed, 19 Aug 2015 09:22:24 +0000 (10:22 +0100)]
Bug 14100: (follow-up) Language overlay for item types

Display the translated description for item types in the following pages:
> admin/smart-rules.pl
> catalogue/detail.pl
> catalogue/itemsearch.pl
> catalogue/moredetail.pl
> reports/acquisitions_stats.pl
> reports/bor_issues_top.pl
> reports/cat_issues_top.pl
> reports/catalogue_out.pl
> reports/catalogue_stats.pl
> reports/issues_avg_stats.pl
> reports/issues_stats.pl
> reports/itemslost.pl
> reports/manager.pl
> reports/reserves_stats.pl
> suggestion/suggestion.pl
> tools/export.pl

> Opac:
> opac-detail.pl
> opac-MARCdetail.pl
> opac-search.pl

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14100: Generic solution for language overlay - Item types
Jonathan Druart [Thu, 30 Apr 2015 15:30:47 +0000 (17:30 +0200)]
Bug 14100: Generic solution for language overlay - Item types

Test plan:
1/ update the Schema (misc/devel/update_dbix_class_files.pl)
2/ Translate templates for some languages (es-DE, de-DE for instance)
3/ Enable them in the pref (search for 'lang') for the staff interface
4/ Go on the item type admin page (admin/itemtypes.pl)
5/ Edit one
6/ Click on the 'translate for other languages' link
7/ You are now on the interface to translate the item type's description
in the languages you want. So translate some :)
8/ Go back on the item type list view (admin/itemtypes.pl)
9/ You should see the original description (non translated)
10/ Switch the language
11/ You should see the translated description in the correct language.
If the description is non translated, the original description is
displayed.

12/ On the different page where the item type is displayed, confirm that
the translated description appears.

Think further / Todo:
1/ Update all occurrences of the item type's description (DONE)
2/ Implement for authorised values
3/ Implement for syspref value (at least textarea)
4/ Implement for branch names
5/ Centralize all the translation on a single page in the admin area
...
N/ Implement a webservice to centralize all the translations and give
the ability to sync the item types/authorised values description with
the rest of the world (push and pull).

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 11559: DBRev 3.21.00.043
Tomas Cohen Arazi [Tue, 27 Oct 2015 15:30:32 +0000 (12:30 -0300)]
Bug 11559: DBRev 3.21.00.043

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 11559: (QA followup) fix several small issues
Jesse Weaver [Mon, 26 Oct 2015 21:11:07 +0000 (15:11 -0600)]
Bug 11559: (QA followup) fix several small issues

This fixes the following:
  * Remove unneeded year on use Modern::Perl
  * Fix occasional freeze when reloading existing record
  * Fix encoding for returned record on first save to catalog

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (QA followup) replace font choices, fix macro editor
Jesse Weaver [Mon, 26 Oct 2015 20:29:54 +0000 (14:29 -0600)]
Bug 11559: (QA followup) replace font choices, fix macro editor

More specifically:
  * Use monospace font options that are more widely installed
  * Don't allow entering macros until the user loads/creates a macro

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (QA followup) fix QA issues
Jesse Weaver [Mon, 26 Oct 2015 01:34:53 +0000 (19:34 -0600)]
Bug 11559: (QA followup) fix QA issues

This fixes the following:
  * License of editor.pl
  * Remove tabs
  * Use [% interface %]
  * Re-order search fields like the old interface
  * Add license information for new libraries

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (QA followup) detect and warn about corruption caused by MARC-8
Jesse Weaver [Fri, 23 Oct 2015 17:06:39 +0000 (11:06 -0600)]
Bug 11559: (QA followup) detect and warn about corruption caused by MARC-8

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (QA followup) fix pagination bar, add Ctrl-D to macro editor
Jesse Weaver [Thu, 22 Oct 2015 22:53:11 +0000 (16:53 -0600)]
Bug 11559: (QA followup) fix pagination bar, add Ctrl-D to macro editor

Also, fix incredibly silly mistake with keyboard shortcuts popup.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) fix first-character deletion, small usability issues
Jesse Weaver [Mon, 19 Oct 2015 23:47:13 +0000 (17:47 -0600)]
Bug 11559: (followup) fix first-character deletion, small usability issues

This should fix the first-character deletion bug reported by Nick, and also:

  * Fix subfield deletion
  * Attempted fix for special keys on dropdowns
  * Allow deleting empty fields
  * Fix bug with composed characters

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (QA followup) switch to new delimiter, fix minor issues
Jesse Weaver [Tue, 6 Oct 2015 22:00:49 +0000 (16:00 -0600)]
Bug 11559: (QA followup) switch to new delimiter, fix minor issues

This followup introduces a major change; instead of subfields starting
with '$<code><space>', they now start with '‡<code>'. The double-cross
character can be typed with Ctrl-D.

It also fixes the following:
  * Add UUID.pm dependency
  * Remove debugging call
  * Fix toLocaleFormat error reported by Nick Clemens
  * Ignore subfields that are marked as unrepeatable/mandatory AND
    ignored (tab is -1)
  * Mention lack of support for UNIMARC/NORMARC fixed fields in system
    preferences screen
  * Confirm when user creates new record and current record is modified
  * Perform better when importing gigantic record dump
  * Show "Edit" instead of "Import" and allow direct editing for local
    catalog records in search screen
  * Add "Keyboard shortcuts" help button to toolbar

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) Prevent saving item tags, fix other issues
Jesse Weaver [Thu, 3 Sep 2015 21:47:35 +0000 (15:47 -0600)]
Bug 11559: (followup) Prevent saving item tags, fix other issues

This fixes the following issues:
  * Spaces are now allowed in indicators
  * Shift-Enter is available to insert a newline if needed
  * Item tags, if present, will prevent saving (as they are not correctly
    processed by the backend)
  * biblionumber tags (999 in MARC21) will be stripped before the record
    is saved to Koha, to prevent their modification

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) Fix error when all servers are deselected
Jesse Weaver [Thu, 6 Aug 2015 21:56:36 +0000 (15:56 -0600)]
Bug 11559: (followup) Fix error when all servers are deselected

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) Fix import bugs, display/parsing issues
Jesse Weaver [Thu, 6 Aug 2015 21:56:36 +0000 (15:56 -0600)]
Bug 11559: (followup) Fix import bugs, display/parsing issues

This fixes the following issues:
  * ISO2709 import fails for Unicode
  * Import only works with .mrc/.xml extensions
  * MARC21 widgets not translatable
  * Macro UI broken
  * Uppercase subfield codes forbidden
  * Tag with no valid subfields shows as error but tries to save

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) Fill in default values, fix redirect and UNIMARC
Jesse Weaver [Tue, 23 Jun 2015 22:24:17 +0000 (16:24 -0600)]
Bug 11559: (followup) Fill in default values, fix redirect and UNIMARC

This fixes the following issues:
    * Help for UNIMARC tags broken
    * MARC21 resources loaded when in UNIMARC
    * Clicking on "advanced editor" in basic editor fails
    * Shift-Tab goes to the beginning of a fixed-field widget rather
      than the end

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: (followup) Fix keyboard control bugs, make labels clickable
Jesse Weaver [Tue, 23 Jun 2015 22:24:17 +0000 (16:24 -0600)]
Bug 11559: (followup) Fix keyboard control bugs, make labels clickable

This fixes the following issues:
    * Labels of search server checkboxes cannot be clicked
    * Quick search fields cannot be focused
    * Search results cannot be scrolled with a keyboard

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
8 years agoBug 11559: Rancor: advanced cataloging interface
Jesse Weaver [Mon, 15 Jun 2015 21:09:27 +0000 (17:09 -0400)]
Bug 11559: Rancor: advanced cataloging interface

Full test plan is posted on bug. Test plan for system preference:

  1. Apply patch, clear cookies.
  2. Go to "Cataloging."
  3. Add new record, verify that basic editor is used.
  4. Navigate to existing record, click on "Edit record", verify that
     basic editor is used.
  5. Inside basic editor, verify that no button appears to switch to the
     advanced editor.
  6. Enable the "EnableAdvancedCatalogingEditor" syspref.
  7. Repeat above steps, should still go to basic editor, but button
     should appear to switch to the advanced editor; click it.
  8. Now, adding new records and editing existing records should go to
     the advanced editor.

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 11559: New libraries for Rancor
Jesse Weaver [Mon, 15 Jun 2015 21:06:19 +0000 (17:06 -0400)]
Bug 11559: New libraries for Rancor

Adds the following JS libraries:

  * CodeMirror - extensible text editor
  * FileSaver - shim for saving files
  * require - dependency resolver and module loader

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 11559: Supporting changes for Rancor
Jesse Weaver [Mon, 15 Jun 2015 20:57:46 +0000 (16:57 -0400)]
Bug 11559: Supporting changes for Rancor

  * Extends login screen to pass along #hash
  * Adds JSONP support to C4::Service
  * Extends humanmsg to allow per-message classes
  * Adds proper charset to results of svc/bib

Test plan:

  1. C4/Auth.pm and .../intranet/.../auth.tt: verify that login/usage
     works as expected, despite the change to pass on the fragment (...#blah)
     from the URL.
  2. C4/Service.pm and humanmsg.js: verify that editing system
     preferences (the main user of these modules) works correctly despite
     updates.
  3. svc/bib: verify that records can be correctly downloaded with the
     change of character set. This can be done in a Firebug/Chrome Devtools
     console by running `$.get('/cgi-bin/koha/svc/bib/1')` and inspecting the
     results (possibly replacing 1 with a different valid biblionumber).

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 10120: (QA followup) avoid raising warnings on upgrade
Tomas Cohen Arazi [Tue, 27 Oct 2015 15:07:27 +0000 (12:07 -0300)]
Bug 10120: (QA followup) avoid raising warnings on upgrade

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14734: Enhance 264 display in OPAC and Staff XSLT.
Winona Salesky [Wed, 16 Sep 2015 16:37:54 +0000 (12:37 -0400)]
Bug 14734: Enhance 264 display in OPAC and Staff XSLT.

Makes 264 repeatable, prefer 264 over 260. If 264/ind1=3 is present in the
record the xslt uses ind1 to determine latest 264, if no ind1=3 then all
264 fields are displayed.

Test Plan:
1) Apply this patch
2) Ensure you are using the default XSLT setting for the staff and opac record details
3) Find or create a record with multiple MARC tags 264
4) Perform a search that would show the record in the search results.
5) Review results for correct 264 display.
6) Click title to review record details.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. 260 not showed when 264 exists, tested with multiple
records. If ind1=3 is present shows the current/latest data

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 15069: DBRev 3.21.00.042
Tomas Cohen Arazi [Tue, 27 Oct 2015 14:44:43 +0000 (11:44 -0300)]
Bug 15069: DBRev 3.21.00.042

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 15069: Update items_search_fields.authorised_values_category to varchar(32)
Jonathan Druart [Tue, 27 Oct 2015 14:29:29 +0000 (14:29 +0000)]
Bug 15069: Update items_search_fields.authorised_values_category to varchar(32)

This is a follow-up for bug 13379.
items_search_fields.authorised_values_category is now a varchar(32) but
the updatedatabase.pl did not modify it (changed only on
kohastructure.sql)

Test plan:
  SHOW CREATE TABLE items_search_fields
before and after this patch.
items_search_fields.authorised_values_category should be a varchar(32)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 10933: (follow-up) fix the previous patch to work with master
Joonas Kylmälä [Mon, 31 Aug 2015 11:41:44 +0000 (11:41 +0000)]
Bug 10933: (follow-up) fix the previous patch to work with master

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 10933: The PurgeSearchHistory should be merge into the C4::Search::History module
Jonathan Druart [Mon, 23 Sep 2013 11:34:19 +0000 (13:34 +0200)]
Bug 10933: The PurgeSearchHistory should be merge into the C4::Search::History module

Since bug 10803 adds a C4::Search::History module, the
PurgeSearchHistory routine should be moved.

Test plan:
- run misc/cronjobs/cleanup_database.pl with the searchhistory param and
verify behavior is the same as before applying this patch.
- run prove t/Search/History.t

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14996: Remove C4::Dates from tags/review.pl
Marc Véron [Fri, 9 Oct 2015 21:11:22 +0000 (23:11 +0200)]
Bug 14996: Remove C4::Dates from tags/review.pl

This patch removes C4::Dates from file tags/review.pl

To test:
- Create some tags
- Go to Home > Tools > Tags
- Verify that dates display properly
- Verify that the date filter works as before

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14468: (QA followup) remove useless diags
Tomas Cohen Arazi [Tue, 27 Oct 2015 13:35:02 +0000 (10:35 -0300)]
Bug 14468: (QA followup) remove useless diags

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14468: followup to fix tests
Bernardo Gonzalez Kriegel [Fri, 23 Oct 2015 16:40:45 +0000 (13:40 -0300)]
Bug 14468: followup to fix tests

This patch fix an expected  test result.
Also changes a comparison for the return value to 'delete'
layout sub, in case of success it returns 'undef' and triggers
the message 'use of uninitialized value $del_results ...'

To test:
1) Whitout this patch

prove t/db_dependent/Labels/t_Layout.t

fails.

Also note the message
"Use of uninitialized value $del_results in string ne at t/db_dependent/Labels/t_Layout.t line 110."
for using the return value of delete layout (undef on success!)

2) Apply the patch
3) Test pass and no more message

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 14468: Remove warnings when creating Labels
Bernardo Gonzalez Kriegel [Sun, 28 Jun 2015 00:41:01 +0000 (21:41 -0300)]
Bug 14468: Remove warnings when creating Labels

This patch removes 2 types of warnings when
creating Labels

a) Using '0' as filling char is not to the like of prStrWidth
On C4/Creators/Layout.pm

b) A RM followup from Galen on Bug 8375 to C4/Creators/PDF.pm
makes impossible to find properly a font :(
(http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=f7ef93e758850e991091e7268b8d1b1453082df4)
on C4/Labels/Label.pm

To test:
Pre patch
1) Go to Tools > Labels
2) Create a new layout, name ABC, type 'Barcode/Biblio'
3) Create a new batch, add 2 items
4) Export as PDF using the new layout
5) Look at logs, you will find something like

a) label-create-pdf.pl: Use of uninitialized value $strwidth in numeric lt (<) at /home/bgkriegel/kohaclone/C4/Creators/Layout.pm line 233., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
(Only one of this kind)

b) Two related lines similar to this examples
label-create-pdf.pl: Use of uninitialized value in -e at /home/bgkriegel/kohaclone/C4/Creators/PDF.pm line 226., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
label-create-pdf.pl: ERROR in koha-conf.xml -- missing <font type="Ft1">/path/to/font.ttf</font> at /home/bgkriegel/kohaclone/C4/Creators/PDF.pm line 229., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
(many many lines x number of items on batch)

6) Apply the patch
7) Export the same PDF, no more warnings

8) Bonus 1: change main font to Courier and Helvetica
and check results
9) Bonus 2: check using arabic records

Many hours to find :(
Easy to fix

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 14995: Remove C4::Dates: Delete files reservereport.pl / reservereport.tt
Marc Véron [Fri, 9 Oct 2015 19:33:03 +0000 (21:33 +0200)]
Bug 14995: Remove C4::Dates: Delete files reservereport.pl / reservereport.tt

The following files use C4::Dates, but they seem no longer to be in use:

- koha-tmpl/intranet-tmpl/prog/en/modules/reports/reservereport.tt
- reports/reservereport.pl

To verify: git grep 'reservereport'

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14949: Remove remaining C4::Dates and fix display in admin/categorie.pl
Marc Véron [Wed, 14 Oct 2015 19:51:17 +0000 (21:51 +0200)]
Bug 14949: Remove remaining C4::Dates and fix display in admin/categorie.pl

This patch removes a remaining C4::Dates from admin/categroie.pl and fixes
the display of "Enrollment period" on the confirmation screen for deleting.

To verify and test pls. refer to comments #5 and #6

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14949: (followup) Fix regression with hard due date
Marc Véron [Tue, 6 Oct 2015 13:06:25 +0000 (15:06 +0200)]
Bug 14949: (followup) Fix regression with hard due date

This patch fixes the regresseion as described in comment #3

To test:

- Go on smart-rules.pl and edit a line. Do not define a Hard due date, save.
  The value is "None defined".

- Edit the line, do not change anything and save.
  The value should be "None defined"

- Edit the line, define a hard due date, save.
  The date should display as expected.

- Edit the line agein, remove the hard due date, save.
  The value should be "None defined"

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14949: Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Marc Véron [Sun, 4 Oct 2015 16:25:46 +0000 (18:25 +0200)]
Bug 14949: Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl

Bug to remove C4::Dates from
 - admin/smart-rules.pl
 - admin/categorie.pl

To test:

- Apply patch

- Go to Home > Administration > Circulation and fine rules (smart-rules.pl)
- Edit or add a rule
- Verify that 'Hard due date' displays and saves fine

- Go to Home > Administration > Patron categories
- Edit or add a category
- Verify that 'Until date' displays and saves fine

Note: The date picker does not warn about wrong date formats as e.g. while
      editing patrons, but that is not in the scope of this bug

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14997: Remove C4::Dates from tools (import / export)
Marc Véron [Sat, 10 Oct 2015 08:03:51 +0000 (10:03 +0200)]
Bug 14997: Remove C4::Dates from tools (import / export)

This patch removes C4::Dates from:

- tools/export.pl
- tools/import_borrowers.pl

Note: For testing, both need preparation without patch, see below.

To test export:
- Without patch applied, go to
  Home > Tools > Export data > Export bibliographic records
- Define Start date / End date for Accession dates
- Export bibliographic records as 'without-patch.mrc'

- Do the same with patch, export as 'with-patch.mrc
- Compare the files, they should be the same

To test Import patrons:
- Without patch
- Go to Home > Tools > Import patrons
- Create a patron category like 'TEST' (useful for filtering...)
- Prepare a file with some patrons with category TEST to import.
  Fill date of birth, enrolment date, expiry date with values
  formatted in syspref format, in iso format and garbage
- Import
- Review the imported patrons (search for category TEST)

- With patch: Change cardnumber and names in import file
- Import
- Review again and compare with results from previous import.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Switch recent commits from Glyphicons to Font Awesome
Kyle M Hall [Mon, 26 Oct 2015 17:15:37 +0000 (13:15 -0400)]
Bug 14915: (QA followup) Switch recent commits from Glyphicons to Font Awesome

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-time with fa-clock-o
Katrin Fischer [Sun, 25 Oct 2015 22:12:28 +0000 (23:12 +0100)]
Bug 14915: (QA followup) Replace fa-time with fa-clock-o

Icon looks almost the same, just has a different name.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: [FA 4.4] (QA followup) Replace fa-hold with fa-sticky-note-o
Katrin Fischer [Sun, 25 Oct 2015 22:01:11 +0000 (23:01 +0100)]
Bug 14915: [FA 4.4] (QA followup) Replace fa-hold with fa-sticky-note-o

Ok, this is a fun one: There is no icon like our current hold icon
in Font Awesome. So I picked fa-sticky-note-o for a replacement.

But since this is a new one, it doesn't exist in Koha yet.
I found no better match and the patch was already written...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-merge with fa-compress
Katrin Fischer [Sun, 25 Oct 2015 21:34:42 +0000 (22:34 +0100)]
Bug 14915: (QA followup) Replace fa-merge with fa-compress

Another icon that doesn't quite exist in Font Awesome -
this is starting to get a bit troublesome.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-zoom-in and fa-zoom-out
Katrin Fischer [Sun, 25 Oct 2015 21:18:10 +0000 (22:18 +0100)]
Bug 14915: (QA followup) Replace fa-zoom-in and fa-zoom-out

Same icons don't appear to exist for Font awesome.
Replaced with fa-folder and fa-folder-open for now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-downlowd-alt with fa-download
Katrin Fischer [Sun, 25 Oct 2015 21:08:43 +0000 (22:08 +0100)]
Bug 14915: (QA followup) Replace fa-downlowd-alt with fa-download

Fixes non-existing fa-download-alt by using fa-download instead.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-hdd with fa-save
Katrin Fischer [Sun, 25 Oct 2015 20:57:57 +0000 (21:57 +0100)]
Bug 14915: (QA followup) Replace fa-hdd with fa-save

Alternative patch to using hdd-o.

As the Font Awesome Icon is different to what we used before,
an alternative could be switching back to the 'classic' symbol
for save.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Replace fa-remove-sign with fa-times-circle
Katrin Fischer [Sun, 25 Oct 2015 20:26:51 +0000 (21:26 +0100)]
Bug 14915: (QA followup) Replace fa-remove-sign with fa-times-circle

Noticed that an icon was missing in the templates.

Replaced fa-remove-sign with same-looking fa-times-circle.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: (QA followup) Tweak '+' icon for serials-home
Kyle M Hall [Thu, 8 Oct 2015 18:07:51 +0000 (14:07 -0400)]
Bug 14915: (QA followup) Tweak '+' icon for serials-home

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14915: Use Font Awesome instead of Glyphicons for the staff intranet
Kyle M Hall [Mon, 28 Sep 2015 14:36:28 +0000 (10:36 -0400)]
Bug 14915: Use Font Awesome instead of Glyphicons for the staff intranet

We should be using Font Awesome for our icons instead of Glyphicons, for
the reasons discussed on bug 13696.

Test Plan:
1) Apply this patch
2) Note all Glyphicons have been replaced with FA icons in the staff intranet
3) git grep "icon-" ./koha-tmpl/intranet-tmpl/prog/en/modules/
   should give no results
4) git grep "icon-" ./koha-tmpl/intranet-tmpl/prog/en/includes/
   should give no results

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
We need a follow-up to cover the files changes since this
patch was written. Especially to cover the changes in the
label creator modules.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13696: (QA followup) Update FA to 4.4.0
Kyle M Hall [Mon, 26 Oct 2015 16:47:22 +0000 (12:47 -0400)]
Bug 13696: (QA followup) Update FA to 4.4.0

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13696: (QA followup) Add Font Awesome license to the about page
Kyle M Hall [Mon, 28 Sep 2015 15:41:44 +0000 (11:41 -0400)]
Bug 13696: (QA followup) Add Font Awesome license to the about page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 13696: Add support for Font Awesome icons in Koha
Kyle M Hall [Wed, 11 Feb 2015 12:24:24 +0000 (07:24 -0500)]
Bug 13696: Add support for Font Awesome icons in Koha

Font Awesome is similar to Glyphicons included in Twitter Bootstrap,
except better in every way and more Free.

Test Plan:
1) Apply this patch
2) Edit the template for a page, and add a Font Awesome tag to it,
   examples can be found here:
   http://fortawesome.github.io/Font-Awesome/examples/
3) Reload the page and verify the icon displays.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14982: Remove C4::Dates from guided report wizard and dictionary
Marc Véron [Thu, 8 Oct 2015 17:34:56 +0000 (19:34 +0200)]
Bug 14982: Remove C4::Dates from guided report wizard and dictionary

This patch removes C4::Dates from files:
- reports/guided_reports.pl
- reports/dictionary.pl
- C4/Reports/Guided.pm

To test:
- Go to Home > Reports > Guided reports wizard
- Then go to 'View Dictionary' (menue at teh left)
- Click 'New definition' and step through
- In step 2. select e.g. borrowers
- In step 3 select a date field
- In step 4, select date range and test start / end dates
- In step 5, verify that dates display properly
- Save and verify that dates are insertet properly in sql definition

- Go back to Home > Reports > Guided reports wizard
- Step through the wizard and verify that it works as before.

http://bugs.koha-community.org/show_bug.cgi?id=14982
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14961: Remove C4::Dates from files reports/*_stats.pl
Marc Véron [Mon, 5 Oct 2015 21:34:38 +0000 (23:34 +0200)]
Bug 14961: Remove C4::Dates from files reports/*_stats.pl

Remove C4::Dates from following files:

- reports/acquisitions_stats.pl
- reports/borrowers_stats.pl
- reports/reserves_stats.pl
- reports/serials_stats.pl
- reports/issues_avg_stats.pl
- reports/issues_stats.pl

To test:
- Go to Home > Reports
- Verify that following reports work as before:
  - Other > Average loan time
  - Statistic wizards
    - Acquisitions
    - Patrons
    - Circulation
    - Serials
    - Holds

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@theke.io>
8 years agoBug 14824: Fix sorting of Norwegian vowels
Magnus Enger [Tue, 15 Sep 2015 08:24:44 +0000 (10:24 +0200)]
Bug 14824: Fix sorting of Norwegian vowels

Currently, Norwegian vowels are not sorted correctly, even when
you have chosen "nb" as the ZEBRA_LANGUAGE during installation.

To test:
- Make sure you have three records with titles that begin with ÆØÅ
  respectively
- Do a search that turns up those three records and some others, and
  sort the results by title, bot ascending and descending.
- Verify that ÆØÅ is shown in some weird order.
- Edit your sort-string-utf.chr* so it is in line with the current
  patch. It should include these two lines:
  lowercase {0-9}{a-z}æøå
  uppercase {0-9}{A-Z}ÆØÅ
- Restart Zebra and reindex all the records, e.g.:
  $ sudo koha-restart-zebra <instancename>
  $ sudo koha-rebuild-zebra -f -v <instancename>
- Do the search again, make sure you order by title and check that
  ÆØÅ are sorted in the order of 1. Æ 2. Ø 3. Å, and after all other
  characters

* = If you are on a gitified install, you need to edit this file:
/etc/koha/zebradb/lang_defs/<your ZEBRA_LANGUAGE>/sort-string-utf.chr
NOT the file in your git clone (yeah, i wasted some time there...)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: (QA followup) remove warnings
Tomas Cohen Arazi [Mon, 26 Oct 2015 14:18:04 +0000 (11:18 -0300)]
Bug 14778: (QA followup) remove warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Make Search.t pass - replace SHOW COLUMNS
Jonathan Druart [Mon, 26 Oct 2015 13:59:06 +0000 (13:59 +0000)]
Bug 14778: Make Search.t pass - replace SHOW COLUMNS

For an unkown reason, when executed from a test file, the 'SHOW COLUMNS'
statement does not return anything.
We need to retrieve the column list from the DBIx::Class resultset.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14106: (RM followup) sick of failing tests in Jessie
Tomas Cohen Arazi [Sat, 24 Oct 2015 01:58:05 +0000 (22:58 -0300)]
Bug 14106: (RM followup) sick of failing tests in Jessie

This patch adds the original fix for source installs too...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Remove t/Acquisition/Invoices.t
Jonathan Druart [Tue, 20 Oct 2015 14:42:53 +0000 (15:42 +0100)]
Bug 14778: Remove t/Acquisition/Invoices.t

Using Test::DBIx::Class now, we cannot do what we did in this file with DBD::Mock.
Since the Invoice[s] subroutines are already tested in
t/db_dependent/Acquisition/Invoices.t there is no special needs to have
these ones.
Instead of loosing 2 hours on this file, I would prefer to remove it.
Feel free to provide a counter patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Mock the dbh for t/db_dependent/Search.t
Jonathan Druart [Tue, 20 Oct 2015 14:37:40 +0000 (15:37 +0100)]
Bug 14778: Mock the dbh for t/db_dependent/Search.t

No need to mock the items' columns (?)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Make Barcodes_ValueBuilder.t db dependent
Jonathan Druart [Tue, 20 Oct 2015 13:45:11 +0000 (14:45 +0100)]
Bug 14778: Make Barcodes_ValueBuilder.t db dependent

The get_barcode subroutines call very mysql specific functions and it's
not possible to easily use fixtures here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/SocialData.t
Jonathan Druart [Tue, 20 Oct 2015 13:21:45 +0000 (14:21 +0100)]
Bug 14778: Install fixtures for t/SocialData.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Members_AttributeTypes.t
Jonathan Druart [Tue, 20 Oct 2015 13:10:18 +0000 (14:10 +0100)]
Bug 14778: Install fixtures for t/Members_AttributeTypes.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Matcher.t
Jonathan Druart [Tue, 20 Oct 2015 12:52:37 +0000 (13:52 +0100)]
Bug 14778: Install fixtures for t/Matcher.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Letters.t
Jonathan Druart [Tue, 20 Oct 2015 12:46:46 +0000 (13:46 +0100)]
Bug 14778: Install fixtures for t/Letters.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Koha.t
Jonathan Druart [Tue, 20 Oct 2015 12:02:15 +0000 (13:02 +0100)]
Bug 14778: Install fixtures for t/Koha.t

Warning: This patch modifies a module!
What's the need of the binary function here?
The data are case insensitive, so no need to use this mysql function.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/ItemType.t
Jonathan Druart [Tue, 20 Oct 2015 11:48:37 +0000 (12:48 +0100)]
Bug 14778: Install fixtures for t/ItemType.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Images.t
Jonathan Druart [Tue, 20 Oct 2015 11:44:55 +0000 (12:44 +0100)]
Bug 14778: Install fixtures for t/Images.t

Note that this tests file were completely buggy before.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Biblio.t
Jonathan Druart [Thu, 15 Oct 2015 15:05:14 +0000 (16:05 +0100)]
Bug 14778: Install fixtures for t/Biblio.t

Note that it already passed before

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Install fixtures for t/Calendar.t
Jonathan Druart [Thu, 15 Oct 2015 15:44:32 +0000 (16:44 +0100)]
Bug 14778: Install fixtures for t/Calendar.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Use mock_dbh where it should be used
Jonathan Druart [Tue, 20 Oct 2015 10:48:00 +0000 (11:48 +0100)]
Bug 14778: Use mock_dbh where it should be used

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Mocks Koha::Database->_new_schema instead of C4::Context->_new_dbh
Jonathan Druart [Tue, 20 Oct 2015 11:03:54 +0000 (12:03 +0100)]
Bug 14778: Mocks Koha::Database->_new_schema instead of C4::Context->_new_dbh

C4::Context::_new_dbh does not exist anymore.
Koha::Database::_new_schema should be mocked instead.

Will fix:
- t/00-load.t
- t/Breeding.t
- t/ImportBatch.t
- t/Message.t
- t/Overdues.t
- t/Prices.t
- t/RotatingCollections.t
- t/Search.t
- t/SuggestionEngine_AuthorityFile.t
- t/XSLT.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Example - Replace DBI::Mock with Test::DBIx::Class - Sitemapper.t
Jonathan Druart [Thu, 8 Oct 2015 10:40:43 +0000 (11:40 +0100)]
Bug 14778: Example - Replace DBI::Mock with Test::DBIx::Class - Sitemapper.t

We can use Test::DBIx::Class to install fixtures before our tests.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Set PrintError as it was before
Jonathan Druart [Thu, 8 Oct 2015 10:40:19 +0000 (11:40 +0100)]
Bug 14778: Set PrintError as it was before

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Make the installer test pass - use DBI missing
Jonathan Druart [Thu, 8 Oct 2015 10:39:41 +0000 (11:39 +0100)]
Bug 14778: Make the installer test pass - use DBI missing

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Make 3 tests pass
Jonathan Druart [Thu, 8 Oct 2015 10:39:19 +0000 (11:39 +0100)]
Bug 14778: Make 3 tests pass

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Make sure the dbh returned is checked by DBIC
Jonathan Druart [Fri, 4 Sep 2015 11:23:44 +0000 (12:23 +0100)]
Bug 14778: Make sure the dbh returned is checked by DBIC

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14778: Get rid of DBIx::Connector
Jonathan Druart [Thu, 3 Sep 2015 14:11:21 +0000 (15:11 +0100)]
Bug 14778: Get rid of DBIx::Connector

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 10363: Fix Updatedb entry on MariaDB
Jonathan Druart [Fri, 23 Oct 2015 13:20:17 +0000 (14:20 +0100)]
Bug 10363: Fix Updatedb entry on MariaDB

With MariaDB, I get the following error:

ERROR 1832 (HY000): Cannot change column 'av_id': used in a foreign key
constraint 'authorised_values_branches_ibfk_1'

The solution would be to remove the constraints, modify the columns and
finally reintroduce the foreign keys.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14918: [QA Follow-up] Correct enddate and use constant
Marcel de Rooy [Fri, 23 Oct 2015 06:47:58 +0000 (08:47 +0200)]
Bug 14918: [QA Follow-up] Correct enddate and use constant

Corrected enddate (subtraction in the revised code must be an addition).
Replaced hardcoded 2 days by a constant.
Renamed the constant TWO_DAYS to PULL_INTERVAL.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all three date formats.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14918: Remove C4::Dates from circ/pendingreserves.pl
Jonathan Druart [Thu, 1 Oct 2015 09:08:56 +0000 (10:08 +0100)]
Bug 14918: Remove C4::Dates from circ/pendingreserves.pl

This patch uses Koha::DateUtils instead of C4::Dates and Date::Calc. It
also sent DateTime objects to the template, which use the TT plugin to
display them.
If an invalid dates is entered, the default date is picked.

Test plan:
1/ Go to Home > Circulation > Holds to pull
2/ Verify that the the filter and the list behave as before
3/ Enter invalid dates and confirm that you do not get a software error

Counter patch works as expected and is a much cleaner solution.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14776: Remove 'selfcheck' patron related links from and add language selector...
Marc Véron [Tue, 20 Oct 2015 16:53:12 +0000 (18:53 +0200)]
Bug 14776: Remove 'selfcheck' patron related links from and add language selector to SCO header

The SCO screen displays patron related menu items in it's header (Link to the account and "Logout").
This makes no sense since the patron that is logged in is the 'selfcheck' user as defined in syspref AutoSelfCheckId.
Additionally, the language menue is missing when the syspref OpacLangSelectorMode is set to 'top' or to 'both'.

To test:
- Apply on top of Bug 15039
- Set AutoSelfCheck sysprefs as appropriate
- Set OpacLangSelectorMode to 'top' or 'both'
- Go to SCO page
- Verify that the language menue does not display in the header
- Enter a card number to check out (this logs in the SCO user)
- Verify that you get text similar to "Welcome, checkout" with a link to the sco user's account in the OPAC and a 'Logout' link
- Apply patch
- Verify that the language menu appears and the SCO user's information disappears.
- Verify, that the language menu displays / does not display with combinations of:
  - opaclanguagedisplay (Allow)
  - opaclanguages ( > 1 language selected)
  - OpacLangSelectorMode (top or both)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 15037: Correctly check the patron categories on displaying the Batch checkout tab
Jonathan Druart [Wed, 21 Oct 2015 13:08:05 +0000 (14:08 +0100)]
Bug 15037: Correctly check the patron categories on displaying the Batch checkout tab

When checking for the patron categories allowed to use the batch
checkout, the comparison should be strict (eq).

Test plan:
0/ Do not apply this patch
1/ Create 2 patron categories ST and S
2/ Enable BatchCheckouts and define BatchCheckoutsValidCategories = S
3/ Create 2 patrons, 1 in the ST category and the other one in S
4/ On the patron detail page, you should see the "batch checkout" tab
for both patron
5/ Apply this patch
6/ The tab should only be displayed for the patron S

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tested using an 'S' patron and allowing 'ST' patrons only, worked as expected.
Also tried setting &batch=1 to force it to show the batch page, and it says
I'm not allowed to do batch checkouts for that patron. Great!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14981: Remove ethnicity occurrences from sample patrons file
Jonathan Druart [Thu, 8 Oct 2015 16:19:47 +0000 (17:19 +0100)]
Bug 14981: Remove ethnicity occurrences from sample patrons file

Bug 10020 has removed these columns, the should be removed from the
patron sample file.

Test plan:
Insert the files updated by this patch into a fresh DB, you shouldn't
get any error.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Before applying the patch, I was able to notice the error when loading the
  patron sample SQL file to a DB. With the patch, it's solved.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 15021: Fix scoping variable in tools/batchMod.pl
Jonathan Druart [Fri, 16 Oct 2015 08:45:30 +0000 (08:45 +0000)]
Bug 15021: Fix scoping variable in tools/batchMod.pl

$tagslib is used in subroutines and should be declare as global.

Test plan:
On the Batch item modification page, all item fields should be listed, not only the title.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Works as expected

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
8 years agoBug 14674: [QA Follow-up] Typos and textual adjustment
Marcel de Rooy [Wed, 21 Oct 2015 11:02:31 +0000 (13:02 +0200)]
Bug 14674: [QA Follow-up] Typos and textual adjustment

This patch does:

[1] Resolve error [koha-create: line 294: local: `=upload21': not a valid
    identifier] by replacing $instance by instance.
[2] Resolved typo for 'specify'.
[3] Resolve error: [sed: -e expression #26, char 20: unknown option to `s']
    by replacing the slash in the sed line by a #. This makes sed not
    stumble over the slashes in the upload path.
[4] Added the aspect of permanent storage in the wording (as opposed to
    the storage of temporary uploads in /tmp or similar).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified that koha-create now inserts the right path in koha-conf.xml.
Verified that koha-create-dirs created the new uploads directory.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>