Commit graph

3830 commits

Author SHA1 Message Date
377b2fd673 Bug 7722 - Insidious problem with searching
I cannot find the root cause of this issue, but multiple libraries that I am aware of have problems searching on particular search terms ( and never the same terms at the same library ). The error they get when they trigger this problem is:

Tag "" is not a valid tag. at /home/koha/kohaclone/C4/Biblio.pm line 1849

Something somewhere is adding empty keys to C4::Context->marcfromkohafield, I think it may have something to do with the analytics feature that was added.

In the while loop for TransformKohaToMarc, there is a line

next unless my $dtm = $db_to_marc->{''}->{$name};

I don't think it's working.
If I dump $dtm, for each search, I see the dump twice.
It looks like this:
$VAR1 = [
           '952',
           'w'
         ];
 $VAR1 = [];
I think the second time, when it is empty is what's breaking this.
The next never fails because even though it is empty, it is still a valid arrayref.

The solution I have some up with is to skip over the elements where the arrayref is empty.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-15 16:08:51 +02:00
b04899bafd Bug 7641 - Followup - Suspend Until not set on by suspend button.
For request.pl, there are two ways to suspend a reserve, either
by using the 'suspend' button for an individual reserve, or by
using the 'Update hold(s)' button with suspend until dates set.

If the 'suspend' button is used, any date in the 'suspend until'
field is ignored. This commit fixes this issue.

  * Add suspend_until date to suspend button link via jquery
  * Add optional date to ToggleSuspend()
  * Add KohaDates plugin where necessary

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, tested:
* suspend all holds from circ.pl
* suspend one hold from circ.pl
* suspend all holds from moremember.pl
* suspend one hold from moremember.pl
   --- NOTE: clicking suspend all holds without setting a date will mean the holds must be manually unsuspended. I'm not sure this is intentional?
* suspend a specific hold using the in-table button on reserves
* suspend a specific hold using the "update hold" button

500 error is gone.

http://bugs.koha-community.org/show_bug.cgi?id=8084
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-15 15:48:12 +02:00
Marc Veron
fbc309bdde Bug 8019 - Preserve language choice between Browser sessions
Language choice in Opac an Staff client was not preserved between Browser sessions.
Changed expiry date of cookie 'KohaOpacLanguage' from '' (= expire after session) to '+3y' (3 years from now)

To test:
- In a multilingual Koha istallation, choose a language.
- Log out, close all Browser instances. Go to login screen. Login should show up in same language as before.
- Repeat with other languages.

	modified:   C4/Templates.pm

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 18:37:56 +02:00
Ian Walls
f61a961718 Bug 5549 followup: fix suspension in days further
Grace periods are now measured in the same unit as the loan.

Suspension in days works explicitly in days, independent of unit.  Since
the 'deltadays' duration is actually the duration, possibly in hours, between
when the material was due and when it's returned, we need to take the finedays
factor (how many days per unit overdue) and multiple it by 24 if the unit is
hourly.

Example: a 1 hour loan material with 1 hour grace period and finedays = 2,
returned 2 hours late would give 4 days suspension

To test:
1.  create some circ rules:
  A) an hourly loan rule with suspension in days
  B) an hourly loan rule with suspension in days and a grace period
  C) a daily loan rule with suspension in days
  D) a daily loan rule with suspension in days and a grace period
2.  Check out 2 materials under each rule.  We'll call these A1-D1
and A2-D2 (to associate with the rule)
3.  Return A1-D1 late, but within the grace period for B1 and D1 as appropriate
4.  Return A2-D2 late, after the grace periods

You should get:

