]> git.koha-community.org Git - koha.git/log
koha.git
8 years agoBug 16429 - Fix root problem
Kyle M Hall [Tue, 3 May 2016 10:36:15 +0000 (10:36 +0000)]
Bug 16429 - Fix root problem

The root of this issue is old code in circulation.pl that is no longer
needed and leaves the affected scripts open to future regressions.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16429 - Going to circulation from notice triggers may change logged in branch
Kyle M Hall [Tue, 3 May 2016 10:30:20 +0000 (10:30 +0000)]
Bug 16429 - Going to circulation from notice triggers may change logged in branch

If you edit notice triggers and then use the "Checko out" tab from the
top bar, you may change your logged in library by accident!

Test Plan:
1) Disable the system preference CircAutocompl
2) Go to the notice triggers
3) Select the triggers for a library other than the one you logged in as
4) Use the "Check out" tab at the top to check out to a patron
5) Note your logged in branch has changed ( you'll need to refresh the
    page if the check out search took you directly to one patron ).
6) Apply this patch
7) Repeat steps 2-4
8) Note the branch no longer changes

Tested with both patches applied. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16390: Accounts.t does not need MPL
Marcel de Rooy [Fri, 29 Apr 2016 06:01:26 +0000 (08:01 +0200)]
Bug 16390: Accounts.t does not need MPL

This test fails if you do not have a MPL branch, but a closer look shows
that we only need to replace one occurrence.

Test plan:
Run Accounts.t

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16405: Fix Circulation/NoIssuesChargeGuarantees.t test 2
Jonathan Druart [Mon, 2 May 2016 09:40:27 +0000 (10:40 +0100)]
Bug 16405: Fix Circulation/NoIssuesChargeGuarantees.t test 2

Resolves:
Failed test 'Patron cannot check out item due to debt for guarantee'
at t/db_dependent/Circulation/NoIssuesChargeGuarantees.t line 63.
          got: '10'
     expected: '10.00'

Test plan:
Run the test again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 10171: (QA followup) Make search tests use the right form
Tomas Cohen Arazi [Mon, 2 May 2016 18:47:03 +0000 (15:47 -0300)]
Bug 10171: (QA followup) Make search tests use the right form

This bug removed the search tab from the main search box, so the tests
that use /cgi-bin/koha/catalogue/search.pl for searching, should use
the advanced search box instead.

To test:
- Run
  $ prove t/db_dependent/www/search_utf8.t
=> FAIL: Several tests related to searching on the intranet interface fail.
- Apply the patch
- Run
  $ prove t/db_dependent/www/search_utf8.t
=> SUCCESS: Tests pass
- Be happy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 14622 - New data in French Canadian for the web installer. Add "fr-CA" folder.
Francois Charbonnier [Thu, 25 Feb 2016 21:59:10 +0000 (16:59 -0500)]
Bug 14622 - New data in French Canadian for the web installer. Add "fr-CA" folder.

 TEST PLAN :
 - install Koha
 - choose fr-CA as the installation language
 - check every options in the web installer
 - every file should load smoothly

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well, no problem/warning loading all sample files.
No koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 7143: Moving about to 16.05. Hurray.
Marcel de Rooy [Sat, 30 Apr 2016 13:31:30 +0000 (15:31 +0200)]
Bug 7143: Moving about to 16.05. Hurray.

Any suggestions to highlight the version number more prominently or
elegantly are welcome. Just add a follow-up.

Test plan:
Go to About. Check Koha team. Hover over the version number.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
16.05, Yeah!
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 13903: (QA followup) change routes to /holds
Julian Maurice [Tue, 24 Mar 2015 10:30:00 +0000 (11:30 +0100)]
Bug 13903: (QA followup) change routes to /holds

GET    /holds?borrowernumber=X (list)
POST   /holds                  (create)
PUT    /holds/{reserve_id}     (update)
DELETE /holds/{reserve_id}     (delete)

Unit tests in t/db_dependent/api/v1/holds.t

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 13903: Add API routes to list, create, update, delete reserves
Julian Maurice [Tue, 24 Mar 2015 10:30:00 +0000 (11:30 +0100)]
Bug 13903: Add API routes to list, create, update, delete reserves

GET    /reserves?borrowernumber=X (list)
POST   /reserves                  (create)
PUT    /reserves/{reserve_id}     (update)
DELETE /reserves/{reserve_id}     (delete)

Unit tests in t/db_dependent/api/v1/reserves.t

Test plan:
1. Apply patch
2. Run unit tests
3. Play with the API with your favorite REST client, using documentation
   in the swagger.json file
4. Try to make reserves until the maximum number of reserves for a user
   is reached (you should have a 403 error)

Depends on bug 15126

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15126: Update patron definition
Julian Maurice [Tue, 12 Apr 2016 09:36:26 +0000 (11:36 +0200)]
Bug 15126: Update patron definition

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15126: Update dependencies
Julian Maurice [Mon, 2 Nov 2015 07:10:51 +0000 (08:10 +0100)]
Bug 15126: Update dependencies

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15126: x-mojo-controller deprecation
Martin Renvoize [Wed, 7 Oct 2015 14:49:17 +0000 (14:49 +0000)]
Bug 15126: x-mojo-controller deprecation

Remove the use of soon to be deprecated x-mojo-controller from our
specification and replace with the recommended operationId format.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15126: Refactor spec file
Martin Renvoize [Wed, 7 Oct 2015 15:20:25 +0000 (15:20 +0000)]
Bug 15126: Refactor spec file

Spreading the specification over multiple files should lead to a more
manageable specification long term

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: (QA followup) fix small bug in t/db_dependent/ILSDI_Services.t
Tomas Cohen Arazi [Thu, 21 Apr 2016 14:23:58 +0000 (11:23 -0300)]
Bug 16155: (QA followup) fix small bug in t/db_dependent/ILSDI_Services.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
With all patches applied all test pass,
all == git grep -l "use t::lib::TestBuilder" | grep -v -e 'pm$' -e Old | xargs prove

No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: [QA Follow-up] Add transaction to BiblioFrameworks.t
Marcel de Rooy [Thu, 21 Apr 2016 07:15:19 +0000 (09:15 +0200)]
Bug 16155: [QA Follow-up] Add transaction to BiblioFrameworks.t

This unit test does not have a transaction.
It does not need TestBuilder.

Test plan:
[1] Optionally remove records with mfw1, mfw2 from biblio_framework table.
    If you ran this test before and it failed, you may have them.
[2] Run the test.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: Adjust a few other tests
Marcel de Rooy [Tue, 29 Mar 2016 13:32:24 +0000 (15:32 +0200)]
Bug 16155: Adjust a few other tests

Accounts.t: Only added a line that ensures the MPL branch exists.
AnonymiseIssueHistory.t: Only add a branch to work with.
Barcodes.t: Replaced clear with delete_all.
CalcFine.t: Remove default issuing rule and add one instead of updating.
Holds.t: Add category S in case it would not exist.
Members.t: Replaced clear with delete_all.
MoveItemFromBiblio.t: Replace last _fk construction.

Test plan:
Run these tests. (See note).
Git grep for only_fk, {_fk} and TestBuilder::default_value.

Note: Holds.t does not pass. Tests 9 and 39 fail, but they did already.
not ok 9 - GetReservesFromItemnumber should return a valid borrowernumber
not ok 39 - Test AlterPriority(), move to bottom
So this test needs attention, but on another report please :)

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: Adjust TestBuilder.t
Marcel de Rooy [Thu, 10 Mar 2016 13:42:08 +0000 (14:42 +0100)]
Bug 16155: Adjust TestBuilder.t

The changes in TestBuilder.pm require some changes in this test.

[1] Tests have been organized under subtests. A few superfluous tests have
    been removed. (There is still some overlap between the sections
    of overduerules_transport_type and userpermission.)
[2] The results in the build all sources-test are checked one step further.
[3] Tests are added for field length, null values and delete method.
[4] The former defaults from TestBuilder are incorporated in the tests
    for userpermission.

Test plan:
Run t/db_dependent/TestBuilder.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: Remove a second use from Members_Attributes.t
Marcel de Rooy [Tue, 29 Mar 2016 13:02:50 +0000 (15:02 +0200)]
Bug 16155: Remove a second use from Members_Attributes.t

