Commit graph

5600 commits

Author SHA1 Message Date
Bernardo Gonzalez Kriegel
b722fbfb5c Bug 15093: Load/show saved item type group and hideinopac
This patch adds loading of hideinopac and searchgroup
when showing/editing itemtypes

To test:
1) Put some values in ITEMTYPCAT auth value
2) Edit an item type, select a value for
search category & check 'Hide in OPAC'
Save
3) Results do no show on list of item types
4) Edit same item type, values are default/empty
5) Apply the patch
6) Edit again, change again, save
Now values shows in list
7) Edit again, values are now correct

Values were saved on db, but not loaded from it
How this happen?

Side note: searching for searchcategory I found

installer/data/mysql/kohastructure.sql:  searchcategory varchar(80) default NULL, -- Group this item type with others w
installer/data/mysql/updatedatabase.pl:            ADD searchcategory VARCHAR(20) DEFAULT NULL

Its varchar(80) in kohastructure and varchar(20) in updatedatabase

We need more eyes :)

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-11-01 17:10:44 -03:00
Marc Véron
421fae24f1 Bug 14903: Remove C4::Dates from circ/circulation.pl (and more)
Patch to remove deprectated C4::Dates from:
- circ/circulation.pl
- C4/Circulation.pm
- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

To test:
- Apply patch
- Go to the checkout site (Home > Circulation > Checkouts)
- Verify that data displays properly (including for users with a card
  that expires in the  near future, see syspref 'NotifyBorrowerDeparture')
- Search for regressions
- prove -v t/db_dependent/Circulation.t

(Amended following comment #9 / #11  25.10.2015 /mv)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 11:57:15 -03:00
d9426ddfc5 Bug 14100: Fix Search.t tests
So, this one is VERY weird, let me try to explain what I have
understood.

Bisecting using run prove t/db_dependent/Search.t, I have found that the
following commit make the test fail:
  commit 0f63f89f66
    Bug 14100: Generic solution for language overlay - Item types
The error is
  DBI bind_columns: invalid number of arguments: got handle + 0, expected handle + between 1 and -1
  Usage: $h->bind_columns(\$var1 [, \$var2, ...]) at /usr/lib/i386-linux-gnu/perl5/5.20/DBI.pm line 2065.

Note that the interface (admin/itemtypes.pl) which calls the same
subroutine with the same parameter (style => 'array') works great.

The problem comes from the change in C4::Search::searchResults, if I
only apply the change done to this subroutine on 0f63f89f^1, I reproduce
the issue.

Looking closely at how %itemtypes is built, we could actually call
GetItemTypes with the style => 'hash' to get exactly what we want.
The following piece prove it for you:
    use Test::More;
    use C4::Koha;
    my $i = GetItemTypes;
    my $j = GetItemTypes(style => 'array');
    my %itemtypes;
    for my $itemtype ( @$j ) {
        $itemtypes{ $itemtype->{itemtype} } = $itemtype;
    }
    is_deeply( \%itemtypes, $i);

So changing the code accordingly and just forget this last hour...

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 08:47:33 -03:00
4c103508b2 Bug 14100: Fix t/db_dependent/Items.t
prove t/db_dependent/Items.t
Undefined subroutine &C4::Languages::getlanguage called at C4/Items.pm line 1304.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 08:47:33 -03:00
93d6de4bf0 Bug 14100: Fix test xt/author/valid_templates complaining on opac-topissues.tt
undef error - Undefined subroutine &C4::Languages::getlanguage called at C4/Koha.pm line 250.

Test plan:
    prove xt/author/valid-templates.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-29 08:47:33 -03:00
Martin Persson
1f15b585d4 Bug 14248: Optionally display authorship for news
Test plan:

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

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

Sponsored-By: Halland County Library

Tested on top of Bugs 1246 and 1247, works as advertised.
Note: Some whitespaces changed / removed in koha-news.tt to pass qa tools.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 16:26:22 -03:00
d58f2cfaf6 Bug 14100: Fix some missing occurrences
This patch fixes:
- reports/bor_issues_top.pl
- sort order
- adv search and search results
- opac-topissues.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 12:34:07 -03:00
30667f0555 Bug 14100: (follow-up) Language overlay for item types
Display the translated description for item types in the following pages:
> admin/smart-rules.pl
> catalogue/detail.pl
> catalogue/itemsearch.pl
> catalogue/moredetail.pl
> reports/acquisitions_stats.pl
> reports/bor_issues_top.pl
> reports/cat_issues_top.pl
> reports/catalogue_out.pl
> reports/catalogue_stats.pl
> reports/issues_avg_stats.pl
> reports/issues_stats.pl
> reports/itemslost.pl
> reports/manager.pl
> reports/reserves_stats.pl
> suggestion/suggestion.pl
> tools/export.pl

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

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 12:34:06 -03:00
Jonathan Druart
0f63f89f66 Bug 14100: Generic solution for language overlay - Item types
Test plan:
1/ update the Schema (misc/devel/update_dbix_class_files.pl)
2/ Translate templates for some languages (es-DE, de-DE for instance)
3/ Enable them in the pref (search for 'lang') for the staff interface
4/ Go on the item type admin page (admin/itemtypes.pl)
5/ Edit one
6/ Click on the 'translate for other languages' link
7/ You are now on the interface to translate the item type's description
in the languages you want. So translate some :)
8/ Go back on the item type list view (admin/itemtypes.pl)
9/ You should see the original description (non translated)
10/ Switch the language
11/ You should see the translated description in the correct language.
If the description is non translated, the original description is
displayed.

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

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

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 12:34:06 -03:00
Jesse Weaver
5c287a8931 Bug 11559: (QA followup) switch to new delimiter, fix minor issues
This followup introduces a major change; instead of subfields starting
with '$<code><space>', they now start with '‡<code>'. The double-cross
character can be typed with Ctrl-D.

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

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2015-10-27 12:18:00 -03:00
Jesse Weaver
ed0ff59152 Bug 11559: Supporting changes for Rancor
* Extends login screen to pass along #hash
  * Adds JSONP support to C4::Service
  * Extends humanmsg to allow per-message classes
  * Adds proper charset to results of svc/bib

Test plan:

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

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 12:16:05 -03:00
Joonas Kylmälä
75cd02c048 Bug 10933: (follow-up) fix the previous patch to work with master
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 11:03:03 -03:00
Jonathan Druart
c4d3002995 Bug 10933: The PurgeSearchHistory should be merge into the C4::Search::History module
Since bug 10803 adds a C4::Search::History module, the
PurgeSearchHistory routine should be moved.

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

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 11:03:03 -03:00
Bernardo Gonzalez Kriegel
fea62637df Bug 14468: Remove warnings when creating Labels
This patch removes 2 types of warnings when
creating Labels

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

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

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

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

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

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

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

Many hours to find :(
Easy to fix

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-27 10:12:32 -03:00
Marc Véron
d331bcfbee Bug 14982: Remove C4::Dates from guided report wizard and dictionary
This patch removes C4::Dates from files:
- reports/guided_reports.pl
- reports/dictionary.pl
- C4/Reports/Guided.pm

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

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

http://bugs.koha-community.org/show_bug.cgi?id=14982
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-26 11:20:11 -03:00
9dde8c1632 Bug 14778: Make Search.t pass - replace SHOW COLUMNS
For an unkown reason, when executed from a test file, the 'SHOW COLUMNS'
statement does not return anything.
We need to retrieve the column list from the DBIx::Class resultset.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-26 11:01:33 -03:00
cc73c53c6f Bug 14778: Install fixtures for t/Koha.t
Warning: This patch modifies a module!
What's the need of the binary function here?
The data are case insensitive, so no need to use this mysql function.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-23 12:01:18 -03:00
29b4f5d128 Bug 14778: Install fixtures for t/Images.t
Note that this tests file were completely buggy before.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-23 12:01:18 -03:00
3ab51c87db Bug 14778: Make the installer test pass - use DBI missing
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-23 12:01:17 -03:00
389ef2c6c7 Bug 14778: Make sure the dbh returned is checked by DBIC
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-23 12:01:17 -03:00
5d8cb8b2ee Bug 14778: Get rid of DBIx::Connector
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-23 12:01:17 -03:00
f86816220e Bug 13590: Add ability to charge fines at start of charge period
Right now, Koha only charges fines at the end of a given charge period.
For example, let us assume a circulation rule has a charge period of one
week ( 7 days ) and a fine of $5. This means that an item can be overdue
for 6 days without accruing a fine. Koha should allow circulation rules
to be configured to place the charge at the start of the end of the
charge period so the library can decide when the fine should accrue.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) prove t/db_dependent/Circulation_Issuingrule.t
4) prove t/db_dependent/Circulation.t
5) prove t/db_dependent/Fines.t
6) Ensure you can still create/edit circulation rules

Edit: I removed the DBIx changes after a couple minutes fighting with them.
Will regenerate as usual in a RM followup / Tomas

Signed-off-by: Daniel Grobani <dgrobani@samuelmerritt.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 14:51:24 -03:00
Julian Maurice
3d7600f976 Bug 14788: Move opac-topissues.pl code into C4::Circulation
Tested with syspref 'AdvancedSearchTypes' set to itemtypes an ccode (one at a time).
No problems found.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 11:35:06 -03:00
Blou
96b05f3535 Bug 10937: cleanup and rename DOCTYPECAT to ITEMTYPECAT
- "Item" and not "Document" is the word used throughout Koha.
- Moved the updates to an atomic update
- changed searchcategory from varchar(20) to (80)
- cleanup
2015-10-22 11:06:22 -03:00
ahmed
30edfbfa58 Bug 10937: Option to hide and group itemtypes from advanced search
This allows to group certain item types in a category, to be displayed (and searched) as such in OPAC's advanced search.  For example, you can group Reserve 2h and Reserve 12h into a Reserve category.  The 2 and 12h types won't appear anymore.
This also allows to simply prevent an item type from displaying as a search option.

