Commit graph

887 commits

Author SHA1 Message Date
3bcc032181 Bug 11826: Use XSLT handler object in showmarc, Record.pm
Modifies showmarc and opac-showmarc to use new XSLT handler.
Removes cardview.pl as obsolete script.
Modifies C4/Record.pm and a typo in the test Record.t.

Test plan:
[1] catalogue/showmarc: Go to Cataloging. Search. Click Card.
[2] opac-showmarc: Go to opac detail, MARC view.
    Open URL for plain view in new tab.
    Change URL: Change viewas=html to viewas=card
[3] Verify that there are no references in the codebase to cardview.pl
[4] C4/Record.pm: Run the Record.t test in db_dependent.
    This test uses marc2modsxml, triggering the change.
    Additional: export to MODS from opac-detail.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Views Ok. Test pass. No more cardview. No koha-qa errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 03:52:45 +00:00
93ba8d0b70 Bug 11826: Add unit tests for Koha::XSLT_Handler
Test plan:
Verify if XSLT_Handler.t passes.
You could also sabotage the test by removing one of the test xsl files.
Or you could 'repair' the bad xsl file (test02). Remove the second line
redefining the xsl variable.
In all those cases the unit test should fail now.. Discard your changes :)

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 03:52:45 +00:00
bcf27a9cf0 Bug 11629: (folllow-up) fix various issues
Changed the syspref.sql file to remove one of the doubled
up UNIMARCAuthrityField100 that slipped in with an earlier
patch on this bug.

Passes all tests and QA script, also t/db_dependent/Circulation_issue.t

Tested with items that had
- no notforloan value set
- notforloan value not used in updateNotforLoanStatusOnCheckin
- the notforloan value defined in UpdateNotForLoanStatusOnCheckin

Also verified it works the same, when the item was checked out or
not checked out on return.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 03:25:22 +00:00
a276d0a920 Bug 11629: (follow-up) add unit tests
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 03:24:21 +00:00
Galen Charlton
6f23ccf1cc Bug 12230: (follow-up) improve unit tests
[1] Clear holidays first to avoid throwing off the
    calculations
[2] Add descriptions for the tests

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 02:01:51 +00:00
Jonathan Druart
aa6117da36 Bug 12230: Set a maximum suspension days as a new issuing rule
This patch adds a new issuing rule: maxsuspensiondays.

A new column "Max. suspension duration (day)" appears in the main table
of the issuing rules.

If this value is filled, on returning an item, a patron won't be
suspended longer than this cap.

Test plan:
1/ Set "suspension in days" to 2.
2/ Check an item out to a patron and specify a due date to today - 10
days.
3/ Check the item in and verify the patron is suspended until today + 10
* 2 days.
4/ Remove the suspension.
5/ Set "Max. suspension duration" to 10.
6/ Check an item out to a patron and specify a due date to today - 10
days.
7/ Check the item in and verify the patron is suspended until today + 10
days.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-26 01:39:19 +00:00
Jonathan Druart
059107ca75 Bug 3050: QA follow-up
1/ Use the usual way for ordering dates in table
2/ Add a confirmation dialog box on deleting a file
3/ Add some UTs

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-25 21:15:03 +00:00
Jacek Ablewicz
480847e81c Bug 3050 - Add an option to upload scanned invoices #1/3
(part #1: new module w/ UT + script + template)

New feature, adds an ability to attach arbitrary files to
acquisition records (currently: to the invoices - but it can
be extended to baskets, basketgroups, budgets etc.).

Note: this code is (heavily) based on "Bug 8130 - attach PDF
files to a patron record" by Kale M Hall, main difference being
that new table (misc_files) and new module (Koha/Misc/Files.pm)
are intended to be a little more generic solution - they allow to
store and manage files associated with great many kinds of records,
from arbitrary tables.

Test plan:
1) Apply patch[es]
2) Run installer/data/mysql/updatedatabase.pl
3) Enable system preference 'AcqEnableFiles' in acquisition
4) New option 'Manage invoice files' appears in the invoice
detail page
5) Upload/view/download/delete some files for some invoices
6) Try to delete invoice with files attached (files should
get deleted as well)
7) Try to merge 2+ invoices with files attached; after merge,
all files previously attached to individual invoices being
merged should be attached to resulting invoice (merge destination)
8) prove t/db_dependent/Koha_Misc_Files.t
9) Ensure there are no regressions of any kind in invoice detail
page (acqui/invoice.pl).

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-25 21:14:00 +00:00
Mark Tompsett
4219063f34 Bug 10330: (follow-up) fix missed case of authoritysep
$ git grep authoritysep
This showed:
1) the updatedatabase.pl script, as expected,
2) lots of po files,
3) a test file that was missed.