Test plan:
Run t/db_dependent/Members_Attributes.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16155: Composite keys in TestBuilder and more
Marcel de Rooy [Fri, 4 Mar 2016 14:15:40 +0000 (15:15 +0100)]
Bug 16155: Composite keys in TestBuilder and more

The number of tests using TestBuilder is gradually growing. Once you
are familiar with its use, you will appreciate it and find yourself
using it when writing new tests. Although it works quite well, some details
still needs some polishing.

While looking at the handling of composite keys in TestBuilder, a number
of related points came up too. This patch finally ended up in setting
the following design goals:

[1] TB should not only look at the first column of a composite FK.
[2] TB should optionally create records for fixed FK values.
[3] TB should create a new record, never change an existing record.
[4] TB should respect auto_increment columns.
[5] Passing a hash for a foreign key should always imply a new record.
[6] Explicitly passing undef for a column should mean NULL.
[7] Add a delete method; it will replace the clear method.
[8] Simplify by removing $default_values, hash key _fk and param only_fk.

The comments below further clarify these points. Note that they refer to
the old behavior (before this patch) unless stated otherwise.

Comments for point 1
====================
Look at:
    $builder->build({
        source => 'UserPermission',
        value => {
            borrowernumber => $borrowerno,
            module_bit => { flag => 'my flag' },
            code => 'will_be_ignored',
        },
    });
Module_bit and code here are a composite FK to permissions.
TB ignores the value for the code column here and creates a record with a
randomized code.

But if we would pass the hash in the second column of this compound key like:
            borrowernumber => $borrowerno,
            module_bit => 10,
            code => { code => 'new_code' },
TB would now crash when passing the hash for code thru to DBIx.

Comments for point 2
====================
Look at:
    $builder->build({
        source => 'UserPermission',
        value => {
            borrowernumber => $borrowerno,
            module_bit => 99,
            code => 'new_super_tool',
        },
    });
TB detects a fixed value for the module_bit, continues and will crash on
DBIx if the foreign keys are not found. In this case it would be friendly
to create a missing linked record.

Comments for point 3
====================
Look at:
    $builder->build({
        source => 'Branch',
        value  => { branchcode => 'CPL' },
    });
If this branch already exists, this call would modify the branch record and
overwrite all columns with randomized values (expected or not). In any case,
it would be safer here to return undef than modifying an existing record.

Comments for point 4
====================
Look at:
    $builder->build({
        source => 'Borrower',
        value  => { borrowernumber => '123456789' },
    });
If this number would exist, we would update (as earlier). But if this
number does not exist, we would create the record. Although that is
technically possible, I would prefer to have TB respect the auto
increment property of this column.

Comments for point 5
====================
Look at:
    $builder->build({
        source => 'Item',
        value  => { homebranch => { branchcode => 'MPL' } },
    });
As discussed under point 3, we should actually not pass primary key values
if we expect to build new records. The same also holds for the deeper
(recursive) calls to build when using hashes like here for homebranch.
In this case again an existing record might be overwritten.

Comments for point 6
====================
Look at:
    $builder->build({
        source => 'Reserve',
        value => { itemnumber => undef },
    });
As you know, a reserve without an itemnumber is a biblio level hold.
Unfortunately, TB did not care about passing undefs until now. So you would
get an item level hold.
In the new situation TB will respect these explicit undefs, as long as the
corresponding foreign key column is nullable of course.

Comments for point 7
====================
This patch will allow you to delete records created by TB:
    my $patron = $builder->build({ source => 'Borrower' });
    $builder->delete({ source => 'Borrower', records => $patron });
Or:
    $builder->delete({ source => 'Borrower', records => [ $patron, ... ] });
For safety, delete requires you to provide all primary key values in the
passed hashref(s).
Deleting all records in a table via clear is no longer supported and can
still be arranged in one statement.

Comments for point 8
====================
Current use of TestBuilder reveals that $default_values and only_fk
are not really needed. The current $default_values should imo not be in the
module anyway; if you want to use it, you could still pass it to TB:
    $builder->build({ ..., value => { %defa, %your_values } });

Only_fk stops at the very last step of saving the top level record while
storing all linked records at the lower levels. Practical use is not
very obvious; it can be easily simulated by one delete statement.

The hash key _fk is now used to store all linked records one or more levels
down. It is used in a few tests to retrieve a value one level down.
Why not retrieve that one value via the database and get rid of the
whole structure?

Implementation
==============
This highlights the main changes:

The $default_value hash (with some hardcoded values for UserPermission)
is removed from the module. It was used by a test in TestBuilder.t and has
been relocated.
The value of $gen_type is returned now by sub _gen_type. (See new.)

The main change in the build method is moving the foreign keys logic to a
new subroutine _create_links. This routine now looks at all columns of a
composite FK. It checks if a linked record exists for passed values, and
it looks at NULL values.

Routine _buildColumnValues is slightly adjusted to allow for passed undef
values. The theoretically endless loop is replaced by three tries. For
composite unique constraints we only check complete sets of values.

Routine _getForeignKeys contains a check to not return the same relation
twice in case of doubled belongs_to relations in the DBIx scheme.

The eval in _storeColumnValues is removed. The autoincrement check in sub
_buildColumnValue got more priority; the handling of foreign keys has been
adjusted and a check for not-nullable columns has been added.

TEST PLAN
=========
This patch only deals with the TestBuilder module itself. In the follow-up
patches TestBuilder.t and a few other unit tests are adjusted.

[1] Do not yet apply this patch. But apply the 'OldBehavior' patch.
    Verify that all tests pass. (They cover the first six design goals.)
[2] Apply this patch. Does TestBuilder still compile (perl -c)?
[3] Run the OldBehavior test again. Do all tests fail now? This means
    that we got rid of all unwanted side-effects in the list of goals.
[4] Run some other tests that use TestBuilder. (See below.)
    Skip the following tests; a follow-up patch deals with them.
    t/db_dependent/Accounts.t
    t/db_dependent/Barcodes.t
    t/db_dependent/Circulation/AnonymiseIssueHistory.t
    t/db_dependent/Circulation/CalcFine.t
    t/db_dependent/Holds.t
    t/db_dependent/Items/MoveItemFromBiblio.t
    t/db_dependent/Koha/BiblioFrameworks.t
    t/db_dependent/Members.t
    t/db_dependent/TestBuilder.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
The following tests pass:
    t/db_dependent/Acquisition/OrderUsers.t
    t/db_dependent/Auth/haspermission.t
    t/db_dependent/Barcodes_ValueBuilder.t
    t/db_dependent/Budgets.t
    t/db_dependent/Category.t
    t/db_dependent/Circulation.t
    t/db_dependent/Circulation/GetTopIssues.t
    t/db_dependent/Circulation/IsItemIssued.t
    t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
    t/db_dependent/Circulation/Returns.t
    t/db_dependent/Circulation/TooMany.t
    t/db_dependent/Circulation_dateexpiry.t
    t/db_dependent/Circulation_transfers.t
    t/db_dependent/CourseReserves.t
    t/db_dependent/Creators/Lib.t
    t/db_dependent/DecreaseLoanHighHolds.t
    t/db_dependent/Exporter/Record.t
    t/db_dependent/Holds/LocalHoldsPriority.t
    t/db_dependent/Holds/RevertWaitingStatus.t:
    t/db_dependent/HoldsQueue.t
    t/db_dependent/Holidays.t
    t/db_dependent/Items.t
    t/db_dependent/Items_DelItem.t
    t/db_dependent/Koha/Acquisition/Currencies.t
    t/db_dependent/Koha/Authorities.t
    t/db_dependent/Koha/BiblioFrameworks.t
    t/db_dependent/Koha/Cities.t
    t/db_dependent/Koha/Libraries.t
    t/db_dependent/Koha/Objects.t
    t/db_dependent/Koha/Patron/Categories.t
    t/db_dependent/Koha/Patron/Images.t
    t/db_dependent/Koha/Patron/Messages.t
    t/db_dependent/Koha/Patrons.t
    t/db_dependent/Koha/SMS_Providers.t
    t/db_dependent/Koha_template_plugin_Branches.t
    t/db_dependent/Letters.t
    t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t
    t/db_dependent/Members/GetUpcomingMembershipExpires.t
    t/db_dependent/Members_Attributes.t
    t/db_dependent/Patron/Borrower_Debarments.t
    t/db_dependent/Patron/Borrower_Discharge.t
    t/db_dependent/Patron/Borrower_Files.t
    t/db_dependent/Ratings.t
    t/db_dependent/Reports_Guided.t
    t/db_dependent/Reserves/GetReserveFee.t
    t/db_dependent/Review.t
    t/db_dependent/Serials_2.t
    t/db_dependent/ShelfBrowser.t
    t/db_dependent/Virtualshelves.t
    t/db_dependent/api/v1/patrons.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15263: (QA followup) Use the new XSLTParse4Display everywhere
