Commit graph

196 commits

Author SHA1 Message Date
Jared Camins-Esakov
a6c7ba8519 Bug 9191: updatedatabase.pl should only run updates up to the current version
Check whether a given update should be run when passed the proposed
version number. The update will always be run if the proposed version
is greater than the current database version and less than or equal to
the version returned by C4::Context->final_linear_version (initially set
to be equal to the version in kohaversion.pl). The update is also run if
the version contains XXX, though this behavior will be changed following
the adoption of non-linear updates as implemented in bug 7167.

To test:
1) Make sure that the first example database update added by this patch
   in installer/data/mysql/updatedatabase.pl has a version number one
   greater than the version of Koha you have installed.
2) Set the Version syspref back one version behind your current version.
3) Navigate to the main page of the staff client, and log in to the
   installer.
4) Confirm that the update page claims to have rerun the previous update
   and has displayed the log message:
   "Upgrade to 3.11.00.XXX done (Bug 9191: You should see this)"
   but not the log message:
   "Upgrade to [version number] done (Bug 9191: You shouldn't see this)"

Note: the sample database revisions will be removed by the RM before
this patch is pushed to master.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
works great

Signed-off-by: Elliott Davis <elliott@test.bywatersolutions.com>
Works as expected.  Test plan is great. Code looks to be adherent to standards.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-12-11 08:19:00 -05:00
Chris Nighswonger
cb6870d8d1 Bug 9085 - Installer will not run with DEBUG set
This is due to raising all db errors combined with the fact that attempts
to make selections from a non-existent systempreferences table raises db errors.

The installer should run even with DEBUG set, otherwise dropping and recreating
a development database becomes somewhat of a chore. This patch adds code to
check for the existence of the systempreferece table. If the table exists, then
RaiseError is enabled on the database handle. Otherwise it is disabled to allow
the installer to run without throwing an error.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
The installer can now be run both with and without DEBUG set.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-20 06:50:08 -05:00
Jared Camins-Esakov
4b65389d5e Bug 9005: Allow user to disable syspref cache
Because C4::Context uses an in-memory hash for caching sysprefs,
changing a syspref under a multi-threaded persistent environment
requires a server restart. This patch makes it possible disable
the syspref cache.

To test:
1) If you are using a multi-threaded persistent server (Starman, etc.),
   change a syspref and note that the effects of the syspref change may
   or may not be visible on any given request before applying this patch.
   You will need to choose a syspref with obvious effects that can be
   seen by simply refreshing the page. I recommend enabling or
   disabling additional languages in the OPAC, since you can refresh the
   page a dozen times and reasonably expect to see the new behavior you
   set only 1/n of the time.
2) Apply patch.
3) Add "C4::Context->disable_syspref_cache();" to your koha.psgi file
4) Repeat step 1, noting that you never see the stale behavior.
5) Run test at t/db_dependent/Context.t.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
All tests passed.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-11-08 12:41:10 -05:00
084367f6cb Bug 3087 Fix Z39.50 server to return the correct record syntax
Modify Makefile.PL and Zebra configuration files in order to parametrized
biblio record type returned by Zebra Z39.50 server.

How to test:

- Test with a MARC21 and a UNIMARC DB
- Do a new installation
- Search from OPAC
- Search from a Z39.50 client like yaz-client: syntax = MARC21/UNIMARC must be
  choosed
- It was working for MARC21: it continues to work
- It wasn't working for UNIMARC: it works now, both in OPAC and from a Z39.50
  client

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works fine for MARC21. Frederic looked at UNIMARC. Magnus looked at NORMARC.
GRS1 works okay for me. I still have issues with DOM, but they are not directly related to changes in this patch.
A followup is still needed for packaging (debian/templates).

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-10-22 14:12:22 +02:00
809b543d27 Bug 6679 -[SIGNED-OFF] fix 12 perlcritic violations in C4/Context.pm
"return" statement with explicit "undef" at line 486, column 5.  See page 199 of PBP.  (Severity: 5)

Subroutine prototypes used at line 548, column 1.  See page 194 of PBP.  (Severity: 5)

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-20 11:39:37 +02:00
Jared Camins-Esakov
7ad5e203da Bug 2060: Update command line MARC import scripts
Expose authority import functionality to the command line import
scripts, and rename them from commit_biblios_file.pl and
stage_biblios_file.pl to commit_file.pl and stage_file.pl.