A1: suspended for (#hours late) * (#suspensionindays) days
B1: not suspended
C1: suspended for (#days late) * (#suspensionindays) days
D1: not suspended

A2: suspended for (#hours late) * (#suspensionindays) days
B2: suspended for (#hours late) * (#suspensionindays) days
C2: suspended for (#days late) * (#suspensionindays) days
D2: suspended for (#days late) * (#suspensionindays) days

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 18:15:54 +02:00
Paul Poulain
a598b10061 Merge remote-tracking branch 'origin/new/bug_7178' 2012-05-14 16:18:46 +02:00
Julian Maurice
7a81b89357 Bug 7178: Follow-up Improve order item creation
Move SQL code from Perl script to Perl module
Replace SHOW COLUMNS by $dbh->column_info()
Update total on neworderempty.pl when adding or deleting items

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested ok for ordering and receiving items.
Total updated correctly.

Note: There are lots of errors in the logs before and after applying
the patch. A follow up is needed.
2012-05-14 16:16:13 +02:00
Colin Campbell
78938e685c Bug 6335 Set branch in sip session
The server returns its branch as the institution in the config file
However in transactions it will default to the homebranch of the
sip user which may not be consistent with that. Needs to set branch
in the session if there is a value in config otherwise statistics and
behaviour can be wrong (esp in discharge)

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-11 11:15:06 +02:00
Chris Hall
24213703d5 Bug 7249 : Allow reports to be called through a restful interface
Hands back JSON, and supports caching

Squashed commit of the following:

commit 5c93506079738b9a13139417d3a0734289a4b007
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 15:41:14 2011 +1300

    Fixed bugs when creating reports, added more user friendly input and
    feedback

commit c62430bb358ee4af6ee5331b4d3a2ed67f723032
Author: Chris Hall <chrish@catalyst.net.nz>
Date:   Mon Nov 21 12:00:27 2011 +1300

    Added caching to intranet report webservices, added cache expiry and public
    options to reports

commit 2d89f0777d95b26bf08635782070b6367d0698f3
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 20:29:26 2011 +1300

    Working on caching for services

commit e0511f180cebd81747858ad776433fe3a1cf6854
Author: Chris Cormack <chris@bigballofwax.co.nz>
Date:   Wed Nov 9 08:28:26 2011 +1300

    Starting work on webservices

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch includes database update adding 2 new fields to the saved_sql table.

1) Checked that adding/deleting/editing of sql reports still works and new
fields are correctly saved to the database.

2) The saved reports page now lists the new fields correctly.

3) Checking URLs with JSON output
- if report is not public http://localhost/cgi-bin/koha/svc/report?id=2 fails,
but http://localhost:8080/cgi-bin/koha/svc/report?id=2 works
- if report is public, both links work

4) Checking results are cached
Created a report listing my borrowers, setting caching to 60 seconds and
added new borrowers before doing following tests.
- URL doesn't show new borrower immediately - correct
- Turning off the usecache system preference updates data - correct
- Restarting memcached updates data '/etc/init.d/memcached restart' - correct
- Waiting until cache time runs out updates data - correct

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Retested the feature and renewing my sign-off.

There are some things that should be noted:
- currently there is a hardcoded limit of 10 results for the reports webservice
- reports with runtime parameters are currently not supported
2012-05-11 10:26:29 +02:00
Adrien Saurat
1ea7afdb57 Bug 8025: corrects the return of a zero value for authorised values
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-07 22:00:09 +02:00
Colin Campbell
49ba0df9e7 Fix typo in patch for bug 7849
$type declared twice effectively throwing away the returned value

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-30 14:12:43 +02:00
Elliott Davis
d06c231982 bug 7849 Instant Fine Calculation\n Adds functionality of calculate fines instantly. This is very important for Hourly loans becuase of a loophole from the cron.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 17:52:18 +02:00
Paul Poulain
90d13965d3 Revert "Bug 7785: Remove unused function columns() which uses a MySQLism."
This reverts commit 1c8df08aea.

See:
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7785#c5
and
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7975

This patch broke tools/import_borrowers.pl

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-19 10:21:58 +02:00
Katrin Fischer
bd1d643fad Bug 7958 - Batch Item Delete Fails
Adding back "use C4::Search;" in Items.pm fixes the problem.

I think this is probably related to the denesting efforts.

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-18 17:09:50 +02:00
Paul Poulain
367c4fb881 Merge remote-tracking branch 'origin/new/bug_7016' 2012-04-18 16:54:44 +02:00
Galen Charlton
dc1d934c8f bug 7016 further followup: clarify return of GetItemnumbersForBiblio
New function was actually returning an arrayref, so made
perldoc and function usage consistent.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-18 16:48:30 +02:00
Ian Walls
f84671dce9 Bug 7016 Followup: Add new GetItemnumberForBiblio subroutine
Adds a new subroutine in C4::Items, GetItemnumbersForBiblio, which takes a
single biblionumber, and returns an array of all the corresponding itemnumbers.

This patch also replaces the usage of get_itemnumbers_of in C4::Reserves::CanBookBeReserved
with this new subroutine, as the output is more consistent with what we were
lookng for (this is what fixes the bug issue).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2012-04-18 16:48:25 +02:00
Jonathan Druart
763d69732e Bug 7756: FIX send email for late orders
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
- sending claim mails works now
- claim counter is not increased when vendor has no email address

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-12 16:50:27 +02:00
Katrin Fischer
47fac215af Bug 7935: Introduce sys pref to control 'browse results' in OPAC
Patch introduces a new system preference "OpacBrowseResults" to control
the feature for browsing and paging through results shown on top of the
left menu on detail pages in OPAC.

Preference is activated by default and can be deactivated using the
system preference.

To test:
 - Check database update works correctly
 - Check that browsing and paging still works with after database update
 - Deactivate the feature by setting 'OpacBrowseResults' to 'Disable'
 - Check the feature does no longer show up in OPAC
 - Check that a new installation also has the system preference with correct default

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2012-04-10 15:26:37 +02:00
Paul Poulain
5d9c7dfe04 Bug 2505 follow-up: C4::Ris not ready for use strict;use warnings;
The patch pushed a few hours ago is a good 1st step in the right direction.
however, many things are still to do to have the script OK with strict/warning, so commenting them

Errors if you have them:

Global symbol "$utf" requires explicit package name at C4/Ris.pm line 111.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 350.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 350.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 353.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 363.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 389.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 431.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 438.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 439.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 440.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 441.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 442.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 443.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 464.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 465.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 466.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 479.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 480.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 483.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 484.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 485.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 501.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 505.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 527.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 530.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 539.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 540.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 556.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 557.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 561.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 562.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 578.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 579.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 583.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 584.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 613.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 614.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 629.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 630.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 645.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 646.
Global symbol "$intype" requires explicit package name at C4/Ris.pm line 674.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 706.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 707.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 707.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 710.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 715.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 721.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 725.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 729.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 730.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 730.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 731.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 734.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 735.
Global symbol "$protoyear" requires explicit package name at C4/Ris.pm line 738.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 772.
Global symbol "@kwsubfields" requires explicit package name at C4/Ris.pm line 776.
Global symbol "@kwsubfields" requires explicit package name at C4/Ris.pm line 779.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 789.
Global symbol "@notesubfields" requires explicit package name at C4/Ris.pm line 892.
Global symbol "@notesubfields" requires explicit package name at C4/Ris.pm line 895.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 901.
Global symbol "$marcprint" requires explicit package name at C4/Ris.pm line 935.
Global symbol "$utf" requires explicit package name at C4/Ris.pm line 962.
Global symbol "$uniout" requires explicit package name at C4/Ris.pm line 966.
C4/Ris.pm had compilation errors.
2012-04-10 15:08:47 +02:00
7eef4c8c70 Bug 5668 - Star ratings in the opac
patch applied to commit eb3dc448d2

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

Turned on star ratings in the opac on details and results
Searched for titles - saw the stars
Clicked on a title
Clicked on the stars
Clicked on the stars to change my rating
Logged out
Tried to click on stars
Logged in as different user
Rated items that were rated already and saw average change
Changed preference to show only on detail and repeated tests
Changed preference to now show stars

All above tests passed. Signing off.

Rebased 3-19-12 by Ian Walls

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 14:40:49 +02:00
Julian Maurice
680e92115f Bug 7807: [SIGNED-OFF] Fix call to GetSuggestionFromBiblionumber
This sub only takes one parameter

signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 11:57:29 +02:00
beb0678bfc Bug 2505 - enable Perl warnings in all modules and scripts
enable warnings, and correct perlcritic's 'Loop iterator is not lexical' errors in C4/Ris.pm

	modified:   C4/Ris.pm

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-10 11:29:33 +02:00
Dobrica Pavlinusic
abffe961f7 Bug 7847 - OPAC search dies with plack
This bug was uncovered by @mglavica during HackFest in Marseille
It also showed it's ugly head during my plack presentation there.

Following chang removes circural dependecy introduced by commit
b65efdaacaf77fb53fee479da7f2e990ba0adeed which is part of Bug 6027

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-06 18:14:27 +02:00
08cee791a7 Bug 7758 - Koha allowing LOST items to check out without alert
Adds a confirmation alert when issuing an item that has
been marked as lost.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes tests, works as advertiesd

Tested:
- checking out an item that is marked lost performs all usual lost operations
- checking out an item that is marked lost prompts for confirmation

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-06 18:08:17 +02:00
Magnus Enger
44ab1c531d Bug 7445 - Clicking on a tag gives "Language ... does not exist"
To test:
- Syspref QueryStemming = Try
- Install Norwegian bokmål:
  cd misc/translator/
  perl translate install nb-NO
- Go to Home › Administration › System Preferences > I18N/L10N
  and enable "Norsk bokmål(nb-NO)" for opaclanguages as well as
  setting opaclanguagesdisplay = Allow
- Make sure you have selected "Norsk bokmål" as the active language
  in the OPAC
- Find a record that has a tag (which does not contain any digits)
- Click on the tag and see that you get the error in the title of
  this bug
- Apply the patch
- Click on the tag again and the error should be gone

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Easy to test with a great test plan. Works nicely.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-06 17:49:35 +02:00
Srdjan
12ff7355bb bug_7613: OCLC Connexion gateway
svc/import_bib:
* takes POST request with parameters in url and MARC XML as DATA
* pushes MARC XML to an impoort bach queue of type 'webservice'
* returns status and imported record XML
* is a drop-in replacement for svc/new_bib

misc/cronjobs/import_webservice_batch.pl:
* a cron job for processing impoort bach queues of type 'webservice'
* batches can also be processed through the UI

misc/bin/connexion_import_daemon.pl:
* a daemon that listens for OCLC Connexion requests and is compliant
  with OCLC Gateway spec
* takes request with MARC XML
* takes import batch params from a config file and forwards the lot to
  svc/import_bib
* returns status

ImportBatches:
* Added new import batch type of 'webservice'
* Changed interface to AddImportBatch() - now it takes a hashref
* Replaced batch_type = 'batch' with
  batch_type IN ( 'batch', 'webservice' ) in some SELECTs

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
2012-04-06 17:26:20 +02:00
Paul Poulain
ef038b258e Merge remote-tracking branch 'origin/new/bug_7310' 2012-04-06 16:02:11 +02:00
a334fec190 7368 Followup for indentation in VirtualShelves.pm
Corrects some further indentation issues, removes last tab from file.
Related to report 7310.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2012-04-06 16:01:38 +02:00
Marc Balmer
1c8df08aea Bug 7785: Remove unused function columns() which uses a MySQLism.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-05 10:31:49 +02:00
Colin Campbell
ce046f9a73 Stop unnecessary warnings in get_language
Refactor code to be more idiomatic and clarify its intention was testing
undef against languages causing log warn was creating and assigning to
unnecessary variables calling accept_language with an undef is an
expensive way to get undef returned to the caller test we are asking it
a meabingful question use any rather than first ( we dont care about
firstness it should be unique anyway but it obscures the meaning of the
test ) split takes a pattern not a string

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

Having put my hands recently in this part of Koha code, I can confirm
that this patch fix log warnings, and add clarity and conciseness.

http://bugs.koha-community.org/show_bug.cgi?id=7874
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-04 18:33:11 +02:00
Paul Poulain
2bc542789f Merge remote-tracking branch 'origin/new/bug_7284' 2012-04-04 18:18:26 +02:00
MJ Ray
9d65f66536 bug 7284: fix package build problem, move BEGIN into new
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-04-04 18:18:12 +02:00
Dobrica Pavlinusic
d0b2d72e0b Bug 7766 - C4/Auth.pm: emit DEBUG output to STDERR
writing to STDOUT breaks plack when running with DEBUG=1

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-04 18:09:24 +02:00
Jonathan Druart
d76dbace5e Bug 7291: Adds new field aqbooksellers.deliverytime
New field deliverytime in aqbooksellers table. It is an estimated
delivery time for orders (in days).
You can set this delay on the supplier modification page.
It is used in the late orders search.

The order estimated date is the aqbasket.closedate +
aqbooksellers.deliverytime

If you set a delay, the query check if closedate <= today - delay

If you set a "delivery time from" and a "delivery time to", the query check if
$delivery_time_from <= aqbooksellers.deliverytime is not NULL and if
closedate + deliverytime >= $delivery_time_to
if there is not a time_to then $delivery_time_to = the current date.
2012-04-03 18:19:46 +02:00
Colin Campbell
32c5ef613d Use hour or day deltas to calculate overdue durations
If durations are calculated by subtraction they will use units
larger than those we care about and these are not convertable
to the smaller units we are attempting to enumerate
Use the appropriate delta methods to calculate theee fines

Adds a separate hours_between method to calendar
This should strictly be checking opening hours (of which
closed days are a special case) of the relevant branch
These need adding to branches

http://bugs.koha-community.org/show_bug.cgi?id=7852
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>

QA comment: renamed "days_minus_grace" variable to "units_minus_grace"
Also added POD to _get_chargeable_units

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-03 17:59:56 +02:00
Dobrica Pavlinusic
574f46fb19 Bug 7821 - fix C4::Templates::_current_language
Bareword "C4::Templates::_current_language" not allowed while "strict subs" in use at /home/oleonard/kohaclone/C4/XSLT.pm line 175.

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

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-04-02 11:33:17 +02:00
Paul Poulain
f9207da8f2 bug 7821 follow-up: escaping {} in regexp 2012-03-29 17:23:50 +02:00
Dobrica Pavlinusic
f91bd36399 Bug 7821 - {langcode} will be replaced with current interface language
This makes bug 4032 support multi-language Koha installation which is important
for some of Koha users.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
1) After update XSLT system preferences are set to 'default'. All views
(OPAC and staff, results and detail page) work and switching languages
selects the correct translated file.

2) Leaving empty works and normal views are used.

