[Vtigercrm-commits] [vtiger-commits] r6082 - in /vtigercrm/trunk: ./ data/ include/ include/Ajax/ include/freetag/ include/utils/ install/ modules/Accounts/ modules/Activities/ modules/Calendar/ modules/Contacts/ modules/CustomView/ modules/Dashboard/ modules/Leads/ modules/Notes/ modules/Reports/ modules/Settings/ modules/Users/ schema/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 16 14:29:59 EDT 2006


Author: jeffk
Date: Tue May 16 12:29:45 2006
New Revision: 6082

Log:
refs #752. merge source:vtigercrm/branches/5.0_postgresql_integration to source:vtigercrm/trunk. clean automatic merge, no conflicts.

Modified:
    vtigercrm/trunk/data/CRMEntity.php
    vtigercrm/trunk/include/Ajax/CommonAjax.php
    vtigercrm/trunk/include/PopulateComboValues.php
    vtigercrm/trunk/include/RelatedListView.php
    vtigercrm/trunk/include/freetag/freetag.class.php
    vtigercrm/trunk/include/utils/CommonUtils.php
    vtigercrm/trunk/include/utils/UserInfoUtil.php
    vtigercrm/trunk/include/utils/utils.php
    vtigercrm/trunk/install.php
    vtigercrm/trunk/install/2setConfig.php
    vtigercrm/trunk/install/3confirmConfig.php
    vtigercrm/trunk/install/4createConfigFile.php
    vtigercrm/trunk/install/5createTables.inc.php
    vtigercrm/trunk/install/populateSeedData.php
    vtigercrm/trunk/modules/Accounts/ListView.php
    vtigercrm/trunk/modules/Accounts/ListViewTop.php
    vtigercrm/trunk/modules/Activities/Activity.php
    vtigercrm/trunk/modules/Activities/ListView.php
    vtigercrm/trunk/modules/Activities/OpenListView.php
    vtigercrm/trunk/modules/Activities/RenderRelatedListUI.php
    vtigercrm/trunk/modules/Calendar/Appointment.php
    vtigercrm/trunk/modules/Calendar/calendarLayout.php
    vtigercrm/trunk/modules/Contacts/Contact.php
    vtigercrm/trunk/modules/CustomView/CustomView.php
    vtigercrm/trunk/modules/Dashboard/display_charts.php
    vtigercrm/trunk/modules/Leads/ListView.php
    vtigercrm/trunk/modules/Notes/ListView.php
    vtigercrm/trunk/modules/Reports/PopulateReports.php
    vtigercrm/trunk/modules/Reports/ReportRun.php
    vtigercrm/trunk/modules/Settings/PickList.php
    vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
    vtigercrm/trunk/modules/Users/DetailView.php
    vtigercrm/trunk/modules/Users/LoginHistory.php
    vtigercrm/trunk/modules/Users/Security.php
    vtigercrm/trunk/parent_tabdata.php
    vtigercrm/trunk/schema/DatabaseSchema.xml
    vtigercrm/trunk/tabdata.php

Modified: vtigercrm/trunk/data/CRMEntity.php
==============================================================================
--- vtigercrm/trunk/data/CRMEntity.php (original)
+++ vtigercrm/trunk/data/CRMEntity.php Tue May 16 12:29:45 2006
@@ -99,6 +99,9 @@
 				$parentid=$_REQUEST['parent_id'];
 				if($_REQUEST['module'] != 'Emails' && $_REQUEST['module'] != 'Webmails')
 				{
+					if(!$parentid) {
+						$parentid = $adb->getUniqueID('seactivityrel');
+					}
 					$mysql='insert into seactivityrel values('.$parentid.','.$actid.')';
 					$adb->query($mysql);
 				}
@@ -361,7 +364,7 @@
 		$adb->query($sql1);
 		if($ownerid != $current_user->id)
 		{
-			$sql1 = "insert into ownernotify values(".$this->id.",".$ownerid.",'')";
+			$sql1 = "insert into ownernotify values(".$this->id.",".$ownerid.",null)";
 			$adb->query($sql1);
 		}
 	}
@@ -404,7 +407,7 @@
 		else
 		{
 			$description_val = from_html($adb->formatString("crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false);
-			$sql = "insert into crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",'".$date_var."','".$date_var."')";
+			$sql = "insert into crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",".$adb->formatDate($date_var).",".$adb->formatDate($date_var).")";
 			$adb->query($sql);
 			$this->id = $current_id;
 		}
@@ -810,7 +813,7 @@
 			  {
 				  if($table_name == 'activity')
                                   {
-			             updateActivityGroupRelation($this->id,'');
+			             updateActivityGroupRelation($this->id,$groupname);
 				  }
 			  }
 			  	
@@ -1014,7 +1017,7 @@
 	{
 		$activity_id=$this->id;
 
-		$sql='select min(recurringdate) min_date,max(recurringdate) max_date,recurringtype from recurringevents where activityid='. $activity_id.' group by activityid';
+		$sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from recurringevents where activityid='. $activity_id.' group by activityid, recurringtype';
 		
 		$result = $adb->query($sql);
 		$noofrows = $adb->num_rows($result);
@@ -1083,7 +1086,7 @@
 				$tdate=$date_array[$k];
 				if($tdate <= $end_date)
 				{
-					$max_recurid_qry = 'select max(recurringid) recurid  from recurringevents;';
+					$max_recurid_qry = 'select max(recurringid) AS recurid from recurringevents;';
 					$result = $adb->query($max_recurid_qry);
 					$noofrows = $adb->num_rows($result);
 					for($i=0; $i<$noofrows; $i++)
@@ -1091,7 +1094,7 @@
 						$recur_id = $adb->query_result($result,$i,"recurid");
 					}
 					$current_id =$recur_id+1;
-					$recurring_insert = 'insert into recurringevents values ("'.$current_id.'","'.$this->id.'","'.$tdate.'","'.$type.'")';
+					$recurring_insert = "insert into recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."')";
 					$adb->query($recurring_insert);
 					if($_REQUEST['set_reminder'] == 'Yes')
 					{

Modified: vtigercrm/trunk/include/Ajax/CommonAjax.php
==============================================================================
--- vtigercrm/trunk/include/Ajax/CommonAjax.php (original)
+++ vtigercrm/trunk/include/Ajax/CommonAjax.php Tue May 16 12:29:45 2006
@@ -34,7 +34,7 @@
 	$module = $_REQUEST["module"];
 	$useid = $current_user->id;
 	global $adb;
-	$query='select * from freetagged_objects where module = "'.$module .'"';
+	$query="select * from freetagged_objects where module = '".$module ."'";
 	$result=$adb->query($query);
 	if($adb->num_rows($result) > 0)
 	{

Modified: vtigercrm/trunk/include/PopulateComboValues.php
==============================================================================
--- vtigercrm/trunk/include/PopulateComboValues.php (original)
+++ vtigercrm/trunk/include/PopulateComboValues.php Tue May 16 12:29:45 2006
@@ -26,13 +26,14 @@
 		$i=0;
 		foreach ($values as $val => $cal)
 		{
+			$id = $adb->getUniqueID($tableName);
 			if($val != '')
 			{
-				$adb->query("insert into ".$tableName. " values(null,'".$val."',".$i.",1)");
+				$adb->query("insert into ".$tableName. " values(".$id.",'".$val."',".$i.",1)");
 			}
 			else
 			{
-				$adb->query("insert into ".$tableName. " values(null,'--None--',".$i.",1)");
+				$adb->query("insert into ".$tableName. " values(".$id.",'--None--',".$i.",1)");
 			}
 			$i++;
 		}

Modified: vtigercrm/trunk/include/RelatedListView.php
==============================================================================
--- vtigercrm/trunk/include/RelatedListView.php (original)
+++ vtigercrm/trunk/include/RelatedListView.php Tue May 16 12:29:45 2006
@@ -80,12 +80,6 @@
 	if(isset($where) && $where != '')
 	{
 		$query .= ' and '.$where;
-	}
-
-	//Appending the group by for Jaguar/Don
-	if($relatedmodule == 'Activities')
-	{
-		$query .= ' group by crmentity.crmid';
 	}
 
 

Modified: vtigercrm/trunk/include/freetag/freetag.class.php
==============================================================================
--- vtigercrm/trunk/include/freetag/freetag.class.php (original)
+++ vtigercrm/trunk/include/freetag/freetag.class.php Tue May 16 12:29:45 2006
@@ -378,7 +378,7 @@
 		}
 		$prefix = $this->_table_prefix;
 
-		$sql = "SELECT DISTINCT tag, raw_tag, tagger_id
+		$sql = "SELECT DISTINCT tag, raw_tag, tagger_id, id
 			FROM ${prefix}freetagged_objects INNER JOIN ${prefix}freetags ON (tag_id = id)
 			WHERE object_id = $object_id
 			$tagger_sql
@@ -437,7 +437,7 @@
 		}
 		$sql = "SELECT COUNT(*) as count 
 			FROM ${prefix}freetagged_objects INNER JOIN ${prefix}freetags ON (tag_id = id)
-			WHERE 1 
+			WHERE 1=1 
 			$tagger_sql
 			AND object_id = $object_id
 			AND tag = $normalized_tag
@@ -964,14 +964,12 @@
 		$sql = "SELECT tag, COUNT(object_id) AS quantity
 			FROM ${prefix}freetags INNER JOIN ${prefix}freetagged_objects
 			ON (${prefix}freetags.id = tag_id)
-			WHERE 1
+			WHERE 1=1
 			$tagger_sql
 			GROUP BY tag
-			ORDER BY quantity DESC
-			LIMIT 0, $max
-			";
+			ORDER BY quantity DESC";
         //echo $sql;
-		$rs = $adb->query($sql) or die("Syntax Error: $sql");
+		$rs = $adb->limitQuery($sql, 0, $max) or die("Syntax Error: $sql");
 		while(!$rs->EOF) {
 			$retarr[$rs->fields['tag']] = $rs->fields['quantity'];
 			$rs->MoveNext();

Modified: vtigercrm/trunk/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/CommonUtils.php (original)
+++ vtigercrm/trunk/include/utils/CommonUtils.php Tue May 16 12:29:45 2006
@@ -1681,7 +1681,7 @@
 			 'Contacts'=>'LNK_NEW_CONTACT',
 			 'Vendors'=>'LNK_NEW_VENDOR'); 	
 
-$qc_query = "select distinct tablabel,tab.name from field inner join tab on tab.tabid = field.tabid where quickcreate=0 order by tab.tablabel";
+$qc_query = "select distinct tab.tablabel,tab.name from field inner join tab on tab.tabid = field.tabid where quickcreate=0 order by tab.tablabel";
 $result = $adb->query($qc_query);
 $noofrows = $adb->num_rows($result);
 $qcmodule_array = Array();

Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php
==============================================================================
--- vtigercrm/trunk/include/utils/UserInfoUtil.php (original)
+++ vtigercrm/trunk/include/utils/UserInfoUtil.php Tue May 16 12:29:45 2006
@@ -1219,9 +1219,11 @@
 $log->debug("Entering updateActivityGroupRelation(".$activityid.",".$groupname.") method ...");
 	global $adb;
   $sqldelete = "delete from activitygrouprelation where activityid=".$activityid;
-  $adb->query($sqldelete);
-  $sql = "insert into activitygrouprelation values (".$activityid .",'" .$groupname ."')";  
-  $adb->query($sql);
+  if($groupname != '' && $groupname != 'null') {
+	  $adb->query($sqldelete);
+	  $sql = "insert into activitygrouprelation values (".$activityid .",'" .$groupname ."')";  
+	  $adb->query($sql);
+  }
   $log->debug("Exiting updateActivityGroupRelation method ...");
 
 }