Tomas Cohen Arazi [Wed, 20 Apr 2016 17:44:27 +0000 (14:44 -0300)]
Bug 15263: (QA followup) Use the new XSLTParse4Display everywhere

Edit: fixed catalogue/detail.pl and opac/opac-detail.pl so they use the right
XSLT syspref.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15263: (QA followup) Make *shelves.pl use the new API
Tomas Cohen Arazi [Thu, 24 Mar 2016 03:33:32 +0000 (00:33 -0300)]
Bug 15263: (QA followup) Make *shelves.pl use the new API

This patch makes the lists work as the search results for rendering on
XSLT-driven context. No behaviour change is expected.

To test:
- Apply the patch
- Navigate lists (OPAC and intranet)
=> SUCCESS: the only difference is speed (faster)
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15263: Bug 15263: (follow-up 2) XSLT display fetches sysprefs for every result...
Jonathan Druart [Tue, 15 Mar 2016 09:08:39 +0000 (09:08 +0000)]
Bug 15263: Bug 15263: (follow-up 2) XSLT display fetches sysprefs for every result processed

Don't retrieve prefs if we won't need them

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15263: (follow-up) XSLT display fetches sysprefs for every result processed
Jonathan Druart [Thu, 10 Mar 2016 14:47:36 +0000 (14:47 +0000)]
Bug 15263: (follow-up) XSLT display fetches sysprefs for every result processed

Set variables ($sysxml, $xslfilename, $lang) if they are not passed to
the subroutine. This happens from catalogue/detail.pl,
opac/opac-shelves.pl, opac/opac-tags.pl and virtualshelves/shelves.pl.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15263: XSLT display fetches sysprefs for every result processed
Mirko Tietgen [Sun, 29 Nov 2015 19:35:19 +0000 (20:35 +0100)]
Bug 15263: XSLT display fetches sysprefs for every result processed

On search, every single result goes through some XSLT processing.
This includes fetching the relevant sysprefs every single time.
We should do it only once per search.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16016: Sitemap handling scripts for packages
Tomas Cohen Arazi [Tue, 8 Mar 2016 17:48:17 +0000 (14:48 -0300)]
Bug 16016: Sitemap handling scripts for packages

This patch introduces the koha-sitemap script. This script wraps calls to
the misc/cronjobs/sitemap.pl script so it can be done easily instance-wise.

It sets /var/lib/koha/${instance}/sitemap as the destination directory for
the sitemap files. A followup will make them available through an Apache
configuration entry.

koha-functions.sh is provided with a handy is_sitemap_enabled function so
we can later add filters to other commands (koha-list, koha-foreach, etc).

Exposes sitemap files to apache. This is suitable for including the sitemap in
the robots.txt file as proposed in

  http://www.sitemaps.org/protocol.html#submit_robots

Note: it depends on Apache 2.4+ so we can patch the file as needed. Older
Apache users will be warned that they need to tweak the apache files on their
own.

To test:
- You can build a package out of this patchset, or do the following on a kohadevbox
  cp debian/scripts/koha-functions.sh /usr/share/koha/bin
- Run
  $ debian/scripts/koha-sitemap --help
- Go through all the options (--enable, --disable, generate).
(a) --enable:
  - debian/scripts/koha-sitemap --enable kohadev
=> SUCCESS: /var/lib/koha/kohadev/sitemap.enabled is created
  - call it again, a suitable warning is raised and the file is still there
(b) debian/scripts/koha-sitemap --disable kohadev
=> SUCCESS: /var/lib/koha/kohadev/sitemap.enabled is deleted
  - call it again, a suitable warning is raised and the file does not exist
(c) --generate:
  - debian/scripts/koha-sitemap --generate kohadev
=> SUCCESS: sitemapindex.xml and sitemap000X.xml files are generated in
            /var/lib/koha/kohadev/sitemap/
- Sign off :-D

Sponsored-by: Orex Digital
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15564 - Fix tranfert branch: Set collection branch with return branch if it is...
Alex Arnaud [Thu, 11 Feb 2016 15:02:42 +0000 (16:02 +0100)]
Bug 15564 - Fix tranfert branch: Set collection branch with return branch if it is empty.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15564 - Display "print slip" option when returning an item which is in a rotating...
Natasha [Wed, 20 Jan 2016 23:35:48 +0000 (23:35 +0000)]
Bug 15564 - Display "print slip" option when returning an item which is in a rotating collection

To Test -
1. Make a new rotating collection (under tools) with at least one book in it.
2. Check out the book/s from rotating collection.
3. Set library to a different library.
4. Check in book you just checked out.
5. Should show a dialog box with no print slip link or city.
6. Apply patch and repeat steps 1-4. Dialog box should now show the item name, city name and print slip link.

Patch works as expected. (Superfluous white space removed on line 136)
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16383: Making Local Use sysprefs actions buttons
Aleisha [Fri, 29 Apr 2016 00:31:20 +0000 (00:31 +0000)]
Bug 16383: Making Local Use sysprefs actions buttons

To test:
1) Go to Admin -> System Preferences -> Local Use tab
2) Confirm buttons show as font awesome buttons and work as expected
3) Confirm buttons do not wrap on a narrower browser

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoDBIx updates
Tomas Cohen Arazi [Tue, 3 May 2016 18:35:51 +0000 (15:35 -0300)]
DBIx updates

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16408: Fix UsageStats.t
Marcel de Rooy [Sat, 30 Apr 2016 15:06:37 +0000 (17:06 +0200)]
Bug 16408: Fix UsageStats.t

Bug 16167 removed some prefs. This impacts the number of tests.

Test plan:
Run the test.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass
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 16398: Keep the expanded view after clearing the search form
Jonathan Druart [Fri, 29 Apr 2016 15:52:26 +0000 (16:52 +0100)]
Bug 16398: Keep the expanded view after clearing the search form

On the advanced search form, the "Clear fields" button should pass expanded_options
param to preserve the view we use.

Test plan:
- Click on more options
- Fill some fields
- Click on "Clear fields"
=> Without this patch you get the "fewer options" view
=> With this patch, you will keep the "more options" view

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16384: Fix cancel link for 'Edit basket'
Katrin Fischer [Fri, 29 Apr 2016 00:53:43 +0000 (02:53 +0200)]
Bug 16384: Fix cancel link for 'Edit basket'

When you edit the basket from the basket summary page,
saving the change brings you back to the basket summary
page, but cancelling brings you to the baskets page of
the vendor.

To test:
- Add a basket in acq
  - Test cancel link returns to baskets page of vendor
- Add a basket and save
- Edit this basket
  - Test cancel link now returns to basket summary page

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16423: [QA Follow-up] Remove $opac
Marcel de Rooy [Tue, 3 May 2016 15:04:32 +0000 (17:04 +0200)]
Bug 16423: [QA Follow-up] Remove $opac

It is not used. And even may raise an uninitialized warnings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test still passes :)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16423: (followup) Add more tests
Tomas Cohen Arazi [Mon, 2 May 2016 20:42:29 +0000 (17:42 -0300)]
Bug 16423: (followup) Add more tests

On fixing this tests, we retrieved the JSON data for the datatable used on
the 'Manage staged records' page. It would be cool to check the data it
carries makes sense.

To test:
- Run t/db_dependent/www/batch.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
All test pass
prove t/db_dependent/www/batch.t
t/db_dependent/www/batch.t .. ok
All tests successful.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16423: Fix t/db_dependent/www/batch.t so it matches new layout
Tomas Cohen Arazi [Mon, 2 May 2016 20:30:57 +0000 (17:30 -0300)]
Bug 16423: Fix t/db_dependent/www/batch.t so it matches new layout

This patch adjusts batch.t so it matches the use of datatables on the
'Manage staged records' page, and small layout changes already fixed
on search_utf8.t.

The tests are slightly modified so they actually test interesting stuff.
Some were passing only because an undefined value was passed.

To test:
- On master, run
  $ prove t/db_dependent/www/batch.t