3) Putting in a single URL without placeholder works.

4) Putting in a URL with placeholder works. Created local directories
have to match the language codes.

NOTE: In order to make the URLs and patchs work, the Utils file needs to be
copied too.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-29 17:05:12 +02:00
Stéphane Delaune
df0a6a71d7 Bug 4032 XSLT systempreference takes a path to file rather than YesNo
Signed-off-by: Marijana Glavica <mglavica@ffzg.hr>

I am signing it off because it doesn't break anything and I will report
another bug for language issues described in my previous comment.

Removed MySQLism backquotes
2012-03-29 16:58:55 +02:00
Paul Poulain
0a44448bfb bug 7641 follow-up: remove some unconditionnal warns 2012-03-29 15:10:34 +02:00
f446b3d03d Bug 7641: Suspend Reserves
Adds the ability to suspend reserves. The new system preference
AutoResumeSuspendedHolds enables the ability to set a date for
a suspended hold to automatically be resumed.

When a hold is suspended, it will continue to increase in priority
as the holds above it are fulfilled. If the first holds in line
to be filled are suspended, the first non-suspened hold in line
will be used when an item can fulfill a hold that has been placed.

http://bugs.koha-community.org/show_bug.cgi?id=7641
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

Tested with the preference on and off:
1. placed several holds in the staff client
2. suspended some with a date
3. suspended some without a date
4. triggered hold message by checking in for hold with suspensions
5. the suspended hold was skipped as it should be
6. tested suspending holds in the OPAC w and w/out dates
7. ran the cron to clear suspensions with dates