Modified: vtigercrm/trunk/include/utils/utils.php
==============================================================================
--- vtigercrm/trunk/include/utils/utils.php (original)
+++ vtigercrm/trunk/include/utils/utils.php Tue May 16 12:29:45 2006
@@ -1161,7 +1161,7 @@
 function ChangeStatus($status,$activityid,$activity_mode='')
  {
 	global $log;
-	$log->debug("Entering ChangeStatus(".$status.",".$activityid.",".$activity_mode=''.") method ...");
+	$log->debug("Entering ChangeStatus(".$status.",".$activityid.",".$activity_mode."='') method ...");
         $log->info("in ChangeStatus ".$status. ' activityid is  '.$activityid);
 
         global $adb;
@@ -1173,7 +1173,9 @@
         {
                 $query = "Update activity set eventstatus='".$status."' where activityid = ".$activityid;
         }
-        $adb->query($query);
+	if($query) {
+        	$adb->query($query);
+	}
 	$log->debug("Exiting ChangeStatus method ...");
  }
 
@@ -1202,7 +1204,11 @@
 		list($y,$m,$d) = split('-',$value);
 	}
 		
-	$insert_date=$y.'-'.$m.'-'.$d;
+	if(!$y && !$m && !$d) {
+		$insert_date = '';
+	} else {
+		$insert_date=$y.'-'.$m.'-'.$d;
+	}
 	$log->debug("Exiting getDBInsertDateValue method ...");
 	return $insert_date;
 }
@@ -1274,7 +1280,7 @@
 function getProductImageName($id,$deleted_array='')
 {
 	global $log;
-	$log->debug("Entering getProductImageName(".$id.",".$deleted_array=''.") method ...");
+	$log->debug("Entering getProductImageName(".$id.",".$deleted_array."='') method ...");
 	global $adb;
 	$image_array=array();	
 	$query = "select imagename from products where productid=".$id;

Modified: vtigercrm/trunk/install.php
==============================================================================
--- vtigercrm/trunk/install.php (original)
+++ vtigercrm/trunk/install.php Tue May 16 12:29:45 2006
@@ -16,6 +16,8 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install.php,v 1.2 2004/10/06 09:02:02 jack Exp $
  * Description:  Starts the installation process.
  ********************************************************************************/
+
+include('adodb/adodb.inc.php');
 
 if (substr(phpversion(), 0, 1) == "5") {
 	ini_set("zend.ze1_compatibility_mode", "1");

Modified: vtigercrm/trunk/install/2setConfig.php
==============================================================================
--- vtigercrm/trunk/install/2setConfig.php (original)
+++ vtigercrm/trunk/install/2setConfig.php Tue May 16 12:29:45 2006
@@ -89,6 +89,11 @@
 	elseif (isset($dbconfig['db_password']))
 	$db_password = $dbconfig['db_password'];
 
+	if (isset($_REQUEST['db_type']))
+	$db_type = $_REQUEST['db_type'];
+	elseif (isset($dbconfig['db_type']))
+	$db_type = $dbconfig['db_type'];
+
 	if (isset($_REQUEST['db_name']))
 	$db_name = $_REQUEST['db_name'];
 	elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_')
@@ -140,6 +145,15 @@
 		!isset($_REQUEST['mail_server_username']) ? $mail_server_username = $mail_server_username : $mail_server_username = stripslashes($_REQUEST['mail_server_username']);
 		!isset($_REQUEST['mail_server_password']) ? $mail_server_password = $mail_server_password : $mail_server_password = stripslashes($_REQUEST['mail_server_password']);
 		!isset($_REQUEST['admin_email']) ? $admin_email = "" : $admin_email = $_REQUEST['admin_email'];
+		}
+
+		// determine database options
+		$db_options = array();
+		if(function_exists('mysql_connect')) {
+			$db_options['mysql'] = 'MySQL';
+		}
+		if(function_exists('pg_connect')) {
+			$db_options['pgsql'] = 'Postgres';
 		}
 ?>
 
@@ -295,9 +309,19 @@
 			<tr><td colspan=2><strong>Database Configuration</strong></td></tr>
 			<tr>
                <td width="25%" nowrap bgcolor="#F5F5F5" ><strong>Database Type</strong> <sup><font color=red>*</font></sup></td>
-               <td width="75%" bgcolor="white" align="left"><select name="dbtype">
-			   <option value="mysql" selected="selected">MySQL</option>
-			   </select>
+               <td width="75%" bgcolor="white" align="left">
+		<?php if(!$db_options) : ?>
+			No Database Support Deteched
+		<?php elseif(count($db_options) == 1) : ?>
+			<?php list($db_type, $label) = each($db_options); ?>
+			<input type="hidden" name="db_type" value="<?php echo $db_type ?>"><?php echo $label ?>
+		<?php else : ?>
+			<select name="db_type">
+			<?php foreach($db_options as $db_option_type => $label) : ?>
+				<option value="<?php echo $db_option_type ?>" <?php if(isset($db_type) && $db_type == $db_option_type) { echo "SELECTED"; } ?>><?php echo $label ?></option>
+			<?php endforeach ?>
+			</select>
+		<?php endif ?>
 			   </td>
             </tr>
 			<tr>

Modified: vtigercrm/trunk/install/3confirmConfig.php
==============================================================================
--- vtigercrm/trunk/install/3confirmConfig.php (original)
+++ vtigercrm/trunk/install/3confirmConfig.php Tue May 16 12:29:45 2006
@@ -33,701 +33,270 @@
 if (isset($_REQUEST['ftpserver'])) $ftpserver= $_REQUEST['ftpserver'];
 if (isset($_REQUEST['ftpuser'])) $ftpuser = $_REQUEST['ftpuser'];
 if (isset($_REQUEST['ftppassword'])) $ftppassword= $_REQUEST['ftppassword'];
-if (isset($_REQUEST['dbtype'])) $dbtype	= $_REQUEST['dbtype'];
-
-//Checking for mysql connection parameters
-
-$mysql_status = '';
-$mysql_db_status = '';
-if($dbtype != 'mysql' || $dbtype =='')
-{
-	$mysql_status = 'false';
-	$mysql_db_status = 'false';
-}
-else
-{
-	$mysql_status = 'true';
-	$conn = @mysql_pconnect($db_hostname,$db_username,$db_password);
-	if(!$conn)
+if (isset($_REQUEST['db_type'])) $db_type	= $_REQUEST['db_type'];
+
+$db_type_status = false; // is there a db type?
+$db_server_status = false; // does the db server connection exist?
+$db_creation_failed = false; // did we try to create a database and fail?
+$db_exist_status = false; // does the database exist?
+$next = false; // allow installation to continue
+
+//Checking for database connection parameters
+if($db_type)
+{
+	include('adodb/adodb.inc.php');
+	$conn = &NewADOConnection($db_type);
+	$db_type_status = true;
+	if($conn->Connect($db_hostname,$db_username,$db_password))
 	{
-		$mysqlconn_status = 'false';
-	}else
-	{
-		$mysqlconn_status = 'true';
-		$version = explode('-',mysql_get_server_info($conn));
-		$mysql_server_version=$version[0];
+		$db_server_status = true;
+		if($db_type=='mysql')
+		{
+			$version = explode('-',mysql_get_server_info($conn));
+			$mysql_server_version=$version[0];
+		}
 		if($_REQUEST['check_createdb'] == 'on')
 		{
 			$root_user = $_REQUEST['root_user'];
 			$root_password = $_REQUEST['root_password'];
-			$create_conn = @mysql_connect($db_hostname,$root_user,$root_password);
-			if(mysql_select_db($db_name,$create_conn))
+
+			// drop the current database if it exists
+			$dropdb_conn = &NewADOConnection($db_type);
+			if($dropdb_conn->Connect($db_hostname, $root_user, $root_password, $db_name))
 			{
 				$query = "drop database ".$db_name;
-				@mysql_query($query);
+				$dropdb_conn->Execute($query);
+				$dropdb_conn->Close();
 			}
-			$query = "create database ".$db_name;
-			$dbstatus = @mysql_query($query);
-			if(!$dbstatus)
-			{
-				$mysql_createddb_status = 'false';
-			}
-			else	
-			{
-				$mysql_db_status = 'true';
-				$mysql_createddb_status = 'true';
-			}
-			@mysql_close($create_conn);	
-		}else
-		{	
-			if(mysql_select_db($db_name,$conn))
-			{
-				$mysql_db_status = 'true';
-			}else
-			{
-				$mysql_db_status = 'false';
+
+			// create the new database
+			$db_creation_failed = true;
+			$createdb_conn = &NewADOConnection($db_type);
+			if($createdb_conn->Connect($db_hostname, $root_user, $root_password)) {
+				$query = "create database ".$db_name;
+				if($createdb_conn->Execute($query)) {
+					$db_creation_failed = false;
+				}
+				$createdb_conn->Close();
 			}
 		}
+
+		// test the connection to the database
+		if($conn->Connect($db_hostname, $db_username, $db_password, $db_name))
+		{
+			$db_exist_status = true;
+		}
+		$conn->Close();
 	}
 }
-$conn = @mysql_pconnect($db_hostname,$db_username,$db_password);
-
-if($mysql_status == 'true' && $mysqlconn_status == 'false')
-{
+
+$error_msg = '';
+$error_msg_info = '';
+
+if(!$db_type_status || !$db_server_status)
+{
+	$error_msg = 'Unable to connect to database Server. Invalid mySQL Connection Parameters specified';
+	$error_msg_info = 'This may be due to the following reasons:<br>
+			-  specified database user, password, hostname, database type, or port is invalid.<BR>
+			-  specified database user does not have access to connect to the database server from the host';
+}
+elseif($db_type == 'mysql' && ($mysql_server_version < '4.1' || $mysql_server_version > '5.0.19'))
+{
+	$error_msg = 'MySQL version '.$mysql_server_version.' is not supported, kindly connect to MySQL 4.1.x or above';
+}
+elseif($db_creation_failed)
+{
+	$error_msg = 'Unable to Create Database '.$db_name;
+	$error_msg_info = 'Message: The database User "'. $root_user .'" doesn\'t have permission to Create database. Try changing the Database settings';
+}
+elseif(!$db_exist_status)
+{
+	$error_msg = 'The Database "'.$db_name.'" is not found.Try changing the Database settings';
+}
+else
+{
+	$next = true;
+}
+
 ?>
-	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	<HTML>
-	<HEAD>
-	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-	<title>vtiger CRM 5.0 beta Installer: Step 3</title>
-	<link rel="stylesheet" href="include/install/install.css" type="text/css" />
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+		<title>vtiger CRM 5.0 beta Installer: Step 3</title>
+		<link rel="stylesheet" href="include/install/install.css" type="text/css" />
 	</head>
 	<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
 
-
-	<!-- Master table -->
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td align=center>
-	<br><br>
-	<!--  Top Header -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
-	<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
-	</tr>
-	</table>
-
-	<!-- 3 of 5 header -->
-	<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small> 
-	<tr>	
-	<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	<td width=98% valign=top>
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
-	<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
-	</tr>
-	<tr>
-	<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	</tr>
-	</table>
-	<hr noshade size=1>
-	</td>
-
-	</tr>
-	<tr>
-	<td></td>
-	<td valign="top" align=center>
-	<!-- ---------------------------------------------- System Configuration -- -->
-
-	<table border=0 cellspacing=0 cellpadding=10 width=90% class=small >
-	<tr>
-	<td>
-	<!-- Error Messages -->
-	<b><span style="background-color:#ff0000;padding:5px;color:#ffffff;">Unable to connect to database Server. Invalid mySQL Connection Parameters specified</span></b><br><br>
-	This may be due to the following reasons:<br>
-	-  specified database user, password , hostname or port is invalid.<BR>
-	-  specified database user does not have access to connect to the database server from the host
-
-
-	<br><br>
-	<table width="100%" cellpadding="5" border="0" style="background-color:#cccccc" cellspacing="1" class=small>
-	<tr>
-	<td colspan=2><strong>Database Configuration, as provided by you</strong></td>
-	</tr>
-	<tr>
-	<td bgcolor="#F5F5F5" width="40%">Host Name</td>
-	<td bgcolor="White" align="left" nowrap><font class="dataInput"><?php if (isset($db_hostname)) echo "$db_hostname"; ?></font></td>
-	</tr>
-	<tr>
-	<td bgcolor="#F5F5F5" width="40%">User Name</td>
-	<td bgcolor="White" align="left" nowrap><font class="dataInput"><?php if (isset($db_username)) echo "$db_username"; ?></font></td>
-	</tr>
-	<tr>
-	<td noWrap bgcolor="#F5F5F5" width="40%">Password</td>
-	<td bgcolor="White" align="left" nowrap><font class="dataInput"><?php if (isset($db_password)) echo ereg_replace('.', '*', $db_password); ?></font></td>
-	</tr>
-	<tr>
-	<td noWrap bgcolor="#F5F5F5" width="40%">Database Name</td>
-	<td bgcolor="White" align="left" nowrap> <font class="dataInput"><?php if (isset($db_name)) echo "$db_name"; ?></font></td>
-	</tr>
-	</table>
-
-	<!-- ---------------------------------------------- System Configuration -- -->
-
-	</td>
-	</tr>
-	</table>
-	<br>
-	<table border=0 cellspacing=0 cellpadding=10 width=100%>
-	<tr>
-	<td align=center>
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="2setConfig.php">
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" name="next" value="Change" src="include/install/images/cwBtnChange.gif" />
-	</form>
-	</td>
-	</tr>
-	</table>
-
-	</td>
-	</tr>
-	</table>
-	<!-- Horizontal Shade -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwShadeLeft.gif"></td>
-	<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
-	</tr>
-	</table><br><br>
-
-	<!-- 3 of 5 closes -->
-
-	</td>
-	</tr>
-	</table>
+		<!-- Master table -->
+		<table border=0 cellspacing=0 cellpadding=0 width=100%>
+			<tr>
+				<td align=center>
+					<br><br>
+					<!--  Top Header -->
+					<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
+						<tr>
+							<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
+							<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
+						</tr>
+					</table>
+
+					<!-- 3 of 5 header -->
+					<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small>
+						<tr>
+							<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
+							<td width=98% valign=top>
+								<table border=0 cellspacing=0 cellpadding=0 width=100%>
+									<tr>
+										<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
+										<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
+									</tr>
+									<tr>
+										<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
+									</tr>
+								</table>
+								<hr noshade size=1>
+							</td>
+
+						</tr>
+						<tr>
+							<td></td>
+							<td valign="top" align="center">
+								<?php if($error_msg) : ?>
+								<div style="background-color:#ff0000;color:#ffffff;padding:5px">
+									<b><?php echo $error_msg ?></b>
+								</div>
+								<?php if($error_msg_info) : ?>
+								<p><? echo $error_msg_info ?><p>
+								<?php endif ?>
+								<?php endif ?>
+								<table width="90%" cellpadding="5" border="0" class="small" style="background-color:#cccccc" cellspacing="1">
+									<tr>
+										<td ><strong>Database Configuration</strong></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">Host Name</td>
+										<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_hostname)) echo "$db_hostname"; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">User Name</td>
+										<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_username)) echo "$db_username"; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%" noWrap>Password</td>
+										<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_password)) echo ereg_replace('.', '*', $db_password); ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td noWrap bgcolor="#F5F5F5" width="40%">Database Type</td>
+										<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_type)) echo "$db_type"; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td noWrap bgcolor="#F5F5F5" width="40%">Database Name</td>
+										<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_name)) echo "$db_name"; ?></font></td>
+									</tr>
+								</table>
+								<table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
+									<tr>
+										<td colspan=2 ><h4>Site Configuration</h4></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">URL</td>
+										<td align="left"> <font class="dataInput"><?php if (isset($site_URL)) echo $site_URL; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">Path</td>
+										<td align="left"><font class="dataInput"><?php if (isset($root_directory)) echo $root_directory; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">Cache Path</td>
+										<td align="left"> <font class="dataInput"><?php if (isset($cache_dir)) echo $root_directory.''.$cache_dir; ?></font></td>
+									</tr>
+									<tr bgcolor="White">
+										<td bgcolor="#F5F5F5" width="40%">Admin Password</td>
+										<td align="left"> <font class="dataInput"><?php if (isset($admin_password)) echo ereg_replace('.', '*', $admin_password); ?></font></td>
+									</tr>
+
+								</table>
+
+								<br><br>
+								<table width="90%" cellpadding="5" border="0" class="small" >
+									<tr>
+										<td align="left" valign="bottom">
+											<form action="install.php" method="post" name="form" id="form">
+												<input type="hidden" name="file" value="2setConfig.php">
+												<input type="hidden" class="dataInput" name="db_type" value="<?php if (isset($db_type)) echo "$db_type"; ?>" />
+												<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
+												<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
+												<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
+												<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
+												<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
+												<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
+												<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
+												<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
+												<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
+												<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
+												<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
+												<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
+												<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
+												<input type="image" name="Change" value="Change" src="include/install/images/cwBtnChange.gif"/>
+											</form>
+										</td>
+
+										<?php if($next) : ?>
+										<td align="right" valign="bottom">
+
+											<form action="install.php" method="post" name="form" id="form">
+												<input type="hidden" name="file" value="4createConfigFile.php">
+												<table class=small>
+													<tr>
+														<td><input type="checkbox" class="dataInput" name="db_populate" value="1"></td>
+														<td>Populate database with demo data</td>
+													</tr>
+												</table>
+												<input type="hidden" class="dataInput" name="db_type" value="<?php if (isset($db_type)) echo "$db_type"; ?>" />
+												<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
+												<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
+												<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
+												<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
+												<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
+												<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
+												<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
+												<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
+												<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
+												<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($mail_server)) echo $mail_server; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($mail_server_username)) echo $mail_server_username; ?>" />
+												<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($mail_server_password)) echo $mail_server_password; ?>" />
+												<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
+												<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
+												<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
+												<input type="image" src="include/install/images/cwBtnNext.gif" name="next" value="Create" onClick="window.location=('install.php')"/>
+											</form>
+
+										</td>
+										<?php endif ?>
+									</tr>
+								</table>
+
+							</td>
+						</tr>
+					</table>
+					<!-- -->
+					<br><br>
+					<!-- Horizontal Shade -->
+					<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
+						<tr>
+							<td><img src="include/install/images/cwShadeLeft.gif"></td>
+							<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
 	<!-- Master table closes -->
