Upgrading to 0.60
-----------------

1)	Introduction

The development phase for 0.55 and 0.60 has caused significant
changes to be made to the codebase and database structure.

These changes were made to improve the future functionality
of the product and cleanup some inconsistencies in the
coding in general.

2)	History

The development of 0.60, actually began with releases
0.55-dev1 through 0.55-dev20b.  The decision was made
to increment the release number to 0.60-dev21, to provide
a indication of just how significant this version, and
the changes it has underwent is.

3)	PHP Changes

3.1)	Configuration (include/config.php and/or include/local_config.php)

	The configuration system underwent a major rework to reduce the number of 
	configuration arrays to a single $CONFIG_VARS array.
	
	Part of the reason for this change, was the intention in the future of
	allowing configuration information to be stored in the database.  This
	required an easy way to expose configuration values from the database
	to each script.  A single $CONFIG_VARS array was obviously the way
	to go.
	
3.1.1)	Upgrade process

	The basic conversion is, that the original array name, has now become
	the prefix, and the array key, is the suffix.  For example, lets
	take an example of $item_input['link_same_type_only'], this has been
	changed to:
		$CONFIG_VARS['item_input.link_same_type_only']

	The exceptions to this conversion are:
	
		$opendb_email['use_php_mail']		=> $CONFIG_VARS['email.use_php_mail']
		$opendb_email['format_email_addr']	=> $CONFIG_VARS['email.friendly_email_format'] (Reversed value)

		$opendb['enable']					=> $CONFIG_VARS['site.enable']
		$opendb['title']					=> $CONFIG_VARS['site.title']
		$opendb['version']					=> $CONFIG_VARS['site.version']
		$opendb['idle_timeout']				=> $CONFIG_VARS['site.idle_timeout']
		$opendb['login_timeout']			=> $CONFIG_VARS['site.login_timeout']
		$opendb['security_hash']			=> $CONFIG_VARS['site.security_hash']
		$opendb['admin_name']				=> $CONFIG_VARS['site.admin_name']
		$opendb['admin_email']				=> $CONFIG_VARS['site.admin_email']
		$opendb['language']					=> $CONFIG_VARS['site.language']
		$opendb['theme']					=> $CONFIG_VARS['site.theme']
		$opendb['hostname']					=> $CONFIG_VARS['site.hostname']
		$opendb['hostport']					=> $CONFIG_VARS['site.hostport']
		
	Removed $opendb['timeout'] & $use_php_mail backwards compatibility.
	No backwards compatibility exists for the old configuration file format.		

3.2)	Language packs

	The use of lowercase variables for configuration was always a bit of worry, as
	it was much harder to recognise these variables in common use.  The decision was
	made to change all references to $lang_var.  The new $LANG_VARS was chosen to
	keep in line with the new $CONFIG_VARS.
	
	When using non-english language pack, the lang/english.inc.php is included
	first, in case the non-english pack is not up to date.  This will affect
	language packs which define array based variables like this:
	
	$lang_var['days_abbrev'][] = 'Sun';
	$lang_var['days_abbrev'][] = 'Mon';
	$lang_var['days_abbrev'][] = 'Tue';
	$lang_var['days_abbrev'][] = 'Wed';
	$lang_var['days_abbrev'][] = 'Thu';
	$lang_var['days_abbrev'][] = 'Fri';
	$lang_var['days_abbrev'][] = 'Sat';
	
	Instead of:
		$lang_var['days_abbrev'] = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
	
3.2.1)	Upgrade process

	No upgrade of existing language packs should be necessary as backwards compatibility
	as this level has been maintained.
	
	If you are declaring array based variables using the '[]' syntax, for each array element,
	as highlighted in the previous section, you should update the array declaration to use
	the '= array' syntax instead.
	
	Any third party themes, site plugins, addons will have to upgraded to use the
	new $LANG_VARS, instead of $lang_var however, as this portion of backwards compatibility
	is not guaranteed to be in 0.60 stable release.
	
3.3)	Language variables

	Substantial changes have been made to the language variables in lang/english.inc.php,
	which will have to be reflected in all non-english language packs.

	3.3.1)	Upgrade process

	The new System Admin 'Language Diff' tool can be used to compare the 0.54 english.inc.php
	language pack with the latest 0.60-devXX english.inc.php for details of what variables
	have been deleted/added/updated.
	
