Commit graph

2310 commits

Author SHA1 Message Date
Mason James
31adf4ef83 patch for feature 2952 - v3
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-12 16:39:33 -06:00
Nahuel ANGELINETTI
f09d0547b1 (bug #2957) import Date_to_Days
This patch import Date_to_Days from Data::Calc, else CalcFine can crash.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-12 14:45:47 -06:00
Galen Charlton
4c55cc220f reduce bib fetches during search and OPAC display
Speed up bib search and OPAC bib display, especially
when the XSLT OPAC results and details display sysprefs are
ON, by passing an existing MARC::Record object to three
functions:

C4::Biblio::get_biblio_authorised_values()
C4::XSLT::XSLTParse4Display()
C4::XSLT::transformMARCXML4XSLT (internal)

These functions previously fetched the bib from the
database, incurring the cost of DB retrieval and MARCXML
parsing even though client code already had a
MARC::Record object available.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-12 14:31:55 -06:00
Galen Charlton
05864978c5 bug 2126: reduce round-off errors in fine balance
If a patron has a number of fine transactions, the
total could be wrong.  This is particularly noticeable
when a patron has a zero balance, as summing a group
of floating point values derived from decimal(6,2) columns
can result a scalar value that is not zero.

Koha really should be using integral arithmetic
or appropriate accounting modules to do fine and
acquisitions calculations.  Using floating point scalars
for monetary amounts is always a mistake.

This patch also prevents an account maintenance
fee from being applied when renewing a patron if the
amount would be 0.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-12 14:31:52 -06:00
Joshua Ferraro
d2cb0a20de Fixes to two issues with status display on OPAC:
1. rather than testing for notforloan == -1, test for any negative values to set the On order status
2. in cases where itemcallnumber is blank or null, don't display the itemcallnumber brackets []

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:36:56 -06:00
Joshua Ferraro
04270d01b2 Distinguish between items marked 'not for loan' and 'Available'
This patch works with XSL* sysprefs == ON, a future patch will address XSL sysprefs==OFF

Items with notforloan set to a negative number still designate an 'ordered' status

Some items are marked 'not for loan' by setting that value at the item level, others by assigning
that value to that item's itemtype. This patch works for both scenarios.

Specific changes this patch introduces to the OPAC:

* Adds a new OPAC results page key 'Copies available for reference:'
* Changes 'Copies available at:' to 'Copies available for loan:'
* Changes the availability limit label in opac-advsearch from:
    'Only items currently available' to 'Only items currently
	available for loan or reference
* Displays the authorised value for the specific notforloan value in the OPAC detail page in
	parentheses next to 'Not for Loan'

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:36:51 -06:00
Joe Atzberger
bf17eb3902 Bug 2940 - private shelf (list) display error on 2nd and subsequent pages.
The before/after URL for the 2nd page of list elements:
http://atz.dev.kohalibrary.com/cgi-bin/koha/opac-shelves.pl?display=privateshelves?viewshelf=120&itemoff=2
http://atz.dev.kohalibrary.com/cgi-bin/koha/opac-shelves.pl?viewshelf=120&display=privateshelves&itemoff=2

The change in query string arguments is incidental, the prevention of multiple "?" is essential.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:28:52 -06:00
Joe Atzberger
6b9b778b1b GetMarcFromKohaField needs 2 args, or there's no point.
GetMarcFromKohaField returns (0,0) without the $frameworkcode argument.
Note the argument can be "", but it must not be undefined.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:15:03 -06:00
eaa3ee40a7 Avoid XSLT stylesheet building for each biblio record to transform
In XSLT.pm, put XSLT stylesheet object in a session variable in order
to avoid to build it for each biblio to parse: useful on search
result page.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 14:06:57 -06:00
Michael Hafen
ee7499d9d6 tweak Inventory tool and sub in C4/Items so call number min and max are not required
This changes the setting if default values in the inventory tool where
the min and max call number are concerned.  Also changes how the query
is formed in C4/Items so that these two are not required.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-09 13:53:07 -06:00
Galen Charlton
ed3621aa47 remove editor settings
Me, I use ed(1) for everything...

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 14:47:42 -06:00
John Beppu
b0ed658d3b bug 341: Use the Right Branch
When sending circulation alerts, use the branch that the
event happened on instead of $item->{homebranch}.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 14:00:46 -06:00
John Beppu
062bb9a804 bug 324: Setting to_address
- Enqueue the messages with a to_address.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 14:00:18 -06:00
John Beppu
9035706950 bug 323: Item Circulation Alerts UI Fixes
- fixed cross browser issues.  (IE and Safari don't let you say
  someobject.class, presumably because "class" is a keyword that's reserved
  for future versions of JS.  Firefox and Opera allow it.)

- added text to the grid for added clarity.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:59:03 -06:00
John Beppu
39d0ed3635 Perl Modules
- C4::Letters:EnqueueLetter() is aware of new fields in message_queue table
- C4::Circulation::SendCirculationAlert() actually works
- C4::Category cleanup
- C4::ItemType cleanup
- C4::Message is a new module.
  It presents yet another way to interact with the message_queue.
  You can now take messages that have already been queued and modify
  their contents before they're sent out.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:58:03 -06:00
John Beppu
2270ecaa90 Brand New UI for Alert Configuration
- grid layout (javascript required now)
- makes distinction between checkin and checkout messages
- no longer have to click on a button to submit the branch selection form

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:57:48 -06:00
John Beppu
e0dd01406f whitespace cleanup
Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:56:53 -06:00
John Beppu
02fe630873 Sending Circulation Alerts part 1
- Added code to AddIssue to send an alert when appropriate.
- Added code to AddReturn to send an alert when appropriate.
- Added a sub called SendCirculationAlert() that DOESN'T ACTUALLY WORK YET.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:56:20 -06:00
John Beppu
5991cdd33a New C4 Modules
* C4::Category
  - patron categories as objects
  - an all() method to return all the categories as a list
* C4::ItemType
  - itemtypes as objects
  - an all() method to return all the item types as a list
* C4::ItemCirculationAlertPreference
  - wrapper around the item_circulation_alert_preference table
  - create() and delete() methods for easy manipulation of the preferences
  - I regret giving it such a long name.
  - The item_type column should've been named itemtype to make it
    more similar to pre-existing tables.  Oh well.

(C4::Category and C4::ItemType were made so that I wouldn't have to
write SQL inside my CGI scripts.
Their main purpose is to provide an easy way to get a list of
patron categories and item types.
Do not be fooled by the amount of POD.
There's actually very little code in these modules.)

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:55:48 -06:00
John Beppu
e7702b3334 POD for C4::Members::Messaging
- fixed typos and formatting.
- added notes on how to add new kinds of messages.
- added notes on the tables being used.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-04 13:55:14 -06:00
Mason James
35a8b9bf55 fixes SQL typo and return value in GetImportBatchStatus()
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-02-02 08:20:57 -06:00
Jesse Weaver
1301705150 Add holds policies
This adds holds policy creation support to smart rules and read support to
C4/Circulation.pm, and the two reservation pages. It also adds a system
preference, AllowHoldPolicyOverride, to control whether the staff can override
these policies.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-16 08:21:07 -06:00
Nahuel ANGELINETTI
bfebda4ad9 (bug #2908) adding send shelf by e-mail feature
This patch add the form for sending shelf by e-mail, and add a button in shelves that allow the user to send a shelf.
It's an approximate copy of the send basket feature.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-12 15:51:59 -06:00
Nahuel ANGELINETTI
796f626b5b (bug #2904) support of 856$u and 856$z in UNIMARC
This patch change the linktext as the label of the link(in 856$z), and set the url from the 856$u.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-09 13:22:01 -06:00
Joe Atzberger
54f5ee3332 Prevent multiple warnings per notice filling cron logs.
If a value being substituted in was NULL, then warnings like this
would be emailed to the crontab owner (or MAILTO):

Use of uninitialized value in substitution (s///) at /home/user/kohaclone/C4/Letters.pm line 508.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-09 12:22:30 -06:00
Galen Charlton
e7aff14ba2 bug 2505: more warnings fixes in C4/Context.pm
* more portable way to determine uname for
  crash messages
* C4::Context->userenv now returns undef instead
  of 0 if no userenv has been set yet; returning
  undef when necessary is almost always better
  than returning a scalar when a hashref is
  normally expected.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-09 12:17:49 -06:00
stan
5ce47ac580 Enable use warnings;, clean up complainy functions, fix a few tab/space formatting issues.
Refactoring KOHAVERSION to be less crufty, enabling use warnings, change formatting slightly in places.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-09 10:42:57 -06:00
Galen Charlton
3a7ae97440 followup to patch for bug 2900
Previous patch broke date comparison that sets
overdue flag - now that ISO-formatted date
strings are being compared, must use "it"
instead of "<".

"2009-01-02" lt "2009-01-08" is true
"2009-01-02" <  "2009-01-08" is *false*

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-08 14:19:09 -06:00
Joe Atzberger
c70cd87d54 Bug 2900: fix GetPendingIssues.
GetPendingIssues did several bad things:
~ select * on a 4 table join,
~ including multiple namespace collisions,
~ including large fields marc and marcxml from biblioitems,
~ return ($count, \@array_being_counted).

Not everything is fixed here (see FIXMEs), but the situation is
improved considerably, with bug 2900 resolved.  The "timestamp"
namespace collision in query should be resolved by separate patch.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-08 11:08:27 -06:00
Joe Atzberger
cdb4b60d93 Bug 2747 for staff interface itemtype display.
Prefer accuracy over graphical icon.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-07 15:13:43 -06:00
Galen Charlton
2dcca73ae0 fix permission error introduced in a previous patch
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 21:04:42 -06:00
Joe Atzberger
a581f7203c Bug 2842: ->regexp('syspref') failed for users of iso dateformat.
Sticky due date and patron import were the two areas affected.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 20:24:46 -06:00
Joe Atzberger
4e50585926 Dates expanding to expose some time (HH:MM:SS) granularity.
t/Dates.t is essentially restored from its previous state with
the revision that it now does not use C4::Context or check syspref
for the default date format.  Instead it sets the C4::Dates default
directly, taking cue from command line argument or ENV.  ISO format
revised to accept "T" separator and "Z" (zulu) terminator. POD
expanded and corrected.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 20:24:40 -06:00
Galen Charlton
db59418c2c patch followup: restore test in GetMarcItem
Change made to GetMarcItem to quell a warning
changed sense of a test; defined($foo) is *not*
the same as $foo ne ''.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 18:55:01 -06:00
Galen Charlton
dfa0f6ea24 bug 2505: more warnings fixes to C4/Biblio.pm
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-06 18:54:55 -06:00
Andrew Moore
0b1c856e4b Bug 2505: adding warnings to C4/Biblio.pm
I added 'use warnings' to C4::Biblio and made a handful of changes to
reduce the number of warnings emitted.

One notable spot is the change in the regex in
C4::Biblio::GetNoZebraIndexes. I have replaced the parens with a character
class. The parens change the way 'split' works, making it return elements
for each delimiter. We did not want those elements returned, and they
only resulted in "'' => undef" being added to the final hash. They also
resulted in two "undefined" warnings for each pass through the loop. I've
included a simple test for this function.

There may be a few warnings still emitted in spots, but either I haven't
seen them yet, or I have chosen to not fix them yet because they require
too much change.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-05 16:16:38 -06:00
Henri-Damien LAURENT
80781eedeb Using Warns would cause problems with NoZebra
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-05 16:04:52 -06:00
Joe Atzberger
9dbd65da27 barcodedecode() did not always return barcode
This patch amends the function to return barcode, in particular when
filter is not defined.  It also adds an optional 2nd argument to
allow the filter to be specified by caller, enabling testing.

Non-DB-dependent test script included.  Note: T-prefix style
barcode filter is not documented, and drops the first nonzero
digit after the T.  This seems mistaken, but is not corrected here
to avoid any surprises.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-05 15:55:14 -06:00
Joe Atzberger (siptest
76309ae328 Allow AddIssue to log SIP transactions distinct from others.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-01-05 15:43:12 -06:00
Joe Atzberger
55c2320a23 Labels Cleanup (Part 1 of Many)
Consolidated error catching after evals.
Removed unnecessary $sth->finish calls and some unused variables.
Pulled query for itemtype mappings outside DrawSpineText and added
a class level caching variable to eliminate repeated queries for
*each piece of text* on *each label*!  This was a major performance
downside.

Note: this does not fix Unicode problems, but it does add some notes
on unsuccessful attempted workaround using utf8::encode.

C4::Labels should likely be broken up to separate out the pieces that
do not touch the database (wrappers of PDF::Reuse) and those that are
CRUD API for table data.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 15:56:11 -06:00
Joshua Ferraro
acd431f55d Adds the ability to reference itemcallnumber within XSLT
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-31 10:19:55 -06:00
Galen Charlton
53d4e8fa2c bug 2856 followup: remove unconditional warn
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-29 13:55:22 -06:00
Nahuel ANGELINETTI
61ebf9160f (bug #2856) Activate the duplicate patrons detection and check birthdate only if one is set
This patch activate the check of unique member, it was checked but not shown, and the member was added even if a duplicate was
detected.
It improve the duplicate detection, to check the birthdate only if it was specified in the form.
And fix an url of "Yes" link(if the borrower added IS the duplicate detected).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-29 13:46:11 -06:00
Kyle Hall
9cf0472903 Added 'Branch Transfer Limits' Feature requested by Geauga County Library System.
Added syspref to updatedatabase.

Updated kohastructure.sql with the limits table.

Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-17 14:49:02 -06:00
Henri-Damien LAURENT
29995accf1 Adding some fixing for NoZebra
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-11 09:34:14 -06:00
Joe Atzberger
45a33a9a40 Minor cleanup, unused variable removed.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-11 08:33:35 -06:00
Jesse Weaver
c9a50403e5 bug 2848 [1/2]: Send notifications to patrons when hold is received
This adds notification code to Reserves.pm to send notifications through email
or SMS to patrons when their hold is filled. It does not send the letter
directly, but instead uses EnqueueLetter. Also, it relies on
EnhancedPatronMessaging being on and the hold notification being turned on for
the specific patron through the 'Messaging' tab.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-08 08:51:12 -06:00
Galen Charlton
5f18793461 bug 2758: don't confirm checkout if fine balance is 0
Fixes problem where if the IssuingInProcess preference is ON,
the operator is always required to confirm a checkout if
the patron has had any fine transactions at all, even if
the patron's balance is 0.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-02 16:44:20 -06:00
Nahuel Angelinetti
873d1c6336 bug #2757: change the opac login generation
This patch change the method used to generate a new login for a user when his informations are modified(memberentry.pl).

Before the login are generated with the first letter of lastname and the 9 first letter of the surname, and do not verify the
login already exist).
Now the login will be lastname.surnameX, where X is an incremented digit if the login already exists.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-02 08:35:01 -06:00
Galen Charlton
933216b1c1 fix POD error introduced in last patch
Run prove xt/author/podcorrectness.t to verify
that POD is syntactically correct.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-12-01 11:13:35 -06:00