=> FAIL: Tests fail notably
- Apply the patch
- Run:
  $ prove t/db_dependent/www/batch.t
=> SUCCESS: Notice tests now pass.
- Sign off :-D

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16419: follow-up of bug 11371 - Fix t/db_dependent/Acquisition.t
Jonathan Druart [Mon, 2 May 2016 14:41:42 +0000 (15:41 +0100)]
Bug 16419: follow-up of bug 11371 - Fix t/db_dependent/Acquisition.t

The tests added by bug 11371 have been put after the rollback statement.

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

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Tests fail before the patch, and pass with it. QA scripts like the patch too.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16407: Simplify comments
Jonathan Druart [Mon, 2 May 2016 09:46:59 +0000 (10:46 +0100)]
Bug 16407: Simplify comments

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16407: Fix Koha_borrower_modifications.t
Marcel de Rooy [Sat, 30 Apr 2016 14:55:28 +0000 (16:55 +0200)]
Bug 16407: Fix Koha_borrower_modifications.t

This test was using hardcoded borrower number, assuming they should be
present. Now we use TestBuilder.

Test plan:
Run the test.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass before and after patch.
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 16403: Remove unnecessary undef param
Jonathan Druart [Mon, 2 May 2016 09:30:55 +0000 (10:30 +0100)]
Bug 16403: Remove unnecessary undef param

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16403: Fix holds.t (tests 9 and 39)
Marcel de Rooy [Sat, 30 Apr 2016 12:36:44 +0000 (14:36 +0200)]
Bug 16403: Fix holds.t (tests 9 and 39)

Resolves this:

Failed test 'GetReservesFromItemnumber should return a valid borrowernumber'
at t/db_dependent/Holds.t line 97.
          got: '2000001890'
     expected: '2000001889'
Failed test 'Test AlterPriority(), move to bottom'
at t/db_dependent/Holds.t line 220.
          got: '4'
     expected: '5'

Test plan:
Run the test before and after applying this patch.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16396: Update package version for master packages
Tomas Cohen Arazi [Fri, 29 Apr 2016 15:49:00 +0000 (12:49 -0300)]
Bug 16396: Update package version for master packages

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16404: Fix Circulation/Branch.t (tests 8-11)
Marcel de Rooy [Sat, 30 Apr 2016 12:52:29 +0000 (14:52 +0200)]
Bug 16404: Fix Circulation/Branch.t (tests 8-11)

Resolves:
Failed test 'GetBranchitem returns holdallowed and return branch'
at t/db_dependent/Circulation/Branch.t line 226.
     Structures begin differing at:
          $got->{hold_fulfillment_policy} = 'any'
     $expected->{hold_fulfillment_policy} = Does not exist
Failed test 'Without parameters GetBranchItemRule returns the values in default_circ_rules'
at t/db_dependent/Circulation/Branch.t line 234.
     Structures begin differing at:
          $got->{hold_fulfillment_policy} = 'any'
     $expected->{hold_fulfillment_policy} = Does not exist
Failed test 'With only a branchcode GetBranchItemRule returns values in default_branch_circ_rules'
at t/db_dependent/Circulation/Branch.t line 239.
     Structures begin differing at:
          $got->{hold_fulfillment_policy} = 'any'
     $expected->{hold_fulfillment_policy} = Does not exist
Failed test 'With only one parametern GetBranchItemRule returns default values'
at t/db_dependent/Circulation/Branch.t line 244.
     Structures begin differing at:
          $got->{hold_fulfillment_policy} = 'any'
     $expected->{hold_fulfillment_policy} = Does not exist

Test plan:
Run test before and after applying this patch.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note: I do not see the usefulness of the lazy_any variable, I don't
think it make things easier to read.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16369 - Clean up and improve plugins template
Owen Leonard [Tue, 26 Apr 2016 18:54:23 +0000 (14:54 -0400)]
Bug 16369 - Clean up and improve plugins template

This patch makes multiple changes to the plugins home page template to
bring it up to date with current interface patterns.

Test the following changes:

- Breacrumb links have been corrected to include "Tools" in the path.
  Verify that this link is correct.
- A toolbar has been added for an "Upload plugin" button. Uploading is
  an action, not a view, so it should be displayed in a toolbar. Verify
  that the button works correctly.
- Messages are now formatted as messages rather than as headings. To
  test, trigger a message by, for instance, uninstalling all plugins or
  passing an invalid "method" parameter with the URL.
- Incorrect capitalization corrected.
- Plugin actions are moved to a single "Actions" dropdown menu. This
  includes 'Run report,' 'Run tool,' 'Configure,' and 'Uninstall.' Test
  that all these menu options work correctly.
- The standard "Tools" sidebar menu has been added.
- An "onclick" attribute has been removed in favor of defining the event
  in JavaScript. Test by choosing the 'Uninstall' menu item for a
  plugin. Test both confirm and cancel actions.

Also changed:

- Corrected capitalization on the tools home page.
- Adding missing plugins link to the tools sidebar menu.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16170 - DBRev 3.23.00.061
Kyle M Hall [Tue, 3 May 2016 15:04:20 +0000 (15:04 +0000)]
Bug 16170 - DBRev 3.23.00.061

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16170: [QA Follow-up] Fix embeded typos
Marcel de Rooy [Fri, 1 Apr 2016 07:34:50 +0000 (09:34 +0200)]
Bug 16170: [QA Follow-up] Fix embeded typos

Just noticed this typo three times here.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16170: [QA Follow-up] Adjust Items.t
Marcel de Rooy [Fri, 1 Apr 2016 07:24:04 +0000 (09:24 +0200)]
Bug 16170: [QA Follow-up] Adjust Items.t

Items.t inserts an item via biblioitem not correctly linked to biblio.
The new foreign key constraint does not allow that.
Actually, we should be choosing to either remove biblioitems from Koha or
remove biblionumber from items.

Note: This seems to be the only case where an item is added this way.

Test plan:
Run Items.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16170 - Corrected to make work more smoothly
Mark Tompsett [Thu, 31 Mar 2016 00:11:45 +0000 (20:11 -0400)]
Bug 16170 - Corrected to make work more smoothly

Signed-off-by: Mark Tompsett <mtompset@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 16170: Pseudo foreign key in Items
Marcel de Rooy [Wed, 23 Mar 2016 15:59:26 +0000 (16:59 +0100)]
Bug 16170: Pseudo foreign key in Items

While many of us would like to get rid of biblioitems one day, the current
scheme includes a biblioitemnumber and a biblionumber in Items.
(Which is not so great..)

But also note that biblionumber is NOT defined as a foreign key in Items,
although a belongs_to relation has been added to the DBIx scheme!
This inconsistency should be resolved. The "remove biblioitem table"
operation is a large one, but in the meantime we better make biblionumber
a regular FK not a 'pseudo' one.

Note: If in an (very) exceptional case biblionumbers are found in items,
that do not exist in biblio, this patch prints a warning at upgrade
time and does not add the constraint.

@RM: Please update the DBIx scheme accordingly.

Test plan:
[1] Run the upgrade. Check if the FK constraint has been added.
[2] Remove the FK constraint. Change the biblionumber of one item to an
    unexisting record. Run the upgrade again. Notice the warning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested both cases: constraint added as well as warning printed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16397 - Unable to delete audio alerts
Owen Leonard [Fri, 29 Apr 2016 16:29:01 +0000 (12:29 -0400)]
Bug 16397 - Unable to delete audio alerts

This patch corrects a JavaScript error which has arisen due to the
jQuery upgrade. This should have been included in Bug 16321.

To test, apply the patch and go to Administration -> Audio alerts.

- In the list of existing audio alerts, check one or more checkboxes.
  The "Delete selected" button should become enabled.
- Uncheck all checkboxes and check that the "Delete selected" button is
  now disabled.
- Confirm that deletions are completed correctly.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16418: Remove duplicate of EnhancedMessagingPreferencesOPAC
Jonathan Druart [Mon, 2 May 2016 14:33:29 +0000 (15:33 +0100)]
Bug 16418: Remove duplicate of EnhancedMessagingPreferencesOPAC

Test plan:
  mysql < installer/data/mysql/sysprefs.sql
should work

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoRevert "Bug 16104: Remove warnings "used only once: possible typo""
Jonathan Druart [Mon, 2 May 2016 11:13:59 +0000 (12:13 +0100)]
Revert "Bug 16104: Remove warnings "used only once: possible typo""