-
-
-
 	</body>
-	</html>
-<?php
-}
-elseif($mysql_server_version < '4.1' || $mysql_server_version > '5.0.19')
-{
-?>
-	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	<HTML>
-	<HEAD>
-	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-	<title>vtiger CRM 5.0 beta Installer: Step 3</title>
-	<link rel="stylesheet" href="install/install.css" type="text/css" />
-	</head>
-	<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
-
-	<!-- Master table -->
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td align=center>
-	<br><br>
-	<!--  Top Header -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
-	<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
-	</tr>
-	</table>
-
-
-
-	<!-- 3 of 5 header -->
-	<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small> 
-	<tr>	
-	<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	<td width=98% valign=top>
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
-	<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
-	</tr>
-	<tr>
-	<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	</tr>
-	</table>
-	<hr noshade size=1>
-	</td>
-
-	</tr>
-	<tr>
-	<td></td>
-	<td valign="top" align=center>
-	<! ---------------------------------------------- System Configuration-->
-
-	<div style="background-color:#ff0000;color:#ffffff;padding:5px">
-	<b>MySQL version <?php echo $mysql_server_version; ?> is not supported,kindly connect to MySQL 4.1.x or above</b>
-	</div>
-	<br><br>
-	<table border=0 width=100% cellspacing=0 cellpadding=0>
-	<tr>
-	<td align=center>
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="2setConfig.php">
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" name="next" value="Change" src="include/install/images/cwBtnChange.gif"/>
-	</form>
-	</td>
-	</tr>
-	</table>
-
-
-	</td>
-	</tr>
-	</table>
-	<!-- Horizontal Shade -->
-	<br><br>
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwShadeLeft.gif"></td>
-	<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
-	</tr>
-	</table><br><br>
-
-
-	<!-- 3 of 5 stops -->
-
-	</td>
-	</tr>
-	</table>
-
-
-
-
-<?php
-}
-elseif($mysql_status == 'true' && $mysqlconn_status =='true' && $mysql_createddb_status == 'false')
-{
-?>
-	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	<HTML>
-	<HEAD>
-	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-	<title>vtiger CRM 5.0 beta Installer: Step 3</title>
-	<link rel="stylesheet" href="install/install.css" type="text/css" />
-	</head>
-	<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
-
-	<!-- Master table -->
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td align=center>
-	<br><br>
-	<!--  Top Header -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
-	<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
-	</tr>
-	</table>
-
-
-
-	<!-- 3 of 5 header -->
-	<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small> 
-	<tr>	
-	<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	<td width=98% valign=top>
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
-	<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
-	</tr>
-	<tr>
-	<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	</tr>
-	</table>
-	<hr noshade size=1>
-	</td>
-
-	</tr>
-	<tr>
-	<td></td>
-	<td valign="top" align=center>
-	<! ---------------------------------------------- System Configuration-->
-
-	<div style="background-color:#ff0000;color:#ffffff;padding:5px">
-	<b>Unable to Create Database <?php echo $db_name ?></b>
-	</div>
-	<P>Message: The MySQL User "<? echo $root_user ?>" doesn't have permission to Create database. Try changing the Database settings<P></font>
-
-	<br><br>
-	<table border=0 width=100% cellspacing=0 cellpadding=0>
-	<tr>
-	<td align=center>
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="2setConfig.php">
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" name="next" value="Change" src="include/install/images/cwBtnChange.gif"/>
-	</form>
-	</td>
-	</tr>
-	</table>
-
-
-	</td>
-	</tr>
-	</table>
-	<!-- Horizontal Shade -->
-	<br><br>
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwShadeLeft.gif"></td>
-	<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
-	</tr>
-	</table><br><br>
-
-
-	<!-- 3 of 5 stops -->
-
-	</td>
-	</tr>
-	</table>
-
-
-
-
-<?php
-}
-elseif($mysql_status == 'true' && $mysqlconn_status =='true' && $mysql_db_status == 'false')
-{
-?>
-	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	<HTML>
-	<HEAD>
-	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-	<title>vtiger CRM 5.0 beta Installer: Step 3</title>
-	<link rel="stylesheet" href="install/install.css" type="text/css" />
-	</head>
-	<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
-
-	<!-- Master table -->
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td align=center>
-	<br><br>
-	<!--  Top Header -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
-	<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
-	</tr>
-	</table>
-
-
-
-	<!-- 3 of 5 header -->
-	<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small> 
-	<tr>	
-	<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	<td width=98% valign=top>
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
-	<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
-	</tr>
-	<tr>
-	<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	</tr>
-	</table>
-	<hr noshade size=1>
-	</td>
-
-	</tr>
-	<tr>
-	<td></td>
-	<td valign="top" align=center>
-	<! ---------------------------------------------- System Configuration-->
-
-	<div style="background-color:#ff0000;color:#ffffff;padding:5px">
-	<b>The Database "<?php echo $db_name ?>"  is not found.Try changing the Database settings</b>
-	</div>
-
-	<br><br>
-	<table border=0 width=100% cellspacing=0 cellpadding=0>
-	<tr>
-	<td align=center>
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="2setConfig.php">
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" name="next" value="Change" src="include/install/images/cwBtnChange.gif"/>
-	</form>
-	</td>
-	</tr>
-	</table>
-
-
-	</td>
-	</tr>
-	</table>
-	<!-- Horizontal Shade -->
-	<br><br>
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwShadeLeft.gif"></td>
-	<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
-	</tr>
-	</table><br><br>
-
-
-	<!-- 3 of 5 stops -->
-
-	</td>
-	</tr>
-	</table>
-
-
-
-
-<?php
-}
-elseif($mysql_status == 'true' && $mysqlconn_status == 'true' && ($mysql_db_status == 'true' || $mysql_createddb_status == 'true'))
-{
-?>
-	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	<HTML>
-	<HEAD>
-	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-	<title>vtiger CRM 5.0 beta Installer: Step 3</title>
-	<link rel="stylesheet" href="install/install.css" type="text/css" />
-	<link rel="stylesheet" href="style.css" type="text/css" />
-	</head>
-
-	<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
-
-	<!-- Master table -->
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td align=center>
-	<br><br>
-	<!--  Top Header -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwTopBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwTopLeft.gif" alt="vtiger CRM" title="vtiger CRM"></td>
-	<td align=right><img src="include/install/images/cwTopRight.gif" alt="v5alpha4" title="v5alpha4"></td>
-	</tr>
-	</table>
-
-
-
-	<!-- 3 of 5 header -->
-	<table border="0" cellspacing="0" cellpadding="5" width="75%" class=small> 
-	<tr>	
-	<td valign=top><img src="include/install/images/cwIcoSystem.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	<td width=98% valign=top>
-	<table border=0 cellspacing=0 cellpadding=0 width=100%>
-	<tr>
-	<td><img src="include/install/images/cwHdrVtConfWiz.gif" alt="vtiger CRM Configuration Wizard" title="vtiger CRM Configuration Wizard"></td>
-	<td align=right><img src="include/install/images/cwStep3of5.gif" alt="Step 3 of 5" title="Step 3 of 5"></td>
-	</tr>
-	<tr>
-	<td colspan=2><img src="include/install/images/cwHdrCnfSysConf.gif" alt="Confirm Configuration" title="Confirm Configuration"></td>
-	</tr>
-	</table>
-	<hr noshade size=1>
-	</td>
-
-	</tr>
-	<tr>
-	<td></td>
-	<td valign="top" align=center>
-	<!-- ---------------------------------------------- System Configuration-- -->
-
-	<table width="90%" cellpadding="5" border="0" class="small" style="background-color:#cccccc" cellspacing="1"><tbody>
-	<tr>
-	<td ><strong>Database Configuration</strong></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%">Host Name</td>
-	<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_hostname)) echo "$db_hostname"; ?></font></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%">User Name</td>
-	<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_username)) echo "$db_username"; ?></font></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%" noWrap>Password</td>
-	<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_password)) echo ereg_replace('.', '*', $db_password); ?></font></td>
-	</tr>
-	<tr bgcolor="White">
-	<td noWrap bgcolor="#F5F5F5" width="40%">Database Name</td>
-	<td align="left" nowrap> <font class="dataInput"><?php if (isset($db_name)) echo "$db_name"; ?></font></td>
-	</tr>
-	</table><br>
-
-	<table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc"><tbody>
-	<tr>
-	<td colspan=2 ><h4>Site Configuration</h4></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%">URL</td>
-	<td align="left"> <font class="dataInput"><?php if (isset($site_URL)) echo $site_URL; ?></font></td>
-	</tr>
-	<tr bgcolor="White"> 
-	<td bgcolor="#F5F5F5" width="40%">Path</td>
-	<td align="left"> <font class="dataInput"><?php if (isset($root_directory)) echo $root_directory; ?></font></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%">Cache Path</td>
-	<td align="left"> <font class="dataInput"><?php if (isset($cache_dir)) echo $root_directory.''.$cache_dir; ?></font></td>
-	</tr>
-	<tr bgcolor="White">
-	<td bgcolor="#F5F5F5" width="40%">Admin Password</td>
-	<td align="left"> <font class="dataInput"><?php if (isset($admin_password)) echo ereg_replace('.', '*', $admin_password); ?></font></td>
-	</tr>
-
-	</tbody>
-	</table>
-	<br><br>
-
-	<table width="90%" cellpadding="5" border="0" class="small" >
-	<tr>
-	<td align="left" valign="bottom">
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="2setConfig.php">
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($maill_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($maill_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($maill_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" name="Change" value="Change" src="include/install/images/cwBtnChange.gif"/></td>
-	</form>
-	</td>
-
-	<td align="right" valign="bottom">
-
-	<form action="install.php" method="post" name="form" id="form">
-	<input type="hidden" name="file" value="4createConfigFile.php">
-	<table class=small>
-	<tr>
-	<td><input type="checkbox" class="dataInput" name="db_populate" value="1"></td>
-	<td>Populate database with demo data</td>
-	</tr>
-	</table>
-
-	<input type="hidden" class="dataInput" name="db_hostname" value="<?php if (isset($db_hostname)) echo "$db_hostname"; ?>" />
-	<input type="hidden" class="dataInput" name="db_username" value="<?php if (isset($db_username)) echo "$db_username"; ?>" />
-	<input type="hidden" class="dataInput" name="db_password" value="<?php if (isset($db_password)) echo "$db_password"; ?>" />
-	<input type="hidden" class="dataInput" name="db_name" value="<?php if (isset($db_name)) echo "$db_name"; ?>" />
-	<input type="hidden" class="dataInput" name="db_drop_tables" value="<?php if (isset($db_drop_tables)) echo "$db_drop_tables"; ?>" />
-	<input type="hidden" class="dataInput" name="site_URL" value="<?php if (isset($site_URL)) echo "$site_URL"; ?>" />
-	<input type="hidden" class="dataInput" name="root_directory" value="<?php if (isset($root_directory)) echo "$root_directory"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; ?>" />
-	<input type="hidden" class="dataInput" name="admin_password" value="<?php if (isset($admin_password)) echo "$admin_password"; ?>" />
-	<input type="hidden" class="dataInput" name="cache_dir" value="<?php if (isset($cache_dir)) echo $cache_dir; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server" value="<?php if (isset($mail_server)) echo $mail_server; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_username" value="<?php if (isset($mail_server_username)) echo $mail_server_username; ?>" />
-	<input type="hidden" class="dataInput" name="mail_server_password" value="<?php if (isset($mail_server_password)) echo $mail_server_password; ?>" />
-	<input type="hidden" class="dataInput" name="ftpserver" value="<?php if (isset($ftpserver)) echo "$ftpserver"; ?>" />
-	<input type="hidden" class="dataInput" name="ftpuser" value="<?php if (isset($ftpuser)) echo "$ftpuser"; ?>" />
-	<input type="hidden" class="dataInput" name="ftppassword" value="<?php if (isset($ftppassword)) echo "$ftppassword"; ?>" />
-	<input type="image" src="include/install/images/cwBtnNext.gif" name="next" value="Create" onClick="window.location=('install.php')"/></form>
-	</td>
-
-	</tr>
-	</tbody></table>
-	<!-- ---------------------------------------------- System Configuration -- -->
-
-	</td>
-	</tr>
-	</table>
-	<!-- -->
-	<br><br>
-	<!-- Horizontal Shade -->
-	<table border="0" cellspacing="0" cellpadding="0" width="80%" style="background:url(include/install/images/cwShadeBg.gif) repeat-x;">
-	<tr>
-	<td><img src="include/install/images/cwShadeLeft.gif"></td>
-	<td align=right><img src="include/install/images/cwShadeRight.gif"></td>
-	</tr>
-	</table>
-	</td>
-	</tr>
-	</table>
-	</table>
-	<!-- Master table closes -->
-	</html>
-<?php
-}
-?>
+</html>

Modified: vtigercrm/trunk/install/4createConfigFile.php
==============================================================================
--- vtigercrm/trunk/install/4createConfigFile.php (original)
+++ vtigercrm/trunk/install/4createConfigFile.php Tue May 16 12:29:45 2006
@@ -36,7 +36,6 @@
 
 
 
-require_once('include/utils/utils.php');
 include('vtigerversion.php');
 
 
@@ -52,16 +51,13 @@
 
 if (isset($_REQUEST['db_hostname'])) 	list($db_hostname,$db_port) = 	split(":",$_REQUEST['db_hostname']);
 
-// update default mysql port if not 
-// provided, to be removed latter
-if ($db_port == "")
-$db_port = "3306";
-
 if (isset($_REQUEST['db_username'])) 	$db_username = 	$_REQUEST['db_username'];
 
 if (isset($_REQUEST['db_password'])) 	$db_password = 		$_REQUEST['db_password'];
 
 if (isset($_REQUEST['db_name'])) 		$db_name  	= 		$_REQUEST['db_name'];
+
+if (isset($_REQUEST['db_type'])) 		$db_type  	= 		$_REQUEST['db_type'];
 
 if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = 	$_REQUEST['db_drop_tables'];
 
@@ -87,8 +83,24 @@
 
 if (isset($_REQUEST['ftppassword'])) $ftppassword = 	$_REQUEST['ftppassword'];
 
+// update default port
+if ($db_port == '')
+{
+	if($db_type == 'mysql')
+	{
+		$db_port = "3306";
+	}
+	elseif($db_type = 'pgsql')
+	{
+		$db_port = "5432";
+	}
+	elseif($db_type = 'oci8')
+	{
+		$db_port = '1521';
+	}
+}
+
 $cache_dir = 'cache/';
-
 
 
 ?>
@@ -172,7 +184,7 @@
 				      $buffer = str_replace( "_DBC_USER_", $db_username, $buffer);
 				      $buffer = str_replace( "_DBC_PASS_", $db_password, $buffer);
 				      $buffer = str_replace( "_DBC_NAME_", $db_name, $buffer);
-				      $buffer = str_replace( "_DBC_TYPE_", "mysql", $buffer);
+				      $buffer = str_replace( "_DBC_TYPE_", $db_type, $buffer);
 
 				      $buffer = str_replace( "_SITE_URL_", $site_URL, $buffer);
 

Modified: vtigercrm/trunk/install/5createTables.inc.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.inc.php (original)
+++ vtigercrm/trunk/install/5createTables.inc.php Tue May 16 12:29:45 2006
@@ -213,6 +213,12 @@
 create_tab_data_file();
 create_parenttab_data_file();
 
+// ensure required sequences are created (adodb creates them as needed, but if
+// creation occurs within a transaction we get problems
+$db->getUniqueID("crmentity");
+$db->getUniqueID("seactivityrel");
+$db->getUniqueID("freetags");
+
 // populate the db with seed data
 if ($db_populate) {
         eecho ("Populate seed data into $db_name");

Modified: vtigercrm/trunk/install/populateSeedData.php
==============================================================================
--- vtigercrm/trunk/install/populateSeedData.php (original)
+++ vtigercrm/trunk/install/populateSeedData.php Tue May 16 12:29:45 2006
@@ -81,9 +81,9 @@
 {
 	$date = "";
 	$date .= "2006";
-	$date .= "/";
+	$date .= "-";
 	$date .= rand(1,9);
-	$date .= "/";
+	$date .= "-";
 	$date .= rand(1,28);
 	
 	return $date;
@@ -758,7 +758,6 @@
 	//$rand_key = array_rand($s);$contact_key = array_rand($contact_ids);
         $notes->column_fields["contact_id"] 	= 	$contact_ids[$contact_key];
 	$helpdesk->column_fields["ticket_title"]	= $ticket_title_array[$i];
-	
         $helpdesk->column_fields["assigned_user_id"] = $assigned_user_id;
 	
 	$helpdesk->save("HelpDesk");
@@ -779,7 +778,7 @@
 	$rand_num=array_rand($num_array);
 
 	$rand_date = & create_date();
-	$en=explode("/",$rand_date);
+	$en=explode("-",$rand_date);
 	if($en[1]<10)
 		$en[1]="0".$en[1];
 	if($en[2]<10)
@@ -847,7 +846,7 @@
 }
 
 
-$adb->query("update crmentity set crmentity.smcreatorid=".$assigned_user_id);
+$adb->query("update crmentity set smcreatorid=".$assigned_user_id);
 
 $expected_revenue = Array("250000","750000","500000");
 $budget_cost = Array("25000","50000","90000");

Modified: vtigercrm/trunk/modules/Accounts/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/ListView.php (original)
+++ vtigercrm/trunk/modules/Accounts/ListView.php Tue May 16 12:29:45 2006
@@ -45,15 +45,6 @@
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 
-if(!$_SESSION['lvs'][$currentModule])
-{
-	unset($_SESSION['lvs']);
-	$modObj = new ListViewSession();
-	$modObj->sorder = $sorder;
-	$modObj->sortby = $order_by;
-	$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
-}
-
 if($_REQUEST['errormsg'] != '')
 {
         $errormsg = $_REQUEST['errormsg'];
@@ -171,14 +162,19 @@
 //Retreiving the no of rows
 $noofrows = $adb->num_rows($list_result);
 
-//Storing Listview session object
-if($_SESSION['lvs'][$currentModule])
-{
-	setSessionVar($_SESSION['lvs'][$currentModule],$noofrows,$list_max_entries_per_page);
-}
-
-$start = $_SESSION['lvs'][$currentModule]['start'];
-
+//Retreiving the start value from request
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
+{
+        $start = $_REQUEST['start'];
+
+	//added to remain the navigation when sort
+	$url_string = "&start=".$_REQUEST['start'];
+}
+else
+{
+
+        $start = 1;
+}
 
 //Retreive the Navigation array
 $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);

Modified: vtigercrm/trunk/modules/Accounts/ListViewTop.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/ListViewTop.php (original)
+++ vtigercrm/trunk/modules/Accounts/ListViewTop.php Tue May 16 12:29:45 2006
@@ -33,7 +33,7 @@
 	global $current_user;
 	$current_module_strings = return_module_language($current_language, "Accounts");
 
-	$list_query = 'select account.accountid, account.accountname, account.tickersymbol, sum(potential.amount) as amount from potential inner join crmentity on (potential.potentialid=crmentity.crmid) inner join account on (potential.accountid=account.accountid) where crmentity.deleted=0 AND crmentity.smownerid="'.$current_user->id.'" and potential.sales_stage <> "'.$app_strings['LBL_CLOSE_WON'].'" and potential.sales_stage <> "'.$app_strings['LBL_CLOSE_LOST'].'" group by account.accountname order by 3 desc;';
+	$list_query = "select account.accountid, account.accountname, account.tickersymbol, sum(potential.amount) as amount from potential inner join crmentity on (potential.potentialid=crmentity.crmid) inner join account on (potential.accountid=account.accountid) where crmentity.deleted=0 AND crmentity.smownerid='".$current_user->id."' and potential.sales_stage <> '".$app_strings['LBL_CLOSE_WON']."' and potential.sales_stage <> '".$app_strings['LBL_CLOSE_LOST']."' group by account.accountid, account.accountname, account.tickersymbol order by amount desc;";
 	$list_result=$adb->query($list_query);
 	$open_accounts_list = array();
 	$noofrows = min($adb->num_rows($list_result),7);

Modified: vtigercrm/trunk/modules/Activities/Activity.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/Activity.php (original)
+++ vtigercrm/trunk/modules/Activities/Activity.php Tue May 16 12:29:45 2006
@@ -234,7 +234,7 @@
 			$noofrows_recur = $adb->num_rows($recur_result);
 			if($noofrows_recur==0)
 			{
-				$recur_dates_qry='select activity.date_start,recurringevents.* from activity left outer join recurringevents on activity.activityid=recurringevents.activityid where recurringevents.activityid is NULL and activity.activityid='.$activity_id .' group by activity.activityid';
+				$recur_dates_qry='select activity.date_start,recurringevents.* from activity left outer join recurringevents on activity.activityid=recurringevents.activityid where recurringevents.activityid is NULL and activity.activityid='.$activity_id;
 				$recur_result=$adb->query($recur_dates_qry);
 				$noofrows_recur = $adb->num_rows($recur_result);
 
@@ -251,7 +251,7 @@
 				$activity_start_time=time_to_number($act_time_start);	
 				$activity_end_time=get_duration($act_time_start,$act_hour_dur,$act_mins_dur);	
 
-				$activity_owner_qry='select users.user_name,users.id  userid from users,crmentity where users.id=crmentity.smownerid and crmentity.crmid='.$id;
+				$activity_owner_qry='select users.user_name,users.id AS userid from users,crmentity where users.id=crmentity.smownerid and crmentity.crmid='.$id;
 				$result_owner=$adb->query($activity_owner_qry);
 
 				while($row_owner = $adb->fetch_array($result_owner))

Modified: vtigercrm/trunk/modules/Activities/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/ListView.php (original)
+++ vtigercrm/trunk/modules/Activities/ListView.php Tue May 16 12:29:45 2006
@@ -110,8 +110,6 @@
 	$list_query .= " AND " .$where;
 }
 
-$list_query .= ' GROUP BY crmentity.crmid'; //Appeding for the recurring event by jaguar
-
 if(isset($order_by) && $order_by != '')
 {
 	$tablename = getTableNameForField('Activities',$order_by);

Modified: vtigercrm/trunk/modules/Activities/OpenListView.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/OpenListView.php (original)
+++ vtigercrm/trunk/modules/Activities/OpenListView.php Tue May 16 12:29:45 2006
@@ -77,11 +77,11 @@
 
 	if($activity_view != 'OverDue')
 	{
-		$list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.status is NULL || activity.status != 'Deferred') and  (  activity.eventstatus is NULL ||  activity.eventstatus != 'Held') and (activity.eventstatus is NULL ||  activity.eventstatus != 'Not Held' ) AND (((date_start >= '$today' AND date_start < '$later') OR (date_start < '$today'))  OR (recurringevents.recurringdate between '$today' and '$later') ) AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
+		$list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.status is NULL OR activity.status != 'Deferred') and  (  activity.eventstatus is NULL OR  activity.eventstatus != 'Held') and (activity.eventstatus is NULL OR  activity.eventstatus != 'Not Held' ) AND (((date_start >= '$today' AND date_start < '$later') OR (date_start < '$today'))  OR (recurringevents.recurringdate between '$today' and '$later') ) AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
 	}	
 	else
 	{
-		$list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.status is NULL || activity.status != 'Deferred') and (  activity.eventstatus is NULL ||  activity.eventstatus != 'Held') and (activity.eventstatus is NULL ||  activity.eventstatus != 'Not Held' ) AND (due_date < '$today') OR (recurringevents.recurringdate < '$today') AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
+		$list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.status is NULL OR activity.status != 'Deferred') and (  activity.eventstatus is NULL OR  activity.eventstatus != 'Held') and (activity.eventstatus is NULL OR  activity.eventstatus != 'Not Held' ) AND (due_date < '$today') OR (recurringevents.recurringdate < '$today') AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
 	}
 	$list_result = $adb->limitQuery($list_query,0,5);
 	$open_activity_list = array();