TEST PLAN
---------
1) prove -v t/db_dependent/Search.t
2) Run koha QA test tools

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work (both patches). Test pass. No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-23 13:27:42 +00:00
Galen Charlton
1387c65c0d Bug 12168: (follow-up) correct typos in test descriptions
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 22:05:17 +00:00
Jonathan Druart
dd36f80e2c Bug 12168: Add unit tests for GetBudgetHierarchySpent & GetBudgetHierarchyOrdered
Test plan:
prove t/db_dependent/Budgets.t

Note: This addition may sound overkill but I found this bug developing
bug 12164 and I will reuse all of that.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 21:55:21 +00:00
Galen Charlton
49ebd60687 Bug 12288: add regression test
To test:

[1] Run prove -v t/Koha.t.  The last test should fail.
[2] Apply the main patch for this bug.
[3] Run prove -v t/Koha.t again.  This time, all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 19:59:40 +00:00
Galen Charlton
4af38b9908 Bug 7841: add a direct regression test
This patch adds a direct regression test for verifying that
no warnings are generated when getTranslatedLanguages() is called
without a defined current language, as might happen during
installation.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 16:40:23 +00:00
Mark Tompsett
5b898a09bb Bug 7841: add unit tests to detect no functional changes to getTranslatedLanguages()
When called with undef, floody messages appear in the error
logs. Less floody messages appear when using 'en' as the
language.  This patch adds tests to verify that the behavior of
getTranslatedLanguages() doesn't change when a subsequent
patch updates it to not generate the warnings.

TEST PLAN
---------
1) apply the patch
2) prove -v t/db_dependent/Languages.t
   -- All the tests should pass, including the last two which
      a) check that when undef is used no language is marked
          as current.
      b) check that when 'en' is used there is a language marked
          as current.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test pass, no koha-qa errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 16:38:57 +00:00
Galen Charlton
59c569ce92 Bug 12243: add regression test
This patch adds a regression test for C4::Koha::NormalizeISBN
throwing an exception when trying to parse an invalid ISBN.

To test:

[1] Run prove -v t/Koha.t.  The last test should fail.
[2] Apply the main patch for this bug.
[3] Run prove -v t/Koha.t again.  This time, the test
    should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 15:42:56 +00:00
Galen Charlton
795700d8f0 Bug 12214: add regression test for reporting error when running report with SQL error
To test:

[1] Run prove -v t/db_dependent/Reports_Guided.t. Last test should
    fail.
[2] Apply the main patch.
[3] Run step 1 again.  This time, all tests should pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-09 14:39:54 +00:00
Julian Maurice
606e902838 Bug 11843: (follow-up) fix unit test in t/db_dependent/Serials.t
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-09 14:28:58 +00:00
Galen Charlton
34e136a485 Bug 8375: (follow-up) final adjustment to t/Creators.t
This patch adjusts the test so that it can pass successfully
without a valid context (in which case C4::Creators::PDF defaults
to the built-in fonts) or with one (in which case it uses the
TrueType fonts).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-07 01:00:34 +00:00
Galen Charlton
ac3e5e5147 Bug 8375: (follow-up) adjust another test case for change in fonts
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-06 21:24:40 +00:00
Galen Charlton
f7ef93e758 Bug 8375: (follow-up) adjust StrWidth to account for TTF fonts
This patch fixes an issue caught by the test case where StrWidth()
based its calculations on the internal Adobe font rather than a
TrueType font in use.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-06 18:52:12 +00:00
Galen Charlton
bd4395235c Bug 10807: (follow-up) exclude C4::Search::History from t/00-load.t
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 21:59:50 +00:00
ed4b60fa1d Bug 10500: Improve ISBN matching when importing records
Test Plan:
1) Catalog a record with the ISBN "0394502884 (Random House)"
2) Export the record, edit it so the ISBN is now
   "0394502884 (UnRandomHouse)"
3) Using the record import tool, import this record with matching
   on ISBN.