This reverts commit 6b319a2d487257e8a08bc26af9c6b2e7fa2ece2c.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with memcached and without MEMCACHED_SERVERS.
Cache.t, Context.t and sysprefs.t pass now.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15533 - DBRev - Update OldReserve schema file to match database schema
Kyle M Hall [Mon, 2 May 2016 15:00:39 +0000 (15:00 +0000)]
Bug 15533 - DBRev - Update OldReserve schema file to match database schema

8 years agoBug 14632: Add Copyright for the Koha Dev Team
Jonathan Druart [Sat, 23 Apr 2016 06:30:35 +0000 (07:30 +0100)]
Bug 14632: Add Copyright for the Koha Dev Team

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
https://bugs.koha-community.org/show_bug.cgi?id=14362

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 14362: Regression tests
Mark Tompsett [Mon, 8 Jun 2015 03:40:50 +0000 (23:40 -0400)]
Bug 14362: Regression tests

This should trigger the error. Attempts to shift system time
zones did not make sense as to the number of failures.

Added Time::Fake dependency, if it isn't installed these extra
tests don't run. There is a nice skip message about it.

Added License text.

TEST PLAN
---------
 1) apply test patch
 2) sudo dpkg-reconfigure tzdata
    -- set your system time to GMT (Africa/Abidjan)
 3) prove t/Circulation/AgeRestrictionMarkers.t
    -- should not fail, even if you change system
       time to any time.
 4) sudo dpkg-reconfigure tzdata
    -- set your timezone to Eastern
 5) sudo date -s"2015-06-18 21:15:00"
 6) date
    -- should be past 9pm Eastern timezone
 7) prove t/Circulation/AgeRestrictionMarkers.t
    -- kaboom!
 8) sudo date -s"2015-06-18 12:00:00"
 9) date
    -- should be noon Eastern timezone
10) prove t/Circulation/AgeRestrictionMarkers.t
    -- success?! Time sensitive tests are bad tests.
11) sudo apt-get install libtime-fake-perl
12) prove t/Circulation/AgeRestrictionMarkers.t
    -- kaboom!
    -- changing timezone to anything other than GMT
       should trigger a kaboom.
13) apply fix patch
14) prove t/Circulation/AgeRestrictionMarkers.t
    -- should work all the time.
15) less t/Circulation/AgeRestrictionMarkers.t
    -- the license text should be similar to
       http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
16) koha qa test tools.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 14362: PEGI15 Circulation/AgeRestrictionMarkers test fails
Mark Tompsett [Mon, 8 Jun 2015 01:26:53 +0000 (21:26 -0400)]
Bug 14362: PEGI15 Circulation/AgeRestrictionMarkers test fails

It is best to test when UTC date is a date in the future compared
to your timezone. I'm in Eastern, so right now, I expect this
test to fail for another 2.5 hours.

TEST PLAN
---------
1) prove t/Circulation/AgeRestrictionMarkers.t
   -- fails for PEGI 15 after 9pm.
2) Apply patch
3) prove t/Circulation/AgeRestrictionMarkers.t
   -- works.
4) koha qa test tools

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528 - DBRev 3.23.00.060
Kyle M Hall [Fri, 29 Apr 2016 17:58:30 +0000 (17:58 +0000)]
Bug 12528 - DBRev 3.23.00.060

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528: Add IGNORE to the INSERT statement
Jonathan Druart [Fri, 29 Apr 2016 14:52:36 +0000 (15:52 +0100)]
Bug 12528: Add IGNORE to the INSERT statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528: redirect to 404 if at least 1 pref is off
Jonathan Druart [Mon, 4 Jan 2016 09:23:15 +0000 (09:23 +0000)]
Bug 12528: redirect to 404 if at least 1 pref is off

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528: Bug 9254: Followup - Rename pref to EnhancedMessagingPreferencesOPAC
Kyle M Hall [Mon, 4 Jan 2016 09:21:07 +0000 (09:21 +0000)]
Bug 12528: Bug 9254: Followup - Rename pref to EnhancedMessagingPreferencesOPAC

If the new pref is named EnhancedMessagingPreferencesOPAC, it will show
up adjacent to EnhancedMessagingPreferences

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528 - fix problem when insert OPACEnhancedMessagingPreferences
Bouzid Fergani [Mon, 28 Dec 2015 13:59:21 +0000 (08:59 -0500)]
Bug 12528 - fix problem when insert OPACEnhancedMessagingPreferences

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 12528 - Enable staff to deny message setting access to patrons on the OPAC
Bouzid Fergani [Mon, 2 Nov 2015 21:45:45 +0000 (16:45 -0500)]
Bug 12528 - Enable staff to deny message setting access to patrons on the OPAC

  - Change the preference Enhancedmessagingpreference description.
  - Enable default EnhancedMessagingPreferences and OPACEnhancedMessagingPreferences.
  - not sent e-mail it's necessary, when user call opac-messaging.pl directly..

Testing:

I Apply the patch
II Run updatedatabase.pl

0) Search OPACEnhancedMessagingPreferences preference;
1) Validate "OPACEnhancedMessagingPreferences show patron messaging
   setting on the OPAC (NOTE: EnhancedMessagingPreferences must be
   enabled).";

2) Disable OPACEnhancedMessagingPreferences preference;
3) Enable EnhancedMessagingPreferences preference;
4) On the OPAC -> user's settings, validate "your messaging" is not
   showed.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Works as expected. With the new syspref, patrons can be forbidden to
  modify themselves their own messaging preferences.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Also, I like sysprefs
http://www.quickmeme.com/img/d9/d99723bc544e8d33572dc92f242a6f6e2dbe0126a2e35fe3de073d30d62002e6.jpg

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15543: Use another notice in membership_expiry.pl
Marcel de Rooy [Mon, 18 Jan 2016 10:48:14 +0000 (11:48 +0100)]
Bug 15543: Use another notice in membership_expiry.pl

This patch adds a letter parameter to the cron job membership_expiry.
It is used to substitute the default notice by another one.
This could be handy if you e.g. send a reminder after the first notice.
In any case, it allows for more flexibility.

Apart from this new parameter, this patch removes the sub parse_letter from
the code. The call to GetPreparedLetter is moved to the for loop and the
call to getletter is removed (no longer needed). If there is no letter
found, the Letter module already warns you. So we just exit the loop.

Test plan:
[1] Run membership_expiry.pl -c -n -v -let NOT_EXIST
    Check if you see a warning (coming from Letters.pm)
[2] Check if you have some soon expiring patrons or add before/after
    parameter to include some.
    Run membership_expiry.pl -c -n -v [-before ?] [-after ?]
[3] Create a new notice MEMBERSHIP2. Copy the text from the original notice
    and make some adjustments.
[4] Run membership_expiry.pl -c -v -let MEMBERSHIP2 [-before ?] [-after ?].
    Be aware that this call generates email messages.
    Verify that the email contained the adjusted text.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
On top of Bug 14834
Work as described, tested using '-n' to see messages on terminal, e.g.
membership_expiry.pl -v -n -c -before 3 -branch BC -after 2 --letter MEMEXP2
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 14834: Make membership_expiry cronjob more flexible
Marcel de Rooy [Thu, 17 Sep 2015 08:25:50 +0000 (10:25 +0200)]
Bug 14834: Make membership_expiry cronjob more flexible

This patch adds three parameters to the cron job: -before and -after, and
-branch.

You can run the cronjob now in an adjusted frequency: say once a week with
before 6 or after 6 (not both together). If your pref is set to 14, running
before=6 will include expiries from 8 days to 14 days ahead. When you
use after=6, you would include 14 days to 20 days ahead, etc.

You could also rerun the job of yesterday by setting before=1 and after=-1;
this could help in case of problem recovery.

Obviously, the branch parameter can be used as a filter.

NOTE: Why are these parameters passed only via the command line?
Well, obviously the branch parameter is not suitable for a pref.
The before/after parameter allows you to handle expiry mails different from
the normal scheme or could be used in some sort of recovery. In those cases
it will be more practical to use a command line parameter than editing a
pref.

NOTE: The unit test has been adjusted for the above reasons, but I also
added some lines to let existing expires not interfere with the added
borrowers by an additional count and using the branchcode parameter.

Test plan:
[1] Run the adjusted unit test GetUpcomingMembershipExpires.t
[2] Set the expiry date for patron A to now+16 (with pref 14).
    Set the expiry date for patron B to now+11.