TEST PLAN
------------------
0) Back up database, so you can reset and retest easily. ;)
1) Apply the patch
2) Run Koha QA tool.
3) prove -v t/db_dependent/Koha.t
  -- all tests should pass.
  4) run ./installer/data/mysql/updatedatabase.pl to add the
  two columns to itemtypes
  -- Does a meaningful message get printed?
  Are the columns added?
  "DESCRIBE itemtypes;" should list hideinopac and searchcategory.
  5) You need to add a category to group your item types:
  a) In Intranet/Koha Admin/Authorized values,
  select DOCTYPECAT in the 'Show category:' dropdown
  i) If you do not have a DOCTYPECAT category, create one.
  b) Click button "New authorized value for DOCTYPECAT"
  c) Enter
  Authorized value: HARDWARE
  Description : Hardware
  Description (OPAC): Hardware
  6) Group your items under that new category
  a) In Intranet/Koha Admin/Item types, choose (at least)
  two item types and for each:
  - Click action/Edit on the right column
  - Third row (below Description) is the Search category list box, select Hardware
  - click Save changes at the bottom
  7) Select at least one item to be hidden in the OPAC search
  a) In Intranet/Koha Admin/Item types (again), choose a different item type:
  -  Click action/Edit
  -  Click the checkbox "Hide in OPAC" below the list of icons.
  8) Go test your modifications
  a) Go to OPAC/Adv search.
  b) Validate that all items modified above (hidden or grouped) do not appear in Item type list
  c) Validate that new item type Hardware does appear instead.
  d) Select item Hardware, start Search.
  ) Validate returned items are the of the two types that were grouped into the Hardware category in step 4.

Sponsored-by: Vanier college

Signed-off-by: Nick <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 11:06:07 -03:00
Magnus Enger
55127d50fb Bug 15042: Barcode hbyymmincr does not work when receiving serials
To test:
- Set autoBarcode = <branchcode>yymm0001
- Make sure you have a serial that is set to "create an item record
  when receiving this serial"
- Receive an issue
- Click in the barcode field - nothing happens
- Apply patch and reload page
- Receive an issue
- Click in the barcode field - a barcode conforming to the
  hbyymmincr setting appears

Patch works as advertised.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 10:38:50 -03:00
Bernardo Gonzalez Kriegel
05d4c0e69b Bug 12194: Add option 'Oblique title' in labels
This patch adds a checkbox on Label creator
to use or not an oblique variant of main font
for title

Also fix font selection for title in case an
oblique variant is used.

To test:
Before patch
1) Go to Tools > Label creator
2) Create a new layout, default values but select
any 'Oblique' variant for main font and
'Biblio/Barcode' for layout type
3) Go to Manage batches, create a batch, add items,
export PDF, download
4) Check logs, you must find a line with
'ERROR in koha-conf.xml -- missing <font type="COO">'
for example if main font Courier-Oblique

5) Open PDF, title could be right but not using selected font

After patch
6) Apply the patch
7) Run updatedatabase.pl
8) Repeat 1-2, note new checkbox 'Oblique title',
default checked
9) Repeat export, no new warnings on log
10) Create a new layout or edit an existent one,
uncheck 'Oblique title', save, export again
Check PDF has non slanted title

Followed test plan, works as expected. (See comment #11).
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 09:42:31 -03:00
Mark Tompsett
ad9c1733f8 Bug 15027: Correct Type in C4::Items perldoc
As noted in the bug report, there is a typo.
This corrects that typo in documentation.

TEST PLAN
---------
1) perldoc C4::Items
2) Find GetItemsForInventory
   -- note that status is spelt incorrectly.
3) Apply patch
4) repeat steps 1-2
   -- note that status is spelt correctly now.
5) git diff origin/master
   -- note only that line changed.
6) run koha qa tools

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  This typo patch could hit the highway to master at high speeds.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: add a comma at the end of the line
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-22 09:41:11 -03:00
Jonathan Druart
57999441a8 Bug 8417: Make the order receive date editable
Currently the date of the order reception is the date of shipping date,
which is wrong.
This patch makes this date editable (with default is today).

Test plan:
1/ Create an order and receive it
2/ Confirm that you can edit the reception date and it's take into
account as the datereceived.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 14:51:50 -03:00
Lyon3 Team
64b0984a51 Bug 8236: Renewing policy in overdue or restriction case
This patch introduces 2 sysprefs :
    RestrictionBlockRenewing to allow/block renewal of items when patron is restricted.
    OverduesBlockRenewing to allow, block only the late ones or block all checked out items
    Default is "allow" in both case.

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 14:36:55 -03:00
c6d0202569 Bug 14937: Expiration date for holds based onReservesMaxPickUpDelay should not require ExpireReservesMaxPickUpDelay
C4::Letters::_parseletter will replace reserves.expirationdate with the
date a hold will be marked as problematic ( holds over ) if both
ReservesMaxPickUpDelay and ExpireReservesMaxPickUpDelay are enabled.
There is no reason this feature needs to rely on
ExpireReservesMaxPickUpDelay as there are many libraries that would like
to send the last day to pick up a hold in notices, but would rather deal
with the expired waiting holds manually rather than have Koha cancel
them automatically.

Test Plan:
1) Apply this patch
2) Set ReservesMaxPickUpDelay to 7
3) Disable ExpireReservesMaxPickUpDelay
4) Add reserves.expirationdate to your HOLD notice
5) Fill a hold for a patron
6) View the message, not that reserves.expirationdate is replaced
   with the date the hold will be marked as problematic

Signed-off-by: Karl Holton <kholten@switchinc.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 11:59:21 -03:00
201726fae6 Bug 13632: Populate user_flags and permissions tables in the web installer
Move the 2 specific 'en' files outside of the language directory.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 09:38:04 -03:00
a3b4b33e46 Bug 13632: Do not use userflags.flagdesc and permissions.description
These 2 fields are not used anymore, but we want to keep them anyway.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 09:38:04 -03:00
6c30d31af7 Bug 15005: Fix pagination_bar calls
Test plan:
Create an order for an existing biblio, confirm that the pagination links work correctly.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 09:36:43 -03:00
912f238c5e Bug 15005: Replace CGI->url with the corresponding url
CGI->url does not return the correct url on install using packages.

Test plan:
1/ Try to reproduce the bug from the description of bug 15005.
You should be able to login to the intranet and the OPAC
2/ Send a basket and a list from the intranet and the OPAC.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-19 09:36:43 -03:00
Jonathan Druart
f1a1eb05df Bug 14045: Make GetBranchBorrowerCircRule return maxonsiteissueqty
GetBranchBorrowerCircRule should return the value for maxissueqty and
maxonsiteissueqty. It's what this patch does.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:13:24 -03:00
Jonathan Druart
c91b0d49a6 Bug 14045: Change prototype of TooMany to raise a better warning
With this patch, the user will know why the checkout is refused.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:13:23 -03:00
Jonathan Druart
4d8489efba Bug 14045: Add specific quotas to on-site checkouts
This patch set adds the ability to defined independent quotas for on-site
checkouts.
This will be done using the circulation rules matrix where a new column
“Current on-site checkouts allow” will be added.

This feature is going to use the same method as the existing fields maxissueqty
("Current checkouts allowed"), the new fields will be added to the
different tables (see the "DB changes" patch) and will be named
maxonsiteissueqty (for consistency).

In order to keep the existing behavior and to let more flexibility,
a new system preference is added (ConsiderOnSiteCheckoutsAsNormalCheckouts).
This syspref will let the liberty to the library to decide if an on-site
checkout should be considered as a "normal" checkout or not.

To keep the existing behavior, the syspref will be disabled (i.e. an on-site
checkout is considered as a normal checkout) and the number of on-site
checkouts will be the same as the number of checkout (maxissueqty ==
maxonsiteissueqty).

Technically:
There are only very few tests for the Circulation module, and the 2
subroutines impacted by this patch set were not tested at all.
It is necessary to introduce non-regression tests for this area.
The 2 subroutines are: C4::Circulation::GetBranchBorrowerCircRule
and C4::Circulation::TooMany (only called by
C4::Circulation::CanBookBeIssued, so we will take the liberty to change
the prototype to raise a better warning to the end user).

Test plan:
I. Confirm there is no regression and the existing behavior is kept
 0/ Let the syspref disabled
 1/ Set a rule to limit to 2 the number of checkouts allowed
 2/ Do a normal checkout
 3/ Do an on-site checkout
 4/ Try to checkout (on-site or normal) an item again.
 You should not be allowed.

II. Test the new feature - pref disabled
 0/ Let the syspref disabled
 1/ Set a rule to limit to 2 the number of checkouts allowed and to 1
 the number of on-site checkouts allowed.
 2/ Do an on-site checkout
 3/ Try to do another one, you should not be allowed to do it.
 4/ A normal checkout should pass successfully
Note that it does not make sense to have the number of on-site checkouts
alowed > number of checkouts allowed.

III. Test the new feature - pref enabled
 0/ Enable the syspref
Now an on-site checkout is *not* counted as a normal checkout.
This means you can have the number of on-site checkouts > number of
checkouts allowed.
 1/ Set the values you want for the 2 types of checkouts (normal vs
on-site).
 2/ Even if a patron has reached the maximum of checkouts allowed, he
 will be allowed to do a on-site checkout (vice versa).

IV. Stress the developper
 Using the different configurations available in the circulation matrix,
 try to find one where the checkout is allowed and not should be.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:13:22 -03:00
Amit Gupta
21d0e014ad Bug 6810: Fix QA failures
- remove DateTime->now()
    - use Koha::DateUtils->dt_from_string;
    - use Pod2usage for the usage
    - use Modern::Perl
    - use branches table
    - Change letter code from MEMEXP to MEMBERSHIP_EXPIRY
    - review comments implemented
    - fix qa script comments

Bug 6810 - Fix QA failures

    - MembershipExpiryDaysNotice system preferences arragned alphabetical order.

Bug 6810 - Add sample notices

    - review comments implemented
    - default value of is_html field in letter table is 0

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:42 -03:00
Alex Arnaud
e5caccb17a Bug 6810: Add new systempreference (MembershipExpiryDaysNotice)
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Bug 6810 - Fix QA failures

- Use KohaDates to convert dateexpiry
- remove MYSQL specifics methods for date handling in
  GetUpcomingMembershipExpires
