Commit graph

2378 commits

Author SHA1 Message Date
Joshua Ferraro
8f4f59a5bb 2433: Cannot apply manual credits with an item number
This patch changes the behavior so that you can enter in
a barcode instead of an itemnumber for the manual credit
and invoice screens. Also, the borrower's account page now
displays a link back to the item record if an item was
linked to the charge
2008-08-09 12:56:04 -05:00
Galen Charlton
d8da146e65 commented out unconditional warns
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 11:05:57 -05:00
Henri-Damien LAURENT
efc64f4424 Bug fix : use delete_field/insert_grouped_field rather than replace_with
replace_with maight have unexpected behaviour.
Has to test merge_authority.pl

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 11:05:55 -05:00
Henri-Damien LAURENT
ca8d24546e Bug Fixing merge_authority.pl
merge works on the fly now.
But for an obscure reason, merge_authority.pl fails to update database when lanched on command line.
Adding one table to LOCK for noZebra UPDATE in Biblio.pm
You should remove C4::Search from merg_authority.pl

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 11:05:53 -05:00
Chris Nighswonger
49adec80cb kohabug 2475 [2/2] Porting LCCN splitting code to Labels.pm
This patch corrects the csv field list processing alogrithm in two areas:

1. It adjusts the regexp to handle quoted fields with embedded spaces.
2. It adds descrimination for individual 952 subfields.

Documentation needs to be written for the label layout editor.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 08:05:00 -05:00
Chris Nighswonger
386aefb44c kohabug 2463 & 2464 Removing unlinked fields from label-edit-layout.pl
This patch removes unlinked fields from the 'Choose Order Of Text Fields to Print'
option on label-edit-layout.pl

It also adds code to make the 'Itemtype' field respect the item-level_itypes syspref.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 08:04:57 -05:00
Chris Nighswonger
154e5c96e1 kohabug 2475 [1/2] Porting LCCN splitting code to Labels.pm
This patch ports LCCN splitting code from Koha 2.2.9 to Koha 3.0
This algorithm has been ported just as it appears on some production
systems. LCCNs that do not split correctly should have a bug opened
and include an exact example so that the regexp's can be adjusted.

This patch also adds code to split DDCNs using the *loosest* possible
interpretation of DDCN rules. On the simple end, the DDCN split
algorithm will handle being passed just a Dewey call number.
However, there may be some unusually complex DDCNs that will not
split properly. These will need to have a bug submitted for them
including a specific example so that the regexp's can be adjusted.

The correct choice of splitting alogrithm is determimed by the
item level classification source (items.cn_source).

Documentation should be updated to reflect these changes. Please include
the bit about complex call numbers and the need of a bug report.

[LL Bug 26]

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-09 08:04:56 -05:00
Joshua Ferraro
5d01574d43 Bug 2410: Can't use string ("0") as an ARRAY ref while "strict refs" in use at detail.pl line 219
Thanks to HDL for your patch, I couldn't get it to apply so I did it manually

No change to documentation
2008-08-09 08:01:14 -05:00
Joshua Ferraro
85b59ff91d Partial fix for 2446: single word queries that were stopwords
weren't being striped out of the query
2008-08-08 14:09:52 -05:00
Chris Nighswonger
860f1f70e5 kohabug 2458 Disallowing non-SELECT SQL in reports module
This patch enforces SELECT-only SQL in the reports module.
It introduces code to check SQL in two places. The first is
when a save is attempted on a user constructed SQL statement.
If a non-SELECT SQL statement is entered, the user will be
presented with an error message and a button giving the
option of editing the SQL. The second is when any SQL is
executed. If execution of a non-SELECT SQL statement is
attempted, the user is presented with an error message and
instructed to delete that report as the SQL is invalid.

The second check is intended as a safety net as no non-SELECT
SQL should ever be saved.

It may be well to document the proper usage of the direct SQL
entry type report.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-08 10:52:34 -05:00
Chris Nighswonger
6e714ce442 kohabug 2427 Correcting C4::Items:: _koha_new_item to populate items.copynumber
The INSERT was missing the copynumber parameter. moredetail.pl was also not setting
the copyvol template variable. This patch corrects these issues so that the copynumber
is both inserted when a new item is created (including during a bulkmarcimport.pl run)
and displayed properly on moredetail.pl

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-08 06:10:26 -05:00
Galen Charlton
65e5919185 bug 2479: allow MARC21 bib 440 to link to authorities
Fixed overly-strict interpretation of OCLC practice
that prevented 440 series statement/added entries
from linking to the appropriate series authority
record.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 14:49:55 -05:00
Paul POULAIN
83a6382946 partial fix for #2471, (overdue notice sent twice)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 14:49:44 -05:00
5794bde204 Reformatting serials item edit screen to eliminate label truncation and give it additem-like layout. Also correcting some markup errors, both in the template and in markup generated by Biblio.pm. HDL: I assume this will be superceded at some point by an include, but wasn't sure if that would be in time for 3.0.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 10:49:06 -05:00
Joe Atzberger
49e4e7020d Patron import reform - bug 2287 - expanded error catching and feedback
This incorporates and extends the patch from MJ Ray attached to bug 2287.
Added feedback of up to 25 lines, including for errors at the Text::CSV
parsing level.  This allows feedback for problems than involve encoding.
Added link to download "starter" CSV file (with all the columns).

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 09:37:03 -05:00
Henri-Damien LAURENT
d7a56c856e Bug fixing : 2470 Serials forgetting library
Using default values for PrepareItemrecordDisplay
It changes Biblio.pm
Adding a hash with default values to PrepareItemrecordDisplay
Usunf that API in Serials.pm and serials-edit.pl

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 09:35:44 -05:00
Paul POULAIN
666023d88f bugfix for #2472
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-06 07:14:01 -05:00
Ryan Higgins
0c66ac6702 Final patch for serials planning bugs
This patch resolves bug 1580 and addresses the modification of firstacquidate as per hdl's comments.
I have also removed some useless javascript from subscription-detail, and just reported the number of
irregular issues there (previously  was reporting nothing since the js was broken).

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-05 07:31:24 -05:00
Galen Charlton
0bf4cdba9a bug 2459: fix module depedency error blocking SIP2
Ror a poorly understood (by me) reason, use of 'use
UNIVERSAL' and 'use C4::Auth' in the SIP2 code is resulting
in a compilation error, thus blocking SIP2 from working.

The error (prior to this patch) could be reproduced as follows:

cd C4/SIP
perl -I. -wc Sip/MsgType.pm
"get_session" is not exported by the C4::Auth module
Can't continue after import errors at /home/gmc/koha/dev/C4/VirtualShelves.pm
line 51
BEGIN failed--compilation aborted at /home/gmc/koha/dev/C4/VirtualShelves.pm
line 51.
Compilation failed in require at /home/gmc/koha/dev/C4/Auth.pm line 34.
BEGIN failed--compilation aborted at /home/gmc/koha/dev/C4/Auth.pm line 34.
Compilation failed in require at Sip/MsgType.pm line 21.
BEGIN failed--compilation aborted at Sip/MsgType.pm line 21.

or more minimally

perl -ce 'use UNIVERSAL; use C4::Auth;'

This patch works around the problem by making C4::Auth
and C4::VirtualShelves not import any symbols
from each other.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 15:26:54 -05:00
Chris Nighswonger
8bbef6380a kohabug 2456 Moving certain C4::VirtualShelves.pm subs from EXPORT
to EXPORT_OK and correcting associated syntax

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 15:26:52 -05:00
Chris Nighswonger
606f72b97a kohabug 2437 Corrects LIMIT offset algorithm
Because of a miscalculation in the offset algorithm, the LIMIT offset creeps
backwards by a magnitude for every page beyond page two. This patch corrects
the algorithm to behave as expected.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 15:26:51 -05:00
Chris Nighswonger
953a46a088 kohabug 2417 Removing hardcoded query limit from reports
This patch removes a hardcoded 'LIMIT 20' which was added to all report queries
thus limiting all reports to only the first twenty rows of applicable data. In
its place this patch introduces code to paginate through all applicable data,
regardless of how many rows are available. The code will also honor any user
defined 'LIMIT' in reports based on SQL entered directly by the user.

This patch also adds column labels to 'tab' and 'csv' files generated by reports.
NOTE: Only user defined 'LIMIT's apply to 'tab,' 'csv,' and 'text' files.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 15:26:50 -05:00
Chris Nighswonger
35b3df2e95 kohabug 1679 & 1680 Fixes date formatting in guided reports wizard
This patch corrects date formatting when defining dictionary definitions in the
guided reports wizard so that dates display according to syspref.

Date formating is also corrected in the report creation section of the guided
reports wizard.