[3] Run the cronjob without range. You should not see A and B.
[4] Run the cronjob with before 3. You should see patron B.
[5] Run the cronjob with before 3 and after 2. You should see A and B.
[6] Repeat step 5 with a branchcode that does not exist. No patrons.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described following test plan.
Test pass
No errors

New parameters work with one (-) or two(--) dashes, no problem
with that but convention suggest that 'long' options use two-dashes.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16389: Reports row limit should change upon option selection
Aleisha [Fri, 29 Apr 2016 03:00:28 +0000 (03:00 +0000)]
Bug 16389: Reports row limit should change upon option selection

To test:
1) Run a report
2) Confirm there is no 'Update' button next to the 'Rows per page:' dropdown
3) Change the limit (i.e. to 10)
4) Confirm the page updates itself

Sponsored-by: Catalyst IT
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16337 - Remove the use of "onclick" from the stage MARC records template
Owen Leonard [Mon, 25 Apr 2016 01:11:52 +0000 (21:11 -0400)]
Bug 16337 - Remove the use of "onclick" from the stage MARC records template

This patch reviseds the stage MARC records template, removing "onclick"
attributes from the markup and defining those events in the script.

To test, apply the patch and go to Tools -> Stage MARC records for
import.

- Select a MARC file for import.
- Click the "Upload file" button. Your upload should be processed
  correctly.
- Select a MARC file for import.
- Click the "Upload file" button.
- Click the "Cancel" button before the file has been uploaded. The
  upload should be cancelled.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16338 - Remove the use of "onclick" from the lists template
Owen Leonard [Mon, 25 Apr 2016 01:07:19 +0000 (21:07 -0400)]
Bug 16338 - Remove the use of "onclick" from the lists template

This patch removes the use of "onclick" from the list delete button,
moving the event definition into the script.

Also changed: Removed some unnecessary link markup; Added some
whitespace around the action buttons.

To test, apply the patch and go to Lists.

Click the "Delete" button next to any list. You should be prompted to
confirm the deletion. Verify that both confirming and canceling the
deletion works correctly.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16340: JS variable in opac-bottom.inc is declared two times
Hector Castro [Mon, 25 Apr 2016 16:04:13 +0000 (10:04 -0600)]
Bug 16340: JS variable in opac-bottom.inc is declared two times

MSG_NO_RECORD_SELECTED declared two times

To test: Go to cart and list (virtual shelves) in OPAC and
verify if those pages work as expected

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16341: Revise the way table controls look on the title detail page
Owen Leonard [Mon, 25 Apr 2016 00:39:11 +0000 (20:39 -0400)]
Bug 16341: Revise the way table controls look on the title detail page

This patch makes changes to the way links are displayed on the
bibliographic detail page, adding Font Awesome icons to make the links
clearer. Some instances of the "onclick" attribute are removed.

This patch also converts the "Edit" link to a Bootstrap button.

To test, apply the patch and locate a title in the catalog with multiple
holdings from different branches.

Test all the table controls under a variety of conditions:

- Logged in as a user who can or can't edit items
- Logged in as a user who can or can't perform batch item operations.
- With the StaffDetailItemSelection system preference enabled or
  disabled.
- With the SeparateHoldings system preference turned on or off.

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: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16366 - Remove obsolete "border" attribute from <img> tags
Owen Leonard [Wed, 27 Apr 2016 13:37:06 +0000 (09:37 -0400)]
Bug 16366 - Remove obsolete "border" attribute from <img> tags

This patch removes the obsolete "border" attribute from <img> tags.
Browsers haven't applied an border to images by default for years.

There should be no visible changes as a result of this patch. It only
affects HTML validation. If you want to test the affected pages, apply
the patch and confirm that images look correct on these pages:

- In the patron sidebar menu, if patron images are enabled.
- On the authority MARC subfield structure administration page, only
  some obsolete markup is affected (See Bug 16367).
- I don't know how to trigger display of the "filefind.png" image on
  authority and bibliographic detail pages. Possibly unused markup?
- On the advanced search page, itemtype/collection/shelving location
  images should look correct.
- When viewing existing holds for a title, the arrow images used for
  changing the position of a hold in the list should look correct.
- When viewing a list of MARC modification actions, the arrow images
  used for changing the order of actions should look correct.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16368 - Remove obsolete attributes from table tags
Owen Leonard [Wed, 27 Apr 2016 14:29:57 +0000 (10:29 -0400)]
Bug 16368 - Remove obsolete attributes from table tags

This patch removes some obsolete attributes from table markup: border,
cellpadding, and cellspacing. These changes should have no visible
effect.

- To test the changes to the reports dictionary, go to Reports -> View
  dictionary. The table of dictionary definitions should look correct.

- To test the changes to MARC plugins, you must be using MARC21. Open a
  new or existing MARC record in the standard cataloging editor and
  trigger the tag editor for 006 and 008. The tables in each popup
  window should look correct.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16372 - Replace the use of "onclick" for deletion confirmation in some templates
Owen Leonard [Tue, 26 Apr 2016 17:00:42 +0000 (13:00 -0400)]
Bug 16372 - Replace the use of "onclick" for deletion confirmation in some templates

This patch removes the use of event attributes from several templates
where the attributes were used to handle deletion operations. I've
grouped these changes in one patch because each template had only small
changes to be made.

Unrelated change: Reformatted the "no news items" message which is
displayed if there are no news items.

To test, apply the patch and test deletion operations on the following
pages. Clicking "delete" should prompty you to confirm. Test both the
confirm and cancel actions.

- On the staff client home page, test deletion of a news item.
- On the patron lists page, test deletion of a patron list.
- In the patron card creator, choose Manage -> Images. Test the "Delete"
  button for a single image.
- On the news page, test deletion of a single news item.
- On the news page, test deletion of multiple items.

Signed-off-by: Arslan Farooq <arslanone@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16381 [QA Followup] - Wrap string for translations
Kyle M Hall [Fri, 29 Apr 2016 16:09:08 +0000 (16:09 +0000)]
Bug 16381 [QA Followup] - Wrap string for translations

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16381: Fix capitalization on tags review page
Katrin Fischer [Fri, 29 Apr 2016 00:15:30 +0000 (02:15 +0200)]
Bug 16381: Fix capitalization on tags review page

- Fixes capitalization of the sub heading "Displaying ... terms"
- Fixes button label of "Test"

To test:
- Look at all, approved, rejected, pending tags and check
  the line below the heading "Tags" - "Displaying..."
- Check a term using the search box on the left side
  Before the patch: Test - Processing... - test
  After the patch this should be Test again in the end.

Capitalization looks good. QA tools complain about tabs, but there
are loads of tabs all over review.tt. Proper formatting of the whole file
could be done in a separate bug.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
8 years agoBug 16320: [QA Follow-up] Fix borrower attribute test in ILSDI_Services
Marcel de Rooy [Thu, 28 Apr 2016 06:57:05 +0000 (08:57 +0200)]
Bug 16320: [QA Follow-up] Fix borrower attribute test in ILSDI_Services

Since bug 12267 removed the password option, this test should be
adjusted.

Test plan:
Run the test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16320: [QA Follow-up] Remove warnings from ILSDI/Services.pm
Marcel de Rooy [Fri, 22 Apr 2016 11:49:21 +0000 (13:49 +0200)]
Bug 16320: [QA Follow-up] Remove warnings from ILSDI/Services.pm

Removes:
Use of uninitialized value in string eq at /home/koha/kohaclone/C4/ILSDI/Services.pm line 373.
Use of uninitialized value in string eq at /home/koha/kohaclone/C4/ILSDI/Services.pm line 390.
Use of uninitialized value in string eq at /home/koha/kohaclone/C4/ILSDI/Services.pm line 399.
Use of uninitialized value in string eq at /home/koha/kohaclone/C4/ILSDI/Services.pm line 423.

Test plan:
Run t/db_dependent/ILSDI_Services.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16320: Refactor ILSDI_Services.t so it uses TestBuilder
Tomas Cohen Arazi [Thu, 21 Apr 2016 16:11:02 +0000 (13:11 -0300)]
Bug 16320: Refactor ILSDI_Services.t so it uses TestBuilder

This patch refactors the tests so they are corerctly built using TestBuilder
and wrapper inside a DB transaction in a less ambiguous way.