Modified: vtigercrm/trunk/modules/Activities/RenderRelatedListUI.php
==============================================================================
--- vtigercrm/trunk/modules/Activities/RenderRelatedListUI.php (original)
+++ vtigercrm/trunk/modules/Activities/RenderRelatedListUI.php Tue May 16 12:29:45 2006
@@ -64,11 +64,11 @@
 		if( $owner != $userid)
 		{
 			
-			$usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id."  and crmentity.deleted=0 group by crmid;";
+			$usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id."  and crmentity.deleted=0";
 		}
 		else
 		{
-			$usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0 group by crmid;";
+			$usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0";
 		}
 		$result_cal=$adb->query($usr_query);   
 		$noofrows_cal = $adb->num_rows($result_cal);
@@ -98,7 +98,7 @@
 		}
 		if($avail_flag!="true")
 		{
-			$recur_query="SELECT activity.activityid, activity.time_start, activity.duration_hours, activity.duration_minutes , crmentity.smownerid, recurringevents.recurringid, recurringevents.recurringdate as date_start from activity inner join crmentity on activity.activityid = crmentity.crmid inner join recurringevents on activity.activityid=recurringevents.activityid where ('".$avail_date."' like recurringevents.recurringdate) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0 group by crmid";
+			$recur_query="SELECT activity.activityid, activity.time_start, activity.duration_hours, activity.duration_minutes , crmentity.smownerid, recurringevents.recurringid, recurringevents.recurringdate as date_start from activity inner join crmentity on activity.activityid = crmentity.crmid inner join recurringevents on activity.activityid=recurringevents.activityid where ('".$avail_date."' like recurringevents.recurringdate) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0";
 			
 			$result_cal=$adb->query($recur_query);   
 			$noofrows_cal = $adb->num_rows($result_cal);

Modified: vtigercrm/trunk/modules/Calendar/Appointment.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Appointment.php (original)
+++ vtigercrm/trunk/modules/Calendar/Appointment.php Tue May 16 12:29:45 2006
@@ -48,8 +48,6 @@
                 }
 
                 $q.=" ((activity.date_start < '". $to_datetime->get_formatted_date() ."' AND activity.date_start >= '". $from_datetime->get_formatted_date()."')";