- make the script membership_expiry.pl write in Koha system logs
- add tests

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Bug 6810 - Fix QA failures:

  - use Koha::DateUtils instead of Koha::Template::Plugin::KohaDates,
  - Add test with syspref MembershipExpiryDaysNotice equals 0 and undef,
  - fix (new) test failure (when MembershipExpiryDaysNotice is undef).

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:19 -03:00
Amit Gupta
764b8b7e90 Bug 6810: Send membership expiry reminder notices.
A new crontab based perl script to send membership expiry reminders. A
system preference controls the number of days in advance of membership
expiry that the notices will be sent on.

To Test:
1) Create a new Patron and set membership expiry date 14 days from the
   date of registration.
2) Check your systemprefence ( MemExpDayNotice to 14 days default value)
3) Manual testing Run ( perl membership_expiry.pl -h)
    It would give you various option:
    This script prepares for membership expiry reminders to be sent to
    patrons. It queues them in the message queue, which is processed by
    the process_message_queue.pl cronjob.
    See the comments in the script for directions on changing the script.
    This script has the following parameters :
     -c Confirm and remove this help & warning
     -n send No mail. Instead, all mail messages are printed on screen.
        Useful for testing purposes.
     -v verbose
    Do you wish to continue? (y/n)
4) Choose option for ex: perl membership_expiry.pl -c
5) Go to your koha database and check message_queue table you see some
   results.
6) Run (perl process_message_queue.pl) it will send email to those
   patron whose membership after 14 days from today.
7) Cron testing: (10   1 * * *  $KOHA_CRON_PATH/membership_expiry.pl -c)
8) Set your 15   * * * *  $KOHA_CRON_PATH/process_message_queue.pl
9) After running membership_expiry.pl, (process_message_queue.pl will
   send emails to those patron whose membership after 14 days from
   today).

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 11:13:08 -03:00
Jonathan Druart
fb59c5c7c4 Bug 10020: Remove code related to ethnicity
This is a(nother) vestige of Koha (2.2?).
This patch removes unused code related to the 'ethnicity'.

In detail:
There is no way to fill the ethnicity table.
There is no way to fill the borrowers.ethnicity and borrowers.ethnotes.

BUT if borrowers.ethnicity exists, the value is displayed on
members/moremember.pl (and only here).

Test plan:
Apply this patch and confirm there is no regression on
adding/updating/deleting patrons.
Note that you don't see the ethnicity value on the moremember.pl page even if a patron has it.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 10:30:32 -03:00
4f4c5e67ef Bug 5144: Duplicate holds allowed if patron clicks back button after placing hold
Koha is currently not engineered to handle multiple holds per record.
Until such time that is does, we should not allow them to be created.

Test Plan:
1) Apply this patch
2) Log in to the opac
3) Place a hold
4) Hit the back button on your browser
5) Place the hold again
6) Note the new message

Signed-off-by: David Kuhn <kuhn@monterey.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-06 10:01:55 -03:00
4f5d26aa49 Bug 10855: (follow-up) Bug 10855: Remove additional field values when subscription is removed
The subscriptionid should not be escaped and placeholders used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Julian Maurice
10c5109221 Bug 10855: Remove additional field values when subscription is removed
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
640abc852c Bug 10855: Squash several fixes
Bug 10855: FIX: Add additional fields for closed subscriptions

Bug 10855: Fix instance vs static method

This patch fixes the error message.
The 3 modified routines *are* static methods.

Bug 10855: FIX conflicts with bug 7688

Bug 10855: Fix typo addition_fields -> additional_fields

Bug 10855: A partial search should return the subscriptions

If a search on an additional fields is done using a partial string
("foo" and the defined value is "foobar"), the subscription should
appear in the result list.

Test plan:
Try to search a part of the string for an additional field.

Bug 10855: Filtering on additional fields don't work if value is equal to 0

If you tried to filter on an additional field linked to an authorised
value, that did not work if the value was 0.

Bug 10855: Remove the advanced serial search box on the serial home page

Bug 10855: FIX an add field should not be created if the marc field does not exist.

This patch fixes the following:
Create an add fields linked to a nonexistent marc field (does not exist
in serials).
Edit a subscription and save.
Without this patch, an error occured:
Software error:
DBD::mysql::db do failed: Column 'value' cannot be null at
/var/root-koha/bug-10855/Koha/AdditionalField.pm line 107.

Bug 10855: Fix Type table vs tablename

Koha::AdditionalField->all method take "tablename" not "table" in
parameter".

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
37319996b0 Bug 10855: Search subscriptions by additional fields on the claim page
Test plan:
- create some serials in late.
- go on serials/claims.pl.
- choose a vendor.
- verify that additional fields are displayed in new columns.
- try filters on columns.
- verify there is no regression on this page.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:31 -03:00
Jonathan Druart
e0c43b5825 Bug 10855: Search subscriptions by additional fields
Now you will abble to search subscriptions by additional fields.
The additional field values will be displayed in the table results.

Test plan:
- go on the subscriptions advanced search page
  (serials/serials-search.pl).
- verify all searchable additional fields are displayed on the form.
- combine 1 or more values and verify results are consistent.
- verify the values are displayed in new columns of the table.
- for field linked to an authorised value category, the description is
  displayed (not the code).

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
Jonathan Druart
e153d095d4 Bug 10855: New fields on adding/updating a subscription
This patch adds the ability to add values for additional fields when
adding/updating a subscription.

Test plan (test the following on adding a new subscription and on
editing an existent one):
- add/edit a subscription.
- verify all additional fields appears into the "Additional fields"
  block.
- fill a value for af1 and af3.
- fill others values if you are adding a new subscription.
- save.
- verify values appears on the detail of the subscription page.
- verify the af2 field is automatically filled with the specified
  marc field of the notice.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-02 15:10:30 -03:00
2a319e7ae2 Bug 14811: Don't update permanent_location with CART or PROC
The permanent_location should not be set to CART or PROC when the item
is edited.
Otherwise we lost an important info.

Test plan:
0/ Set the ReturnToShelvingCart pref
1/ Create an item with location "on_my_shelf"
2/ Check the item in and out
3/ Look at the DB values, location should be "CART" and
permanent_location unchanged (on_my_shelf)
4/ Edit the item, add a note for instance
5/ Without this patch, the permanent_location is erased with 'CART' and
you have definitely lost the info.
With this patch, the permanent_location is unchanged.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-10-02 14:24:11 -03:00
5d256e6b4b Bug 14522: Use Koha::Cache for accessing single_holidays()
this patch adds Koha::Cache functionality to the 'single_holidays' table
it is a performance patch for the problem described in BZ14315, only

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

it replaces slooow DateTime holiday objects with simple Ymd strings (19991230), then stores the strings in an @array using Koha::Cache
it does not attempt to add caching to all holiday tables - just the single_holidays table (at this stage

 on my test (master-cd9a827); nytprof showed a time reduction of the single_holidays() sub - from 61.7s to 587ms

here are some before/after nytprof runs, (really on master-cd9a827, not 3.20)

 http://x1.kohaaloha.com/i/nyt-bz14522-before/home-mason-g-k-3-20-x-Koha-Calendar-pm-1485-line.html#237
 http://x1.kohaaloha.com/i/nyt-bz14522-after/home-mason-g-k-3-20-x-Koha-Calendar-pm-1485-line.html#280

to test...

1/ add a bunch of single_holidays to your test koha, (my table has 400 holiday rows)
2/ add a loong circ rule for an itemtype (my rule has 140 days)
3/ checkout an item to a user (took me 67 secs)

apply patch...
4/ return item
5/ repeats steps 1..3, (took me 6 secs)

6/ add/change/delete some various single_holidays, via Home->Tools->Calendar
    ensure that your various changes have indeed saved correctly

for extra points...

7/ run tests t/Calendar.t and t/db_dependent/Holidays.t, with all tests pass OK

 sudo  koha-shell -c '  export PERL5LIB=/home/mason/g/k/master ; \
 cd /home/mason/g/k/master ;  perl  t/Calendar.t ; perl  t/db_dependent/Holidays.t  '   testkoha

8/ run QA tool, with all tests pass OK

 sudo  koha-shell -c ' \
export KOHA_CONF=/etc/koha/sites/mayo2/koha-conf.xml \
 export PERL5LIB=/home/mason/g/k/master:/home/mason/qa-test-tools/ ; \
 cd /home/mason/g/k/master ;   perl /home/mason/qa-test-tools/koha-qa.pl  -c 1 ' testkoha

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-10-02 11:41:29 -03:00
f1eb76c831 Bug 14832: Fix encoding issues when exporting in RIS
Test plan:
1/ Make sure you have non ASCII chars in the title and the authors.
2/ Export the record in RIS
You should not see any encoding problems.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Before patch: RIS file has wrongly encoded chars
After patch: RIS file has no endcoding problems
Tested on a NORMARC setup.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Tested on a MARC21 and a UNIMARC database.
Problem only confirmed for UNIMARC, but no regressions in MARC21.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-10-02 11:07:39 -03:00
19ae949e6a Bug 14597: (QA followup) Make Logger package level
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-28 12:20:49 -03:00
9b0f065392 Bug 14597: Reverting a batch where a record overlaid is now deleted record will fail
If batch of records is used to overlay existing records, and one of
those records is deleted, any attempt to revert this batch will fail.

The unanimous consensus is that deleted records should stay deleted (
 https://lists.katipo.co.nz/public/koha/2015-June/043048.html ).

Test Plan:
1) Import a batch of records
2) Import the same batch again, using ISBN as a matcher for overlay
3) Find a record that overlayed a previous record and delete it
   ( the match type will be "match applied" and there will be a link in
     "match details" )
4) Attempt to revert the second batch ( that overlayed the first )
5) The progress will stop at some point and never complete
6) Apply this patch
7) Attempt to revert the second batch again
8) This time it should succeed!