To test:
- Verify that the tests pass with the patch:
- Run:
  $ prove t/db_dependent/ILSDI_Services.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16322: Translatability: Also adding "Status unknown" to column table
Hector Castro [Thu, 21 Apr 2016 21:47:28 +0000 (15:47 -0600)]
Bug 16322: Translatability: Also adding "Status unknown" to column table

Also add the "Status unknown to the column table
To test: follow previous commit

Signed-off-by: Marc Veron <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 16322 - Translatability: "Unknown" in suggestion/suggestion.pl not translatable
Marc Véron [Thu, 21 Apr 2016 19:13:46 +0000 (21:13 +0200)]
Bug 16322 - Translatability: "Unknown" in suggestion/suggestion.pl not translatable

This patch adds translatability for the tab "Unknown" in
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt

To test:
- Apply patch
- Examine koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
  and verify that it handles the label "Unknown" (line 496)
- Go to suggestion/suggestion.pl, set status of a suggestion to -- Choose a status --
  and verify that the tab "Status unknown" appears
- Bonus test: Go through a translation process and verify that "Status unknown" is
  translated

Note: If you have a suggestion with unknown status, all suggestions are listed under
      this tab. This is not in the scope of this bug; this bug is about translation
      only.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16316 - QA FOLLOWUP - Add tests
Magnus Enger [Tue, 26 Apr 2016 10:49:40 +0000 (12:49 +0200)]
Bug 16316 - QA FOLLOWUP - Add tests

Add 6 tests for searching by surname.

To test, run: prove t/db_dependent/Utils/Datatables_Members.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16316 - Limit patron search to surname
Magnus Enger [Thu, 21 Apr 2016 12:58:11 +0000 (14:58 +0200)]
Bug 16316 - Limit patron search to surname

This patch makes it possible to limit a patron search to
search just for surnames.

To test:
- Apply the patch
- Add two patrons, called e.g. "John Doe" and "Doe John"
- Go to Patrons in the Intranet
- Make sure you have selected "Search fields" = Standard
- Search for "john" and verify both patrons show up
- Search for "doe" and verify both patrons show up
- Set "Search fields" = Surname and search for "john".
  "Doe John" should show up, but not "John Doe".
- Set "Search fields" = Surname and search for "doe".
  "John Doe" should show up, but not "Doe John".

Update: Revised the last point in the test plan.

Sponsored-by: Alingsås Public Library, Sweden
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16301 - Remove the use of "onclick" from SMS cellular providers template
Owen Leonard [Wed, 20 Apr 2016 12:31:16 +0000 (08:31 -0400)]
Bug 16301 - Remove the use of "onclick" from SMS cellular providers template

This patch refactors some of the JavaScript in the SMS cellular
providers template so that event attributes are removed from the markup.

This patch also updates the markup for the "Edit" and "Delete" buttons
to make them consistent with similar buttons in Koha.

To test you must have the SMSSendDriver system preference set to
"Email."

- Go to Administration -> SMS cellular providers.
- If necessary, create a new SMS cellular provider.
- Edit at least one patron to use an SMS cellular provider under "Patron
  messaging preferences."
- In the table of SMS cellular providers:
  - Click the "Edit" button. The correct edit form should be displayed.
  - Click the "Delete" button next to a provider which is not used by
    any patrons. You should see an error message, "Are you sure you want
    to delete [provider name]." Test both cancel and confirm.
  - Click the "Delete" button next to a provider which is in use by one
    or more patrons. YOu should see an error message, "Are you sure you
    want to delete [provider name]? X patron(s) are using it!" Test both
    cancel and confirm.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16305 - Remove the use of "onclick" from transport cost matrix
Owen Leonard [Wed, 20 Apr 2016 01:02:05 +0000 (21:02 -0400)]
Bug 16305 - Remove the use of "onclick" from transport cost matrix

This patch updates the transport cost matrix template to eliminate the
use of event attributes (onclick and onblur) in favor of JS separate
from the markup.

To test, apply the patch and go to Administration -> Transport cost
matrix.

- Click in any table cell. Form fields in the cell should activate.
- Check and uncheck the "disable" checkbox. The form field should be
  correctly disabled and enabled.
- Fill various enabled fields and submit the form to confirm that data
  is saved correctly.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16308 - Remove the use of "onclick" from Z39.50/SRU servers template
Owen Leonard [Wed, 20 Apr 2016 13:36:20 +0000 (09:36 -0400)]
Bug 16308 - Remove the use of "onclick" from Z39.50/SRU servers template

This patch removes the use of event attributes in the markup in favor of
attaching events in JavaScript.

This patch also revises the SRU search fields mapping template
considerably while correcting multiple HTML validation issues:

- Corrected label/id pairs.
- Corrected incorrect capitalization.
- Removed redundant <legend>
- Restructured form so that it displays in two columns.

Also changed in the z3950 servers template: Replaced empty [%
script_name %] variable with actual path.

To test, apply the patch and go to Administration -> Z39.50/SRU servers/

- In the list of servers, select Actions -> Delete. You should be
  prompted to confirm your choice. Test both confirming and cancelling.
- Create or edit an SRU server.
  - After entering text in the server name field, moving to the next
    field should trigger transformation of that text to upper case.
  - On the SRU Search fields mapping line, clicking the "Modify" button
    should trigger a popup.
    - In the "Modify SRU search fields mapping" popup:
      - The fields should display in two columns.
      - All labels should be correctly associated with corresponding
        inputs.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16299 - Use validation plugin when creating a patron attribute type
Owen Leonard [Tue, 19 Apr 2016 17:58:12 +0000 (13:58 -0400)]
Bug 16299 - Use validation plugin when creating a patron attribute type

This patch replaces custom client-side form validation with use of the
jQuery validation plugin. Besides reducing the amount of code in the
template, this allows us to eliminate use of "onclick."

This patch also makes a correction for HTML validity: <option value=""
/> is not accepted. I have also added an id attribute to a <select>
which lacked it.

To test, apply the patch and go to Administration -> Patron attribute
types.

- Test creating a new patron attribute type. Try to submit the form
  without a code, description, or both. You should be prevented from
  doing so.
- Test editing an existing patron attribute type. You should not be able
  to remove the description and have it save successfully.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16228 - Move some patron entry form JavaScript into members.js again
Owen Leonard [Fri, 8 Apr 2016 12:11:11 +0000 (08:11 -0400)]
Bug 16228 - Move some patron entry form JavaScript into members.js again

Bug 15206 undid the changes Bug 15692 made to memberentrygen.tt. This
patch re-removes the JS from the template and moves the additions made
by Bug 15206 into members.js.

Two other minor edits: Changes to quiet JSHint errors.

To test, apply the patch and repeat the test plan for Bug 15692. Confirm
that the following interactions still work on the patron entry form:

1. clear_entry(): With ExtendedPatronAttributes enabled, the "Clear"
   link next to any attribute form field should work to clear the field.

2. clone_entry(): With ExtendedPatronAttributes enabled and a repeatable
   attribute defined, it should be possible to click the "New" link to
   add another instance of that attribute's entry field.

3. update_category_code(): With ExtendedPatronAttributes enabled and an
   attribute defined which is limited to a single patron category,
   changing the patron category selection should correctly show or hide
   the attribute entry form.

4. select_user(): When adding or editing a patron with a "Child"
   category it should be possible to search for and select a guarantor
   to add to the record by clicking the "Set to patron" button.
   Selecting a new guarantor should change the text of the button from
   "Set to patron" to "Change."

5. noEnterSubmit(): This function should be correctly preventing you
   from hitting "ENTER" in any form field to submit the form.

6. guarantordelete(): When adding or editing a patron with a "Child"
   category, it should be possible to clear existing guarantor
   information by clicking the "Delete" button. Clicking the "Delete"
   button should change the text of the adjacent button to "Set to
   patron."

7. select_city(): With one or more cities defined it should be possible
   to use the drop-down menu of cities to populate the city, state, zip,
   and country fields.

8. Date of birth entry should have a maximum date limit of yesterday.
   The drop-down menu of years should go back 100 years.

9. Selecting a date of birth should replace the date format hint with a
   message showing the user's age in years or months. Test with values
   which will show an age of 1 month, between 2 and 11 months, 1 year,
   and more than one year.

10. Client-side validation rules should be in effect, requiring that a
   valid email address be entered in the primary email, secondary email,
   and alternate address email fields.