It also corrects a javascript bug which caused some of the calander widgets not
to function properly.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 15:26:49 -05:00
Ryan Higgins
8393fb0a3a Serials planning: Update subscription edit to properly deal with date changes. ( patch 3 / 3 )
Previously subscription-add.pl allowed modification of 'firstacquidate', which changed
the subscription definition, but did not affect prediction.  This patch adds two fuctions
to Serials.pm to get/set the current expected issue date (note that all date calculations
in prediction patterns are based on the current expected date, and there's only one serial
issue per subscription in the 'expected' status at any time).  Subscription editing
now allows you to edit the next expected date, but not the first acqui date (unless you
haven't received any issues yet), thus allowing for adjustments in the prediction pattern.
This patch also updates fixes some discrepancies in irregularities / prediction display.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-08-04 08:04:49 -05:00
Galen Charlton
e37f6a385a bug 2423: actually ignore already-imported records
When recommiting a partially completed MARC
record batch, records that were already imported
(or had an error status) were being processed
again, leading to duplicate bibs.  Corrected
so that these records are actually ignored.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-31 23:01:40 -05:00
Marc Chantreux
f721d43fd9 C4::Context::import reloaded
the problem was a context was stored every time C4::Context was called.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-31 22:41:32 -05:00
Andrew Moore
a7118d4f48 Bug 1953 [6/6]: adding pod documentation for C4::Koha::displayServers
This method was not documented. I added some POD to it.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:45:24 -05:00
Andrew Moore
e674bbed0e Bug 1953 [5/6]: whitespace changes: perltidy.
ran perltidy on the whole method since I've rewritten most of it.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:45:23 -05:00
Andrew Moore
7d6eddf1ec Bug 1953 [4/6]: removing dead code from C4::Koha::displayServers
displayServers appears to have had old code in it that was no longer used. I'm removing it.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:45:22 -05:00
Andrew Moore
00ad2d7e69 Bug 1953 [3/6]: refactoring to remove superfluous where clause.
refactored the SQL query to remove a confusing and superfluous 'WHERE 1' clause.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:45:21 -05:00
Andrew Moore
9ecd632001 Bug 1953 [2/6]: refactoring SQL in C4::Koha::displayServers to use placeholders.
The SQL call in displayServers was not using placeholders, leaving itself open
to potential SQL injection attacks. I've rewritten it to use placeholders.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:45:20 -05:00
Chris Nighswonger
1baf6348cc kohabug 2404 This patch removes Image::Magick and adds GD
This patch removes Image::Magick as a dependency and replaces it with
the (much) lighter GD. Functionality of patronimage code has not changed with
this conversion.

Adding errorhandling for corrupted image file and link to return to moremember.pl when called from there

Added notes about supported image mime types.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:38:18 -05:00
Henri-Damien LAURENT
6f17553d9a Bug fixing : the link between serial and item wasnot used when editing an issue
table serialitems was not used when getting serialinformation.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:33:12 -05:00
Andrew Moore
8b679f8d81 Bug 1953: refactoring C4::Koha::get_itemtypeinfos_of to eliminate potential SQL injection
C4::Koha::get_itemtypeinfos_of was not using plceholders, opening itself up to
potential SQL injection attacks. This patch refactors it to use placeholders to
bind parameters.
I also had to extend C4::koha::get_infos_of to allow us to pass bind parameters into it.
I'm including a test module for C4::Koha::get_itemtypeinfos_of.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:11:18 -05:00
Andrew Moore
f64f8f98bb Bug 1953 [3/3]: documentation changes for C4::items::GetItemsForInventory
This patch corrects what appears to me to be a few defficiencies in the documentation
for C4::items::GetItemsForInventory. I noticed them while writing test methods for this sub.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:11:00 -05:00
Andrew Moore
22d9133268 Bug 1953 [2/3]: refactoring SQL in C4::Items::GetItemsForInventory to use placeholders
The SQL in C4::Items::GetItemsForInventory wasn't using placeholders and
bind parameters, possibly leaving itself open ot SQL injection attacks. This
patch changes that.
I've also incliuded a test module for C4::items::GetItemsForInventory.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:10:53 -05:00
Jesse Weaver
406dbcd39a kohabug 2379 When a borrower is added manually in Koha...
This checks that the enrolmentfee for a category both exists, and is greater than 0, avoiding a spurious charge.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:10:29 -05:00
Joe Atzberger
f1d9f78814 TZ - multiple timezone support
Support multiple timezones via Apache SetEnv.  See the perldoc for
admin/env_tz_test.pl on how to configure and test.  Minimal changes
to Context itself.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-27 06:05:09 -05:00
Joshua Ferraro
5c2ba65541 This patch fixes the OPAC view and holdability of items:
1. restores a check to itemtype.notforloan to set the norequests flag
2. changes improper boolean OR with AND for checking conditions of setting norequests
3. displays 'Not for loan' for item-level itypes when the itemtype is set to notforloan
4. restores items.notforloan values < 0 allowing holds (ordered items for instance)

We still need a notforhold flag set at the itemtype, and items level
2008-07-25 11:32:06 -05:00
Ryan Higgins
d431ebff93 Update CalcFine to obey maxFine systempreference.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-25 08:56:11 -05:00
Chris Nighswonger
af970db232 kohabug 2139 Fixes C4::Aquisition::NewOrder so that it saves the branchcode
&NewOrder did not save the branchcode posted with a new order. This patch adds that param.

Added code to select the branch the order is for in the branch dropdown list on
acqui/orderreceive.pl

Updating POD and tests

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 14:54:01 -05:00
Chris Nighswonger
542c54e067 kohabug 2392 Changing array dereferencing syntax
It appears that Perl 5.10 does not like ${@$foo}[0] but rather wants $foo->[0]
The latter is also much more readable. This patch makes the change.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:26:16 -05:00
Ryan Higgins
eeef609466 Remove 'Cash Refund' from manual invoice, as it calls a deprecated function. Change the code for 'forgiven' from 'F' to 'FOR', since 'F' is used for 'Fine' elsewhere in the code. Mark other subroutines as deprecated that utilize the accountoffsets table, since that functionality was lost somewhere in the 2.2 series, and half-using it breaks things.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:26:07 -05:00
Ryan Higgins
0411957f73 Update holdings sort to sort by items.enumchron if there's no serial record and the biblio.serial flag is set.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:26:02 -05:00
Andrew Moore
e78c7a5584 bug 1953 [2/2]: whitespace and documentation changes
perltidy and documentation enhancements.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:26:00 -05:00
Andrew Moore
551b95284e bug 1953 [1/2]: fixing SQL injection problem in C4::Context->preference
C4::Context->preference was not using placeholders and was potentially vulnerable to
a SQL injectin attack. This patch refactors the method to use placeholders.

Added some tests for C4::Context.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-24 11:25:58 -05:00
Chris Nighswonger
4d8963d9c9 Correcting C4::VirtualShelves::ShelfPossibleAction to handle the case where the staff user is the superlibrarian ($user == 0)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-23 06:49:53 -05:00
Chris Nighswonger
ed762eb989 Correcting bad session var that caused Lists link not to be displayed in anonymous sessions
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-23 06:49:51 -05:00
Chris Nighswonger
9971756a24 kohabug 2159 Improving "Lists" button list refreshes after adding/changing lists/shelves
Adding code to refresh "Lists" button lists display in OPAC masthead.inc

Adding javascript to force refresh of parent window to update "Lists" button menu

Adding query limits and ability to specify row count and offset in queries related to Virtualshelves.
Also added the ability to return total record counts for specified virtualshelves.

Adding C4::VirtualShelves::GetRecentShelves which returns a list of the most recently modified shelves for
a given set of parameters. This allows the user to be offered active private and open lists to add books
to in drop down menus while also allowing drop down menus to be limited to a reasonable length.
This also limits the shelves stored in the user's session to a fixed number. A further enhancement might
be to add a syspref to enable a staff member to define the limit. Currently it is hardcoded at 10 per
list type (private/public-open).

Adding pagination to list/shelf related screens

Moving refresh shelves code into C4::VirtualShelves::RefreshShelvesSummary and tidying up a bit

Correcting several inconsistancies in the shelves templates as well as handling shelf management on
the intranet side correctly.

Correcting "Add To:" drop-down list to show only lists the patron has permission to add to

Correcting a few C4::VirtualShelves::GetShelvesSummary API calls

Modifications for template consistancy

Breaking up a 1367 char line of javascript in opac-results.tmpl

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-22 15:48:13 -05:00
Chris Nighswonger
39d2d593c6 Allow anyone with superlibrarian permission to edit/delete public patron lists
Edit functions here are limited to renaming and changing the type. No one can view
a list except the list owner unless it is public.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-22 15:47:58 -05:00
Joe Atzberger
7c174930ac Bug 2279: TagsModeration effectiveness restored.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-22 15:45:04 -05:00
Joshua Ferraro
71e436504b Removes the Libraries facet if singleBranchMode is ON 2008-07-18 17:54:11 -05:00
Joe Atzberger
322fd538d0 Refine lateorders - error feedback, filter independence
Added error catching for bad user input on number of days.  I.E., if you
try to filter by "bAd", you now get an error message prompting for valid
digits.  Also I updated highlighting to use loop_context_vars.

Fixed filtering to work on either days, vendor or both.  Previously, if
you selected a number of days, you had to select a vendor or else got
empty results.  DOCUMENTATION NOTE: this supplies the expected behavior,
so specifying vendor is no longer required.

Changed filters form to GET method.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-18 13:23:51 -05:00
Ryan Higgins
d2ca343c71 Fix typo, which disabled receipt of non-periodic or unknown periodicity serials due to miscalculation of subscription end.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-18 13:22:30 -05:00
Ryan Higgins
5431e7eb3c Bug 2213 : First issue of serial was set to subscription start date instead of first issue date.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-18 13:22:29 -05:00
Jesse Weaver
1157ed9457 fix for bug 1551: Renewing doesn't move item...
This makes C4::Circulation::AddRenewal update lastreneweddate, then has circulation.pl check today's date against issuedate or lastreneweddate. It also cl
eans up a little parenthesis spacing.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-16 18:26:16 -05:00
68297d9480 Fix to the Carp handling when we have a fatal cant connect to the database error
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-14 20:02:12 -05:00
Joshua Ferraro
52145c1589 Fix for bug 2115: OpacMaintenance wasn't working 2008-07-14 11:01:44 -05:00
Joshua Ferraro
9b41cf3b3e Fix for 2184 2008-07-14 08:39:14 -05:00
60d585aed6 Hide User Tags link when TagsEnabled preference is turned off. Change to Auth.pm allows TagsEnabled preference to work on login screens.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-12 08:59:39 -05:00
Chris Nighswonger
1d9d3cbcbe Further fixes to Labels.pm including escaping '(' and ')' for the PDF distiller
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-12 08:59:36 -05:00
Ryan Higgins
87a8103c48 Further update to allow notforloan < 0 items to be placed on hold. This is a workaround for the lack of a notforhold flag.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 15:40:06 -05:00
Ryan Higgins
a8d2b44a4c Allow holds to be placed on items with notforloan set as a negative value. See http://wiki.koha.org/doku.php?id=en:development:kohastatuses
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 15:31:24 -05:00
Joshua Ferraro
4ebc1ff3b2 Fallout from removing Date.pm, two places still used it 2008-07-10 12:06:37 -05:00
Chris Nighswonger
d38c4b7f6e Correcting text wrapping on labels
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:45:25 -05:00
Andrew Moore
15ca4bd8fa bug 2284: ModMember can erase the dateofbirth field
patch to C4::Members::ModMember to prevent it from deleting the dateofbirth field when none is supplied.

I also added a KohaTest::random_date method to help generate randomish dates for the test suite.
Added some tests for Member::ModMember. This is an easy method to test, and this bug shows that it
could use some closer examiniation.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:40:46 -05:00
Joe Atzberger
31ef440741 Bugfix pagination_bar to work with only one param/value pair.
A valid test of this patch is this command:
perl -MC4::Output -e 'print pagination_bar("my/script?query=foobar",5,2,"page"),"\n";'

The output before patch begins:
	&nbsp;<a href="my/script?query=foobar?page=1" rel="start">&lt;&lt;</a>
and AFTER patch:
	&nbsp;<a href="my/script?query=foobar&amp;page=1" rel="start">&lt;&lt;</a>

The double "?" in QUERY_STRING are now avoided.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:11:44 -05:00
Paul POULAIN
245e610e82 useless line that generates zillions of "Useless use of a variable in void context" in apache logs
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:11:27 -05:00
Andrew Moore
66c420c3d0 bug 1980: updateing calls to SimpleSearch to limit number of things returned
C4::Search::SimpleSearch was alredy patched to let you pass in the number of results you want back.
These instances were not using the new API. This patch makes all calls to SimpleSearch specify a limit.

I improved the documentation of SimpleSearch a bit to include the third returned value.

I believe there's a bug in C4::Output::pagination_bar, in that it doesn't deal well with URLs
with only one pair of parameter=value passed to it. I'm getting around this by passing in a second
pair that does nothing.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:11:24 -05:00
Andrew Moore
2e2bb0209d bug 2296: removing depreceated C4::Date module
The C4::Date module is deprecated. It is also no longer used anywhere in Koha.
This patch removes it and the associated tests.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:11:11 -05:00
Andrew Moore
4e6eb990a3 bug 2274 [5/5]: removing some warnings
running misc/cronjobs/overdue_notices.pl with warnings on has uncovered some warnings in
C4::Members. This patch eliminates them.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:10:53 -05:00
Andrew Moore
8ae66932cd Bug 2274 [3/5]: consolidating overdue notice cronjobs into one
This patch adds the misc/cronjobs/overdue_notices.pl script that is intended to replace
overduenotices.pl, overduenotices-30.pl and overduenotices-csv.pl. It adds messages to
the message_queue to be sent later (by process_message_queue.pl). It also marks borrowers
as debarred if their issues become too overdue.

It is intended to be run from cron nightly with usage something like:
0 2 * * * misc/cronjobs/overdue_notices.pl

C4::Members:
 - improved documentation on ModMember
 - made ModMember return a useful value (the return value of the database call)
 - added a DebarMember method
 - adding t/lib/KohaTest/Members/DebarMember.pm to test ModMember

misc/cronjobs/overdue_notices.pl
 - designed to replace overduenotices.pl, overduenotices-30.pl, and overduenotice-csv

Changes to C4::Letters:
 - EnqueueLetter now lets you pass in to_address and from_address which can override defaults
 - _send_message_by_email pays attention to these defaults.
 - now handles attachments with MIME::Lite

C4::Overdues
 - added GetBranchcodesWithOverdueRules
   - added t/lib/KohaTest/Overdues/GerBranchcodesWithOverdueRules.pm to test that.

circ/overdue.pl
 - replaced call to obsolete overduenotices-csv.pl with call to overdue_notices.pl

KohaTest:
 - added three helper methods: random_phone, random_email, random_ip
   - these can be used to populate example records
 - you can now pass an optional lengh to random_string

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:10:46 -05:00
Joshua Ferraro
6a5da19c17 Partial apply of a patch from Frederic, this ensures that
Context is cached; the remaining syspref cacheing will be
delayed until 3.2 as it needs to be paired with an as yet
unwritten setter for sysprefs
2008-07-08 18:19:58 -05:00
Joshua Ferraro
36f72775fe fix for 2322: Failure to reach amazon.com to retrieve enhanced content causes fatal error in Koha 2008-07-08 16:31:04 -05:00
Joshua Ferraro
1e45b14714 Prior to this patch, XSL and scan indexes conflicted.
This patch resolves the issue by passing $scan to the
searchResults function to toggle XSL for scan results
2008-07-08 15:59:09 -05:00
Joshua Ferraro
81ecfe67ce Fix for 2308: On-line help editing doesn't work 2008-07-08 15:22:28 -05:00
Galen Charlton
386b4b15a1 bug 2315: no crash if subfield code is a metacharacter
When generating the display form of a heading that
happens to (invalidly) have a regular expression
metacharacter as a subfield label, do not crash.

An example of such a heading field is:

  <datafield tag="650" ind1=" " ind2="0">
    <subfield code="a">Dalziel, Andrew (Fictitious character</subfield>
    <subfield code=")">xFiction.</subfield>
  </datafield>

The error message associated with the crash is:

  Unmatched ) in regex; marked by <-- HERE in m/) <-- HERE / at
  /home/koha-pro/kohaclone/C4/Heading/MARC21.pm line 220.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-08 09:36:11 -05:00