Signed-off-by: Do, Tam T <tdo@albright.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-28 12:20:41 -03:00
11c3b688fc Bug 14321: (QA followup) remove Test::CGI::Multipart dependency
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 15:33:42 -03:00
f8a58d310e Bug 14321: Final cleanup, removing obsolete files
The new Upload.pm, unit test and file-upload.js obsolete a number of
files, including an older jQuery plugin.
The test files progressbar.pl and progressbarsubmit.pl are outdated and
do not serve any purpose in this form. (Actually, we could argue if they
should be here or just be part of a debugging phase.)

Test plan:
[1] Git grep on file-progress, file-upload.inc, UploadedFile,
    ajaxfileupload, ajaxFileUpload
    UploadedFile: Only a reference to DBIx file is found
    ajaxfileupload: Only release notes
[2] Upload a file with tools/upload and stage-marc-import.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:02:52 -03:00
54cf0a8aaf Bug 14297: (QA followup) Remove unnecessary line
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:00:12 -03:00
d75da287ea Bug 14297: Holds Queue building ignoring holds where pickup & home branch don't match and item is not from least cost branch
If a record has a hold on it where the pickup and home branch do not
match, the holds queue builder will only look at items from the least
cost branch ( as defined by the transport cost matrix or the sys pref
StaticHoldsQueueWeight.

Test Plan:
1) Create a record with two items, one for library A and one for library B
2) Set your circulation rules such that the book from library A is
   holdable by all and the book from library B is holdable only by library
   B patrons
3) Create a hold for a Library C patron for pickup at library C
4) Set the syspref StaticHoldsQueueWeight to by Library B, Library A,
   Library C in that order
5) Rebuild the holds queue
6) Note the hold wasn't picked up even though the item from library A
   could have filled the hold
7) Apply this patch
8) Rebuild the holds queue
9) View the holds queue again
10) Note the hold now displays

Signed-off-by: Nora Blake <nblake@masslibsystem.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 12:00:03 -03:00
37ad2d7867 Bug 14733: Prevent a record from having holds with duplicate priorities
It is possible to create holds with duplicate priorities.

The reason for this is that typically the priority is calculated before
placing the hold. When the hold is placed the priority is calculated.
This can easily be shown by opening up two browser windows and starting
to place a hold for a record in each one. You'll see that both list the
same priority. If you than place the hold in each window, both holds
will have the same priority!

Test Plan:
1) Run unit tests pre-patch, note they fail
2) Run unit tests post-patch, note they succeed

Signed-off-by: Heather Braum <hbraum@nekls.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:25:27 -03:00
f1c9b314bb Bug 14817: (follow-up) Fix encoding issues in columns.def
Follow-up for reports.

Test plan:
1/ Use a translated template (fr-FR or ar-Arab)
2/ Go on the report guided page, step 3
3/ The field names should be correctly encoded.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:15:18 -03:00
1291dfe5cf Bug 14817: Fix encoding issues in columns.def
Test plan:
1/ Use a translated template (fr-FR or ar-Arab)
2/ Go on the tools/import_patrons.pl page
3/ The field names in the "default values" block should be correctly
encoded.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-25 11:15:17 -03:00
1e93bd3a94 Bug 13813: [QA Follow-up] Fix some tabs for qa tools
FAIL   C4/Barcodes/annual.pm
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 86)
                forbidden pattern: tab char (line 51)

FAIL   C4/Barcodes/hbyymmincr.pm
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 108)
                forbidden pattern: tab char (line 78)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 12:41:07 -03:00
Marc Véron
5dceb851dd Bug 13813: Remove deprecated module C4::Dates from system
Test plan: See Bugzilla.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-18 12:40:55 -03:00
ff807bc244 Bug 12252: Include item data only in extended mode
Previous patches attached to this bug have been refactored to merge bug
3206 and bug 13568 features. So OAI server must be carrefully tested to
ensure that there is no regression in this area: deleted records and
resumption token.

This last patch fixed the way items are returned. They are returned only
if OAI server operates in extended mode, and specifically for format
having the parameter include_item set to 1 (true). For example this
configuration file set via OAI-PMH:ConfFile syspref will return items:

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-17 11:02:19 -03:00
Jonathan Druart
8b24a09917 Bug 12252: (qa-follow-up) Remove perlcritic error
Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-17 11:02:17 -03:00
Robin Sheat
8e2bb13a25 Bug 12252: OAI-PMH items respect OpacHiddenItems
This allows the OAI-PMH service to not provide item information when
there is a rule that would supress it in OpacHiddenItems.

Test plan:
* Find an OAI-PMH URL that shows you some items.
* Add an entry to OpacHiddenItems that would block that.
* Check that it's blocked.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Tested, playing with OpacHiddenItems. GetRecord OAI verb returns a record
complying with OpacHiddenItems rules, for example without items from a specific
library.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-17 11:01:59 -03:00
Robin Sheat
80aa17d266 Bug 12252: OAI-PMH result includes item data
GetRecord for OAI-PMH was pulling the MARCXML directly from the
database. Now it uses GetMarcBiblio and includes the item data with it,
making it more generally useful.

Test plan:
* Run an OAI-PMH query, for example:
http://koha/cgi-bin/koha/oai.pl?verb=GetRecord&identifier=KOHA-OAI-TEST:52&metadataPrefix=marcxml
  to fetch biblionumber 52
* Note that it doesn't include the 952 data
* Apply the patch
* Do the same thing, but this time see that the 952 data is at the
  bottom of the MARCXML.

Note:
* This patch also includes a small tidy-up in C4::Biblios to group
  things semantically a bit better, so I don't spend ages looking for a
  function that was staring me in the face all along again.

Signed-off-by: David Cook <dcook@prosentient.com.au>

Works as described. Simple yet useful patch.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

952/995 item fields are back in response to GetRecord OAI verb.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Signed-off-by: Gaetan Boisson <gaetan.boisson@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-17 11:01:46 -03:00
Tomas Cohen Arazi
7349777f14 Bug 14245: (QA followup) already global
The original patch correctly unmasks the global variable (by
removing the 'my' on the marc2ris function, but wrongly introduces
a new global variable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 11:58:05 -03:00
Bernardo Gonzalez Kriegel
e15621fee2 Bug 14245: Problems with RIS export in unimarc
Variable $itype is used an all C4/Ris.pm to switch
between marc falvors, but is local and not passed along
as argument.

As a quick solution, is defined as global

To test:
1) On UNIMARC setup, export a record as RIS,
check that author (and other fields) are displayed
incorrectly

2) Apply the patch

3) Export again, improved results

4) Run t/Ris.t

There are other problems in this script, needs maintenance
(e.g. no Modern::Perl friendly)

Signed-off-by: Victor do Rosário <jvr@fct.unl.pt>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 11:58:05 -03:00
a37b3bb7f7 Bug 14640: 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out.
This bug is dealing with the situation where an item is checked out to a
patron that is not the next in line hold-wise for an item. In this case,
Koha will warn the librarian that there are holds on the item and
show the first person in line. Again, I want to stress that this
is the case where the item *is not waiting* for a patron. The
hold for the patron listed will just have a priority of 1.

The only situation where the "Cancel hold" checkbox will function
is when the priority 1 hold is an item level hold. This is due to
the fact that CancelReserve is being passed the trio of
biblionumber, borrowernumber, and itemnumber rather than the
singular reserve_id.

1) place biblio level hold on a book to borrower A.
2) check out an item of the book to borrower B.
3) When confirming checkout, check the 'Cancel hold' check-box, and
   click the "Yes, check out" button.
4) Note the hold was not canceled
5) Apply this patch
6) Repeat steps 1 through 3
7) Note the hold was indeed canceled

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 11:00:19 -03:00
a2ca59efb8 Bug 7634: Prevent permanent_location to be set to NULL if not defined
The permanent_location is correctly filled when an item is added from
the cataloguing module (routine set_item_default_location from
cataloguing/additem.pl).
But when records are imported, this filled is not managed. It's only on
editing (_do_column_fixes_for_mod called from ModItem).

This patch set the permanent_location item fields to the location value for all
items created, even the imported ones.

Test plan:
0/ Do not apply this patch
1/ Import a record with items using the "Stage MARC for import" tool
2/ Check the values for the permanent_location in the items table.
They are set to NULL
3/ Apply this patch
4/ Repeat 2 and confirm that now the permanent_location values are set
to the location values.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:56:07 -03:00
224b1c7976 Bug 6756: Fix bad behaviors if AnonymousPatron is not defined
There are at least 2 wrong behaviors if the AnonymousPatron pref is not
defined (0 or empty string).
1/ If you use the clean borrower tools, you will get a successful
message when the nothing happened (the history has not been anonymised).
2/ At the OPAC, if a patron ask for delete his reading history, he will
get an error message "The deletion of your reading history failed,
because there is a problem with the configuration of this feature.
Please help to fix the system by informing your libr    ary of this
error". IMO this should not happen, the history should be anonymised.

With this patch, the old_issues.borrowernumber field will be set to NULL
if the AnonymousPatron pref if not defined.

Test plan:
1/ Fill the pref with "" or 0
2/ At the OPAC, go on the privacy tab and click on the "Immedia deletion" button.
You should get a green and friendly message. Confirm that the history
has been anonymised.
3/ Use the "Batch patron anonymization" tools (tools/cleanborrowers.pl)
to anonymize the checkout history.
Confirm that a) it works and b) you get a message.

Try again with AnonymousPatron set to a valid patron. You should not see
any changes with the current behaviors.

NOTE: This patch tweaks C4/Circulation.pm and provides tests.
      applying just this, and running prove success. Reverting just
      C4/Circulation.pm fails, as expected.
      Tested OPAC stuff with both patches applied.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:55:42 -03:00
Jonathan Druart
cef7cd40ce Bug 13622: Display a datetime without time in a notice
For some needs, a librarian would like to display a datetime or
timestamp field without the time.

This patch adds filter logic in the notice/letter parsing process.

Test plan:
1/ Defined a notice using a datetime or timestamp DB field
(biblio.timestamp for instance).
2/ Generate the notice
3/ Verify that the letter is generated with the time
4/ Use the "dateonly" filter like:
  <<your_table.your_field | dateonly>>
  <<biblio.timestamp | dateonly>>