To test (note that these instructions assume you have a MARC21
installation and are using the provided sample file):
1. Find a file of authorities (a sample file with MARC21 authorities
   is attached to bug 7475) and download it to your server
2. Stage the file using the following command (replace <filename> with
   the name of the file you saved in step 1):
   > misc/stage_file.pl --file <filename> --authorities
3. Note the batch number the script assigns to your batch
4. Commit the records using the following command (replace <batchnumber>
   with the batch number you made note of in step 3):
   > misc/commit_file.pl --batch-number <batchnumber>
5. Index the authorities Zebraqueue (or wait)
6. Confirm that the new authorities appear.
7. Create a matching rule with the following settings:
   Code: AUTHTEST
   Description: Personal name main entry
   Match threshold: 999
   Record type: Authority record
   Search index: Heading-main
   Score: 1000
   Tag: 100
   Subfields: a
   Offset: 0
   Length: 0
   (note the ID of this matching rule)
8. Stage the authority file again, this time using the following
   command:
   > misc/stage_file.pl --file <filename> --authorities \
     --match <matchingrule>
7. Revert the import with the following command:
   > misc/commit_file.pl --batch-number <batchnumber> --revert
8. Index the authorities Zebraqueue (or wait)
9. Confirm that the records have been removed
10. Import an authority record with the Stage MARC/Manage staged MARC
    tools in exactly the way you would for a bibliographic record,
    but choose "Authority" instead of "Bibliographic" for the record
    type.

Signed-off-by: Elliott Davis <elliott@bywatersolutions.com>

Testing plan delivers as it should.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Rebased on latest master 11 September 2012
2012-09-19 17:16:18 +02:00
Paul Poulain
8449b14dcb Revert "Bug 8089: Use Koha::Cache for all caching"
This reverts commit 215abc8024.

The 3 patches for bug 8089 have been reverted, because they break
jenkins & Koha.
A follow-up has been provided, but it does not solve the problem on my
test server, it just changes the error message.

After a discussion with jared, Dobrica should work on another patch, so
the best option is to revert.
2012-09-12 14:12:41 +02:00
Paul Poulain
04881d9265 Revert "Bug 8089: Cache sysprefs using Koha::Cache"
This reverts commit 499f44fa1d.
2012-09-12 13:45:51 +02:00
Jared Camins-Esakov
499f44fa1d Bug 8089: Cache sysprefs using Koha::Cache
Cache sysprefs using Koha::Cache in a way that is safe even for
caching-related sysprefs. This lays the groundwork for removing
caching configuration from the httpd.conf and configuring it
using sysprefs.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-09-07 16:28:31 +02:00
Jared Camins-Esakov
215abc8024 Bug 8089: Use Koha::Cache for all caching
1. Replace all instances of memoize_memcached with appropriate calls
into Koha::Cache:
* reports/guided_reports.pl
* C4::Biblio::GetMarcStructure
* C4::Languages::getFrameworkLanguages
* C4::Languages::getAllLanguages
* C4::SQLHelper::GetPrimaryKeys
* C4::SQLHelper::_get_columns

2. Replace all references to memcached with the appropriate calls into
Koha::Cache in C4::Context.

Test plan :
* have DEBUG env set to 1
* reach addbiblio page to test the patch in Biblio.pm, or setup more than 1
  language
* you should see in the logs that you're reading and writing from cache
* run the test suite twice both with and without the following environment
  variables set:
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA
export CACHING_SYSTEM=memcached

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