All the above tests worked as expected. Signing off.
2012-03-29 14:37:49 +02:00
Jared Camins-Esakov
98c59fc357 Bug 7701: Error when sending serial alerts
Probably due to bug 6875, C4::Letters is no longer used by C4::Serials, so that
when SendAlerts is called (exactly when this happens is a mystery to me), you
will get an error. Adding a "require C4::Letters;" and prefixing SendAlerts to
C4::Letters:: should fix it.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch fixes the perl error. Steps to reproduce:

1) Create a subscription and set patron notification to "Routling list" -
this is necessary, so that a link to email notifications shows up in the OPAC.
2) Search for the serial record in the OPAC and click on the more details
view from the subscriptions tab. Subscribe to email notifications.
3) Go back into the serials module and receive and issue for the serial.
Before the patch a nasty perl error will be shown, after the patch
receiving works.

I couldn't confirm that the email was sent out with my setup, but this patch
certainly fixes serial receive.

[Update 2011-02-29] Fixed the typo and retested. Looks good, but couldn't check
if the mail was actually sent.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-29 11:13:04 +02:00
Jared Camins-Esakov
937480abe0 Bug 7617: Sort authority results by authid
Add the option of sorting authority search results by authid, and instruct the
FirstMatch and LastMatch linkers to use that sort order rather than the default
search order.

