Commit graph

2081 commits

Author SHA1 Message Date
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