I'm unsure about some of the caching times 10000 is a long long time,
but other than that, works fine.
2012-09-07 16:28:29 +02:00
Chris Cormack
509d673f10 Bug 7941 : Fix version numbers in modules
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-06-11 17:29:38 +02:00
Colin Campbell
7716fce253 Bug 5549 : Add a timezone object to C4::Context
Will be required by rolling loans to get correct times
NB the setting of the TZ in mysql has not been changed as
this appears to rely on $ENV{TZ} being undefined
2012-03-20 12:08:20 +13:00
Paul Poulain
6a520f7456 Bug 6193 follow-up of the follow-up = reindentation only 2012-02-21 13:16:11 +01:00
52afe06ddd Bug 6193 - Follow up: use SetEnv and remove memcached from koha-conf.xml
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Confirmed that memcached is still being used after the memcached configuration
in koha-conf.xml was removed, and the following two lines were added to
both virtual hosts in koha-httpd.conf:
SetEnv MEMCACHED_SERVERS "127.0.0.1:11211"
SetEnv MEMCACHED_NAMESPACE "KOHA"
2012-02-20 23:24:02 +01:00
Paul Poulain
d7a51d83c1 Merge remote-tracking branch 'origin/new/bug_6132' 2012-01-16 14:53:08 +01:00
Julian Maurice
b867d7d12a Bug 6132: Update sysprefs cache in set_preference
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
2012-01-16 14:52:23 +01:00
22dca58cba Bug 6193 - Use memcached cache koha-conf.xml configuration variables
Basically I add some code to Context.pm so it stores koha-conf.xml config vars
in memcached server. It is arguable whether this is an improvement or not,
tests are needed to conclude something about this.

Error handling was an issue with Cache::Memcached, I tried to do it the
simplest I could.

Note: As it was pointless to read the xml file to get the memcached
server info for accessing them for retreiving the info in the koha-conf.xml
file... I passed those values through apache's SetEnv. These variables
are set acordingly through the install scripts and commented out if koha
was setup not to use it.

Bug 6193 - Properly comment the code

Required by slef.

Regards
To+

Signed-off-by: Federico Rinaudo <frinaudo@infocpt.com.ar>
Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-27 17:16:35 +01:00
Henri-Damien LAURENT
7655eaedc1 Bug 6132: preference were case sensitive.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2011-12-06 11:39:37 +01:00
Paul Poulain
0f8db0c538 Bug 7188: C4::Context::db_scheme2dbi does case-insensitive grep
Checking NYTProf in C4::Context, it appears that the /i flag is highly time-consumming
As we don't support anything outside from mysql, returning directly mysql directly

If in a future version PostgresSQL works, then we will have to update this sub. But if an ORM is introduced, this code will be removed completly anyway

Testing note:
Drops execution time of the line from 300ms to 20 microseconds (in my testing).
2011-11-06 15:49:48 +01:00
Paul Poulain
016e66c6f2 Bug 7184 raise mySQL error if debug is set
Before this patch, if a mySQL occured in Koha (any error), then the user was seeing nothing.
With this patch, if DEBUG is set in Koha VirtualHost, any mySQL error will make Koha die and display the SQL error

Step to test:
=== BEFORE PATCH ===
go anywhere, and change a mySQL statement to make it invalid.
Launch a page using the SQL you've made wrong, you'll see nothing, except you won't see the expected results

=== AFTER PATCH ===
Modify koha-httpd.conf, and add the following line, in the virtualhost (if it does not already exist)
SetEnv DEBUG 1
restart/reload Apache
Launch the same page, you'll get a Perl statement saying something like:

DBD::mysql::st execute failed: <<blablabla SQL error>> at <<where the error was raised line <<error line>>
2011-11-06 15:41:28 +01:00
Stéphane Delaune
1fafaafc9a Bug 5728: adding note and manager_id fields to accountlines
Biblibre bug #1874

Signed-off-by: fdurand <frederic.durand@univ-lyon2.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-09 21:25:18 +12:00
b1317464ec remove old revision history notes from a couple files
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
Andrew Elwell
546a0244bb More POD cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 08:38:58 -04:00
Lars Wirzenius
7279f55b60 Fix FSF address in directory C4/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:56 -04:00
afed49ccc8 fix POD errors reported by xt/author/podcorrectness.t
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-03 15:57:31 -05:00
8ad2c7d7ac Merge commit 'pianohacker-koha/prefs-submit' into master
Merge in Jesse Weaver's system preference editor changes.