To test:
1. Install new Zebra authorities config
    etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml,
    etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl,
    etc/zebradb/marc_defs/marc21/authorities/record.abs, and
    etc/zebradb/marc_defs/unimarc/authorities/record.abs
2. Reindex authorities in Zebra
3. Set LinkerModule to FirstMatch or LastMatch
4. Add two identical authority records, and a bib record with a heading that
   matches them
5. Run misc/link_bibs_to_authorities.pl on that record
6. Confirm that the authid that's been inserted into subfield $9 of that
   heading is the first, if you selected FirstMatch, or last if you selected
   LastMatch

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I followed the test plan and checked that for "Last match" and "First match"
the correct authority was selected and linked to the record.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-29 11:04:58 +02:00
Paul Poulain
0486d0c6b7 Merge remote-tracking branch 'origin/new/bug_6199' 2012-03-28 17:54:55 +02:00
Robin Sheat
b96c8b7ffa Bug 6199 - allow bulkmarkimport.pl to remove duplicate barcodes
This adds the -dedupbarcode option that allows bulkmarkimport to erase
a barcode but keep the item of any items it finds with duplicate
barcodes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-28 17:30:54 +02:00
Paul Poulain
8271673722 bug 7470 follow-up, fix POD doc 2012-03-26 17:53:28 +02:00
Dobrica Pavlinusic
5ed65ad59f Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders
In current version of code, it gets initialized too late, so it produces
unitialized warnings for hidden fields (which is non-fatal) and breaks
generated JavaScript for AJAX value_builders (which is fatal)