Andrew Moore
86239ea689 bug 2275: making SMS::Send module optional
I wrapped the use of the SMS::Send module in an eval to make failures graceful if it
is not present.
I also fixed an error with the number of tests in the SMS::Send tests.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-04 09:22:27 -05:00
Joe Atzberger
46a43c0a93 Barcodes - OO replacements, extensible module, tests.
This code is intended to replace current value_builder code in 3.2, but
it does not affect it directly (yet) and is safe to include in 3.0.
This structure will be used to handle more complicated formats, like those
with checkdigits.  Please note that "incremental" format is still STRONGLY
recommended because it will always perform the best, and most flexibly.
The desire to include other information (like branchcode) should compel
the proper use of the barcode generator to print the info ON the barcode,
not IN the barcode.

One of the nicer features of this structure is that you are able to
create a new barcode (of the same type) based on any previous Barcodes object.
That means you can create an array of 51 consecutive barcodes like:
	my $x = C4::Barcodes->new('annual'); # for example
	my @set = ($x);
	for (1..50) {
		push @set, $x=$x->new;
	}
Importantly, this can happen without referencing the database after the
first constructor.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-04 09:22:22 -05:00
Galen Charlton
ed1cadcd3d bug 2297: improve ModBiblio() to avoid duplicate item fields
Prior to this patch, ModBiblio() would append
item tags from the previous version of the bib record
to the incoming bib record before saving the results,
even if the incoming bib record already has embedded
item tags.

For example, if a bib is retrieved using GetMarcBiblio() then
saved using ModBiblio(), the caller was obliged
to delete any item tags first to avoid duplication.

ModBiblio() now deletes item tags supplied in the
incoming MARC record.  This eliminates the possibility
of duplication, and removes any implication that
ModBiblio() can or should be used to modify item
records - ModItem() should be used for that.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-04 09:22:13 -05:00
Paul POULAIN
c50265d238 commenting warn
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-02 13:29:22 -05:00
Philippe Jaillon
4022ca8dd2 OAI package handle correctly unicode content
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-02 12:25:32 -05:00
Chris Nighswonger
4baae3370e Correcting mistyped var names and adding error trapping to C4::VirtualShelves::Page
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-26 05:51:29 -05:00
Andrew Moore
06720cd3cf bug: 2272 - remove warning from C4::Koha::getitemtypeimagedir
I changed getitemtypeimagedir to set a default on its argument so that it would not complain if not passed 'opac'.
I improved the documentation on the method.
I edited the t/icondirecotries.t test script to explicitly pass an argument to both getitemtypeimagedir calls.
 - and I adjusted one line of whitespace to make similar things look similar