Conflicts:
	C4/Bookfund.pm
	koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
	koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
	koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tmpl

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-01-26 20:26:17 -05:00
Matthias Meusburger
3733d2f300 Prevent from Deep Recursion die bug
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
2009-09-30 11:30:36 +02:00
Jesse Weaver
fdd82e8054 Add new system preferences editor
This new editor uses data files instead of descriptions stored in the
database. It also has improved search.
2009-09-06 23:02:47 -06:00
Michael Hafen
051477fbfe bugfix error if memcached_servers is empty in koha-conf.xml
XML::Simple returns by default an empty hash ref if it encounters an xml tag
with no attributes or content.  If memcached_servers is empty, as the installer
sets it when this feature is disabled, then we get the empty hash ref.

In checking if memcached_servers is set the empty hash ref evaluates as true.
I.E.

  $servers = C4::Context->config('memcached_servers');
  if ($servers) {

so we get a comiler error from memcached trying to resolve the nonexistant
server address.
2009-08-30 21:55:15 -04:00
Galen Charlton
3ed41a2cfc Revert "Bug 3226 - Extended characters inconsistantly displayed"
This reverts commit 7a3bdce23d.

Even though patches were submitted that fixed the breakage
that this commit caused to NoZebra searchs, it turns out
this breaks code that uses SimpleSearch - clients of that
routine currently expect ISO2709 blobs, not MARCXML.

No further patches for 3226 will be pushed until a complete,
comprehensive patchset is submitted that (a) includes a
test case for the original bug and (b) demonstrates that
it doesn't break any aspect of bibliographic and authority
searching.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-27 20:57:10 -04:00
7a3bdce23d Bug 3226 - Extended characters inconsistantly displayed
When displayed on result page, some UNIMARC biblio
records are marc8 to utf8 converted for whatever
reason! It appears that iso2709 records in Zebra can't
always properly by used to construct MARC::Record.
This patch ask Zebra to return xml record rather than
iso2709 and use it to create MARC::Record (like
C4::GetMarcBiblio). i

Fix facet display.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-15 09:22:02 -04:00
Galen Charlton
7013085ca5 Revert "Bug 3226 - Extended characters inconsistantly displayed"
This reverts commit 1ddb5df863.
2009-07-14 23:35:16 -04:00
1ddb5df863 Bug 3226 - Extended characters inconsistantly displayed
When displayed on result page, some UNIMARC biblio
records are marc8 to utf8 converted for whatever
reason! It appears that iso2709 records in Zebra can't
always properly by used to construct MARC::Record.
This patch ask Zebra to return xml record rather than
iso2709 and use it to create MARC::Record (like
C4::GetMarcBiblio).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-07-14 23:06:50 -04:00
Joe Atzberger
4017d2449d Remove unused variable and add FIXME.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-24 09:15:58 -05:00
Joe Atzberger
1c1c585073 Minor POD update - copied section doesn't apply to other function
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-03 14:48:44 -05: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
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
Joe Atzberger
bd76a1fb0f Context.pm fatalsToBrowser now dependent on $ENV{USER_AGENT}.
Minor adjustments to Dates.pm and associated test.  You should be able to run a
perl test that uses Context w/o getting fatalsToBrowser output.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-12 22:19:42 -05:00
MJ Ray
a9ca523ba0 Version bump to match updater/updatedatabase
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-05 19:48:15 -05:00
Mason James
e496332255 adding CGI::Carp handling handle_errors() sub to top of Context.pm
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-27 20:24:48 -05:00
Chris Cormack
f12fc20e1d Fix to get selectbranchandprinter working fine with the Session
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-06 20:48:13 -05:00
MJ Ray
e449c139ff Add configuration file helper to the installer
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-06 17:14:40 -05:00
Paul POULAIN
61c72f8f3e Adding KOHAVERSION management.
The kohaversion is in the code directory (in /kohaversion.pl)
C4::Context now has a new method C4::Context->KOHAVERSION
that returns the koha code version.
The systempreference Version contains the database version.

If the 2 are differents, when the user log in, he is redirected to web installer (new behaviour : before this commit, the check was done on everypage, it's too CPU costly I think)

In the web installer, we check now if we do a new setup or an upgrade and show only the appropriate link.

The updatedatabase contains a lot of new things :
* SetVersion($kohaversion), that set the kohaversion after each update
* TransformToNum($kohaversion) that returns a number (3.0000001 from 3.00.00.001 for example) for a given koha version
* DropAllForeignKeys($table) that does what is written : drop all foreign keys. A shame it's not possible directly in mySQL...
* for each database update, just :
add the following lines :
=item
    Describe what it does for other developpers
=cut

$DBversion = "your.koha.version.dbnumber";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
	#
	# DO YOUR UPDATE STUFF
	#
        print "Upgrade to $DBversion done (specify what it does if you want)\n";
        SetVersion ($DBversion);
}

IMPORTANT NOTES :
in koha 2.2, a new install was done through installing a 2.2.0 database, then updating it to the installed version.
in Koha 3.0, /installer/kohaversion.sql MUST contain an uptodate version, as the installer set the DB version to kohaversion after uploading kohaversion.sql. It does NOT run updatedatabase.

The update from Koha 2.2 to Koha 3.0 must NOT be done through the webinstaller : updatedatabase is very very long to run and you'll reach Apache timeout for sure. See http://wiki.koha.org/doku.php?id=22_to_30 that contains my notes for upgrading (with some/few UNIMARC specific stuff)


Note For RM, please eyeball this change

Signed-off-by: Chris Cormack <crc@liblime.com>
2007-08-16 06:58:32 -05:00
tipaul
5ff7fcffa4 Bugfixes & improvements (various and minor) :
- updating templates to have tmpl_process3.pl running without any errors
- adding a drupal-like css for prog templates (with 3 small images)
- fixing some bugs in circulation & other scripts
- updating french translation
- fixing some typos in templates
2007-05-22 09:13:54 +00:00
tipaul
9f42b8ad49 renaming currenttransfers to transferstoreceive 2007-04-23 15:21:17 +00:00
tipaul
b71839d85c circulation cleaning continued: bufixing 2007-04-17 08:44:49 +00:00
tipaul
eba2552086 Code cleaning of Biblio.pm (continued)
All subs have be cleaned :
- removed useless
- merged some
- reordering Biblio.pm completly
- using only naming conventions

Seems to have broken nothing, but it still has to be heavily tested.
Note that Biblio.pm is now much more efficient than previously & probably more reliable as well.
2007-03-29 16:45:53 +00:00
tipaul
a481fad4b7 Code cleaning :
== Biblio.pm cleaning (useless) ==
* some sub declaration dropped
* removed modbiblio sub
* removed moditem sub
* removed newitems. It was used only in finishrecieve. Replaced by a Koha2Marc+AddItem, that is better.
* removed MARCkoha2marcItem
* removed MARCdelsubfield declaration
* removed MARCkoha2marcBiblio

== Biblio.pm cleaning (naming conventions) ==
* MARCgettagslib renamed to GetMarcStructure
* MARCgetitems renamed to GetMarcItem
* MARCfind_frameworkcode renamed to GetFrameworkCode
* MARCmarc2koha renamed to TransformMarcToKoha
* MARChtml2marc renamed to TransformHtmlToMarc
* MARChtml2xml renamed to TranformeHtmlToXml
* zebraop renamed to ModZebra

== MARC=OFF ==
* removing MARC=OFF related scripts (in cataloguing directory)
* removed checkitems (function related to MARC=off feature, that is completly broken in head. If someone want to reintroduce it, hard work coming...)
* removed getitemsbybiblioitem (used only by MARC=OFF scripts, that is removed as well)
2007-03-29 13:30:31 +00:00
kados
56244e6efd Using my precrash CVS copy I did the following:
cvs -z3 -d:ext:kados@cvs.savannah.nongnu.org:/sources/koha co -P koha
find koha.precrash -type d -name "CVS" -exec rm -v {} \;
cp -r koha.precrash/* koha/
cd koha/
cvs commit

This should in theory put us right back where we were before the crash
2007-03-16 01:25:08 +00:00
tipaul
2ffd5b7228 rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
tgarip1957
ab45e7aaab Bug fixing and complete removal of Date::Manip 2006-11-06 21:01:43 +00:00
tgarip1957
c5627d23ec A new Date.pm to use for all date calculations. Mysql date calculations removed from Circ2.pm, all modules free of DateManip, a new get_today function to call in allscripts, and some bug cleaning in authorities.pm 2006-10-20 01:20:56 +00:00