5/ Generate the notice
6/ Confirm the the letter is generated without the time for this field.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Updated the count of tests to 64 for t/db_dependent/Letters.t to pass
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:49:54 -03:00
c7a6745bc0 Bug 8723: Update hold_fill_targets, tmp_holdsqueue and linktracker tables
Same as previous patch for 3 other tables.

Test plan:
Same as before but the hold should exist to the 3 tables before the
move.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:39:02 -03:00
9f8f33e351 Bug 8723: Update the reserves table for item-level holds
If an item is moved from a biblio to another, the holds should be
updated too.

See discussion on the bug report for more information.

Test plan:
1/ Place a item-level hold on biblio1
2/ Move the item to biblio2
3/ Confirm that the hold still exists and point to the biblio2

This patch should not change the existing behavior for bib-level holds.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:39:02 -03:00
Marc Véron
a71cc14a52 Bug 14782: Add possibility to search patrons using the username (userid)
This patch makes it possible to search for users using the username (userid / login name).

To test:

- Apply patch
- Do searches from Home > Patrons
- Search after a full username or parts of a username with Search fields = Standard and Search fields = Userid
- Perform the searches from the top bar (expand with [+]) and from the "Filters" part at the left
- Make sure that other searches behave as before

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:36:56 -03:00
70133ef343 Bug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee
The problem making some tests fail, actually was the unneeded addition
of zero accountline records by ChargeReserveFee, called by AddReserve.
The balance is still zero, but a test like !$var responds differently
when var is 0.00 instead of 0 or undef.

This patch adjusts the test in ChargeReserveFee in order to prevent
adding these records with 0.00.
The first patch that adjusts the tests in Reserves.t is not strictly
needed anymore, but can stay.

Test plan:
[1] Run t/db_dependent/Reserves.t
[2] Run t/db_dependent/Reserves/GetReserveFee.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:19:38 -03:00
fdc859281c Bug 14655: Fix wording
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Fixed a missing space after Error: :)
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-09-16 10:12:15 -03:00
Mark Tompsett
cc2452df23 Bug 12357: Following whitespace failures on koha qa test tools.
TEST PLAN
---------
1) Apply all patches before this.
2) run koha qa test tools
   -- whitespace failures
3) Apply this patch
4) run koha qa test tools
   -- no whitespace failures.

NOTE: More tabs were fixed than required, to also clean up a little indenting.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Koha-qa tools now happy

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 13:59:07 -03:00
Mark Tompsett
95286aad85 Bug 12357: Fix comma issues related to additional fields.
TEST PLAN
---------
1) Apply patches, except this one.
2) prove t/db_dependent/Record.t
   -- fails like comment #38
3) Apply this patch
4) prove t/db_dependent/Record.t
   -- now it passes.
5) koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Make test work, koha-qa problems fixed in next patch

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 13:58:58 -03:00
39ed3dce71 Bug 12357: Enhancements to RIS and BibTeX exporting
Some libraries would like to be able to add arbitrary fields to both the
RIS and BibTeX citation formats that a record can be saved as from the
staff intranet and public catalog. In addition, they would like to be
able to override the default record type and use Koha's itemtype as the
record type for those formats as well.

Test Plan:
 1) Apply this patch
 2) Run updatedatabase.pl
 3) Add the following to the new syspref RisExportAdditionalFields:
TY: 942$c
LC: 010$a
NT: [501$a, 505$g]
 4) Find or create a record with an 010$a (lccn) field, a 501$a field,
    a 942$c field, and multiple 505$g fields.
 5) Locate the record in the catalog, choose "Save" and select RIS
 6) Inspect the downloaded file, note the replaced TY field, the LC
    field, and multiple NT fields
 7) Add the following to the new syspref BibtexExportAdditionalFields:
'@': 942$c
lccn: 010$a
notes: [501$a, 505$g]
 9) Using the previously selected record, choose "Save" and select BIBTEX
10) Inspect the downloaded file, note the lccn, the multiple note
    fields, and the new record type value

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 13:58:39 -03:00
Lari Taskula
46ac35f8e1 Bug 14621: Messaging preferences table needs to be sorted
I have been working with messaging preferences and I noticed a weird issue in Firefox on Ubuntu.

On messaging preferences page, the table is unsorted and the content in rows are generated randomly
on every page refresh. When you select/deselect checkboxes and refresh the page (without posting the changes),
Firefox will remember your choices. Now the issue is that when the table is unsorted and the rows keep
changing on page refresh, Firefox has trouble remembering your choices. This makes it appear as if the
checkboxes are magically changing values on each page refresh.

Here is a patch that prevents this problem by sorting the messaging settings.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:15:45 -03:00
ea92a92f53 Bug 14470: Do not allow renew for on-site checkouts
At the opac, the renew checkbox should not be displayed if it's an
on-site checkout (same on the intranet).

On the way, this patch adds a specific message to the intranet if the
librarian try to renew an on-site checkout.
Indeed before this patch a renew was allowed if the barcode was scanned.

Test plan:
1/ Create an on-site checkout for a patron
2/ Confirm that the checkbox 'renew' is not displayed on the checkout
list tables
3/ At the OPAC, the renew should not be allowed (no checkbox)
4/ Try to check the item out to the same patron, confirm that you get a
specifig message to inform you the renew is not allowed for on-site
checkouts.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changed 'issue' to 'item' in the error message.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:07:37 -03:00
e2a87c54c0 Bug 14702: [QA Follow-up] More readable variable names, less queries
The names are much better now :)
Combined the queries for items and issues.
Only check the number of holds when needed.

Test plan:
Verify the changes here by running the unit test again.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:04:49 -03:00
44a4e043a5 Bug 14702: Refactor GetReserveFee
The code of GetReserveFee was not very clear.
What it did was: check if there are some items not issued. If so and there
are no holds, calculate no fee.

While doing so, I moved the code to charge the fee (in AddReserve) to a small
new sub ChargeReserveFee.

There is no change in behavior.
The follow-up patch adds unit tests.

Test plan:
[1] Make sure that a patron category (X) includes a hold fee.
[2] Select a biblio with 2 items.
[3] Issue one item to another patron.
[4] Place a hold on this biblio by patron with category X. No charge?
[5] Cancel the hold from the previous step.
[6] Use another patron to place another hold on this biblio.
[7] Place hold again by patron with category X. Is it charged?
[8] Cancel that hold again. Issue the second item to another patron.
[9] Place hold again by patron with category X. Is it charged again?

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 12:04:48 -03:00
Jonathan Druart
f189696bb7 Bug 14098: Implement the copy_and_replace action for MTT
This patch implements the copy and replace action for the marc
modification templates.
Instead of copying a field/subfield, it will erase the destination
fields/subfields.

Test plan:
Find it yourself.
Compare the differences between the copy and the copy_and_replace
actions.
The easier way to test is to 1/ create a complete record, 2/create some
modification templates and 3/ use the batch record modification with the
"preview" function.

QA note: I kept the same tests as "copy" and, if no change were
expected, I noted them "(same as copy)", to be sure this new action won't
introduce regression on these tests.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 11:17:13 -03:00
7bad40dcc2 Bug 14717: Prevent 0000-00-00 on updating a patron
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 10:49:49 -03:00
Chris Cormack
d8a9d17115 Bug 14717: Invalid dates in debarred column
To test
1/ Import a patron using the patron import tool, make sure they have
no debarred column in the file
2/ Check the database, notice the debarred column is 0000-00-00
3/ For bonus points, checkout an item to that borrower, then check it in
notice Koha errors
4/ Apply patch
5/ Import a new patron
6/ Notice column is now NULL and that checkins work

Signed-off-by: Eugene Espinoza <eugenegf@yahoo.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 10:49:48 -03:00
5b521eb394 Bug 11273: FIX barcode generation in acquisition if hbyymmincr
When AutoBarcode is activated and you have set AcqCreateItem to 'on
order' there is a Javascript error when you try to generate a barcode
for the item:

TypeError: document.f is undefined
http://localhost:8080/intranet-tmpl/lib/jquery/jquery.js
Line 11

Test plan:
0/ a. Set AutoBarcode to hbyymmincr
   b. Set AcqCreateItem to 'on ordering'
   c. Set the plugin barcode.pl to the barcode field for the default
   and the ACQ frameworks
1/ Go on the add items page (cataloguing/additem.pl) and confirm that
the plugin works as expected.
2/ Go on the New order page (acqui/neworderempty.pl) and confirm that
the plugin works as expected.

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: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-07 10:47:53 -03:00
Joonas Kylmälä
198e273530 Bug 14526: (follow-up) add a space before equals sign
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:53:42 -03:00
ea6c4f5b8a Bug 14526: MoveReserve should look at future holds too
At checkout a hold for the same borrower is considered to be filled.
It is consistent to do the same for holds of the same borrower within
[ConfirmFutureHolds] days (if non-zero).

This goal is achieved by adjusting the CheckReserves call within
MoveReserve, adding the lookahead parameter.
I used this occasion to revisit other calls of CheckReserves:
- transferbook: no need to add lookahead; a future hold should not block
  a transfer;
- CanBookBeIssued: no lookahead; future hold does not block an issue;
- CanBookBeRenewed: idem.
- GetOtherReserves (only used in circ/returns): this call might be a
  candidate for lookahead too, but I leave that for another report. It is
  in the context of checkin and transfer, not checkout.

Test plan:
[1] Set ConfirmFutureHolds to zero days. (You may also need to enable
    AllowHoldDateInFuture.)
[2] Place a hold with borrower A on biblio X for tomorrow. Also place a hold
    with borrower B on X for today. (Use biblio level holds.)
[3] Check out item Y of X to borrower A. Ignore the warning for borrower B
    and do not cancel the hold of B (so: confirm checkout).
    Verify that X has still two holds.
[4] Check in Y (without confirming a hold).
[5] Enable ConfirmFutureHolds, say 2 days.
[6] Check out Y to A again. Ignore the warning for B (no cancel). Verify that
    X now only has one hold for borrower B (the hold for A was filled).

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:53:42 -03:00
Katrin Fischer
c1d9a2c770 Bug 13972: Include fields from subscription and serial table in serial notification email
Currently it's not possible to include information about which
issue has arrived in the serial notification notice the patron
can subscribe to from the OPAC.