4) You should not find a match
5) Apply this patch
6) Run updatedatabase.pl
7) Enable the new system preference AggressiveMatchOnISBN
8) Repeat step 3
9) The tool should now find a match

Signed-off-by: Tom McMurdo <thomas.mcmurdo@state.vp.us>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 18:04:55 +00:00
Galen Charlton
2afadcc358 Bug 9532: add regression test
To test:

[1] Run prove -v t/db_dependent/Holds.t.  The last test
    should fail.
[2] Apply the main patch.
[3] Run step 1 again.  This time the tests should all pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 17:17:36 +00:00
Galen Charlton
e92b6e3dff Bug 4397: (follow-up) adjust unit test reflect return of display version of scan terms
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 05:26:18 +00:00
Julian Maurice
801c5e77d0 Bug 11848: Fix C4::Context::interface, add POD and UT
1/ Edit a Perl script, for example mainpage.pl
2/ add "use Koha::I18N;" to the top of file
3/ add a translatable message somewhere in the script (this have
   to be after the call to get_template_and_user). For example:
   warn gettext("This is a translated warning");
4/ Create or update the PO files with
   misc/translator/translate create LANGCODE
or
   misc/translator/translate update LANGCODE
   (LANGCODE should be enable in syspref 'languages')
5/ In misc/translator/po/LANGCODE-messages.po you should have
   your string, translate it (using a text editor or a PO file
   editor, make sure you don't have the "fuzzy" flag for this
   string).
6/ Go to mainpage.pl with active language being English with your
   browser and check your logs. You should see your string "This
   is a translated warning".
7/ Now change language to LANGCODE. Check your logs, you should
   have the string translated.

Note: I chose to name the sub 'gettext' because it's the default
keyword for xgettext for Perl. We can change it to whatever we want.

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

Follow test plan, work as described.
No koha-qa errors.
Tests pass

Fixed small merge conflict on t/Context.t

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 04:32:31 +00:00
Julian Maurice
76e39750b7 Bug 11848: Move language detection function in C4::Languages
Also store interface (intranet, opac) in context to not have to pass it
as parameter.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
No koha-qa errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 04:29:34 +00:00
Galen Charlton
cf7d0c3a99 Bug 7442: (follow-up) adjust UNIMARC test case to match change in BuildSummary()
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 04:18:22 +00:00
Galen Charlton
b16336caf8 Bug 10807: (follow-up) remove comment about routine that is no longer present
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 02:58:29 +00:00
Jonathan Druart
50e326e5c2 Bug 10807: (follow-up) fix UT t/db_dependent/Search_SearchHistory.t
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 02:34:39 +00:00
Jonathan Druart
ba41b7da79 Bug 10807: Add an authority search history for the OPAC
Like biblio, this feature provides an authority search history.
This history is available for connected and disconnected user.
If the user is not logged in Koha, the history is stored in an
anonymous user sessin.

The search history feature is now factorized in a new module.

This patch adds:
- 1 new db field search_history.type. It permits to distinguish the
  search type (biblio or authority).
- 1 new module C4::Search::History. It deals with 2 different storages:
  DB or cookie
- 2 new UT files: t/Search/History.t and t/db_dependent/Search/History.t
- 1 new behavior: the 'Search history' link (on the top-right corner of
  the screen) is always displayed.

Test plan:
 1/ Switch on the 'EnableOpacSearchHistory' syspref.
 2/ Go on the opac and log out.
 3/ Launch some biblio and authority searches.
 4/ Go on your search history page.
 5/ Check that all yours searches are displayed.
 6/ Click on some links and check that results are consistent.
 7/ Delete your biblio history searches.
 8/ Delete your authority searches history searches.
 9/ Launch some biblio and authority searches
10/ Delete all your history (cross on the top-right corner)
11/ Check that all your history search is empty.
12/ Launch some biblio and authority searches.
13/ Login to your account.
14/ Check that all previous searches are displayed.
15/ Launch some biblio and authority searches.
16/ Check that these previous searches are displayed under "Current
session".
17/ Play with the 4 delete links (current / previous and biblio /
authority).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All patches together pass QA script and tests.
Also, new tests in t/db_dependent/ pass.