This bug was introduced in ticket 6106 which is modification of 5955
which didn't have this particular problem.

Since then, this code moved to C4::Items because of de-nesting patches.

Test scenario:
1. define 952$i plugin: stocknumberam123.pl (this is ajax value_builder)
2. go to one of following pages and verify that plugin works:
	acqui/addorderiso2709.pl
	acqui/neworderempty.pl
	acqui/orderreceive.pl
	serials/serials-edit.pl

For stocknumberam123.pl plugin to work, you have to have at least
one item with stocknumber in format which this plugin expects:
capital letters, space, some number

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, thanks for the great test plan.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 16:18:54 +02:00
Jonathan Druart
f35a1cce68 Bug 7470: Babeltheque integration
3 features:
- adds social network information in search results
- adds babeltheque data in opac-detail
- adds social network links in opac-detail too (google+, twitter, mail
  and co.)
2012-03-26 14:24:04 +02:00
Juan Romay Sieira
020c095377 Bug 7263 - Determine maximum length of some fields or subfields when cataloguing a biblio or an item.
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-03-26 10:51:22 +02:00
Paul Poulain
d5542514d2 Merge remote-tracking branch 'catalyst/merged_5549' into new/bug_5549
Conflicts:
	installer/data/mysql/updatedatabase.pl
	members/moremember.pl
2012-03-22 17:34:26 +01:00