The patch makes the fields from the subscription and serial
table available to the notice template.

In order to be able to print information about the correct
issue, the GetAlert has been modified to expext the serialid
as externalid when the module is issue.

git grep SendAlerts (only call with 'issue' is in Serial.pm)

To test:
- Add a subscription, select a patron notification template
- Search for the record in the OPAC
- Go to the subscription tab - More details
- Subscribe to the notification
- Edit the notice template you selected for the subscription
  - add fields from subscription
  - add fields from serial (serial.serialseq has the issue
    information)
- Receive an issue for the subscription
- Check that you have received the notification and that
  all information has been printed correctly
  NOTE: notice is sent directly, not through the message_queue

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:41:41 -03:00
085d766a05 Bug 12885: Fix if url contains +*... and HTML5 Media is enabled
The special regex chars are not escaped in C4::HTML5Media.

Test plan:
1/ Set 856$u=http://www.mrqe.com/lookup?talented+mr.+ripley
2/ Enable the pref HTML5Media
3/ Go on the detail page
It should not explode.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:38:29 -03:00
Srdjan
22b4106398 Bug 11247: Fix calls of TransformHtmlToXml
The ind_tag of TransformHtmlToXml is unused.
Some calls to this function incorrectly revert indicator and ind_tag (which
is not a problem when both are empty..)

Patch of Srdjan Jankovic, amended and signed off by Marcel de Rooy.

The following calls are fixed:
call in acqui/addorder.pl: switched indicator with ind_tag
call in acqui/addorderiso2709.pl replaced too
acqui/finishreceive.pl replaced too

These calls are fine:
two calls in cataloguing/additem.pl are fine
call in serials/serials-edit.pl is fine
call in tools/batchMod.pl is fine

The folllow-up patch adds a simple unit test.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
With AcqCreateItem=='placing an order', tested if adding an order still
worked (covered both addorder.pl and addorderiso2709.pl).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-09-02 14:36:33 -03:00
3389e03035 Bug 14337: AllowRenewalIfOtherItemsAvailable counts holdable not for loan items when checking renewability
AllowRenewalIfOtherItemsAvailable checks
C4::Reserves::IsAvailableForItemLevelRequest to see if the item is
holdable, which catches not for loan values less than 0 ( i.e. holdable,
but not circ-able ). However, since this feature is about
actually checking out items to patrons, we should not count *any* not
for loan items when deciding if the available items will satisfy all
current holds.

Test Plan:
 1) Enable AllowRenewalIfOtherItemsAvailable
 2) Create a record with two items
 3) Check out one item to a patron
 4) Ensure the item is renewable
 5) Place a hold on the record
 6) The item should now be non-renewable
 7) Add a second item to the record, but with a not for loan value < 0
 8) Note the checkout is still renewable
 9) Apply this patch
10) Note the checkout is now non-renewable

Works ok.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 10:42:25 -03:00
Christophe Croullebois
079de81c10 Bug 13697: Syspref to not add a fee when a patron changes to a category with enrolment fee
By default this syspref is "Do" to keep the previous behaviour.

Test plan :

1/ create 2 categories (A & B). B with enrolment fee
2/ create a patron in category A
3/ change the patron category from A to B
4/ check that the patron has an enrolment fee to pay

Apply the patch

1/ create a new patron in category A
2/ change the patron category from A to B.
3/ check that the patron has an enrolment fee to pay
4/ change the system preference 'FeeOnChangePatronCategory' to 'Don't';
5/ create a new patron in category A
6/ change the patron category from A to B
7/ check that the patron has no enrolment fee to pay

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-28 09:51:45 -03:00
63970ff4a2 Bug 13791: (RM followup) Add new dependencies for packaging
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-27 13:18:28 -03:00
ca341f6840 Bug 11190: sitemap.pl -- Generate a Catalog sitemap
Add a script sitemap.pl to process all biblio records from a Koha
instance and generate Sitemap files complying with this protocol as
described on http://sitemaps.org. The goal of this script is to be able
to provide to search engines direct access to biblio records. It avoid
leaving search engine browsing Koha OPAC and so generating a lot of
traffic, and workload, for a bad result.

Thanks Magnus for testing, and helping to improve the script design.

[2015.04.16] Switch from Moose to Moo.

[2015.08.20] Add complete (more) UT.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
All options to the script work as expected and the output looks
good. Nice enhancement!

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I signed-of my own patch after fixing various QA errors.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: replace tabs with spaces.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 11:05:24 -03:00
6f95acd1a6 Bug 12632: Hold limits ignored for record level holds with item level itemtypes
The crux of the issue is that if you are using item level itemtypes, but
are allowing biblio levels holds, those holds do not have items.

So, in CanItemBeReserved, when Koha counts the number of holds to
compare against the given rule, it will always give 0 ( except of course
for found holds, and the occasional item-level hold ).

So the query is saying "link each of these reserves to the reserved
item, and count the number of reserves this patron where the itemtype is
DVD". However, since these are all record level reserves, there are no
items to link to, and so when it looks for all reserves this and item
whose itemtype is DVD, it finds zero reserves!

This patch solves the problem by looking first at the item level
itemtype, and if it does not exist, then it looks at the record
level itemtype. For installations using record level itemtypes, the
behavior remains unchanged.

Test plan:
1) Enable item level itemtypes
2) Create two records with one item each of a given itemtype
3) Create a single issuing rule and limit the holds allowed for that
   itemtype to 1
4) Place a record level hold on your first record
5) Attempt to place a record level hold for the same patron on your
   second record. You should not be able to but you can!
6) Apply this patch
7) Repeat step 5, note you can no longer place the hold!

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:42:04 -03:00
64fcab9e51 Bug 9809: Fix pod errors
FAIL   C4/Reserves.pm
   FAIL   pod
                 in file C4/Reserves.pm
                *** ERROR:
                Spurious =cut command

Test plan:
perl -e "use Pod::Checker;podchecker('C4/Reserves.pm');"
Should not return any errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:27:00 -03:00
092a7e1b53 Bug 9809: [QA Follow-up] Still found some remains
In the staff client we had still some remains referring to the
constraint types.
Also touched one comment line from SIP.

Test plan:
Add a hold in the staff client.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:58 -03:00
ad3239479d Bug 9809: Update AddReserve prototype to remove constraint parameter
Test Plan:
1) Apply this patch set
2) prove t/db_dependent/Circulation.t
3) prove t/db_dependent/Holds.t
4) prove t/db_dependent/Holds/LocalHoldsPriority.t
5) prove t/db_dependent/Holds/RevertWaitingStatus.t
6) prove t/db_dependent/HoldsQueue.t
7) prove t/db_dependent/Reserves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

AMENDED: An else branch in reserve/placerequest.pl was removed. This had
the effect of making it no longer possible to place an any hold in the
staff client.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified placing a biblio level and an item level hold.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:43 -03:00
a379525086 Bug 9809: Remove reserveconstraints references from C4::Reserves
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-08-26 10:26:36 -03:00
Jesse Weaver
4ce29452ad Bug 14464: (QA followup) add unit tests
This followup adds several tests to t/db_dependent/Reserves.t.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-21 09:20:22 -03:00
Jesse Weaver
bb6277ffcc Bug 14464: Add ability to cancel waiting holds from checkin screen
Test plan:

    1. Ensure that ExpireReservesMaxPickUpDelayCharge is set to 0.
    2. Place a hold (doesn't matter whether it's a bib/item-level hold),
       then confirm the hold by checking it in.
    3. Check in the item again, and hit Cancel.
    4. The reserve in question should be cancelled.
    5. Repeat steps 2-4 twice, once after setting
       ExpireReservesMaxPickUpDelayCharge to a nonzero value and again
       after clicking the "Forgive fees for manually expired holds"
       checkbox.

A fine should only be applied when the syspref is enabled and the
checkbox is not checked. Also, the checkbox should only appear after
enabling the syspref. And finally, the checkbox should remember whether
it is checked across multiple checkins, same as the "Forgive overdue
charges" and "Book drop mode" checkboxes.

Signed-off-by: Jason Burds <jburds@dubuque.lib.ia.us>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: Removed 2 debugging lines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-21 09:20:11 -03:00
91e9cafa7a Bug 3333: Confusing item status for not-for-loans
This patch makes a tiny change in C4::Search::searchResults as to the
handling of not-for-loans. This should make the display of status and
availability of items more consistent in opac and staff.

Additionally, a Place hold link should disappear in the opac, when it is
not possible to place a hold on any item of one biblio.

The following spots need special attention; the display should be
corrected by this patch:
[A] Location column showing number of available items in catalogue/search.
[B] Location column of Cataloging Search (addbooks.pl)
[C] OPAC Search results list in non-XSLT view.

NOTE
The forms opac-MARCdetail and MARCdetail also include an Items table with
column Not for loan. The information in this column might still be somewhat
confusing but is actually correct. The column only contains Not for loan if
the item field is set. So it is empty when only the item type is nfl.
Since a correction here is arguable, I am not including it on this report.

Test plan:
[1] Have at least two item types. Mark one item type (X) as not for loan.
[2] Use at least two biblios with two items each. Mark one item of the first
    biblio as not for loan at item level (via item editor).
    Change one item of the second biblio to the item type of step 1 (X).
[3] Set pref item-level_itypes==item and set all four xslt prefs (for opac
    and staff, results and detail) to default.
[4] Check spots A, B and C as mentioned above. Also check:
    [D] OPAC Detail, Holdings table, Status column
    [E] Staff Detail, Holdings, Status.
[5] Make all four xslt prefs now empty. Check spots A to E again.
    Especially observe C here.
[6] Set pref item-level_itypes==biblio. Change your second biblio to item
    type of step 1 (X) in the cataloguing editor (MARC 942c).
    Check spots A to E again.
