Commit graph

2375 commits

Author SHA1 Message Date
Galen Charlton
6a2a4e146e fix various warnings
* Use of uninitialized value in pattern match (m//) at C4/Biblio.pm line 1305
  (displaying MARC21 856s that don't have $3)
* Use of uninitialized value in multiplication (*) at catalogue/detail.pl line 243.
  (attemping to calculate average Amazon rating if no Amazon info
   is available)
* opac-detail.pl: Use of uninitialized value in length at C4/External/Amazon.pm line 90
  (attempting to calculate length of $isbn if it happens to be undef)

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 15:54:19 -05:00
Galen Charlton
684cea4309 bug 3049: display correct due date of renewed loans
The intranet item display provided by moredetail.pl
would display the original due date of the item, and
would thus be incorrect if the item had been renewed
and got a different due date.

The incorrect date was coming from items.onloan,
which AddIssue() sets to the due date.  This patch
fixes the bug in two ways:

[1] AddRenewal() now updates items.onloan with the
    correct due date.
[2] Two templates were updated to display the
    due date from (indirectly) issues.date_due
    instead of items.onloan, thus making it less
    likely that the wrong value will be displayed.

This patch does *not* update items.onloan to reflect
the correct due date.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 14:51:32 -05:00
Nahuel ANGELINETTI
43bb27b8da (bug #2915) C4::Biblio::DelBiblio delete the serials
This patch add the serials deletion in DelBiblio function, so now when a record is deleted all attached serials will be too.

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 14:51:30 -05:00
Henri-Damien LAURENT
dbe0d99371 auto truncation was not used
Auto truncation now works on LTR languages
For RTL languages(Arab, Hebrew), development should be really improved.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 13:01:30 -05:00
Joe Atzberger
35c8a5be58 Introduce sth caching to Letters.pm
The re-creation of statement handles for the same queries, repeatedly,
seriously degrades the performance of notices.  This introduces new
class-level caching to avoid that problem.

Note: initial provisions
to do the same with caching of COLUMNS information about tables is
also included, but this would probably be most usefully implemented
in C4::Context (or a separate more central module).  The benefits of
caching that info would probably be even greater.  Note that this
proposed implementation might be obsoleted by ORM integration, where
DB structure info would already be cached.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 13:01:23 -05:00
Nahuel ANGELINETTI
89c062c44b (bug #3053) extract ISBD view generator, and permit to display valuecode in ISBD view
this patch extract the generator of ISBD view in a C4 function, because it's used in intranet AND in OPAC but with 2 separate codes.
Now it's more reusable.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-06 11:16:34 -05:00
Joe Atzberger
6a2c518efa Add warning for unrecognized sort order.
This may help elucidate problems we are having with sorts that
do not seem to work.  I.E., if the inteface is requesting
unrecognized sort orders, we need to know about it.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-06 11:01:35 -05:00
Galen Charlton
2e08f626f5 remove incomplete bib bulk editing code
Per discussion I had with Henri, removing experimental
bulk editing from the staff search results code, as
feature is incomplete and can be dangerous if
one tries to use it on a large search result
set.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-06 10:53:50 -05:00
Joe Atzberger
14be4400d8 Bug 3066 - Overhaul guided reports
execute_query now refactored, returns reliable results, does
zero presentation-layer crap.  Arguments reduced, client scripts
adapted to new API and performance improved.  Text::CSV now used
to generate CSV output, ensuring portability, encoding and accuracy.

Replaced tools/runreport.pl with misc/cronjobs/runreport.pl:
    ~ security fixed
    ~ documentation improved
    ~ TODO: finish sendmail option.

Bug 3077 also fixed.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 20:17:55 -05:00
Joe Atzberger
1caa108ef0 runreport.pl and prep work on Guided.pm
The old location of runreport.pl was under tools, leaving it exposed
to web requests.  This is a security flaw since it does NOT check any
Auth and allows the user to request any Saved Report be run.  This is
not a problem under misc/crontab/ and it suggests the more appropriate use.

Guided.pm is not fixed here (see bug 3066), but it is prepared to be fixed
and made compatible with runreport as detailed in the perldoc.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 20:14:32 -05:00
Joe Atzberger
104de0640b Serial IF statements on same $variable should be ELSIFs.
Small POD update also.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 20:14:19 -05:00
Mason James
2fd01051fd patch for bug-3017
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 19:53:16 -05:00
Nahuel ANGELINETTI
4f8f297a23 (bug #2862) improve sql reports
Clear all non-alphanum chars at the end of an sql query.
Use ESCAPE=HTML to escape double quotes in csv export

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 19:53:06 -05:00
02b5091c1a Internationalize Amazon support
With this patch:

  * On Amazon book cover, 'search inside' text is not displayed
    anymore because it's not translatable.
  * Link the image to local Amazon web site 'search inside' service.
    Based on AmazonLocale syspref.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 19:38:37 -05:00
J. David Bavousett
13cce1b3c5 Modifications to C4/Matcher for colon and ending punctuation
Recommended by Michele Maenpaa, this adds handling colon and end-punctuation stripping
in subroutine _normalize, and fixes length testing in subroutine _get_match_keys

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 19:10:49 -05:00
Joe Atzberger
657371808a DDCN callnumber splitting with test.
Similar to previous patch for LCCN splitting, this patch incorporates
changes to split_ddcn and supplies a test file for verifying proper
operation.  Note that the only previously documented example for intended
operation is included as one of the tests.

This regexps are created to be rather forgiving.  For example, the function
will not choke if two spaces were included where the "spec" (such as it is)
expects one.  Obviously this is because for CN splitting purposes, it doesn't
matter, we're not going to ever split in the middle of whitespace.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 18:47:48 -05:00
462dead372 Adding details to OPAC search results RSS, described in Bug 2973.
This includes a change to Search.pm to add a variable, subtitle_nospan, in order to display subtitles in the feed without search term highlighting HTML. The modified template attempts to display Amazon, Syndetics, or Baker & Taylor book cover images. Google images are not included because they require Javascript.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 18:22:04 -05:00
Daniel Sweeney
17b1412ceb Cleared a trailing warn, sorry.
Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 16:41:50 -05:00
Joshua Ferraro
65ddce02f2 Serials Display Enhancement
Allows specification of how many issues of a subscription to display
at a global and subscription-specific level. Also adds a link to the
detail page to a specific subscription.

Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-03 16:41:38 -05:00
066adc4a3e Fix Amazon cover for UNIMARC
In UNIMARC, 010 tag contains ISBN. In UNIMARC, ISBN with '-'
are valid. This patch modify ISBN normalization in order to
automaticaly suppress '-' before sending ISBN to Amazon
to get book cover.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-01 10:49:39 -05:00
Mason James
eb62fd74c1 fix to ignore 600$2 'Source of heading' fields for MARC21 subject display
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-01 10:49:28 -05:00
Henri-Damien LAURENT
32a84d56c5 Minor bug fix Documentation update : 3039
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 18:36:57 -05:00
Daniel Sweeney
0e76b374eb Changed syndetics base URI from syndetics.com to www.syndetics.com
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:52 -05:00
Daniel Sweeney
afde76f1c1 Added upc to content_identifier_exists criteria.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:51 -05:00
Joshua Ferraro
bd5272f074 Fix for LL Bug 405: Syndetics Enhanced Content: some cover imags are being generated as IMGs but show as broken images
Adds new template variable to test for enhanced content identifiers

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:51 -05:00
Joshua Ferraro
0547da0093 Fix for LL Bug 404: Syndetics Enhanced Content: Excerpts show with embedded HTML tags and entity references
XMLout needed the NoEscape option set

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:51 -05:00
Joshua Ferraro
edcc606257 Syndetics Enhancement: adds upc/oclc to the functions to retrive non-image data
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:51 -05:00
Joshua Ferraro
3d65e44d5c Syndetics and Amazon bugfix enhancements
This patch resolves a number of problems related to Enhanced Content:

1. Previously, there was no syspref for controlling whether or not to display
Amazon.com cover images apart from other content. This had the side effect
of preventing use of amazon.com content alongside use of another provider's
images. This patch introduces AmazonCoverImages and OPACAmazonCoverImages,
and changes the name of AmazonContent to AmazonEnabled.

So, for instance, you can now enable OPACAmazonSimilarItems yet utilize
SyndeticsCoverImages for displaying those similar items.

NOTE TO DOCUMENTATION TEAM: please update references to AmazonContent
and OPACAmazonContent to comply with the above.

2. Fixes some semantically incorrect uses of AmazonContent (now OPACAmazonEnabled)
on the OPAC side.

3. Resolves once and for all, the normalization of ISBN,UPC,EAN and OCLC numbers
for all enhanced content elements; These elements can be normalized using the
new functions in C4::Koha; I've replaced use of the various previously used
variables $xisbn,$norm_isbn,$clean_isbn, etc with $isbn, and the template
variable normalized_isbn.

We finally have a single, consistant place to retrieve normalize values for
these fields given a particular record.

4. Adds Syndetics attribution statements to display of all Syndetics content
'enhanced content provide by Syndetics' or 'Enhanced Description from Syndetics'

5. Adds an option to view the large cover image on the detail page on the OPAC
when using SyndeticsCoverImages; this option is controlled by a new system
preference: SyndeticsCoverImageSize which has two values: MC (medium) LC (large)

6. Adds UPC and OCLC numbers for Syndetics enhanced content queries especially
helpful for finding enhanced content for DVD and Music materials

7. Adds capability to display Syndetics images to opac-user for checkouts and overdues

8. Updates to systempreferences.sql, and updatedatabase.pl database revision 015

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:51 -05:00
Joshua Ferraro
9abcd844f5 Add Syndetics AuthorNotes, Awards, Series
This patch also includes a new function to retrieve the index
page from Syndetics and parse it for available content prior to
retrieving content; this is done to speed up syndetics content
by not retrieving content that doesn't exist for an item. However,
Syndetics continues to be a very slow service compared to Amazon.com
and other enhanced content services

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:50 -05:00
Joshua Ferraro
11bd4a7660 Adds Syndetics Reviews
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:50 -05:00
Joshua Ferraro
9806abf865 Adds support for Syndetics Excerpts and Editions
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:50 -05:00
Joshua Ferraro
de6227bd0a Add Syndetics Summaries and TOC
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:50 -05:00
Joshua Ferraro
3d46ed59ee Add System Prefs for Syndetics to Auth
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:49 -05:00
Joshua Ferraro
69c74c06ae Move Amazon.pm to External/ directory
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-27 17:23:49 -05:00
Galen Charlton
3c04a7915a fix error introduced in a previous commit
Change to GetReservesFromBiblionumber() had effect
of causing all requests of constrainttype other
than 'o' to not be included in result.

while ($foo) {
    $bar or next;
    # do stuff
    # do other stuff
}

is not equivalent to

while ($foo) {
    if ($bar) {
        # do stuff
    }
    # do other stuff

}

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 10:39:33 -05:00
Joe Atzberger
6b3e5ce0dc Correct perldoc
Indentations misformatted for code blocks.  Also updated reference to
GetBranchesLoop.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:37:13 -05:00
Joe Atzberger
9c8623fa13 Bug 2691 - LCCN split (for labels)
This corresponds with the test I submitted earlier and essentially
overrides the partial improvement from Nighswonger under Bug 2500.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:37:09 -05:00
Mason James
cd230c2a72 Resubmitting: fixes print statements with missing 'STDERR' in Auth_with_ldap.pm,
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:37:03 -05:00
Nahuel ANGELINETTI
257a439daf (bug #3025) multiple check-in of a multiple times reserved item go wrong
This patch check that an item is not "Waiting" before do something in GetOtherReserves(because is the item is waiting, we don't need to do something).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:36:58 -05:00
Joe Atzberger
ccee815f4a Bug 2617: Add strict (and warnings), partial fix.
These are some of the simpler scripts to add strict to.
Corrected perldoc for Bookfund.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:36:55 -05:00
Joe Atzberger
15443111e5 Trivial correction to comment.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-11 08:36:52 -05:00
Joe Atzberger
ba0ae6cd1c Branchoverdues circ report reworking.
branchoverdues.pl
~ Removed unused variables.
~ Use elsif where applicable.
~ Added many FIXMEs.
~ Added help description.
~ Changed link to more accurate description.
~ REFACTORED branchoverdues-specific function in C4 for obvious consolidation.

This report is still of questionable value, since it's dataset has such strange
hardcoded limitations.  It is not clear that "FU" type fines and notifys=0 are
reliable or useful indicators to query on, in hardcoded form.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 15:01:41 -06:00
Nahuel ANGELINETTI
04cb467401 (bug #2863) add the borrowers branchcodes in suggestion list
Not a big patch, just add the borrower branchcode.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 14:19:11 -06:00
Galen Charlton
638482cf1a fix permissions error 2009-03-06 13:18:00 -06:00
Nahuel Angelinetti
3213ffc859 fix the sql request to work in all mysqls
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 13:18:00 -06:00
Joe Atzberger
621c211d43 Allow all argument forms to GetBranchesLoops.
Allow arguments to be specified in the negative (i.e. 0).
Allow function to be called with no arguments.

This supercedes the patch titled:
Allow GetBranchesLoop to intuit IndependantBranches if not specified in argument.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 13:03:48 -06:00
Joe Atzberger
c188100bf3 Allow GetBranchesLoop to intuit IndependantBranches if not specified in argument.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 13:00:43 -06:00
Joe Atzberger
3d3628a1a6 Add GetBranchLoop since so many pages use exactly the same code.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 12:59:27 -06:00
Joe Atzberger
0c84d36353 AddReserve had bogus prepare statement.
This patch was not fully tested because the actual behavior intended
by constraints 'o' and 'e' was apparently never implemented here.
But it had no chance of success as with:
    my $sth = $dbh->prepare("");

This uses the inteneded query, removes unneeded $sth->finish calls and
fixes *some* redeclaration of my $variables in the same scope, as
would be needed to run under warnings pragma.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 12:44:51 -06:00
Joe Atzberger
efa79c13b2 Basic cleanup of fixup_cardnumber
Avoid warning on syspref "checkdigit" undefined.
Functionality essentially unchanged.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-03-06 12:27:48 -06:00