I added a test module for C4::Koha
I added a test module for C4::Koha::getitemtypeimagedir.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:47:28 -05:00
Joe Atzberger (siptest
99efcf83f0 Interactive tests for SIP abstraction representation and Members.
The test for members is useful to compare against the SIP (ILS)
representation.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:45:30 -05:00
Joe Atzberger (siptest
3e7013d174 Bugfix Circulation, Expand ILS::Patron mapping.
ILS::Patron is where most of the intelligence for SIP's representation
is lodged.  Currently there is difficulty with C4::Members functions.
GetMemberDetails is required for the needed flags, but it returns
empty structure on bad barcodes, where it should be undef.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:45:29 -05:00
Galen Charlton
98f638bb14 bug 2254 [1/3]: fixed GetAuthType(); avoid crash
Improved C4::AuthoritiesMarc::GetAuthType() so that
it returns either a hashref (if the authority type exists)
or undef (if it does not exist).  The same
accessor should not be used to either return a single
value or all values of a settings list.  Note that
all existing clients of GetAuthType are expecting
either a single hashref or undef; none of them
expected the arrayref that could be returned by
the previous version of the accessor.

When BiblioAddsAuthorities is ON, addbiblio.pl
now checks the return value of GetAuthType and
no longer crashes as follows if the MARC framework
specifies an invalid authority type for a given subfield:

Can't coerce array into hash at .../cataloging/addbiblio.pl line 738.

No documentation changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:39:24 -05:00
Galen Charlton
c80b328aae clean up old-style calls to GetMemberDetails
GetMemberDetails() returns only one hashref now,
not two.  In all cases where the caller was
expecting two output values, the $flags return
was ignored anyway.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:39:22 -05:00
Galen Charlton
3104120b13 POD fixes - C4/Members.pm
Corrected and improved the description of the
return values of GetMemberDetails.

Also fixed errors reported by the podcorrectness
test.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:39:21 -05:00
Galen Charlton
d79f050ce3 bug 2252: item-level hold not waiting until priority = 0
When returning an item that has an item-level hold on it,
CheckReserves() will not consider it waiting unless the
priority has been set to 0 (i.e., the item has specifically
been marked as filling the request.)

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:39:20 -05:00
Galen Charlton
98e2db8278 bug 2273: not-for-loan item should not fill hold request
If an item is not for loan (i.e., items.notforloan is not null),
do not use it to fill a title-level hold request when
item is checked in.  Prior to this patch, a notforloan item
could fill a request - CheckReserves() was checking only
the item's item type's not for loan flag.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:39:19 -05:00
Joshua Ferraro
66b2a15f13 fix for 1913: Remove opaclargeimage system preference 2008-06-20 18:38:10 -05:00
Andrew Moore
6bd827e546 bug: 2176 improvements to database upgrade path
This patch calls the new optional database SQL scripts to that sensible data is isntalled.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 17:47:36 -05:00
Galen Charlton
556538e101 bug 2248 [2/2]: import item status display in search results
The in transit status now displays as such in the
OPAC search results.  In the non-XSLT version, the status
is checked only for bibs having 20 or fewer items to avoid
extra hits on the database during result set presentation.
In the XSLT version, all items are checked.

Note that because an item's transfer status is not
stored in the MARC record, the transfer status
has no effect when limiting a search by item
availability.  For a future version, the transit status
should be added to the Zebra index.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 17:47:04 -05:00
Joshua Ferraro
56baa50ead fix for bug 1961: sprintf value needed in C4/Circulation.pm 2008-06-20 17:04:27 -05:00
Joshua Ferraro
7221f2374a patch from cnighs, fixing warn in Context.pm 2008-06-20 17:00:58 -05:00
Chris Nighswonger
14e2e4d540 bugfix for bug introduced by anonymous session code
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 16:48:51 -05:00
Ryan Higgins
f2feb68509 Bugfix 1417 : library was not being saved on order edits.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 14:34:59 -05:00
Galen Charlton
784316826c bug 1710 and 1739: availability for item-level holds
Fixed rules for determining whether an item is
available for an item-level hold request.  Create a
new function in C4::Reserves, IsAvailableForItemRequest(),
that checks whether an item is potentially available for
an item-level hold request.

An item is considered available if:

* it is not lost AND,
* it is not marked not for loan AND,
* it is not withdrawn AND,
* it is not damaged (unless the AllowHoldsOnDamagedItems syspref is ON), AND
* it is not on loan (unless the AllowOnShelfHolds syspref is ON)

Preventing a hold request on withdrawn items is bug 1739, as is
the new preference on whether to allow holds on damaged items.

Removing the condition that an item cannot be requested if
it has already been requested by another patron is the topic of bug 1710.

Note that this patch does not change the behavior where if
independent branches is on and the canreservefromotherbranches
syspref is off, a staff operator is prevented from placing
an item-level hold request on an item from a different branch.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 14:14:49 -05:00
Joshua Ferraro
cff92c0fd6 Fix for 2187: http_accept_language feature not working 2008-06-20 14:09:12 -05:00
Andrew Moore
4d0e0fec72 Bug 2176 (4/5): adding RSS feed for patron overdue alerts
opac-mymessages.pl and opac-mymessages.tmpl generate an RSS feed of a patron's messages from the message_queue.

Some more methods in C4::Letters to let us pluck out the right entries in the queue.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:53 -05:00
Andrew Moore
2cae4efa0a Bug 2176 (3/5): adding methods to manage message_queue, new advance_notices.pl, new C4::SMS module
I've added methods to to C4::Letters to manage the database table
message_queue. This will let us keep track of messages sent
via email, sms, and rss to patrons. That way, we can show the history,
deal with failures, and reconstruct an RSS feed when needed.

misc/cronjobs/overduenotics.pl has been added. It prepares advance notices
and item due notices and stages messages to be sent in the message_queue
table.

C4::Overdues::Getoverdues now takes two optional arguments to tell it how
old of overdues to fetch.

Also, a C4::Circualtion::getUpcomingDueIssues method was added that
advance_notices.pl uses.

misc/cronjobs/process_message_queue.pl has been added. It sends the email
or SMS messages out of the message queue.

The C4::SMS module didn't work at all, and it has been rebuilt to use
an external perl module from CPAN, SMS::Send.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:52 -05:00
Andrew Moore
401c84cc09 Bug 2176 (2/5): adding patron interface to update messaging preferences
This patch allows patrons to update their messaging preferences. This
includes methods in C4::Members to manage patron messaging preferences.

added cgi script to allow patron to edit their messaging preferences

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:50 -05:00
Andrew Moore
3c547de448 refactor C4::Auth::get_template_and_user for readability
I'd like to add another template parameter to geta_template_and user, but found it diffiult due to unreadability.

I stanadardized the whitespace in a portion of get_template_and_user,
alphabetized the parameters, finding a duplicate in one spot,
and then extracted the common template parameters that are set the same
regardless of template type.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:48 -05:00
Chris Nighswonger
3cb7a9ac28 kohabug 2238 This patch allows patrons to add books to public open/free lists whether they are logged in or not.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 12:48:11 -05:00
Chris Nighswonger
813f4ae9d1 kohabug 1873 Fixes shelves.pl so that the date is displayed in the 'date added' column of the virtual shelf contents
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 12:48:01 -05:00
Chris Nighswonger
3d377cd7c1 kohabug 1875 Public lists/virtualshelves are displayed and viewable whether a patron is logged in or not.
NOTE: This patch introduces code which generates an anonymous session when a patron first browses to OPAC.
This anonymous session contains a minimal amount of information including the results of a query to discover
all public lists/shevles. When the user logs in, the anonymous session is cleared and a new session created
for that user.

kohabug 1875 - fix error when editing a patron record

C4::Auth::checkauth was not distinguishing between a
'userid' input from an OPAC or staff login form and
a 'userid' input from (e.g.,) the patron editor.
Consequently, adding or editing a patron record would
result in Koha trying to log in as the new patron.

To resolve this, added a hidden input to all login
forms, 'koha_login_context', to explicitly signal
when a login is occurring.  The value of this input
can be 'opac', 'intranet', or 'sco' - the value is
not used at present, but may be of use later.

C4::Auth - added debug flag to two warns

kohabug 1875 - create anonymous sessions only for OPAC

No need to create an anonymous session for the intranet.

set yuipath correct for login pages

When preparing the template parameters for a login form,
C4::Auth was overriding the value of yuipath set
by C4::Output::gettemplate(), thus causing 404 errors
if the 'yuipath' syspref was set to 'local'.

kohabug 1875 - avoid warns viewing lists anonymously

During an anonymous OPAC session, the $loggedinuser variable
is not set.  As the undefined value causes warns in
C4::VirtualShelves::Page::shelfpage, for the purpose of the
shelfpage call the loggedinuser is set to -1, which should
not correspond to any real borrower number.

This is admittedly a hack to avoid digging through all
of C4::VirtualShelves to deal with lists viewed anonymously.

kohabug 1875 Refactoring of &ModShelf to avoid overwriting list owner needlessly

kohabug 1875 Avoid warning if can't find owner of shelf

Since virtualshelves.owner is not a true FK of borrowersnumber.number,
set ownername to '' if can't find the patron

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 12:44:27 -05:00
paul
87dea9cb0e just doing a <= / >= instead of a < / > in history search.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 08:48:31 -05:00
Galen Charlton
2ba08ac59a bug 2000 - remove base64 functions from C4::Koha
With the removal of admin/finesrules.pl and admin/issuingrules.pl,
the functions str_to_base64() and base64_to_str() in C4::Koha
are no longer used.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 08:19:11 -05:00
Galen Charlton
211defee52 bug 2000 - changes to TooMany()
The C4::Circulation::TooMany() function, which determines
if a patron is at the maximum loan limit, has been
changed to work as follows:

1. Checks the issuing rule that would apply to the
   prospective loan to see if a loan limit (maxissueqty)
   has been set.
2. Counts the number of loans that the patron has
   that would fall under that loan rule.

IMPORTANT: that means that if a specific loan rule
exists for the branch, patron category, and item type
in question, *only* that rule's maxissueqty will be
checked here - it will not go on to check whether
a less specific rule has a lower loan limit.

3. If adding one more loan would bring that count
   over the limit, returns a "too many" error.
4. If the loan hasn't exceeded a specific limit, checks
   whether a branch/patron category circ rule has
   specified a loan limit, regardless of item type.
   If the patron has already reached *that* limit, returns
   the "too many" error.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 08:19:08 -05:00
Galen Charlton
95889857c7 bug 2000 - add C4::Circulation::GetBranchBorrowerCircRule
This routine retrieves the branch/patron category circulation
rules for a given branch and patron category.  The return
value is a hashref containing the following key:

maxissueqty - maximum number of loans across all item types

This will first check for a specific branch and
category match from branch_borrower_circ_rules.

If no rule is found, it will then check default_branch_circ_rules
(same branch, default category).  If no rule is found,
it will then check default_borrower_circ_rules (default
branch, same category), then failing that, default_circ_rules
(default branch, default category).

If no rule has been found in the database, it will default to
the built in rule:

maxissueqty - undef

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 08:19:06 -05:00
Galen Charlton
9f2c77a686 bug 2000 - fix order of issuingrule lookup
Extended help on the alternate circulation rules
form to list the order of issuingrules lookup as
follows:

same library, same patron type, same item type</li>
same library, same patron type, default item type</li>
same library, default patron type, same item type</li>
same library, default patron type, default item type</li>
default library, same patron type, same item type</li>
default library, same patron type, default item type</li>
default library, default patron type, same item type</li>
default library, default patron type, default item type</li>

This includes modifying two routines in C4::Circulation to
follow this order: GetLoanLength() and GetIssuingRule().

The reason for this change is to have Koha exhaust all issuingrules
possibilities for a branch before checking the rules for
the default branch - this is consistent with what an admin
might expect from looking at the issuingrules forms, which display
settings a branch at a time, and is more consistent with how
circulation rules should work for indepdendent branches.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 08:19:03 -05:00
Joe Atzberger (siptest
5aecb46ad0 SIP - Lots of regexp hacking of input streams and verbose debugging feedback.
The basic problem is that the SIP logic doesn't know where the
input is coming from.  It might be a RAW socket, and it might
be telnet.  If it is telnet, although the specs declare a
character set (from MS, unfortunately), they do not specify a telnet
implementation.  So you might get telnet handshaking or
renegotiations in the middle of an otherwise peaceful session and
these should not be taken as SIP commands.  Patches include a move
towards using $CRLF from Socket to avoid problems w/ foreign platform
mapping \n and \r to \015 or \012.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 06:12:42 -05:00
Galen Charlton
ce1fbe0785 bug 2252 - check correct items for item-specific holds
C4::Reserves::_Findgroupreserves(), instead of
getting all requests for a bib, now gets only the
requests that are title-level (itemnumber is null)
or for that specific item.  This prevents an item
from filling an item-level hold for a different item
attached to the same bib, which is the expected
behavior for item-level holds.

[LL Bug 22]

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-17 13:09:41 -05:00
Joe Atzberger
ac9c6f004d Bugfix LDAP config to play nice with Zebra.
The section in KOHA_CONF was moved inside <config> and renamed
<ldapserver>.  Perldoc updated to correspond.  Tested with local
LDAP and existing test (t/db_dependent/Auth_with_ldap.t).
Patch can be applied with confidence based on comparison of 2 dumps:
perl -e 'use C4::Context; use Data::Dumper; my $context=C4::Context->new("./old_config.xml"); print Dumper ($context->{server}->{ldapserver}),"\n";'
 and
perl -e 'use C4::Context; use Data::Dumper; my $context=C4::Context->new("./new_config.xml"); print Dumper (C4::Context->config("ldapserver")),"\n";'
These dumps reflect the way Auth_with_ldap accesses configuration info before and after.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-16 15:37:13 -05:00
Galen Charlton
3c7172f7f5 bug 2247: don't crash linking bib heading with invalid subfield
Prevent following crash when linking a bib heading to an
authority record if the bib heading has a subfield whose code
is ')' or any other regular expression metacharacter:

Unmatched ) in regex; marked by <-- HERE in m/) <-- HERE / at
/home/koha-pro/kohaclone/C4/Heading/MARC21.pm line 186.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-16 10:24:27 -05:00
Ryan Higgins
3675d88035 Fix upgrade-child: could not update child unless guarantor was defined. Also, limit upgrade path to C -> A .
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-12 16:36:50 -05:00
Joe Atzberger
e70e3bcd6d Change order of checks, and avoid warnings if args undef (i.e. anonymous login).
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-12 12:09:24 -05:00
Galen Charlton
0fa1de926f kohabug 2112 - add indicators to MARC display
In any MARC record display in the OPAC or staff client
that displays the MARC tag numbers, the indicators are
now displayed as well, following the tag number.  If an
indicator is a blank, it is displayed as '#'.

Add a function to C4::Koha, display_marc_indicators(), to
generate this display form of the indicators.

Refactoring note: the four scripts changed in this commit
have a lot of duplicate code that could be merged into
a MARC displayer class.

Documentation notes: screenshots of tagged MARC record
displays should be updated.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-12 11:17:44 -05:00
Galen Charlton
ee49d6d372 kohabug 2207 - improve indicator input in MARC editor
Instead of having one input field for both indicators
of a variable field, the bib and authority MARC editor
now has an input field for each indicator.  This has
two main advantages:

* it is easier to tell what the indicator values are,
  even when the first indicator is a space
* it is easier to set the first indicator to blank
  and the second indicator to non-blank.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-12 11:17:35 -05:00
Galen Charlton
e71cff9a92 bug 2235: fix various data-corrupting bugs in MARC editor
1. Non-ASCII characters in the 942$h (biblioitems.cn_class)
   would cause an edit to fail and lead to a corrupt MARC record in
   biblioitems.marc and biblioitems.marcxml.  Fixed by
   turning on Perl's UTF-8 flag for MARC tag parameters
   processed by C4::Biblio::TransformHtmlToMarc

2. Do not add empty 006 and 007 fields if the corresponding
   input fields are blank.

3. Make it possible to save '0' as a valid subfield
   value.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-10 12:59:44 -05:00
Galen Charlton
233a40f1d1 bug 2098: do not apply stemming if search term has digits
If a search contains a digit, it is almost certainly an identifier, and should
not be stemmed.  This is particularly relevant for ISBNs and ISSNs, which
can contain the letter "X" - for example, C4::Search::_build_stemmend_operand
would reduce "014100018X" to "x ", which for a MARC21 database would bring
up irrelevant results (e.g., "23 x 29 cm." from the 300$c).

With this patch, supplying a search term that contains one or more digits
followed by "X" will no longer retrieve irrelevant results.  This applies
to catalogs using Zebra and query stemming.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-10 08:22:18 -05:00
Joshua Ferraro
7304a2e89b Revert "Bug fixing : get_user_permissions SQL Fixing"
From Galen: because code is part of the join, there is in fact no ambiguity

This reverts commit 3a05ae40f6.
2008-06-09 09:53:23 -05:00
Henri-Damien LAURENT
3a05ae40f6 Bug fixing : get_user_permissions SQL Fixing
user_sub_permissions join introduced ambivalence for permissions field

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-09 06:51:05 -05:00
Henri-Damien LAURENT
00adf3d9af Bugfix : generating session id on some systems was not defined
Explicitly naming the method to generate id is required on some systems
(SUN 4)

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-09 06:51:02 -05:00
Galen Charlton
af14b082e4 kohabug 2225 - fix resource leak in SimpleSearch
Explicitly destroy ZOOM Query and ResultSet objects created
in C4::Search::SimpleSearch() - for long-running users
of SimpleSearch, such as link_bibs_to_authorities.pl or
the matcher used by the staging MARC import, the failure
to do this causes a memory leak in both the client Perl
script and (in the case of ZOOM ResultSet objects) a
corresponding resource leak in zebrasrv for the life
of the Z39.50 connection.

With this change, link_bibs_to_authorities.pl will be
be able to process large bib datasets without leaking
memory due to the Z39.50 lookups it does.

Similar changes are indicated for all uses of
ZOOM that could last longer than a single CGI
query.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-09 06:38:06 -05:00
Galen Charlton
d351753d4e kohabug 1993 - task scheduler improvements
[1] Removed hardcoded path to original developer's
    Koha configuration file; now checks KOHA_CONF.
[2] Now attempts to figure out if a task was successfully
    added to the task queue; if it wasn't, the failure
    is now reported in the  task scheduler page.
[3] When traveling to the task scheduler page from a
    saved report, the report in question is now
    selected by default.
[4] Removed the button to edit a queued task; this is
    not supported.

This patch is essentially a bandage; I've added a BUGS
section and some FIXMEs to the POD for C4::Scheduler
detailing some issues - a refactoring of the task
scheduler is in order at some point.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-09 06:38:03 -05:00
Chris Nighswonger
2b7cc53fd7 kohabug 1874 Adding variable assignment so that the confirm button is properly displayed in both Staff and OPAC
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-09 06:38:01 -05:00
Paul POULAIN
e1261ab7df BUGFIX: the language list was calculated on opaclanguage, whatever the interface
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:46:10 -05:00
Joe Atzberger (siptest
1a46bc1218 Interactive debugging aides for SIP abstraction layer.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:44 -05:00
Joe Atzberger (siptest
5f9a539104 Major SIP components reworked.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:43 -05:00
Joe Atzberger (siptest
56cf70e52d Expanded SIP config file.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:41 -05:00
Joe Atzberger (siptest
5671608e13 Object oriented module is not an Exporter.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:40 -05:00
Joe Atzberger (siptest
910e13c4ad Add debugging around readline.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:39 -05:00
Joe Atzberger (siptest
dd06b59fdc SIP tests for renew and renew_all.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:38 -05:00
Joe Atzberger (siptest
84ba43c32e Debugging util. script for SIP config XML.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:38 -05:00
Joe Atzberger (siptest
53576bbb19 Tweak verify_cksum.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:37 -05:00
Joe Atzberger (siptest
4c42971c6e SIP abstraction layer implementation for ILS, Items and Patrons.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:36 -05:00
Joe Atzberger (siptest
6750a1b250 Abstraction layer implementation for Transactions.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:35 -05:00
Joe Atzberger (siptest
3ca5e017bc Add check to resensitize sub.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:34 -05:00
Joe Atzberger (siptest
2cc75039d8 Object oriented module is not an Exporter. 2 subs added, also.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:31 -05:00
Joe Atzberger (siptest
ba673bcc43 Correct package name.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:30 -05:00
Joe Atzberger (siptest
926e6135e5 Object Oriented module is not an Exporter.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:28 -05:00
Joe Atzberger (siptest
9ddb0afc66 Add do_renew_all function, necessary for implementation.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:27 -05:00
Joe Atzberger (siptest
1d821fe51a Whitespace cleanup and one commented-out function added.
Verify with: git diff -w  C4/SIP/Sip/Configuration.pm

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:26 -05:00
Joe Atzberger (siptest
07e51faa9b Trivial POD revision.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:25 -05:00
Joe Atzberger (siptest
3f8e8e06f3 SIP/t - test files adapted, supplemented, expanded. Note: requires matching data to be loaded.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:24 -05:00
Joe Atzberger (siptest
b9b4c5f963 SIP/koha_test - remove duplicative tests
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:23 -05:00
Joe Atzberger
b687919fd1 Add Debug for warns and remove unnecessary middleman variables from returns.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:43:19 -05:00
Joe Atzberger
797c1d5502 Bugfix is_approved() to handle the 3-state nature of approval.
That is, a term is either approved, or rejected, or neither.
Without an external dictionary, most terms will fall into the
latter category.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-05 22:41:40 -05:00
Joe Atzberger
37c25f55b2 Restrict OPAC tags display to approved=>1.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-03 06:00:47 -05:00
Galen Charlton
8fc6b927df kohabug 2078 - send correct Content-type for search feeds
OPAC search RSS and ATOM feeds now have the correct
Content-type sent - "application/rss+xml" and "application/atom+xml",
respectively.

As part of this patch, added an optional fourth parameter
to C4::Output::output_html_with_http_headers to specify
the content type.  If that parameter is now supplied, or if
the value of the parameter does not contain at least a "/",
the default type of "text/html" is returned.

No documentation changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-03 05:59:54 -05:00
Galen Charlton
fe65447e5b OPACBaseURL - do not tack on :443 if using SSL
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-03 05:59:47 -05:00
Galen Charlton
5e5ce6b7f9 calculate OPACBaseURL instead of using syspref
Calculate OPACBaseURL from the
CGI environment variables instead of using the
system preference.  As a result of this patch,
it should be possible to change the hostname,
protocol, or port of the OPAC without having to
reset a system preference.

Also added a FIXME to opac/unapi - the URL of
the SRU/W server has no necessary relationship
to the URL of the OPAC.

Once this patch is confirmed, the syspref can
be removed.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-02 00:51:08 -05:00
Ryan Higgins
d8c4a8190e Remove a couple of warns.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-02 00:50:31 -05:00
ffbb7fb0d0 Fix for bug 2183, "Account tab needs spacing between description and stadard text" Please note that this is a band-aid for a larger issue, described in Bug 2188
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-31 21:59:52 -05:00
Joe Atzberger
97659a73ca FIXME added to note discrepancy.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-31 21:59:38 -05:00
Paul POULAIN
7ff55f6c40 BUGFIX issuingrules : total for all itemtype was not properly calculated
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 14:01:11 -05:00
Paul POULAIN
c01d0d65a1 small (UNIMARC) fix, error in regexp writing
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 11:49:37 -05:00
Mason James
90c25f0498 bug-2149, var fix - changing borr.cardnumber to borr.userid.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 11:13:02 -05:00
Mason James
b461a041d0 bug-2149, added new block to C4::Letters::SendAlerts() to email 'account creation' notice, and new block in memberentry.pl to call SendAlerts().
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 11:11:22 -05:00
Joe Atzberger
a5f90c7d68 Repair Labels code to accomodate patroncards. Purged EXPR.
Major FIXME's still remain, like the use of GET instead of POST.
The code is also a bit too INCLUDE-happy to net good performance.
The entire mechanism of adding to a batch should probably be proper
AJAX instead of the GET-centric opener.location approach.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 10:01:08 -05:00
c4072c8fe9 Fixing some typos, including, I believe, Bug 2174 ("spelling error in web installer")
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 10:01:07 -05:00
Joe Atzberger
fddba9685c minor cleanup, remove $sth->finish's. No documentation impact.
For details: see http://search.cpan.org/~timb/DBI-1.14/DBI.pm
"There's no need to call finish if you're about to destroy or re-execute the statement handle."
In all these cases the sth is falling out of scope, about to be destroyed.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 10:01:06 -05:00
Joe Atzberger
6d3a490c04 is_ajax function added. pagination_bar now intelligent: it has
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-30 08:52:02 -05:00
Joe Atzberger
a101cd2d82 Tags AJAX integration on OPAC details page, so it behaves like results.
Also, prevent duplicate tags (same user, biblio and term).  Strip
leading/trailing whitespace from term.  Block whitespace terms.
The CSS for details could be enhanced to emphasize tagstatus more.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:54 -05:00
Joe Atzberger
2ba8763bb4 Fines repair. Make fines2.pl work, give feedback, improve comments and perldoc.
Remove $dbh->disconnect statements as counterproductive.
Prevent description field from begining with whitespace.
Added robust debug elements.  Test script behavior with:
    perl misc/cronjobs/fines2.pl -v
and:
	mysql> select * from accountlines;

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:42 -05:00
Joe Atzberger
e0c1b0031b Adding basic get_filters to Tags, centralizing "counts" code for Terms Summary.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:41 -05:00
Joe Atzberger
a99164a3a1 Single FIXME comment inserted.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:39 -05:00
Joe Atzberger
f36b8fd59a Commented out fixaccounts (not used anywhere). Also improved getnextacctno.
You can test getnextacctno like:
	perl -e 'use C4::Accounts; print getnextacctno(33), "\n";'
where 33 is a borrowernumber out of the accountlines table.  Get that number like:
	mysql> select borrowernumber,accountno from accountlines LIMIT 100;

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:37 -05:00
Joe Atzberger
dca0e73aed Correct number of args to getnextacctno.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 07:04:35 -05:00
Joe Atzberger
1ebc373d18 Unescape Comment, now that we trust Scrubber to block bad markup.
Obviously if we are going to allow good markup, we can't then escape it.
Documentation reference: allowed tags for comments are:
	br b i em big small strong

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:30:51 -05:00
Joe Atzberger
bbb3f00955 Initial commit for Tags back-end moderation. Requires AJAX functions from Output.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:22:44 -05:00
Joe Atzberger
cbabfaaa5f New subs for moderation, fixed bug to allow multiple sort fields, added POD.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:22:43 -05:00
Joe Atzberger
ec5c3d0ee2 Add AJAX output sub, EXPORT_TAGS and enable loop_context_vars for HTML::Template::Pro.
The loop_context_vars will be very useful in display.  They are:
__first__, __last__, __inner__, __odd__, __counter__.
Note: apparently __even__ does not exist, so instead use something like:
<!-- TMPL_UNLESS NAME="__odd__" -->

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-29 06:22:41 -05:00
Paul POULAIN
c07939757f BUGFIXING authority link in detail.pl
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 07:37:20 -05:00
Ryan Higgins
302da68ce5 Fill statistics table properly for renewals; and issue->checkout, return->checkin
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 07:33:30 -05:00
Ryan Higgins
f924ff5fe7 add URLLinkText syspref to opac detail, and add some extra handling for MARC 21 urls.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 07:33:21 -05:00
1bf93a36db Facets (current) translatable via template
This patch allows to translate facets label with standart
templates / PO files. Facets are still hard coded in Koha.pm.
Template wait those hard coded facets: Topics, Places, Titles,
Autors and Libraries.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 07:26:31 -05:00
Andrew Moore
5838b70b06 removing warnings from C4::Members::GetMember
C4::Members::GetMember emitted a few unnecessary warnings when no $type was passed in. This patch prevents that.

No functional or documentation changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-27 06:52:17 -05:00
Galen Charlton
35ff682f6f minor POD improvement
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-19 16:07:07 -05:00
Joshua Ferraro
2a092b710b Fixing isbn regex to not match unless isbn is valid
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-19 13:12:18 -05:00
Joshua Ferraro
13bddb5818 Fixing Amazon.com Similar Items and Editions features
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-17 20:37:18 -05:00
Henri-Damien LAURENT
89fa713124 Bug Fixing : ModMember and memberentrygen.tmpl
Problem with ModMember : parameters were not passed safely
memberentrygen.tmpl deleted guarantorid for a children if step2 or step3 used fore edition.
Changeing TMPL_IF EXPR into TMPL_IF Name

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-16 08:21:09 -05:00
Galen Charlton
496b6c8ef4 bugfix - fix 'not' operator in NoZebra
Corrected bug that prevented the 'not' operator
from working consistently - i.e., a search of
'mice not men' would not always work.

Also added test cases for NoZebra, so far focusing on
NZanalyse and adding and deleting bibs.  A couple of
the test cases are currently known to fail and
therefore are marked TODO.  The tests in question
are to verify that rows in nozebra are removed if
no bib is linked to the relevant word.  However, it
looks like such rows are retained, just with
nozebra.biblionubmers set to ''.  Is there any
reason to keep these rows?

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-16 08:18:25 -05:00
Galen Charlton
c6d507f8a9 kohabug 2020 - fix infinite loop in NoZebra on Perl 5.10
When running Koha in NoZebra mode under Perl 5.10, a search
containing a operator (e.g., "mice and men") could cause
a bib search to enter into an infinite loop in NZanalyse.

This possibility arises from the fact that NZanalyse used
to use capture variables from regular expressions without
verifying whether the regular expressions actually matched.
It was compounded by the fact that NZanalyse is recursive;
however, because $1, $2, etc. are dynamically scoped,
*they are not automatically cleared when NZanalyse calls
itself*.

Consequently, if the search string contains a boolean
operator, it would be split into

left = mice
operator = and
right = men

Then NZanalyse would be called recursively on the search
string 'mice'.  However, because $1, $2, and $3 are not
automatically cleared when the function is called again,
and because they are not cleared if a match fails, the code
would fail to recognize that 'mice' is leaf, and would
call NZanalyse('mice') repeatedly, to the promotion of
warm server rooms.

The wrinkle in this is that because of a bug in Perl 5.8, a
failing matches can sometimes alter the capture variables, thus
avoiding the infinite recursion.  However,  this bug was fixed in
Perl 5.10, leading to the NZanalyse bug becoming evident.

The Perl bug is described at http://rt.perl.org/rt3/Public/Bug/Display.html?id=19049
and the fix http://public.activestate.com/cgi-bin/perlbrowse/p/29279.

The fix to the Koha code is to check whether each regexp
that uses capture variables matches or fails, then act
accordingly.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-16 08:18:24 -05:00
Andrew Moore
5d2fde5d58 Bug 1953: removing potential SQL injections from C4::Calendar::_init
This patch changes the 4 select statements in C4::Calendar::_init.
tests for this method were included in a previous patch.

There are more potential problems in C4::Calendar::delete_holiday, but that
method seems to have deeper bugs than just these. I'll open another bug for
them if I can figure out how it's supposed to work.

No documentation changes necessary.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:41:21 -05:00
Andrew Moore
c6d5b75d6d Bug 1953: adding tests and 2 corrections for C4::Calendar
In the course of writing tests for C4::Calendar, I found two bugs and am fixing them here.
One is a documentation bug.
The other prevented C4::Calendar::insert_exception_holiday from working. I was unable
to find anywhere else in the code that depended on the broken behaviour.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:41:20 -05:00
Galen Charlton
a7ba1bb941 kohabug 2105: prevent crash on IE7
Three scripts were incorrect setting the HTTP type
header to 'utf-8' instead of something appropriate
like 'text/html' - Firefox evidentally can ignore that
mistake, but IE7 does not.

Fixed by replacing an invalid print of the HTTP header
and template output with a call to
C4::Output::output_html_with_http_headers.

Also corrected POD in C4::Auth and InstallAuth to
reflect correct use of output_html_with_http_headers.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:40:36 -05:00
Galen Charlton
c1ae207d54 kohabug 1621 - add subtitle to main results and details pages
Including the subtitle in search results and OPAC and staff
details templates.  The subtitle is expected to be in the
MARC subfield that is mapped to the (now nonexistant) column
bibliosubtitle.subtitle.

This is a fairly hackish patch that is meant to be minimally
disruptive while allowing subtitles to be displayed for those
not using the experimental XSLT bib display feature.  It
does *not* cover all cases where you have a MARC
record and want to display its subtitle.

UNIMARC notes: at the moment, none of the fr-FR UNIMARC
frameworks appear to be map any subfields to bibliosubtitle.subtitle.
This could be changed, but caveat programmer: the UNIMARC 200$e
is repeatable (meaning that get_koha_field_from_marc will put in ' | '
between multiple subtitles) and one may want to also include the
200$d (parallel title).  A GetMarcSubtitle routine may be in order
if absolutely necessary.

This points to a long-term need to make display of MARC (and later, hopefully,
non-MARC) bib records more flexible - the XSLT feature is one approach;
there may be others.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:40:34 -05:00
Galen Charlton
472d77353e patron cleaning - do not delete staff borrowers
Adjusted C4::Members::GetBorrowersWhoHaveNotBorrowedSince so
that staff member records are not selected for deletion.

This functionality change is motivated by the consideration
that a staff member who is authorized to operate Koha is
not necessarily a prolific user of the library's services.
If a batch purge job for inactive staff records is really need,
it should be a separate tool.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:40:33 -05:00
Galen Charlton
b42b8da0d6 kohabug 1573 - properly count patrons to delete
When both the patron delete and patron anonymize checkboxes
were selected, the patron cleaning tool would not
properly register the number of patrons to delete.  Fixed
by correcting form input handling.

Also, count of patrons to delete or anonymous now correct
when running with IndependentBranches = ON.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 17:40:32 -05:00
Henri-Damien LAURENT
20b72f1253 Adding Optionnal suggestion creation when renewing subscription.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-13 16:45:07 -05:00
Henri-Damien LAURENT
f59c9706a4 change in yuipath management 1/2 Noupdatedatabase.pl
now yuipath is added in C4::Output and uses themelang
In my opinion, all the general variables that are used in output should get in C4::Output (since there is theme lang computed.)
rather than in C4::Auth

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 15:46:35 -05:00
Andrew Moore
56b9f5b882 bug 1953: fixing potential SQL injection problems in C4::Branch::GetBranches
I moved C4::Branch::GetBranches to use bind parameters and wrote some tests to demonstrate functionality.

No functional or documentation changes here.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 15:07:17 -05:00
Paul POULAIN
dfcdc73be6 bugfix : ship utf-8 encoding in mail header
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 10:07:55 -05:00
Henri-Damien LAURENT
9fb4a72122 Bug Fixing 1782 patch
Adding a new routine GetBorrowercategoryList in C4/Member
Displaying categoryname when listing categories in memberentrygen.pl
using categorytype returned with GetMember wherever it is possible.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:42:25 -05:00
Ryan Higgins
a9b7e08077 fix error on lastincrement.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:15 -05:00
Ryan Higgins
b54401ac66 C4::Circulation::FixOverduesOnReturn now handles dropbox mode.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:14 -05:00
Ryan Higgins
97f8b3abff Make dropbox mode obey Calendar module according to CircControl branch.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:13 -05:00
Ryan Higgins
a315de5281 Alter Overdues::CalcFine to use Dates objects.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:12 -05:00
Ryan Higgins
f230264b24 C4::Calendar::addDate now handles negative offsets properly.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:09 -05:00
Ryan Higgins
0b92b75ff8 Alter C4::Calendar::daysBetween() to take C4::Dates objects.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:29:07 -05:00
Galen Charlton
5c1d14d822 C4::Members::SearchMember - support attributes
Modified SearchMember() so that if the patron attributes
feature is on (i.e., ExtendedPatronAttributes is ON), it
is possible to search for patrons on any attributes whose
type is set as staff searchable.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:03:04 -05:00
Galen Charlton
7e8ff3f4b8 C4::Koha - added GetAuthorisedValueCategories
New convenience function to get list of authorised
value categories.

No user-visible changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:03:02 -05:00
Galen Charlton
d75cc041f6 new C4 modules for patron attributes
Two new modules to support patron attributes:

- C4::Members::AttributeTypes

  OO-module for managing patron attribute types.

- C4::Members::Attributes

  Procedural module for retrieving and setting
  extended attributes belonging to a patron.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-12 09:03:00 -05:00
Ryan Higgins
bd30b60a8a Alter itemBarcodeInputFilter T-Prefix.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 07:03:53 -05:00
Galen Charlton
dbbeb6525b C4::Installer - new method to get available MARC frameworks
For use by test suite; not a user-visible change.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:55 -05:00
Andrew Moore
31ad99e2b5 Bug 2094: fixing two bugs in lost items report
* I guess the limit by item type was never working. I made it look for the right database column
* I fixed the error that was returned with no items were returned.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:51 -05:00
Andrew Moore
20fd87d59b Bug 2094: cleanup of lost items report
Just some code cleanup of C4::Items::GetLostItems and reports/itemslist.pl.
Some whitespace changes, perltidy, and documentation improvements.
Also, I rewrote and SQL statement to try to reduce possibilities of SQL injection attacks.

No documentation or functional changes necessary with this patch.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:49 -05:00
Andrew Moore
c6068880ab Bug 2047: another fix for error during search when there is no MARC::Record
This is another fix for a bug that was introduced while adding this feature.
I believe that either this patch or the one at:
http://lists.koha.org/pipermail/koha-patches/2008-May/000309.html
should be applied.

In the case that GetMarcBiblio or GetMarcStructure does not return a true value,
this returns without further processing.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:48:42 -05:00
Joe Atzberger
f8fecb7863 Wrapper for Koha's use of HTML::Scrubber, with test script on usage.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 06:43:46 -05:00
Henri-Damien LAURENT
d08d9e3fb7 Addressing bug 1782
Adding New Systempreference AddPatronLists
This systempreference allow administrator to choose if patrons are created on categorycode lists or category_type ones.

Overloading GetBorrowerCategory so that if no parameter provided, it returns the list of category records
Changing memberentry.pl in order to use the categorycode when provided.
Bug Fixing Circulation.pl so that doesnot come up with Error 500
with no category selected for GetBorrowerCategory

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-05-11 05:49:27 -05:00
Joshua Ferraro
f093a84974 Fixing bug 1629: RSS Feeds of Search Results in OPAC 2008-05-01 18:55:13 -05:00
Galen Charlton
438ed23337 staging import - enhance record overlay behavior
Enhanced the ability of catalogers to specify how
bib and item records should be added, replaced, or
ignored during a staging import.

When an import batch of bib records is staged and commit,
the user can now explicitly specify what should occur
when an incoming bib record has, or does not have, a match
with a record already in the database.  The options are:

if match found (overlay_action):
  create_new (just add the incoming record)
  replace (replace the matched record with the incoming one)
  use_template (option not implemented)
  ignore (do nothing with the incoming bib; however, the
          items attached to it may still be processed
           based on the item action)

if no match is found (nomatch_action):
  create_new (just add the incoming record)
  ignore (do nothing with the incoming bib; in this
          case, any items attached to it will be
          ignored since there will be nothing to
          attach them to)

The following options for handling items embedded in the
bib record are now available:

  always_add (add the items to the new or replaced bib)
  add_only_if_match (add the items only if the incoming bib
                     matches an existing bib)
  add_only_if_add (add the items only if the incoming bib
                   does *not* match an existing bib)
  ignore (ignore the items entirely)

With these changes, it is now possible to support the following use cases:

[1] A library joining an existing Koha database wishes to add their
    items to existing bib records if they match, but does not want
    to overlay the bib records themselves.
[2] A library wants to load a file of records, but only handle
    the new ones, not ones that are already in the database.
[3] A library wants to load a file of records, but only
    handle the ones that match existing records (e.g., if
    the records are coming back from an authority control vendor).

Documentation changes:

* See description above; also, screenshots of the 'stage MARC records
for import' and 'manage staged MARC records' should be updated.

Test cases:

* Added test cases to exercise staging and committing import batches.

UI changes:

* The pages for staging and managing import batches now have
  controls for setting the overlay action, action if no match,
  and item action separately.
* in the manage import batch tool, user is notified when they
  change overlay action, no-match action, and item action
* HTML for manage import batch tool now uses fieldsets

Database changes (DB rev 076):

* added import_batches.item_action
* added import_batches.nomatch_action
* added 'ignore' as a valid value for import_batches.overlay_action
* added 'ignored' as a valid value for import_records.status
* added 'status' as a valid value for import_items.status

API changes:

* new accessor routines for C4::ImportBatch

    GetImportBatchNoMatchAction
    SetImportBatchNoMatchAction
    GetImportBatchItemAction
    SetImportBatchItemAction

* new internal functions for C4::ImportBatch to
  determine how a given bib and item are to be
  processed, based on overlay_action, nomatch_action,
  and item_action:

    _get_commit_action
    _get_revert_action

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 21:58:46 -05:00
Joshua Ferraro
d83a055504 Adding authorised value icons display in the search results
pages.
2008-04-30 21:07:29 -05:00
Andrew Moore
57b3b951c1 Bug 2047: adding images to arbitrary authorized values
I've refactored the subs I added in the previous commit so that they make a little
more sense and are in better places in the code base. I was really hoping to make use
of existing subs, but they all seemed so specific to particular uses.

The icons now show up on the OPAC item details page.

TODO: The icons still don't show up in the OPAC search results page.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 20:10:43 -05:00
Andrew Moore
aef807a937 bug 2047: refactoring icon manipulation logic
I'm extracting some of the icon manipulation logic so that I can get to it from the authorized values pages.

There should be no functionality or documentation changes with this commit.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 20:10:09 -05:00
Joe Atzberger
1a5497ac9b More labels repair: FIXME's added, warns $debug-ified.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 06:09:02 -05:00
Joe Atzberger
58e5e0a236 BUGFIX - get_batches argument counterproductive. NONE of the Labels code
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 06:08:59 -05:00
Joe Atzberger
3a1542c423 BUGFIX: $item is reference to hashref, not reference to hash.
In fact, the double reference is useless overkill for this and another arg.
This patch relieves the error seen in logs as:
label-print-pdf.pl: Not a HASH reference at /home/atz/koha/production/intranet/modules/C4/Labels.pm line 1007., referer: http://staff-atz.dev.kohalibrary.com/cgi-bin/koha/labels/label-manager.pl?type=labels

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-30 06:08:56 -05:00
cfc2b0e184 Adding a couple missing variables for opac login screen (opacheader,OpacUserCSS); Minor tweak to OPAC tags on opac-detail
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-28 05:55:57 -05:00
Joshua Ferraro
affaae1247 Normalizing s/On loan/Checked out/ 2008-04-25 15:28:14 -05:00
Andrew Moore
722a9a9d1e bug 2058: removing spurious warnings from C4::Items::AddItem
just remove a couple unnecessary warn statements.
no documentation or functionality changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-25 15:00:33 -05:00
Henri-Damien LAURENT
8be4679e7f unlocking table when adding/updating authorities is finished.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-24 11:51:48 -05:00
Joshua Ferraro
ad0d08ef33 Improvements to the results display in the OPAC, merging style
between the XSL and non-XSL stuff. Refining style of tags display,
adding back links to place hold, add to list, and add to cart on
results page
2008-04-23 16:00:46 -05:00
Joshua Ferraro
a9804f4fc9 Cleanup after merge of labels improvements 2008-04-22 22:18:10 -05:00
Joshua Ferraro
dfe310868f Adding TagsEnabled to list of known sysprefs, adding 'my tabs'
to the OPAC user portal
2008-04-22 21:00:56 -05:00
Joshua Ferraro
2e3b63e4d2 Revert "2 FixPriority calls were broken. FixPriority itself may be broken too,"
This reverts commit ea9e0804cd.
2008-04-22 19:16:30 -05:00
Joe Atzberger
ea9e0804cd 2 FixPriority calls were broken. FixPriority itself may be broken too,
but we can't test that withtout calling it correctly.
Note FIXME for questionable use of @-.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:06:54 -05:00
Joe Atzberger
5a68c16194 Bugfix #1624 - remove problem w/ EXPR in template, minor cleanup of module.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:06:38 -05:00
Joe Atzberger
41c2599531 Pretty sure that "S" is needed. Significant typo.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:06:37 -05:00
Joe Atzberger
524a5cbb21 Tags - module, script and template support for user tagging in OPAC.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:44 -05:00
Joe Atzberger
caa8afd2cc C4::Search - just cleanup, 1 FIXME added
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:34 -05:00
Joe Atzberger
e2e8475d25 C4/External/BakerTaylor.pm - Back end for B&T content.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:33 -05:00
Joe Atzberger
1b572630d6 BakerTaylor.pm - Initial implementation of B+T jacket cover and bookstore links.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 18:02:29 -05:00
Ryan Higgins
12a3217bfe Add dropbox mode to return.pl. Small API change to allow setting
returndate other than now().  Overdues will be handled in a forthcoming commit.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 17:54:20 -05:00
Ryan Higgins
56b87af4db Labels update- print any marc field and add csv output.
Make any MARC data available to labels module;
Also add a csv output option, allowing export of relevant
biblio data do a 3rd party label layout application.
Note: This patch REQUIRES a forthcoming updatedatabase patch !

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 17:54:02 -05:00
paul
7be6d1f12b IMPROVEMENT : serialsadditems at subscription level (bump 071)
The patch update the DB by adding a row in the subscription table (serialsadditems), that is filled with the value of the syspref.
then, the syspref is deleted.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-22 17:34:33 -05:00
Galen Charlton
ecc779fa50 refactor web installer code to created C4::Installer
Created a new module, C4::Installer, which embodies
most of the code from installer/install.pl that handles
identifying and loading SQL scripts and setting the
Version, marcflavour, FrameworksLoad, and NoZebra
system preferences.

With C4::Installer, it is now easier to automate
initializing and populating a Koha database.  This will
help allow the test suite to set up a test database
in order to run DB-dependent tests, as well as write
a command-line installer which may be of use to hosts
that need to support multiple Koha databases.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:26:23 -05:00
Galen Charlton
257af617f6 fix crash when saving MARC21 bib with NoZebra and BiblioAddsAuthority ON
Needed to identify correct subfield for retrieving
the authority type.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:18:00 -05:00
Galen Charlton
579a227228 kohabug 2022 - fixed fine and issuing rules editors
Because of the way that the older fine and issuing
rule editors generate the HTML form, if a branch code,
patron category code, or item type code happened to have a
'-' or '.', the HTML form would not be parsed properly, thus
adding an implicit (rather than explicit) limit on the
characters allowed in one of those codes.

This fix removes this limitation by Base64-encoding the codes
when constructing the names for the <input> elements.

Two functions are added to C4::Koha:

  str_to_base64() - UTF-8 string to Base64
  base64_to_str() - reverse

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:17:52 -05:00
Chris Nighswonger
7faa2f58b0 Adding back text wrap funcionality for lines exceeding $text_wrap_cols; also adding use of C4::Debug
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:14:03 -05:00
Henri-Damien LAURENT
5e9465a14a Accept or reject : Bug Fix and improvements.
Improving workflow : A suggestion can be edited and status can be changed if mistaken as soon as it is not deleted or acquired.
Adding dates display.
Adding deletion of suggestions.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:47 -05:00
Chris Nighswonger
9b47b82a77 Porting SimpleSearch return changes to all code calling it.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:45 -05:00
Chris Nighswonger
743fbda69d More work on SimpleSearch
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:43 -05:00
Chris Nighswonger
d50ab5e6e8 Enabling SimpleSearch to return the total number of hits to caller
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-17 05:52:42 -05:00
Paul POULAIN
1593ad386a BUGFIX (blocking) : AddSubscription was bugguy
making the creation of a subscription silently fail, but modif is impossible.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-14 23:47:02 -05:00
Paul POULAIN
a201a8bd89 BUGFIX : highlighting term fixes
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-14 23:47:01 -05:00
Andrew Moore
49be89c735 bug 1953: removing possible SQL injections from C4::Acquisition::GetHistory
I think this is the last sub in this module that needs to be changed.
there should be no functionality or no documentation changes with this patch.
http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1953

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-11 16:56:36 -05:00