[7] Set all four xslt prefs again to default. Check spots A to E again.
[8] Run the unit test t/db_dependent/Search.t.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-20 13:43:39 -03:00
Galen Charlton
3ec8b27185 Bug 14644: unbreak SIP2 terminal login when using telnet transport
This patch fixes breakage introduced by the patch for bug 13506
that prevented SIP2 clients from authenticating themselves over
the telnet transport. Attempts to do so would manifest by the
SIPServer backend crashing and the connection getting closed.

To test:

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

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

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

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-20 13:39:56 -03:00
748b212cf9 Bug 14529: The new list permission is 'lists', not 'shelves'
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-18 13:18:21 -03:00
Tomas Cohen Arazi
e1319963d6 Bug 11229: (followup) makepartialpayment fix
makepartialpayment() wasn't logging the branch either. This patch
fixes that too.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-18 13:18:21 -03:00
Katrin Fischer
a90a7202c3 Bug 11229: makepayment doesn't log branch in statistics correctly
This patch fixes makepayment() so it correctly logs the branch code
to the statistics table.

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

Original commit message relying on the UI to test:

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

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

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

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

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-18 13:18:21 -03:00
7f797b3244 Bug 6874: [QA Follow-up] Last adjustments for future developments
This patch does:

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:36 -03:00
d7cdb6e15e Bug 6874: [QA Follow-up] Adjustments for opac-retrieve
Adds httpheaders sub to UploadedFiles; this will be extended on a new
report. (Idea is to add configurable headers for file extensions.)
Trivial unit test added.
Small cosmetic changes to opac-retrieve-file.

Test plan:
Run test UploadedFiles.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:36 -03:00
Mark Tompsett
b36f4674a0 Bug 6874: id based on contents, filename, and directory.
This patch corrects the inability to upload the same file to a
different directory, or even a renamed file to the same
directory. By including the filename and directory as part of
the $id SHA generation, only identical files in the same
directory with the same file name will generate the same $id.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:28 -03:00
Mark Tompsett
98ccd548ee Bug 6874: License Text Update
This updates the license text for
- C4/UploadedFiles.pm
- cataloguing/value_builder/upload.pl
- opac/opac-retrieve-file.pl
to GPL v3 as per the
http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence
text.

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:23:05 -03:00
Mark Tompsett
64079ccaa3 Bug 6874: kohastructure.sql, jquery.js, refocus, and more
Two problems were discovered while doing a fresh install
of Koha. These problems in the kohastructure.sql file are
addressed with this patch.

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

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

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

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:45 -03:00
094092b111 Bug 6874: (QA followup) Attach files to bibliographic records
* Renames uploadPath to upload_path to follow the standard naming
  conventions in koha-conf which use underscores rather than camel case
* Remove reference to intranet-tmpl and replace with [% interface %]
  required to pass qa

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:13 -03:00
Julian Maurice
9f0546f003 Bug 6874: Move uploadPath syspref to koha-conf.xml
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:06 -03:00
Julian Maurice
209faec183 Bug 6874: Add unit tests for C4::UploadedFiles
Add unit tests for C4::UploadedFiles and move a variable
declaration at subroutine level instead of file level.
Add dependency to Test::CGI::Multipart

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

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:06 -03:00
Paul Poulain
bfe5680186 Bug 6874: QA follow-up
Squash of the following commits:
  return with explicit undef removed
  Follow-up for PBP fixes
  follow-up fix POD syntax
  follow-up jquery has moved

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: removed POD changes in Biblio.pm while rebasing.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-08-07 15:22:06 -03:00
Julian Maurice
2def11d678 Bug 6874: Attach files to bibliographic records
New cataloging plugin upload.pl and new system preference 'uploadPath'.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Slightly amended/simplified the patch during QA: The changes to
GetMarcUrls are not really needed, and would have needed some
attention. Another link text can be supplied by the plugin too.

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

Edit: more meaninfull commit subject
2015-08-07 15:21:31 -03:00
daab662c7c Bug 13948: (QA followup) Make dependency optional
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
2015-07-28 10:30:04 -03:00
aa356f47ea Bug 13948: Add ability to dump template toolkit variables to html comment
It would be incredibly helpful if we could easily enable Koha to dump
all Template Toolkit variables to a comment for debugging purposes.

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

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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:29:43 -03:00
5c3c679728 Bug 13049: Merge selfreg cron jobs into cleanup_database
This patch moves the core code of two selfreg cron jobs into the Members
module. The new routines are called from cleanup_database with two new
parameters. The old cron jobs are now wrappers to cleanup_database.
As a bonus, we can add a unit test now.

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:24:02 -03:00
Stéphane Delaune
62dc6b0ca1 Bug 10961: (followup) Make query fields explicit and add regression tests
add correct frameworkcode to _koha_marc_update_bib_ids parameters

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

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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:19:51 -03:00
298c4c76a5 Bug 10961: Error in GetMarcBiblio can cause severe data loss
A bug in GetMarcBiblio can cause severe data loss if your database has
records where the biblionumber and biblioitemnumber do not match and the
script misc/batchRebuildBiblioTables.pl is run.

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

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

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

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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-28 10:19:51 -03:00
Marc Véron
3b23fb8b21 Bug 14107: Patron cards: Make barcode width and height scaling editable
The size of the barcode in patron card creator was hardcoded to 1% of the card height and 80% of the card width.
This patch exposes both values in the layout editor. If no values are given, the previousely hard coded values (0.01 / 0.8) are used in order to work with existing card definitions.

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

Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-24 14:07:18 -03:00
Jonathan Druart
fa5104a6a1 Bug 8684: Fix duplicate check on creating items in the acquisition module
The script acqui/check_uniqueness.pl has been introduced by bug 7178.
But bug 11425 added a call to a new subroutine SearchItemsByField in
order to refactore some code. This subroutine calls SearchItems with an
arrayref, which is not what SearchItems is expecting.
This broke the duplicate check done on creating items in the acquisition
module.

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

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

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

Works well, no errors.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-24 13:40:43 -03:00
7d4e7e4e52 Bug 14569: Typo borroewr|borow
Trivial correction. Only touches comments.

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

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-07-24 12:55:07 -03:00
a269e8ec44 Bug 14167: Add Koha::Logger based on Log4perl
Koha needs a better logger, and it seems like the best solution would be
to take advantage of Log4perl which is already a fully featured logger.
We use Log4perl to selectively decide what statements should be logged,
and where they should go!

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Moved the renewal stuff to a separate example patch.
And upgraded the DEBUG level to WARN in the log4perl config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-21 10:15:40 -03:00
Jonathan Druart
f8abcf3e8e Bug 12137: Use Koha.Preference to access pref value
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
2015-07-20 10:44:06 -03:00
Mark Tompsett
db5fe99b33 Bug 12137: Extend CalendarFirstDayOfWeek to be any day
Mubassir Ahsan asked on the Koha mailing list:
Is there any option to set Saturday as the first day of
the week? Please help me.

CalendarFirstDayOfWeek is currently either Sunday|Monday.

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

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

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

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:43:35 -03:00
Mark Tompsett
588f13e699 Bug 14121: Silence warnings t/db_dependent/Auth_with_cas.t
TEST PLAN
---------
1) $ prove t/db_dependent/Auth_with_cas.t
   -- CGI security warning
2) apply patch
3) $ prove t/db_dependent/Auth_with_cas.t
   -- no noise.
4) koha qa test tools

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Not able to reproduce the error on my setup, but the code
is a clear improvement over the previous version.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:32:21 -03:00
Katrin Fischer
e799e1cbc3 Bug 11620: Add dissertation-information index for MARC21 (502)
Bug 11202 introduced a new index 'dissertation-information' for
UNIMARC. This patch adds the index also for MARC21 installations.

http://www.loc.gov/marc/bibliographic/bd502.html

To test:
- Apply patch
- Copy files in etc/zebradb changed by this patch to your
  corresponding directory (koha-dev..)
- Make sure you have records with 502
- Reindex
- Verify you can search the field contents with
  dissertation-information= and
  diss=

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Can find by dissertation-information,
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:31:06 -03:00
17d04c4619 Bug 14494: Terribly slow checkout caused by DateTime->new in far future
An expiry date like 9999-12-31 in the local timezone will make DateTime
spend a lot of time (maybe 60 seconds) on date calculation. See the
DateTime documention on CPAN.
A calculation in floating (or alternatively in UTC) would only take
a few milliseconds.

This patch makes two changes in this regard:

[1] The compare between expiry date and today in CanBookBeIssued has been
    adjusted in Jonathan's patch. I am moving the compare to the floating
    timezone (as was done in my original patch). This removes a hardcoded
    9999.
[2] If ReturnBeforeExpiry is enabled, CalcDateDue compares the normal due
    date with the expiry date. The comparison is now done in the floating
    timezone. If the expiry date is before the due date, it is
    returned in the user context's timezone.

NOTE: The calls to set_time_zone moving to or from floating do not adjust
the local time.

TEST PLAN:
First without this patch (and the one from Jonathan):
[1] Set expiry date to 9999-12-31 for a patron.
[2] Enable ReturnBeforeExpiry.
[3] Checkout a book to this patron. This will be (very) slow.

Continue now with this patch applied:
[4] Check in the same book.
[5] Check it out again. Should be much faster.

Bonus test:
[6] Set borrower expiry date to today. Change relevant circulation rule
    to loan period of 21 hours. Test checking out with a manual due date
    /time just before today 23:59 and after that. In the second case the
    due date/time should become today 23:59 (note that 23:59 is not
    shown on the checkout form).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:16:24 -03:00
Jonathan Druart
8d58acc565 Bug 14494: Prevent slow checkout if the patron does not have an expiry date
If a patron has a expiry date set to 9999-12-31 (for organizations for
instance), the checkouts are very slow.

It's caused by 2 different calls to DateTime in CanBookBeIssued:
1/
  DateTime->new( year => 9999, month => 12, day => 31, time_zone => C4::Context->tz );
