Koha/C4
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
..
Barcodes rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Circulation bug fix : 2007-05-21 07:45:45 +00:00
tests rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Accounts.pm fixes to fine management 2007-08-14 21:32:45 -05:00
Acquisition.pm Cleaning up perldocs for make utility that MJ wrote. I was getting a bunch 2007-07-08 15:36:59 +00:00
Amazon.pm move Accounts2.pm to Accounts.pm 2007-03-09 23:30:17 +00:00
Auth.pm Adding KOHAVERSION management. 2007-08-16 06:58:32 -05:00
Auth_with_ldap.pm removing guessencoding, hard-coding utf-8 2007-06-05 08:53:19 +00:00
AuthoritiesMarc.pm removing warn compilation. 2007-07-26 15:14:05 +00:00
Biblio.pm reintroducing an important line in TransformeMarcToKoha 2007-08-14 21:32:52 -05:00
Bookfund.pm Bug FIXING: 2007-07-20 10:41:34 +00:00
Bookseller.pm adding supplier deletion feature. 2007-08-16 06:56:00 -05:00
Boolean.pm Forgot to take out debugging code 2003-02-06 07:07:54 +00:00
Branch.pm new virtual shelves changes, keyed by biblionumber 2007-08-09 09:17:49 -05:00
Breeding.pm bug fix : Sometime importing biblio return no breedingid. 2007-07-10 14:34:32 +00:00
Calendar.pm rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Circulation.pm really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
Context.pm Adding KOHAVERSION management. 2007-08-16 06:58:32 -05:00
Date.pm removing all useless %env / $env 2007-04-18 17:00:14 +00:00
Input.pm removing all useless %env / $env 2007-04-18 17:00:14 +00:00
Koha.pm using 'our' instead of 'use vars' + POD fixing. 2007-07-26 15:15:08 +00:00
Labels.pm rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
Languages.pm Cleaning up perldocs for make utility that MJ wrote. I was getting a bunch 2007-07-08 15:36:59 +00:00
Letters.pm really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
Log.pm rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
Maintainance.pm rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Members.pm really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
NewsChannels.pm rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
Output.pm really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
Overdues.pm minor code rewritte 2007-07-02 09:14:09 +00:00
Print.pm removing all useless %env / $env 2007-04-18 17:00:14 +00:00
Record.pm rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Reserves.pm really minor change : POD fixing, indentation & some compilation warn removing. 2007-07-26 15:18:46 +00:00
Review.pm rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
Search.pm reintroducing an important line in TransformeMarcToKoha 2007-08-14 21:32:52 -05:00
Serials.pm show callnumber in result list and update SQL by using LEFT JOIN 2007-08-16 06:56:17 -05:00
Stats.pm re introducing TotalPaid function as circ/stat.pl use it. 2007-06-05 10:01:17 +00:00
Suggestions.pm rel_3_0 moved to HEAD 2007-03-09 14:28:54 +00:00
VirtualShelves.pm new virtual shelves changes, keyed by biblionumber 2007-08-09 09:17:49 -05:00
Z3950.pm patches from paul 2007-08-08 07:41:19 -05:00