Tested in all 4 OPAC themes, being logged in and anonymous.
Anonymous search history will be appended to personal search
history after logging in.
Also verified that cleanup_database still purges search history,
now also including the authority searchs.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 02:32:27 +00:00
Galen Charlton
275e389afb Bug 6739: (follow-up) add unit tests for GetMemberDetails()->{is_expired}
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 02:07:32 +00:00
Galen Charlton
c221194a94 Bug 11466: (follow-up) add additional test
This adds an additional test case to document the behavior
that if AdvancedSearchTypes contains 'itemtypes' or /is/
'itemtypes', that it returns the same results.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 23:24:06 +00:00
Olli-Antti Kivilahti
24dd5ea3d2 Bug 11466: improve selection of item types for purchase order desired format list
This patch ensures that the list of desired formats for a purchase
suggestion includes the list of item types so long as the
AdvancedSearchTypes system preference includes 'itemtypes'.

--------------
-- Synopsis --
--------------

When system preference AdvancedSearchTypes has other values than 'itemtypes',
for ex 'itemtypes|loc', itemtypes selection in opac-suggestions.pl
is not populated with available itemtypes.

This patch fixes the issue by broadening the strict comparison of
($advanced_search_types eg 'itemtypes') #fails 'itemtypes|loc'
to
($advanced_search_types =~ 'itemtypes') #succeeds 'itemtypes|loc'

Unit tests included

---------------
-- Test plan --
---------------

REPLICATING THE ISSUE
1. Set system preference  AdvancedSearchTypes to itemtypes|loc
2. Go to opac-suggestions.pl and observe Item type <select> dropdown list
2.1. List should have only the default value

AFTER APPLYING THIS PATCH
1. Set system preference  AdvancedSearchTypes to itemtypes|loc
2. Go to opac-suggestions.pl and observe Item type <select> dropdown list
2.1. List should have itemtypes available for selection

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tests worked as expected. Placed a suggestion and saw the whole
list of item types, chose one, saved, checked staff and it loaded
as expected. Changed item type in staff and it applied in both
views.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests including new regression tests.
Restores old functionality.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 23:20:33 +00:00
Galen Charlton
f13c72ebee Bug 9593: (follow-up) don't make currency.isocode required
This patch changes the price parsing so that it can fall
back on the currency name if an ISO code is not supplied; this allows
for handling the very common situation where the currency name
as entered was already the same as the ISO code.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 22:21:17 +00:00
Lyon3 Team
94d3aed746 Bug 9593: improve parsing of prices from staged files
Initial bug :
When there's a round price with no decimals after it,
or when the symbol is after the digits, the price is not captured
by regular expression in MungeMarcPrice routine and the variable
is not initialized.

Enhancement :
The MungeMarcPrice routine had been widely modified.
It's still possible to priority pick the active currency but
unlike the previous mechanism that worked only for prices preceded
by the currency sign, it's now valid wherever the symbol is situated.
As symbol you may enter a pure currency sign as well as a string
including it like '$US'. Moreover, an 'isocode' column had been
added in currency table (editable in the staffo interface from
Administration/Currencies and exchange rates). So the active
currency can be picked either through its symbol or through its iso
code.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests, especially t/db_dependent/MungeMarcPrice.t
Checked currencies can be added, edited and deleted.
Notes: new ISO code field is mandatory.
       Sample sql files need to be updated (bug 12146)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 22:02:08 +00:00
Jonathan Druart
a6affb44e2 Bug 7180: QA followup
- fix unit tests (use a transaction).
- add 3 tabs on the page in order to be more understandable.
- fix a warn in logs

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 19:52:06 +00:00
Jonathan Druart
3c8c0591e2 Bug 7180: Add UT for C4::Budgets::GetBudgetByCode
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-04 19:45:17 +00:00
Jonathan Druart
08e594f149 Bug 12019: ensure that it is optional to define an owner if a fund is restricted
Before this patch, the C4::Budgets::CanUserUseBudget assumed that
budget_owner_id was set if a restriction (budget_permission) exists.
see
        && $budget->{budget_owner_id}
        && $budget->{budget_owner_id} != $borrower->{borrowernumber}

Actually a restriction could exists on users and/or library without
being forced to define an owner.

Test plan:
Create a fund A without restriction
Create a fund B restricted to an owner
Create a fund C restricted to a non defined owner
Create a fund D restricted to owner and users (try defining/no
defining an owner and/or users)
Create a fund E restricted to owner, users and library (try
defining/no defined an owner and/or users)