The time_zone should not be set (as it's done in Koha::DateUtils), set to UTC or floating tz.

2/
  DateTime->compare($today, $expiry_dt)
The comparaison of 2 DT with 1 related to 9999 is very slow, as you can
imagine.

For 1/ we need to call Koha::DateUtils::dt_from_string (actually, we
should never call DateTime directly).
For 2/ we just need to test if the date is != 9999, no need to compare
it in this case.

Test plan:
Before this patch, confirm that the checkouts are slow if the patron has a
dateexpiry set to 9999-12-31.
update borrowers set dateexpiry="9999-12-31" where borrowernumber=42;

After this patch, you should not see any regression when checking out
items to an expired patron and to a valid patron.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:16:24 -03:00
Aleisha
09b34591b6 Bug 14436: Noisy warns in C4/Utils/DataTables/Members.pm
TEST PLAN
---------
1) Backup the koha intranet error log.
2) Empty the koha intranet error log.
3) In staff client, go to Patrons
   (/cgi-bin/koha/members/members-home.pl)
4) Pick any letter to 'Browse by last name'
   -- koha intranet error log now has warns.
   -- the one of importance is the uninitalized value.
5) Empty the koha intranet error log.
6) apply this patch
7) Repeat steps 3 & 4.
   -- koha intranet error log does not contain the
      uninitialized value error.
8) run koha qa test tools.

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:13:17 -03:00
Jonathan Druart
454becb78f Bug 9006: Remove AUTOLOAD in C4::Context
Happily this was only used for intranetdir.
It's time to remove it and replace existing calls.

I used the following commands to catch calls to C4::Context:
git grep 'C4::Context\->' | grep -v 'C4::Context->preference' | grep -v
'C4::Context->config' | grep -v  'C4::Context->userenv' | grep -v
'C4::Context->IsSuperLibrarian' | grep -v 'C4::Context->dbh' | grep -v
'C4::Context->set_preference' | grep -v '_syspref_cache' | grep -v
_userenv | grep -v 'C4::Context->interface' | grep -v
'C4::Context->Zconn' | grep -v 'C4::Context->queryparser' | grep -v
'C4::Context->tz' | grep -v 'C4::Context->boolean_preference' | grep -v
'C4::Context->memcached'

NOTE: I applied 14428, and then did what I suggested in comment #2.
      Only intranetdir references appeared.

      I applied this patch, and repeated.
      Nothing appeared. This means the autoload references are
      properly removed.

      koha qa test tools complained about whitespace, I just fixed
      those. Though, we may wish to perltidy
      auth_fields_substructure.pl on another bug.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-20 10:11:41 -03:00
Mark Tompsett
63427fce60 Bug 14428: Remove C4::Input
Jonathan Druart agreed that C4::Input is vestigial code that should be removed.
Here is how I checked. First I found where C4::Input was used. Then, I checked
what functions are in the package: just checkdigit. Then, I confirmed that
checkdigit is not used at all in any acquisition, administration, or member
related perl scripts. Lastly, I took a look at our supposed test file for the
package. It was painfully sparse.

As such, this patch removes the test file and the package file, and removes
C4::Input references from these six files:
- acqui/addorderiso2709.pl
- acqui/basketgroup.pl
- acqui/neworderempty.pl
- acqui/uncertainprice.pl
- admin/aqplan.pl
- members/memberentry.pl
NOTE: neworderempty had 3 lines of it?! Didn't anyone see that?!

Here is the output of what I did to confirm this correction:

mtompset@debian:~/kohaclone$ git reset --hard origin/master
HEAD is now at 6e9086f Bug 3206: (QA followup) missing comma on sysprefs.sql
mtompset@debian:~/kohaclone$ git grep C4::Input
C4/Input.pm:package C4::Input; #assumes C4/Input
C4/Input.pm:C4::Input - Miscellaneous sanity checks
C4/Input.pm:  use C4::Input;
acqui/addorderiso2709.pl:use C4::Input;
acqui/basketgroup.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/neworderempty.pl:use C4::Input;
acqui/uncertainprice.pl:use C4::Input;
admin/aqplan.pl:use C4::Input;
members/memberentry.pl:use C4::Input;
t/Input.t:        use_ok('C4::Input');
mtompset@debian:~/kohaclone$ grep sub C4/Input.pm
sub checkdigit ($;$) {
                my $temp2 = substr($infl,$i,1);
        if ($rem eq substr($infl,8,1)) {
} # sub checkdigit
mtompset@debian:~/kohaclone$ grep checkdigit `find acqui -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find admin -type f`
mtompset@debian:~/kohaclone$ grep checkdigit `find members -type f`
mtompset@debian:~/kohaclone$ cat t/Input.t

use strict;
use warnings;

use Test::More tests => 1;

BEGIN {
        use_ok('C4::Input');
}

Apply this patch, and the output of git grep C4::Input will be empty.
Run koha qa test tools (kind of overkill)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-10 10:53:56 -03:00
Julian FIOL
52814a9fa0 Bug 14207: Improving circulation performance
by caching yaml file This patch improve circulation performance by caching yaml file With this patch we saved between 300ms and 500ms on circulation page.

Following Comment #3 :
No useless warn
No tidy

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Less lines, same result.
Comments were useful on testing :)
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-07 15:23:48 -03:00
Jonathan Druart
94315f663b Bug 9942: Make Koha fails if privacy is not respected
If a patron has requested anonymity on returning items and the system is
not correctly configured (AnonymousPatron no set or set to an inexistent
patron), the application should take it into account and not fail
quietly.

This patch is quite radical: the script will die loudly if the privacy
is not respected.

To be care of the bad "Software error", some checks are done in the
updatedatabase to be sure the admin will be warned is something is wrong
in the configuration.

Test plan:
1/ Test the updatedatabase entry:
a. Turn on OPACPrivacy and set AnonymousPatron to an existing patron
=> You will get a warning
b. Turn on OPACPrivacy and set AnonymousPatron to 0 or ''
=> You will get a warning
c. Turn on OPACPrivacy and set the privacy to 2 (Never) for at least 1 patron
Turn off OPACPrivacy
=> You will get a warning
d. In all other cases you will get no error

2/ Test the interface
a. Turn on OPACPrivacy and set the privacy to 2 (Never) for a patron
b. Now you can turn off OPACPrivacy or keep it on, behavior should be
the same
c. check an item out the patron
d. Check the item in using the check out table
=> fail
e. Check the item in using the Check in tab
=> fail (not gracefully).

Note that the software error could appear on other pages too.

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

Updatedatabase works as described
On staff, if don't have correct settings for anonymity it's
impossible to check-in (with OPACPrivacy on)
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-07-07 14:52:32 -03:00
Jonathan Druart
734a6805c8 Bug 13014: Notify budget owner on new suggestion - UT
When a suggestion is created and linked to a fund, a mail will be
generated, using a cronjob, to notify the budget owner.

A suggestion is considered as "can be treated" if its status is "ASKED".

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-24 11:39:40 -03:00
cb44a8de3a Bug 14439: Typo in Bug 14408 regexp
In Bug 14408 first patch, the regexp used needs an escape on dot and does not need an ending "?"

Test plan :
  - prove t/db_dependent/Auth.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-24 10:53:25 -03:00
Jonathan Druart
64e47c63dc Bug 14408: Allow integers in template paths
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:44:58 -03:00
5a7f459290 Bug 14408: Path Traversal error
Counter counter patch
Please test well, including with the null byte %00, this uses a whitelisting to only allow files ending with .tt
and not allowing ../etc

Note the previous patch tries to protect against /etc/passwd
but //etc/passwd is now vulnerable.  I do think a whitelist is safer than trying to do a blacklist

/cgi-bin/koha/svc/virtualshelves/search
/cgi-bin/koha/svc/members/search

Are vulnerable

To test:
1/ Hit /cgi-bin/koha/svc/members/search?template_path=members/tables/members_results.tt
  Notice you get a valid JSON response
2/ Hit
/search?template_path=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd
  (You may have add more ..%2f or remove them to get the correct path)
  Notice you can see the contents of the /etc/passwd file
3/ Hit
/cgi-bin/koha/svc/members/search?template_path=test%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd
4/ Apply patch
5/ Hit the first url again, notice it still works
6/ Hit the second url notice it now errors with a file not found
7/ Hit the third url notice it now errors with a file not found

Repeat for the other script also

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:44:47 -03:00
f4a2471848 Bug 14383: (QA followup) missing POD fix in C4/Branch.pm
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:43:21 -03:00
Jonathan Druart
40d7ab4895 Bug 14383: Fix POD error in C4/Ratings.pm
perl -e "use Pod::Checker;podchecker('C4/Ratings.pm');"

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:47 -03:00
Stefan Weil
64925f7522 Bug 14383: C4: Fix some typos (mostly in comments and documentation)
Most of them were found and fixed using codespell.
Fix also some related grammar issues.

In C4/Serials.pm a variable was renamed to make future codespelling
checks easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

http://bugs.koha-community.org/show_bug.cgi?id=14383
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-06-22 17:34:45 -03:00
Bernardo Gonzalez Kriegel
b9c4061479 Bug 12616: Locale in subscriptions not preselecting correctly
There is a problem if a language is present but
don't have ISO639-2 code. Locale pulldown on serial
suscription is malformed.

To reproduce on master:
a) remove some entries on language_rfc4646_to_iso639
b) go to Serials > New suscription
c) Put any value on Vendor and record, press Next>>
d) Look at locale pulldown, it must default to last
removed lang from a), also other langs has no value
and are also 'selected' on html

To test:
1) Reproduce the problem
2) Apply the patch
3) Add New suscription, pulldown must be fixed

NOTE: Deleted Urdu and Chinese.
      Master had both "selected" in the HTML.
      Applied patch, neither were added.
      Defaults to first item, which is blank meaning English.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-22 11:52:35 -03:00
Jonathan Druart
9ed3d83dcb Bug 10063: Remove outdated FIXME
Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-22 11:09:19 -03:00
Katrin Fischer
307f7a064c Bug 10063: Correct documentation of C4::Members::IsMemberBlocked
Rephrased documentation a bit, replacing fine days with the
more general term restriction. As IsDebarred checks for existing
active restrictions.

TEST PLAN
---------
1) apply patch
2) git diff origin/master
   -- do the changes make sense
3) perldoc C4::Members
   -- look for the IsMemberBlocked.
   -- Does it reflect current state
4) koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
2015-06-22 11:09:19 -03:00