-                $q.=" and (activity.date_start like (activity.due_date) or (activity.date_start != '0000-00-00' ))";
-
                 if(!is_admin($current_user))
                 {
                         $q .= "  ) AND ((crmentity.smownerid ='".$current_user->id."' and salesmanactivityrel.smid = '".$current_user->id."') or (crmentity.smownerid in ($shared_ids) and salesmanactivityrel.smid in ($shared_ids) and activity.visibility='Public'))";

Modified: vtigercrm/trunk/modules/Calendar/calendarLayout.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/calendarLayout.php (original)
+++ vtigercrm/trunk/modules/Calendar/calendarLayout.php Tue May 16 12:29:45 2006
@@ -578,14 +578,28 @@
 	$Entries = Array();
 	global $adb,$current_user,$mod_strings;
 	
-	$query = "select groups.groupname ,users.user_name,activity.activitytype,activity.subject,crmentity.smownerid,seactivityrel.crmid,cntactivityrel.contactid ,crmentity.crmid,activity.* from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname left join users on users.id=crmentity.smownerid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') and (activity.activitytype != 'Task') and (activity.date_start between '".$start_date."' and '".$end_date."' or recurringevents.recurringdate between '".$start_date."' and '".$end_date."')";
+	$query = "SELECT cntactivityrel.contactid, activity.*
+		FROM activity
+		INNER JOIN crmentity
+			ON crmentity.crmid = activity.activityid
+		LEFT JOIN cntactivityrel
+			ON cntactivityrel.activityid = activity.activityid
+		LEFT OUTER JOIN recurringevents
+			ON recurringevents.activityid = activity.activityid
+		WHERE crmentity.deleted = 0
+			AND (activity.activitytype = 'Meeting' OR activity.activitytype = 'Call')
+			AND (activity.date_start BETWEEN '".$start_date."' AND '".$end_date."'
+				OR recurringevents.recurringdate BETWEEN '".$start_date."' AND '".$end_date."')";
 	if($info != '')
 	{
-		$pending_query = $query." and (activity.eventstatus = 'Planned') and crmentity.smownerid = ".$current_user->id." GROUP BY crmentity.crmid ORDER BY activity.date_start,activity.time_start ASC";
+		$pending_query = $query." AND (activity.eventstatus = 'Planned')
+			AND crmentity.smownerid = ".$current_user->id."
+		ORDER BY activity.date_start,activity.time_start ASC";
 		$res = $adb->query($pending_query);
 		$pending_rows = $adb->num_rows($res);
 	}
-	$query .= " and crmentity.smownerid = ".$current_user->id." GROUP BY crmentity.crmid ORDER BY activity.date_start,activity.time_start ASC";
+	$query .= " AND crmentity.smownerid = ".$current_user->id."
+		ORDER BY activity.date_start,activity.time_start ASC";
 	$result = $adb->query($query);
 	$rows = $adb->num_rows($result);
 	if($info != '')

Modified: vtigercrm/trunk/modules/Contacts/Contact.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Contact.php (original)
+++ vtigercrm/trunk/modules/Contacts/Contact.php Tue May 16 12:29:45 2006
@@ -316,7 +316,7 @@
 
 		$log->info("Activity Related List for Contact Displayed");
 
-		$query = "SELECT contactdetails.lastname, contactdetails.firstname,  activity.activityid , activity.subject, activity.activitytype, activity.date_start, activity.due_date, cntactivityrel.contactid, crmentity.crmid, crmentity.smownerid, crmentity.modifiedtime, recurringevents.recurringtype  from contactdetails inner join cntactivityrel on cntactivityrel.contactid = contactdetails.contactid inner join activity on cntactivityrel.activityid=activity.activityid inner join crmentity on crmentity.crmid = cntactivityrel.activityid left outer join recurringevents on recurringevents.activityid=activity.activityid left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname  where contactdetails.contactid=".$id." and crmentity.deleted = 0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.eventstatus is NULL || activity.eventstatus != 'Held') and ( activity.eventstatus is NULL || activity.eventstatus != 'Not Held' )";  //recurring type is added in Query -Jaguar
+		$query = "SELECT contactdetails.lastname, contactdetails.firstname,  activity.activityid , activity.subject, activity.activitytype, activity.date_start, activity.due_date, cntactivityrel.contactid, crmentity.crmid, crmentity.smownerid, crmentity.modifiedtime, recurringevents.recurringtype  from contactdetails inner join cntactivityrel on cntactivityrel.contactid = contactdetails.contactid inner join activity on cntactivityrel.activityid=activity.activityid inner join crmentity on crmentity.crmid = cntactivityrel.activityid left outer join recurringevents on recurringevents.activityid=activity.activityid left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname  where contactdetails.contactid=".$id." and crmentity.deleted = 0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.eventstatus is NULL OR activity.eventstatus != 'Held') and ( activity.eventstatus is NULL OR activity.eventstatus != 'Not Held' )";  //recurring type is added in Query -Jaguar
 		$log->debug("Exiting get_activities method ...");
 		return GetRelatedList('Contacts','Activities',$focus,$query,$button,$returnset);
 
@@ -366,10 +366,10 @@
 	{
 		global $log;
 		$log->debug("Entering get_attachments(".$id.") method ...");
-		$query = "select notes.title,'Notes      '  ActivityType,
-			notes.filename, attachments.type  FileType,crm2.modifiedtime  lastmodified,
-			seattachmentsrel.attachmentsid  attachmentsid, notes.notesid crmid,
-			crm2.createdtime, notes.notecontent description, users.user_name
+		$query = "select notes.title,'Notes      ' AS ActivityType,
+			notes.filename, attachments.type AS FileType,crm2.modifiedtime AS lastmodified,
+			seattachmentsrel.attachmentsid AS attachmentsid, notes.notesid AS crmid,
+			crm2.createdtime, notes.notecontent AS description, users.user_name
 		from notes
 			inner join crmentity on crmentity.crmid= notes.contact_id
 			inner join crmentity crm2 on crm2.crmid=notes.notesid and crm2.deleted=0
@@ -378,9 +378,9 @@
 			inner join users on crm2.smcreatorid= users.id
 		where crmentity.crmid=".$id;
 		$query .= " union all ";
-		$query .= "select attachments.description title,'Attachments'  ActivityType,
-			attachments.name  filename, attachments.type  FileType,crm2.modifiedtime  lastmodified,
-			attachments.attachmentsid attachmentsid, seattachmentsrel.attachmentsid crmid,
+		$query .= "select attachments.description AS title,'Attachments' AS ActivityType,
+			attachments.name AS filename, attachments.type AS FileType,crm2.modifiedtime AS lastmodified,
+			attachments.attachmentsid AS attachmentsid, seattachmentsrel.attachmentsid AS crmid,
 			crm2.createdtime, attachments.description, users.user_name
 		from attachments
 			inner join seattachmentsrel on seattachmentsrel.attachmentsid= attachments.attachmentsid
@@ -500,7 +500,7 @@
 
 		$log->info("Email Related List for Contact Displayed");
 
-		$query = 'select activity.activityid, activity.activityid, activity.subject, activity.activitytype, users.user_name, crmentity.modifiedtime, crmentity.crmid, crmentity.smownerid, activity.date_start from activity, seactivityrel, contactdetails, users, crmentity left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where seactivityrel.activityid = activity.activityid and contactdetails.contactid = seactivityrel.crmid and users.id=crmentity.smownerid and crmentity.crmid = activity.activityid  and contactdetails.contactid = '.$id.'  and activity.activitytype="Emails" and crmentity.deleted = 0';
+		$query = "select activity.activityid, activity.activityid, activity.subject, activity.activitytype, users.user_name, crmentity.modifiedtime, crmentity.crmid, crmentity.smownerid, activity.date_start from activity, seactivityrel, contactdetails, users, crmentity left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where seactivityrel.activityid = activity.activityid and contactdetails.contactid = seactivityrel.crmid and users.id=crmentity.smownerid and crmentity.crmid = activity.activityid  and contactdetails.contactid = ".$id." and activity.activitytype='Emails' and crmentity.deleted = 0";
 		$log->debug("Exiting get_emails method ...");
 		return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset);
 	}