11.When editing a patron, the "Add manual restriction" link should
   display the form for adding a manual restriction, and clicking the
   "Cancel" link should hide it.

Followed test plan, everything works OK.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16297 - Remove the use of "onclick" from OAI sets configuration template
Owen Leonard [Tue, 19 Apr 2016 16:40:29 +0000 (12:40 -0400)]
Bug 16297 - Remove the use of "onclick" from OAI sets configuration template

In order to bring the OAI sets configuration template into compliance
with coding guideline JS9, this patch changes with way some JavaScript
events are handled by moving JS handling out of the HTML markup.

To test, apply the patch and go to Administration -> OAI sets
configuration.

- Create or edit a set.
- Test the "Add description" link. Clicking it should add a
  description textarea.
- Test the "Remove" link associated with multiple description lines.
  Click them should remove the corresponding textarea.
- Test that additions and removals are saved correctly.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16298: Standardize on "Patron categories" when referring to patron category admin...
Owen Leonard [Tue, 19 Apr 2016 16:56:38 +0000 (12:56 -0400)]
Bug 16298: Standardize on "Patron categories" when referring to patron category administration

This patch modifies references to the patron categories administration
page in two places: Replacing "Patron types and categories" in the
administration sidebar menu and replacing "Patron category
administration" in the heading of categories.tt. Both should now read
"Patron categories."

To test, apply the patch and confirm that the text has been updated
correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Text has been updated correctly

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 15533 - DBRev - Fix typo
Kyle M Hall [Fri, 29 Apr 2016 15:25:03 +0000 (15:25 +0000)]
Bug 15533 - DBRev - Fix typo

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16286 - Use validation plugin when adding or editing patron category
Owen Leonard [Fri, 15 Apr 2016 18:56:14 +0000 (14:56 -0400)]
Bug 16286 - Use validation plugin when adding or editing patron category

This patch updates the patron category entry form so that it is
validated using the staff client's globally-included form validation
plugin. This patch also moves the page's JavaScript into a separate
file.

To test, apply the patch and go to Administration -> Patron categories.

- Create a new category. Try to submit the form with the following
  fields empty:
  - Category code
  - Description
  - Both enrollment period fields
  - Category type
- Try to enter data in the category code field which contains characters
  other than letters, numbers, hyphens, or underscores.
- Try to enter non-numeric data in the following fields:
  - Enrollment period in months
  - Age required
  - Upper age limit
  - Enrollment fee
  - Hold fee
- Try to submit the form with both enrollment period fields filled.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16262 - Remove the use of "onclick" from acquisitions basket template
Owen Leonard [Thu, 14 Apr 2016 17:40:17 +0000 (13:40 -0400)]
Bug 16262 - Remove the use of "onclick" from acquisitions basket template

In order to bring the acquisitions basket template into compliance with
coding guideline JS9, this patch changes with way some JavaScript events
are handled by moving JS handling out of the HTML markup.

Also changed: Replaced the use of [% script_name %] (which is
undefined), with the actual script path.

To test, apply the patch and locate an open basket in Acquisitions which
has more than one order in it.

- Test the "Managed by: Add user" button and verify that it triggers a
  popup where you can search for patrons.
  - Select two or more patrons to be managers for the basket.
  - Close the search windows and confirm that your choices appear on the
    basket page.
  - Click "Delete user" next to one of the patrons. The patron should be
    removed.
  - Click "Save changes" and verify that your choices are correctly
    saved.
  - Click "Delete user" next to one of the remaining patrons. The patron
    should be removed.
  - Click "Save changes" and verify that the patron stays deleted.
- In the list of orders, click the "Transfer" link and confirm that the
  correct pop-up window is triggered.
- Test the "Delete this basket" button in the toolbar. A modal window
  should be triggered.
  - In a basket with orders:
    - The "Delete basket and orders" button should do what it says,
      leaving associated bibliographic records intact.
    - The "Delete basket, orders, and records" button should do what it
      says, deleting any bibliographic records associated with orders.
  - In a basket with no orders:
    - The "Delete basket" button should work correctly.
- Test the "Create edifact order" button.
  - Click "Send EDI order" on the resulting page.
  - In the resulting dialog, "Are you sure you want to generate an
    edifact order," verify that both the "Yes" and "No" options work
    correctly.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16270 (followup) Typo authentification vs authentication
Marc Véron [Fri, 15 Apr 2016 14:18:37 +0000 (16:18 +0200)]
Bug 16270 (followup) Typo authentification vs authentication

Additionally fix typo in following files:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/bootstrap/en/modules/errors/errorpage.tt

To test: Apply patch, verify in files that authentification is
         replaced by authentication

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16270: Typo authentification/authentication
Jonathan Druart [Fri, 15 Apr 2016 07:05:37 +0000 (08:05 +0100)]
Bug 16270: Typo authentification/authentication

Test plan;
Trigger /cgi-bin/koha/errors/404.pl
Confirm the typo without the patch and that it's fixed with this patch
applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16257 - EDIfact messages link on tools page results error
Kyle M Hall [Tue, 26 Apr 2016 18:25:14 +0000 (18:25 +0000)]
Bug 16257 - EDIfact messages link on tools page results error

There is a link to EDIfact messages on the tools home page that will
lead to an error. I assume that the link should be removed in favor of
the link on the acquisitions homepage.

Test Plan:
1) Note the EDIfact messages link on the Tools home page
2) Apply this patch
3) Refresh the page, the link should be gone

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16253: Changing 'delete order' to 'cancel order'
Aleisha [Tue, 26 Apr 2016 01:15:47 +0000 (01:15 +0000)]
Bug 16253: Changing 'delete order' to 'cancel order'

To test:
1) Go to Acqui -> do a vendor search and view an open basket
2) Confirm last column heading says cancel instead of delete
3) Confirm link to cancel order says cancel instead of delete
4) If can't delete record, confirm reasons say cancel order instead of delete
5) Click the vendor name, then Baskets tab, then Receive Shipment
6) Fill vendor invoice field and click next
7) If there are any pending orders, confirm that all instances of 'delete order' now say cancel

Sponsored-by: Catalyst IT
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16242 [Follow-up] Move staff client JavaScript out of language directory
Owen Leonard [Mon, 25 Apr 2016 12:06:37 +0000 (08:06 -0400)]
Bug 16242 [Follow-up] Move staff client JavaScript out of language directory

Correcting to a file I missed: circ/offline.tt. This patch corrects the
path to offlinecirc.js.

To test, go to Circulation -> Built-in offline circulation interface.
There should be no errors in the console warning of missing files. The
"Check out" link should work correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
File missed was fixed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16242 - Move staff client JavaScript out of language directory
Owen Leonard [Tue, 12 Apr 2016 17:50:54 +0000 (13:50 -0400)]
Bug 16242 - Move staff client JavaScript out of language directory

This patch moves the JavaScript files in prog/en/js to prog/js.
JavaScript files do not need to be in the directory which is processed
by the translator.

To test, apply the patch and visit various pages in the staff client to
confirm that JavaScript files are still loading correctly.

Revised: I intended for this to be built on top of Bug 15883 as well as
Bug 16242. Now it is.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
On top of 15883 and 16241
All seems to work, js files pulled from new dir.
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16238 [Follow-up] Upgrade jQuery in staff client: use .prop() instead of .attr()
Owen Leonard [Fri, 22 Apr 2016 13:01:26 +0000 (09:01 -0400)]
Bug 16238 [Follow-up] Upgrade jQuery in staff client: use .prop() instead of .attr()

This patch corrects some tabs which should have been replaced with
spaces.

To test, diff against the previous commit with the '-w' flag. There
should be no visible changes.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Space changes, 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 16238: Use .prop() instead of .attr() for 'readonly'
Julian Maurice [Wed, 13 Apr 2016 18:51:06 +0000 (20:51 +0200)]
Bug 16238: Use .prop() instead of .attr() for 'readonly'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16238: Use .prop() instead of .attr() for 'disabled'
Julian Maurice [Wed, 13 Apr 2016 18:27:49 +0000 (20:27 +0200)]
Bug 16238: Use .prop() instead of .attr() for 'disabled'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
8 years agoBug 16238: QA fix: remove tab characters
Julian Maurice [Wed, 13 Apr 2016 08:31:05 +0000 (10:31 +0200)]
Bug 16238: QA fix: remove tab characters

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>