With different logged in users, try to show/edit these differents funds.
The restriction should be correctly applied.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested various permission combinatons, visibility of funds is now ok.
- not superlibrarian, no buget_manage_all,
  no owner, no users, no library, no restrictions on the fund
  = visible
- changed: library = staff patron library,
  restriction = Owner, users and library
  = visible
- changed: library = not staff patron library
  = invisible
- changed: budget_manage_all
  = visible
- changed: owner = staff patron
  no budget_manage_all
  = visible
- changed: no owner, user = staff patron
  = visible
- changed: no user, owner = another user, restriction = owner
  = invisible
- changed: budget_manage_all
  = visible
- changed: no budget_manage_all but superlibrarian
  = visible
...

Passes tests and QA script, also t/Budgets/*

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-03 19:00:08 +00:00
Galen Charlton
80c68171bd Bug 10694: (follow-up) remove truncate table from test case
Doing a truncate of a table in MySQL causes an implicit commit.
Consequently, they should not be used in DB-dependent test cases,
as they will cause the changes to NOT be rolled back.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 22:00:45 +00:00
0b2e9dbf62 Bug 10694: (follow-up) add unit tests, improve AddReturn POD
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 21:46:41 +00:00
Jonathan Druart
7ca4f590ac Bug 11696: ensure that print overdue notices use the print template
This reordering avoids the case where a print notice is sent with an
email or sms template is no email or SMS is defined.

Test plan:
Check print, sms and email for an overdue rule
Don't define an email address and generate an overdue for a user
Define 3 templates for the notice used
Launch the cronjob script and verify the print notice is generated using
the print template.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 20:29:21 +00:00
Galen Charlton
6b1c114cc6 Bug 10845: (follow-up) update how a test case counts print hold available notices
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 20:29:19 +00:00
Jonathan Druart
f7537bc938 Bug 9016: (follow-up) fix unit tests
The unit tests should insert overdue rules.
+ Fix the doc for GetOverdueMessageTransportTypes

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 20:29:17 +00:00
Jonathan Druart
e421ec4925 Bug 9016: Define different transport types for overdues
This patch adds:
- a new routine C4::Overdues::GetOverdueMessageTransportTypes.
- the ability to define one or more transport types for an overdue
  level.

Test plan:
- go on tools/overduerules.pl.
- verify that previous rules still exist and that the 'email' checkboxes
  is checked if a rule is defined.
- redefined rules at different levels and check the transport type
  needed. Currently, only email, sms and print are relevant
- Save the changes.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 20:29:16 +00:00
Jonathan Druart
8214541114 Bug 9016: Create a message for each transport type.
This patch adds:
- a new jquery plugin : insertatcaret.
- the ability to define a notice template for each transport type.
- a new routine C4::Letters::GetMessageTransportTypes.

Test plan:
- Go on tools/letter.pl and check that all existing notices are still
  there.
- Modify one. A new empty message is present for sms, print, etc. The
  email message is filled with the existant value.
- Add a message for sms for example (don't forget the subject) and save.
- edit again and verify the sms message has been saved.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-02 20:29:16 +00:00
Galen Charlton
18ae04a4ac Bug 11334: (follow-up) teach the search tests to mock the DisplayLibraryFacets syspref
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-30 03:29:46 +00:00
Galen Charlton
17a43f9159 Bug 7844: (follow-up) don't test koha.psgi for ability to compile (yet)
Given the experimental nature of Plack support, for now we're
excluding koha.psgi from the Perl compilation tests.  This should be
changed as we get closer to making Plack support a first-class option.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-29 19:34:23 +00:00
ddab9e939b Bug 11518: (follow-up) Make unit tests pass
This works around a problem where the database handle
returned by C4::Context->dbh() is not the same as the one
used by Koha::Database.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-29 15:06:24 +00:00
c3c7105fe7 Bug 11518: (follow-up) Change method name from 'itemtype' to 'effective_itemtype' for clarity
Test runs without errors.

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-29 15:05:24 +00:00
cef35259ee Bug 11518: Add new method to K::S::R::Item that will always return the correct itemtype
There are many disparate areas of Koha that deal with item level
itemtypes vs record level itemtypes. We can take advantage of
DBIx::Class to make smarter objects that automatically return the
correct value depending on the system preference.

Test Plan:
1) Apply this patch
2) Run t/db_dependent/Items.t

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-29 15:04:55 +00:00