Modified: vtigercrm/trunk/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/CustomView.php (original)
+++ vtigercrm/trunk/modules/CustomView/CustomView.php Tue May 16 12:29:45 2006
@@ -1211,7 +1211,7 @@
                 {
                         $listviewquery = substr($listquery, strpos($listquery,'from'),strlen($listquery));
 
-                        $query = "select count(*) count ".$listviewquery;
+                        $query = "select count(*) AS count ".$listviewquery;
                         
 			$stdfiltersql = $this->getCVStdFilterSQL($viewid);
                         $advfiltersql = $this->getCVAdvFilterSQL($viewid);

Modified: vtigercrm/trunk/modules/Dashboard/display_charts.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/display_charts.php (original)
+++ vtigercrm/trunk/modules/Dashboard/display_charts.php Tue May 16 12:29:45 2006
@@ -63,7 +63,7 @@
 $invoice_query="select crmentity.*,invoice.* from invoice inner join crmentity on crmentity.crmid=invoice.invoiceid inner join invoicebillads on invoice.invoiceid=invoicebillads.invoicebilladdressid inner join invoiceshipads on invoice.invoiceid=invoiceshipads.invoiceshipaddressid left outer join salesorder on salesorder.salesorderid=invoice.salesorderid inner join invoicecf on invoice.invoiceid = invoicecf.invoiceid left join invoicegrouprelation on invoice.invoiceid=invoicegrouprelation.invoiceid left join groups on groups.groupname=invoicegrouprelation.groupname left join users on users.id=crmentity.smownerid where crmentity.deleted=0 ";
 
 //Query for tickets
-$helpdesk_query=" select troubletickets.status ticketstatus, troubletickets.*,crmentity.* from troubletickets inner join ticketcf on ticketcf.ticketid = troubletickets.ticketid inner join crmentity on crmentity.crmid=troubletickets.ticketid left join ticketgrouprelation on troubletickets.ticketid=ticketgrouprelation.ticketid left join groups on groups.groupname=ticketgrouprelation.groupname left join contactdetails on troubletickets.parent_id=contactdetails.contactid left join account on account.accountid=troubletickets.parent_id left join users on crmentity.smownerid=users.id and troubletickets.ticketid = ticketcf.ticketid where crmentity.deleted=0";
+$helpdesk_query=" select troubletickets.status AS ticketstatus, troubletickets.*,crmentity.* from troubletickets inner join ticketcf on ticketcf.ticketid = troubletickets.ticketid inner join crmentity on crmentity.crmid=troubletickets.ticketid left join ticketgrouprelation on troubletickets.ticketid=ticketgrouprelation.ticketid left join groups on groups.groupname=ticketgrouprelation.groupname left join contactdetails on troubletickets.parent_id=contactdetails.contactid left join account on account.accountid=troubletickets.parent_id left join users on crmentity.smownerid=users.id and troubletickets.ticketid = ticketcf.ticketid where crmentity.deleted=0";
 
  /**  This function returns  the values for the graph, for any type of graph needed	 
         * Portions created by vtiger are Copyright (C) vtiger.

Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue May 16 12:29:45 2006
@@ -50,15 +50,6 @@
 $smarty = new vtigerCRM_Smarty;
 $other_text=Array();
 
-if(!$_SESSION['lvs'][$currentModule])
-{
-	unset($_SESSION['lvs']);
-	$modObj = new ListViewSession();
-	$modObj->sorder = $sorder;
-	$modObj->sortby = $order_by;
-	$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
-}
-
 if($_REQUEST['errormsg'] != '')
 {
         $errormsg = $_REQUEST['errormsg'];
@@ -176,7 +167,15 @@
 $noofrows = $adb->num_rows($list_result);
 
 //Storing Listview session object
-if($_SESSION['lvs'][$currentModule])
+if(!$_SESSION['lvs'][$currentModule])
+{
+	unset($_SESSION['lvs']);
+	$modObj = new ListViewSession();
+	$modObj->sorder = $sorder;
+	$modObj->sortby = $order_by;
+	$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
+}
+else
 {
 	setSessionVar($_SESSION['lvs'][$currentModule],$noofrows,$list_max_entries_per_page);
 }

Modified: vtigercrm/trunk/modules/Notes/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/ListView.php (original)
+++ vtigercrm/trunk/modules/Notes/ListView.php Tue May 16 12:29:45 2006
@@ -130,8 +130,6 @@
         $query .= ' and '.$where;
 }
 
-$query .= ' group by notes.notesid';
-
 if(isset($order_by) && $order_by != '')
 {
 	$tablename = getTableNameForField('Notes',$order_by);

Modified: vtigercrm/trunk/modules/Reports/PopulateReports.php
==============================================================================
--- vtigercrm/trunk/modules/Reports/PopulateReports.php (original)
+++ vtigercrm/trunk/modules/Reports/PopulateReports.php Tue May 16 12:29:45 2006
@@ -417,8 +417,8 @@
 {
 	global $adb;
 	$sql = "INSERT INTO reportfolder ";
-	$sql .= "(FOLDERID,FOLDERNAME,DESCRIPTION,STATE) ";
-	$sql .= "VALUES (null,'".$fldrname."','".$fldrdescription."','SAVED')";
+	$sql .= "(FOLDERNAME,DESCRIPTION,STATE) ";
+	$sql .= "VALUES ('".$fldrname."','".$fldrdescription."','SAVED')";
 	$result = $adb->query($sql);
 }
 

Modified: vtigercrm/trunk/modules/Reports/ReportRun.php
==============================================================================
--- vtigercrm/trunk/modules/Reports/ReportRun.php (original)
+++ vtigercrm/trunk/modules/Reports/ReportRun.php Tue May 16 12:29:45 2006
@@ -65,7 +65,7 @@
 			$querycolumns = $this->getEscapedColumns($selectedfields);
 			if($querycolumns == "")
 			{
-				$columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1]." '".$selectedfields[2]."'";
+				$columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"';
 			}else
 			{
 				$columnslist[$fieldcolname] = $querycolumns;

Modified: vtigercrm/trunk/modules/Settings/PickList.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/PickList.php (original)
+++ vtigercrm/trunk/modules/Settings/PickList.php Tue May 16 12:29:45 2006
@@ -48,7 +48,7 @@
 	global $adb;
 	$user_fld = Array();
 	$tabid = getTabid($fldmodule);
-	$query = "select fieldlabel,generatedtype,columnname,fieldname from field where displaytype = 1 and (tabid = ".getTabid($fld_module)." && uitype IN (15,16)) || (tabid = ".getTabid($fld_module)." && fieldname='salutationtype')";
+	$query = "select fieldlabel,generatedtype,columnname,fieldname from field where displaytype = 1 and (tabid = ".getTabid($fld_module)." AND uitype IN (15,16)) OR (tabid = ".getTabid($fld_module)." AND fieldname='salutationtype')";
 	$result = $adb->query($query);
 	$noofrows = $adb->num_rows($result);
     if($noofrows > 0)

Modified: vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
==============================================================================
--- vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php (original)
+++ vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php Tue May 16 12:29:45 2006
@@ -1232,7 +1232,7 @@
        		$code = 'array(';
        		foreach ($var as $key => $value)
 		{
-           		$code .= $key.'=>'.$value.',';
+           		$code .= "'".$key."'=>".$value.',';
        		}
        		$code .= ')';
        		return $code;

Modified: vtigercrm/trunk/modules/Users/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DetailView.php (original)
+++ vtigercrm/trunk/modules/Users/DetailView.php Tue May 16 12:29:45 2006
@@ -207,9 +207,14 @@
 	$smarty->assign("CURRENCY_NAME",$currency);
 
 //Getting the Group Lists
-$query ="select groupid,groupname from groups where groupid in (".fetchUserGroupids($focus->id).")";
-$result = $adb->query($query);
-$num_rows = $adb->num_rows($result);
+$groupids = fetchUserGroupids($focus->id);
+if($groupids) {
+	$query ="select groupid,groupname from groups where groupid in (".$groupids.")";
+	$result = $adb->query($query);
+	$num_rows = $adb->num_rows($result);
+} else {
+	$num_rows = 0;
+}
 
 
 

Modified: vtigercrm/trunk/modules/Users/LoginHistory.php
==============================================================================
--- vtigercrm/trunk/modules/Users/LoginHistory.php (original)
+++ vtigercrm/trunk/modules/Users/LoginHistory.php Tue May 16 12:29:45 2006
@@ -60,7 +60,7 @@
 	/** Records the Login info */
 	function user_login(&$usname,&$usip,&$intime)
 	{
-		$query = "Insert into loginhistory values (null,'$usname','$usip',null,".$this->db->formatDate($intime).",'Signedin')";
+		$query = "Insert into loginhistory (user_name, user_ip, logout_time, login_time, status) values ('$usname','$usip',null,".$this->db->formatDate($intime).",'Signedin')";
 		$result = $this->db->query($query)
                         or die("MySQL error: ".mysql_error());
 		
@@ -69,7 +69,7 @@
 	
 	function user_logout(&$usname,&$usip,&$outtime)
 	{
-		$logid_qry = "SELECT max(login_id) login_id from loginhistory where user_name='$usname' and user_ip='$usip'";
+		$logid_qry = "SELECT max(login_id) AS login_id from loginhistory where user_name='$usname' and user_ip='$usip'";
 		$result = $this->db->query($logid_qry);
 		$loginid = $this->db->query_result($result,0,"login_id");
 		if ($loginid == '')

Modified: vtigercrm/trunk/modules/Users/Security.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Security.php (original)
+++ vtigercrm/trunk/modules/Users/Security.php Tue May 16 12:29:45 2006
@@ -2062,56 +2062,51 @@
 		$this->db->query("insert into moduleowners values(".getTabid($mod).",1)");
 	}
 	//added by jeri for category view from db
-	$this->db->query("insert into parenttab values
-			(1,'My Home Page',1,0),
-			(2,'Marketing',2,0),
-			(3,'Sales',3,0),
-			(4,'Support',4,0),
-			(5,'Analytics',5,0),
-			(6,'Inventory',6,0),
-			(7,'Tools',7,0),
-			(8,'Settings',8,0)
-		    	");
-
-	$this->db->query("insert into parenttabrel values
-			(1,9,2),
-			(1,17,3),
-			(1,10,4),
-    			(1,3,1),
-		    	(3,7,1),
-			(3,6,2),
-			(3,4,3),
-    			(3,2,4),
-	    		(3,20,5),
-	    		(3,22,6),
-	    		(3,23,7),
-	    		(3,14,8),
-	    		(3,19,9),
-	    		(3,8,10),
-	   		(4,13,1),
-	    		(4,15,2),
-	    		(4,6,3),
-	    		(4,4,4),
-		   	(4,14,5),
-			(4,8,6),
-			(5,1,1),
-			(5,25,2),
-		    	(6,14,1),
-	 	   	(6,18,2),
-		    	(6,19,3),
-		    	(6,21,4),
-		    	(6,22,5),
-		    	(6,20,6),
-	    		(6,23,7),
-		    	(7,24,1),
-			(7,27,2),
-	    		(7,8,3),
-		    	(2,26,1),
-		    	(2,6,2),
-		    	(2,4,3)");
-				
-
-		}
-	
+	$this->db->query("insert into parenttab values (1,'My Home Page',1,0)");
+	$this->db->query("insert into parenttab values (2,'Marketing',2,0)");
+	$this->db->query("insert into parenttab values (3,'Sales',3,0)");
+	$this->db->query("insert into parenttab values (4,'Support',4,0)");
+	$this->db->query("insert into parenttab values (5,'Analytics',5,0)");
+	$this->db->query("insert into parenttab values (6,'Inventory',6,0)");
+	$this->db->query("insert into parenttab values (7,'Tools',7,0)");
+	$this->db->query("insert into parenttab values (8,'Settings',8,0)");
+
+	$this->db->query("insert into parenttabrel values (1,9,2)");
+	$this->db->query("insert into parenttabrel values (1,17,3)");
+	$this->db->query("insert into parenttabrel values (1,10,4)");
+	$this->db->query("insert into parenttabrel values (1,3,1)");
+	$this->db->query("insert into parenttabrel values (3,7,1)");
+	$this->db->query("insert into parenttabrel values (3,6,2)");
+	$this->db->query("insert into parenttabrel values (3,4,3)");
+	$this->db->query("insert into parenttabrel values (3,2,4)");
+	$this->db->query("insert into parenttabrel values (3,20,5)");
+	$this->db->query("insert into parenttabrel values (3,22,6)");
+	$this->db->query("insert into parenttabrel values (3,23,7)");
+	$this->db->query("insert into parenttabrel values (3,14,8)");
+	$this->db->query("insert into parenttabrel values (3,19,9)");
+	$this->db->query("insert into parenttabrel values (3,8,10)");
+	$this->db->query("insert into parenttabrel values (4,13,1)");
+	$this->db->query("insert into parenttabrel values (4,15,2)");
+	$this->db->query("insert into parenttabrel values (4,6,3)");
+	$this->db->query("insert into parenttabrel values (4,4,4)");
+	$this->db->query("insert into parenttabrel values (4,14,5)");
+	$this->db->query("insert into parenttabrel values (4,8,6)");
+	$this->db->query("insert into parenttabrel values (5,1,1)");
+	$this->db->query("insert into parenttabrel values (5,25,2)");
+	$this->db->query("insert into parenttabrel values (6,14,1)");
+	$this->db->query("insert into parenttabrel values (6,18,2)");
+	$this->db->query("insert into parenttabrel values (6,19,3)");
+	$this->db->query("insert into parenttabrel values (6,21,4)");
+	$this->db->query("insert into parenttabrel values (6,22,5)");
+	$this->db->query("insert into parenttabrel values (6,20,6)");
+	$this->db->query("insert into parenttabrel values (6,23,7)");
+	$this->db->query("insert into parenttabrel values (7,24,1)");
+	$this->db->query("insert into parenttabrel values (7,27,2)");
+	$this->db->query("insert into parenttabrel values (7,8,3)");
+	$this->db->query("insert into parenttabrel values (2,26,1)");
+	$this->db->query("insert into parenttabrel values (2,6,2)");
+	$this->db->query("insert into parenttabrel values (2,4,3)");
+	
+	}
 }
 ?>

Modified: vtigercrm/trunk/parent_tabdata.php
==============================================================================
--- vtigercrm/trunk/parent_tabdata.php (original)
+++ vtigercrm/trunk/parent_tabdata.php Tue May 16 12:29:45 2006
@@ -1,0 +1,13 @@
+<?php
+
+
+//This file contains the commonly used variables 
+
+$parent_tab_info_array=array(1=>'My Home Page',2=>'Marketing',3=>'Sales',4=>'Support',5=>'Analytics',6=>'Inventory',7=>'Tools',8=>'Settings');
+
+
+$parent_child_tab_rel_array=array(1=>array(3,9,17,10,),2=>array(26,6,4,),3=>array(7,6,4,2,20,22,23,14,19,8,),4=>array(13,15,6,4,14,8,),5=>array(1,25,),6=>array(14,18,19,21,22,20,23,),7=>array(24,27,8,),8=>array(),);
+
+
+
+?>

Modified: vtigercrm/trunk/schema/DatabaseSchema.xml
==============================================================================
--- vtigercrm/trunk/schema/DatabaseSchema.xml (original)
+++ vtigercrm/trunk/schema/DatabaseSchema.xml Tue May 16 12:29:45 2006
@@ -752,9 +752,7 @@
 			<notnull />
 		</field>
 		<field name="due_date" type="D" />
-		<field name="time_start" type="C" size="50">
-			<notnull />
-		</field>
+		<field name="time_start" type="C" size="50" />
 		<field name="sendnotification" type="C" size="3">
 			<notnull />
 			<default value="0"/>
@@ -771,6 +769,7 @@
 		</field>
 		<field name="visibility" type="C" size="50">
 			<notnull />
+			<default value="all" />
 		</field>
 
 		<index name="activity_activityid_subject_idx">
@@ -1730,53 +1729,6 @@
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
 
-	<table name="sogrouprelation">
-		<field name="salesorderid" type="I" size="19">
-			<key />
-			<constraint>REFERENCES salesorder(salesorderid) ON DELETE CASCADE</constraint>
-		</field>
-		<field name="groupname" type="C" size="100">
-			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
-		</field>
-
-		<index name="sogrouprelation_groupname_idx">
-			<col>groupname</col>
-		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
-	<table name="invoicegrouprelation">
-		<field name="invoiceid" type="I" size="19">
-			<key />
-			<constraint>REFERENCES invoice(invoiceid) ON DELETE CASCADE</constraint>
-		</field>
-		<field name="groupname" type="C" size="100">
-			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
-		</field>
-
-		<index name="invoicegrouprelation_groupname_invoiceid_idx">
-			<col>groupname</col>
-			<col>invoiceid</col>
-		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
-	<table name="pogrouprelation">
-		<field name="purchaseorderid" type="I" size="19">
-			<key />
-			<constraint>REFERENCES purchaseorder(purchaseorderid) ON DELETE CASCADE</constraint>
-		</field>
-		<field name="groupname" type="C" size="100">
-			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
-		</field>
-
-		<index name="pogrouprelation_groupname_purchaseorderid_idx">
-			<col>groupname</col>
-			<col>purchaseorderid</col>
-		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
 	<table name="activitygrouprelation">
 		<field name="activityid" type="I" size="19">
 			<key />
@@ -2738,6 +2690,115 @@
 		</field>
 	</table>
 
+	<table name="activsubtype">
+		<field name="activesubtypeid" type="I" size="19">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="activsubtype" type="C" size="100" />
+		<field name="sortorderid" type="I" size="19">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="presence" type="I" size="1">
+			<notnull />
+			<default value="1" />
+		</field>
+	</table>
+
+	<table name="downloadpurpose">
+		<field name="downloadpurposeid" type="I" size="19">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="purpose" type="C" size="200">
+			<notnull />
+		</field>
+		<field name="sortorderid" type="I" size="19">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="presence" type="I" size="1">
+			<notnull />
+			<default value="1" />
+		</field>
+
+		<index name="downloadpurpose_purpose_idx">
+			<col>purpose</col>
+			<unique />
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
+	<table name="durationhrs">
+		<field name="hrsid" type="I" size="19">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="hrs" type="C" size="50" />
+		<field name="sortorderid" type="I" size="19">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="presence" type="I" size="1">
+			<notnull />
+			<default value="1" />
+		</field>
+	</table>
+
+	<table name="durationmins">
+		<field name="minsid" type="I" size="19">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="mins" type="C" size="50" />
+		<field name="sortorderid" type="I" size="19">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="presence" type="I" size="1">
+			<notnull />
+			<default value="1" />
+		</field>
+	</table>
+
+	<table name="evaluationstatus">
+		<field name="evalstatusid" type="I" size="19">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="status" type="C" size="200">
+			<notnull />
+		</field>
+		<field name="sortorderid" type="I" size="19">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="presence" type="I" size="1">
+			<notnull />
+			<default value="1" />
+		</field>
+
+		<index name="evaluationstatus_status_idx">
+			<col>status</col>
+			<unique />
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
+	<table name="profile">
+		<field name="profileid" type="I" size="10">
+			<key />
+			<autoincrement />
+		</field>
+		<field name="profilename" type="C" size="50">
+			<notnull />
+		</field>
+		<field name="description" type="X" />
+
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
 	<table name="profile2globalpermissions">
 		<field name="profileid" type="I" size="19">
 			<key />
@@ -2752,115 +2813,6 @@
 			<col>profileid</col>
 			<col>globalactionid</col>
 		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
-	<table name="activsubtype">
-		<field name="activesubtypeid" type="I" size="19">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="activsubtype" type="C" size="100" />
-		<field name="sortorderid" type="I" size="19">
-			<notnull />
-			<default value="0" />
-		</field>
-		<field name="presence" type="I" size="1">
-			<notnull />
-			<default value="1" />
-		</field>
-	</table>
-
-	<table name="downloadpurpose">
-		<field name="downloadpurposeid" type="I" size="19">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="purpose" type="C" size="200">
-			<notnull />
-		</field>
-		<field name="sortorderid" type="I" size="19">
-			<notnull />
-			<default value="0" />
-		</field>
-		<field name="presence" type="I" size="1">
-			<notnull />
-			<default value="1" />
-		</field>
-
-		<index name="downloadpurpose_purpose_idx">
-			<col>purpose</col>
-			<unique />
-		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
-	<table name="durationhrs">
-		<field name="hrsid" type="I" size="19">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="hrs" type="C" size="50" />
-		<field name="sortorderid" type="I" size="19">
-			<notnull />
-			<default value="0" />
-		</field>
-		<field name="presence" type="I" size="1">
-			<notnull />
-			<default value="1" />
-		</field>
-	</table>
-
-	<table name="durationmins">
-		<field name="minsid" type="I" size="19">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="mins" type="C" size="50" />
-		<field name="sortorderid" type="I" size="19">
-			<notnull />
-			<default value="0" />
-		</field>
-		<field name="presence" type="I" size="1">
-			<notnull />
-			<default value="1" />
-		</field>
-	</table>
-
-	<table name="evaluationstatus">
-		<field name="evalstatusid" type="I" size="19">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="status" type="C" size="200">
-			<notnull />
-		</field>
-		<field name="sortorderid" type="I" size="19">
-			<notnull />
-			<default value="0" />
-		</field>
-		<field name="presence" type="I" size="1">
-			<notnull />
-			<default value="1" />
-		</field>
-
-		<index name="evaluationstatus_status_idx">
-			<col>status</col>
-			<unique />
-		</index>
-		<opt platform="mysql">Type=InnoDB</opt>
-	</table>
-
-	<table name="profile">
-		<field name="profileid" type="I" size="10">
-			<key />
-			<autoincrement />
-		</field>
-		<field name="profilename" type="C" size="50">
-			<notnull />
-		</field>
-		<field name="description" type="X" />
-
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
 
@@ -2940,9 +2892,7 @@
 		<field name="share_action_id" type="I" size="19">
 			<key />
 		</field>
-		<field name="share_action_name" type="C" size="200">
-			<key />
-		</field>
+		<field name="share_action_name" type="C" size="200" />
 
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
@@ -3067,6 +3017,21 @@
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
 
+	<table name="sogrouprelation">
+		<field name="salesorderid" type="I" size="19">
+			<key />
+			<constraint>REFERENCES salesorder(salesorderid) ON DELETE CASCADE</constraint>
+		</field>
+		<field name="groupname" type="C" size="100">
+			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
+		</field>
+
+		<index name="sogrouprelation_groupname_idx">
+			<col>groupname</col>
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
 	<table name="sobillads">
 		<field name="sobilladdressid" type="I" size="19">
 			<key />
@@ -3471,6 +3436,22 @@
 		</index>
 		<index name="purchaseorder_contactid_idx">
 			<col>contactid</col>
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
+	<table name="pogrouprelation">
+		<field name="purchaseorderid" type="I" size="19">
+			<key />
+			<constraint>REFERENCES purchaseorder(purchaseorderid) ON DELETE CASCADE</constraint>
+		</field>
+		<field name="groupname" type="C" size="100">
+			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
+		</field>
+
+		<index name="pogrouprelation_groupname_purchaseorderid_idx">
+			<col>groupname</col>
+			<col>purchaseorderid</col>
 		</index>
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
@@ -3574,6 +3555,22 @@
 		<opt platform="mysql">Type=InnoDB</opt>
 	</table>
 
+	<table name="invoicegrouprelation">
+		<field name="invoiceid" type="I" size="19">
+			<key />
+			<constraint>REFERENCES invoice(invoiceid) ON DELETE CASCADE</constraint>
+		</field>
+		<field name="groupname" type="C" size="100">
+			<constraint>REFERENCES groups(groupname) ON DELETE CASCADE</constraint>
+		</field>
+
+		<index name="invoicegrouprelation_groupname_invoiceid_idx">
+			<col>groupname</col>
+			<col>invoiceid</col>
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
 	<table name="invoicebillads">
 		<field name="invoicebilladdressid" type="I" size="19">
 			<key />

Modified: vtigercrm/trunk/tabdata.php
==============================================================================
--- vtigercrm/trunk/tabdata.php (original)
+++ vtigercrm/trunk/tabdata.php Tue May 16 12:29:45 2006
@@ -3,7 +3,7 @@
 
 //This file contains the commonly used variables 
 
-$tab_info_array=array(Dashboard=>1,Potentials=>2,Home=>3,Contacts=>4,Accounts=>6,Leads=>7,Notes=>8,Activities=>9,Emails=>10,HelpDesk=>13,Products=>14,Faq=>15,Events=>16,Calendar=>17,Vendors=>18,PriceBooks=>19,Quotes=>20,PurchaseOrder=>21,SalesOrder=>22,Invoice=>23,Rss=>24,Reports=>25,Campaigns=>26,Portal=>27,Webmails=>28);
+$tab_info_array=array('Home'=>3,'Leads'=>7,'Accounts'=>6,'Contacts'=>4,'Potentials'=>2,'Notes'=>8,'Activities'=>9,'Emails'=>10,'HelpDesk'=>13,'Products'=>14,'Dashboard'=>1,'Faq'=>15,'Events'=>16,'Calendar'=>17,'Vendors'=>18,'PriceBooks'=>19,'Quotes'=>20,'PurchaseOrder'=>21,'SalesOrder'=>22,'Invoice'=>23,'Rss'=>24,'Reports'=>25,'Campaigns'=>26,'Portal'=>27,'Webmails'=>28,);
 
-$tab_seq_array=array(1=>0,2=>0,3=>0,4=>0,6=>0,7=>0,8=>0,9=>0,10=>0,13=>0,14=>0,15=>2,16=>2,17=>0,18=>0,19=>0,20=>0,21=>0,22=>0,23=>0,24=>0,25=>0,26=>0,27=>0,);
-?>
+$tab_seq_array=array('3'=>0,'7'=>0,'6'=>0,'4'=>0,'2'=>0,'8'=>0,'9'=>0,'10'=>0,'13'=>0,'14'=>0,'1'=>0,'15'=>0,'16'=>2,'17'=>0,'18'=>0,'19'=>0,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>0,'25'=>0,'26'=>0,'27'=>0,'28'=>0,);
+?>





More information about the vtigercrm-commits mailing list