Commit graph

111 commits

Author SHA1 Message Date
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
34ba89fd5d fix POD error
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-11 16:03:09 -06:00
Andrew Moore
549ec91a13 Bug 2775: adding method to clean syspref cache in C4::Context
C4::Installer provides a way to update the kohaversion syspref. Now that
C4::Context caches syspref values, any updated value through C4::Installer
is not being seen.

This patch adds a method to C4::Context to allow you to clean that
cache. Then, it calls that method when the kohaversion syspref is changed.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-11 15:59:00 -06:00
Clay Fouts
0ff177431b Database connectivity cleanups
This patch employs process-local caching of systempreferences and
eliminates the "select 1" execution every time dbh() is called.
DBI::ping() is used instead.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-06 15:53:25 -06: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
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
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
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
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
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
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
7221f2374a patch from cnighs, fixing warn in Context.pm 2008-06-20 17:00:58 -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
MJ Ray
697088968a Add backtrace printing option through SetEnv KOHA_BACKTRACES 1
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-03 14:44:31 -05:00
Galen Charlton
1acc90eb84 for DebugLevel=2; improved reporting of version numbers
Koha software and DB version numbers now reported;
also improved formatting of multi-line error messages.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-01 06:44:27 -05:00
Galen Charlton
cfc0e33829 improved formatting of fatal error messages sent to browser
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-01 06:44:25 -05:00
Galen Charlton
7ef6669a7e fixed invocation of CGI::Carp::set_message
The message handler in C4::Context is now correctly
passed CGI::Carp.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-01 06:44:24 -05:00
Galen Charlton
bf2e91560c IMPORTANT: clean up after Z39.50 connections
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-04 04:48:01 -06:00
Galen Charlton
bb40656eb3 use ZOOM::Connection error method compatible with 1.16
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-01 09:49:24 -06:00
Chris Cormack
bf37fd8269 Fix for Zconn not creating a new connection when zebra goes away and comes
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-11 22:11:31 -06:00
Joe Atzberger
7a85fcd4d7 Context.pm - file size test (-s) is subset of file exists test (-e), so testing both is same as testing -s.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-03 07:24:56 -06:00
Joe Atzberger
0b2aeb3b2d Backend for "Session" Shelves in toolbar. Affects Auth and Context, so please test.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-23 21:31:20 -06:00
Galen Charlton
4df803ec36 remove extra warn left in by mistake
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:08:16 -06:00
Galen Charlton
5290ec5596 test suite cleanup
Many of the tests were failing or putting warnings
because a valid systempreferences table is
usaully absent by the time 'make test' is run.

Fortunately, only a few modules try to invoke
C4::Context->preference during module initialization,
so added to the test suite override_context_prefs.pm,
which replaces preference() with a sub to return
testing values for three variables: 'dateformat',
'marcflavour', and 'LibraryName'.

Also fixed bug in t/Boolean.t

With this patch and the patch to move the DB-dependent
tests off to the side for the moment, 'make test'
now runs cleanly, at least on Debian.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:08:02 -06:00
MJ Ray
0eb6d9f6c8 Undo strange copy-paste error from last commit
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:06:12 -06:00
MJ Ray
89c0cf9150 die on db connection failure
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:05:29 -06:00
Joe Atzberger
b2e8eb4a7c Context.pm - BEGIN block VERSION and vars related to export.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-07 20:02:26 -06:00
Galen Charlton
88451107ae UTF8 and mysql: enable UTF8 mode correctly
Doc for DBD::mysql states that if not setting
mysql_enable_utf8 as part of the database
connect(), must do it before doing "set names utf8"

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-27 17:23:58 -06:00
Paul POULAIN
20649b7dc0 Adding OPACItemsResultsDisplay syspref & bumping to version 036
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-26 14:33:04 -06:00
Galen Charlton
f5903fbbb5 installer: location of koha-conf.xml
* rewrite-config.PL now puts in installed location
  of koha-conf.xml in C4/Context.pm so that
  correct config can be found even when
  KOHA_CONF is not set.  Note that setting KOHA_CONF
  will still override path set by installer.
* changed references from koha.xml to koha-conf.xml
2007-12-17 09:13:53 -06:00
Joe Atzberger
d39334c9c5 Context.pm - bugfix punctuation (; vs ,)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-13 19:00:31 -06:00
Galen Charlton
073b8b7a36 bugfix: restore setting classification source by dropdown
Apparently as an inadvertant result of the patches to
move the SQL files to load the MARC frameworks, the
authorised_value of 'cn_source' was dropped for
kohafield = 'items.cn_source' and 'biblioitems.cn_source'.

This patch restores those values, thus making the
classification source set by a dropdown in the bib
and item editors.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-13 17:30:34 -06:00
Joe Atzberger
af14810bac Context.pm: obvious code consolidation, perldoc corrections.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 16:03:26 -06:00
Galen Charlton
583baef555 MARC21 framework: changed 'items.withdrawn' to 'items.wthdrawn'
The correct field is 'items.wthdrawn', not 'items.withdrawn'.
Spelling may be corrected in post-3.0 version.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-27 15:51:55 -06:00
Galen Charlton
0c1617010f bugfix: fixed quelling of warning if $db_port not specified
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-25 16:45:36 -06:00
Galen Charlton
1552407c45 quell warning about missing config parameter (DB) 'port'
This context parameter is not necessarily present for
MySQL storage method.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-25 16:43:40 -06:00
Joe Atzberger
78e524fb97 Context.pm extraneous variable removed.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 13:24:43 -06:00
Chris Cormack
abe28f3bbd Updating version in C4/Context as begged for by slef :)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 07:27:30 -06:00
MJ Ray
6a3f484ca2 Context.pm version update and a begging NOTE in updatedatabase
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 07:27:26 -06:00
Chris Nighswonger
bc55b2cf6c Added code to notify PostgreSQL server of utf8 client when opening connection
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 07:27:25 -06:00
Paul POULAIN
9754dd35b5 BUGFIX to handle correctly db_driver eq mysql
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-14 11:14:20 -06:00
Chris Nighswonger
8bce6fc757 Ported _new_dbh() to handle PostgreSQL connections
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-13 11:22:48 -06:00
Ryan Higgins
0072a3b7de quick auth hack for zebra 2.0.18 could probably be cleaner...
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-11 18:39:02 -06:00
Mason James
59f2f638f5 removing dumper
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-11 12:45:46 -06:00
Joe Atzberger
539974308c Context.pm: Trivial adjustment for clarity.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-23 18:23:14 -05:00
Chris Cormack
1f5e1606e8 Fixing a little bug with Context, USER_AGENT changed to HTTP_USER_AGENT
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-22 16:45:55 -05:00
Galen Charlton
d7d4f699a3 quell warning about C4::Context::DIR being used only once
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-22 15:42:43 -05:00
Chris Cormack
b9c20fa9cf Patch from Galen Charlton, removing $Id$ $Log$ and $Revision$ from files
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-18 20:22:01 -05:00