3.4)	User Language support

	The user table language field, is not supported for selecting the context language at
	PHP level. The include/config.php variable $CONFIG_VARS['login.user_language_support'] 
	can be used to enable/disable this feature.
	
3.5)	Site Plugins

	Apart from the $CONFIG_VARS and $LANG_VARS changes, the site.php was also modified to
	remove the check_url(...) call.  The functions/http.php open_url(...) will abort if it
	cannot open the specified URL, and log an error to the OpenDb logfile.  But the user
	will actually get a 'No Matches Found' error.  It was felt that for the few times where
	this would be inconvenient, the performance boost by not opening the site page twice,
	outweight it.
	
3.5.1)	Upgrade process	
	None
	
3.6)	Email support

	Non-OpenDb email support was removed completely.  Email can only be sent to OpenDb
	user.email addresses, and the include/config.php $CONFIG_VARS['site.admin_email']
	
	The $opendb_email['format_email_addr'] variable is not available, and has no equivalent
	in the 0.60.  The original intention of this variable when TRUE, is to remove all
	email formatting. 
	
	The new variable $CONFIG_VARS['email.friendly_email_format'], is set to TRUE, by default
	and will include "Name" <email address>.  If set to FALSE, this formatting will be
	removed.
	
3.6.1)	Upgrade process	
	The $CONFIG_VARS['email.users_only'] is no longer used.
	
3.7)	CSV Import support

	The format of CSV files supported has been modified, so that it works correctly with
	files saved from Excel.  The ability to support escaped delimiters using the '\' escape
	character has been removed.
	
	The Import feature now uses the standard PHP fgetcsv function instead of a custom
	solution.  The DIF support is unchanged.
	
3.7.1)	Upgrade process	
	Ensure you do not include '\' escape sequences in your CSV files.  Instead use 
	double quotes for columns with delimiters, and escape the double quote where
	required with an extra double quote, which is how Excel generates its CSV files.
	
3.8)	Borrow Configuration

	The following variables were replaced:
	
	$CONFIG_VARS['borrow.reserve_custom_email'] with 
			$CONFIG_VARS['borrow.reserve_more_information']
	$CONFIG_VARS['borrow.cancel_custom_email'] with 
			$CONFIG_VARS['borrow.cancel_more_information']
	$CONFIG_VARS['borrow.checkout_custom_email'] with 
			$CONFIG_VARS['borrow.checkout_more_information']
	$CONFIG_VARS['borrow.checkin_custom_email'] with 
			$CONFIG_VARS['borrow.checkin_more_information']

	Added new variables to control whether the notification emails are sent:
		$CONFIG_VARS['borrow.reserve_email_notification'] = TRUE;
		$CONFIG_VARS['borrow.cancel_email_notification'] = TRUE;
		$CONFIG_VARS['borrow.checkout_email_notification'] = TRUE;
		$CONFIG_VARS['borrow.quick_checkout_email_notification'] = TRUE;
		$CONFIG_VARS['borrow.checkin_email_notification'] = TRUE;
	
3.9)	Status Type functionality

	This was a huge undertaking completed as part of 0.60-dev21 and 0.60-dev22
	
	Check the docs/notes/s_status_type.txt document for complete information
	on this new functionality.
	
3.9)	Themes

	Renamed 'unavail.gif' to 'borrowed.gif'
	
3.9.1)	Upgrade process		
	Rename any unavail.gif images in your own themes to borrowed.gif
	
4.0)	Database Changes

4.1)	Table s_item_type (UPDATED)

		title_prompt column removed, the prompt value was move to the matching
		prompt field in the s_item_attribute_type record.

4.2)	Table item_instance (UPDATED)

		Renamed active_ind -> s_status_type
		Added status_comment
		
4.3)	Table s_attribute_type (UPDATED)

		Added s_field_type column.  Copied value from s_field_type column in
		s_item_attribute_type.
		
4.4)	Table s_item_attribute_type (UPDATED)

		Removed s_field_type column
		
4.5)	Table s_status_type (NEW)

		Check the docs/notes/s_status_type.txt document for complete information
		on this new functionality.


	
	


