[Vtigercrm-commits] [vtiger-commits] r9182 - in /vtigercrm/trunk/install: 2setConfig.php 3confirmConfig.php 4createConfigFile.php 5createTables.inc.php 5createTables.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Aug 29 09:21:18 EDT 2006


Author: saraj
Date: Tue Aug 29 07:21:11 2006
New Revision: 9182

Log:
changes made to have user defined currency configuration

Modified:
    vtigercrm/trunk/install/2setConfig.php
    vtigercrm/trunk/install/3confirmConfig.php
    vtigercrm/trunk/install/4createConfigFile.php
    vtigercrm/trunk/install/5createTables.inc.php
    vtigercrm/trunk/install/5createTables.php

Modified: vtigercrm/trunk/install/2setConfig.php
==============================================================================
--- vtigercrm/trunk/install/2setConfig.php (original)
+++ vtigercrm/trunk/install/2setConfig.php Tue Aug 29 07:21:11 2006
@@ -131,9 +131,15 @@
 	if (isset($_REQUEST['admin_password']))
 	$admin_password = $_REQUEST['admin_password'];
 	
-	if (isset($_REQUEST['currency']))
-	$currency = $_REQUEST['currency'];
+	if (isset($_REQUEST['currency_name']))
+	$currency_name = $_REQUEST['currency_name'];
 	
+	if (isset($_REQUEST['currency_symbol']))
+	$currency_symbol = $_REQUEST['currency_symbol'];
+	
+	if (isset($_REQUEST['currency_code']))
+	$currency_code = $_REQUEST['currency_code'];
+
 	}
 	else {
 		!isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname'];
@@ -243,8 +249,25 @@
 	if (trim(form.cache_dir.value) =='') {
                 isError = true;
                 errorMessage += "\n temp directory path";
-                form.root_directory.focus();
+                form.cache_dir.focus();
         }
+	if (trim(form.currency_name.value) =='') {
+                isError = true;
+                errorMessage += "\n currency name";
+                form.currency_name.focus();
+        }
+	if (trim(form.currency_symbol.value) =='') {
+                isError = true;
+                errorMessage += "\n currency symbol";
+                form.currency_symbol.focus();
+        }	
+	if (trim(form.currency_code.value) =='') {
+                isError = true;
+                errorMessage += "\n currency code";
+                form.currency_code.focus();
+        }
+
+
 	if(document.getElementById('check_createdb').checked == true)
 	{
 		if (trim(form.root_user.value) =='') {
@@ -430,40 +453,27 @@
 				<td bgcolor="white" align="left"><input class="dataInput" type="text" name="admin_email" value="<?php if (isset($admin_email)) echo "$admin_email"; else echo "admin at your-domain.com"; ?>"></td>
 			</tr>
 			<tr>
-				<td bgcolor="#F5F5F5" nowrap><strong>Master Currency</strong><sup><font color=red>*</font></sup></td>
-								<td bgcolor="white" align="left"><select name="currency" id="master">
-						<option>EURO</option>
-						<option>United States Dollar</option>
-						<option>United Kingdom Pounds</option>
-						<option>Canada Dollars</option>
-						<option>Australia Dollars</option>
-						<option>Japan Yen</option>
-						<option>Indian Rupee</option>
-						<option>New Zealand Dollars</option>
-						<option>South Africa Rand</option>
-				</select></td>
-			</tr>	
-	<?
-				if(isset($currency) && $currency !='')
-				{
-				?>
-					<script language="javascript">
-					var curr_combo = document.getElementById('master');
-					var curr_value = "<?echo $currency;?>";
-					for(i=0;i<curr_combo.length;i++)
-					{
-						if( curr_value == curr_combo.options[i].value)
-						{
-							curr_combo.selectedIndex = i;
-						}       
-					} 
-					</script>	
-				<?
-				}
-				?>
-
-			<tr>
 				<td colspan="2" bgcolor="white"><font color=blue> <b>Note:</b> The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.</font></td>
+			</tr>
+			</table>
+	
+				<br><br>
+		<!-- Currency Configuration -->
+            <table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
+			<tr>
+				<td colspan=2><strong>Currency Configuration</strong></td>
+            </tr>
+			<tr>
+				<td nowrap width=25% bgcolor="#F5F5F5" ><strong>Name</strong><sup><font color=red>*</font></sup></td>
+				<td width=75% bgcolor="white" align="left"><input class="dataInput" type="text" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>"></td>
+			</tr>
+			<tr>
+				<td bgcolor="#F5F5F5" nowrap><strong>Symbol</strong><sup><font color=red>*</font></sup></td>
+				<td bgcolor="white" align="left"><input class="dataInput" type="text" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol";?>"></td>
+			</tr>
+			<tr>
+				<td bgcolor="#F5F5F5" nowrap><strong>Code</strong><sup><font color=red>*</font></sup></td>
+				<td bgcolor="white" align="left"><input class="dataInput" type="text" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>"></td>
 			</tr>
 			</table>
 

Modified: vtigercrm/trunk/install/3confirmConfig.php
==============================================================================
--- vtigercrm/trunk/install/3confirmConfig.php (original)
+++ vtigercrm/trunk/install/3confirmConfig.php Tue Aug 29 07:21:11 2006
@@ -25,7 +25,9 @@
 if (isset($_REQUEST['site_URL'])) $site_URL= $_REQUEST['site_URL'];
 if (isset($_REQUEST['admin_email'])) $admin_email= $_REQUEST['admin_email'];
 if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password'];
-if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency'];
+if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name'];
+if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol'];
+if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code'];
 if (isset($_REQUEST['cache_dir'])) $cache_dir= $_REQUEST['cache_dir'];
 if (isset($_REQUEST['mail_server'])) $mail_server= $_REQUEST['mail_server'];
 if (isset($_REQUEST['mail_server_username'])) $mail_server_username= $_REQUEST['mail_server_username'];
@@ -226,19 +228,42 @@
 						<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 Username</td>
+					</table>	
+					<table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
+					<tr>
+						<td colspan=2 ><strong>Admin Configuration</strong></td>
+					</tr>
+					<tr bgcolor="White">
+						<td bgcolor="#F5F5F5" width="40%">Username</td>
 						<td align="left"> <font class="dataInput">admin</font></td>
 					</tr>
 					<tr bgcolor="White">
-						<td bgcolor="#F5F5F5" width="40%">Admin Password</td>
+						<td bgcolor="#F5F5F5" width="40%">Password</td>
 						<td align="left"> <font class="dataInput"><?php if (isset($admin_password)) echo ereg_replace('.', '*', $admin_password); ?></font></td>
 					</tr>
 					<tr bgcolor="White">
-						<td bgcolor="#F5F5F5" width="40%">Master Currency</td>
-						<td align="left"><font class="dataInput"><?php if (isset($currency)) echo $currency;?></font></td>
-					</tr>
-					</table>
+						<td bgcolor="#F5F5F5" width="40%">Email</td>
+						<td align="left"> <font class="dataInput"><?php if (isset($admin_email)) echo $admin_email; ?></font></td>
+					</tr>
+					</table>
+					<table width="90%" cellpadding="5" border="0" class="small" cellspacing="1" style="background-color:#cccccc">
+					<tr>
+						<td colspan=2 ><strong>Currency Configuration</strong></td>
+					</tr>
+					<tr bgcolor="White">
+						<td bgcolor="#F5F5F5" width="40%">Name</td>
+						<td align="left"> <font class="dataInput"><?php if (isset($currency_name)) echo $currency_name; ?></font></td>
+					</tr>
+					<tr bgcolor="White">
+						<td bgcolor="#F5F5F5" width="40%">Symbol</td>
+						<td align="left"> <font class="dataInput"><?php if (isset($currency_symbol)) echo $currency_symbol; ?></font></td>
+					</tr>
+					<tr bgcolor="White">
+						<td bgcolor="#F5F5F5" width="40%">Code</td>
+						<td align="left"> <font class="dataInput"><?php if (isset($currency_code)) echo $currency_code; ?></font></td>
+					</tr>
+					</table>
+
 
 					<br><br>
 					<table width="90%" cellpadding="5" border="0" class="small" >
@@ -256,7 +281,9 @@
 						<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="currency" value="<?php if (isset($currency)) echo "$currency"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>" />
 						<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; ?>" />
@@ -291,7 +318,9 @@
 						<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="currency" value="<?php if (isset($currency)) echo "$currency"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>" />
+						<input type="hidden" class="dataInput" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol"; ?>" />
 						<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; ?>" />

Modified: vtigercrm/trunk/install/4createConfigFile.php
==============================================================================
--- vtigercrm/trunk/install/4createConfigFile.php (original)
+++ vtigercrm/trunk/install/4createConfigFile.php Tue Aug 29 07:21:11 2006
@@ -47,7 +47,7 @@
 
 $vtiger_version = "5.0 Beta";
 $release_date = "31 March 2006";
-if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type'];
+
 
 if (isset($_REQUEST['db_hostname']))
 {
@@ -59,10 +59,9 @@
 	{
 		$db_hostname = $_REQUEST['db_hostname'];
 		if($db_type == "pgsql")
- 		    $db_port = '5432';
- 		else
- 		    $db_port = '3306';
-
+		     $db_port = '5432';
+		else
+		     $db_port = '3306';
 	}	
 }
 if (isset($_REQUEST['db_username']))$db_username = $_REQUEST['db_username'];
@@ -71,7 +70,7 @@
 
 if (isset($_REQUEST['db_name']))$db_name = $_REQUEST['db_name'];
 
-//if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type'];
+if (isset($_REQUEST['db_type'])) $db_type = $_REQUEST['db_type'];
 
 if (isset($_REQUEST['db_drop_tables'])) $db_drop_tables = $_REQUEST['db_drop_tables'];
 
@@ -85,7 +84,11 @@
 
 if (isset($_REQUEST['admin_password'])) $admin_password = $_REQUEST['admin_password'];
 
-if (isset($_REQUEST['currency'])) $currency = $_REQUEST['currency'];
+if (isset($_REQUEST['currency_name'])) $currency_name = $_REQUEST['currency_name'];
+
+if (isset($_REQUEST['currency_code'])) $currency_code = $_REQUEST['currency_code'];
+
+if (isset($_REQUEST['currency_symbol'])) $currency_symbol = $_REQUEST['currency_symbol'];
 
 if (isset($_REQUEST['mail_server'])) $mail_server = $_REQUEST['mail_server'];
 
@@ -444,7 +447,9 @@
 				 <input type="hidden" class="dataInput" name="db_populate" value="<?php if (isset($db_populate)) echo "$db_populate"; ?>" />
 				 <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="currency" value="<?php if (isset($currency)) echo "$currency"; ?>" />
+				 <input type="hidden" class="dataInput" name="currency_name" value="<?php if (isset($currency_name)) echo "$currency_name"; ?>" />
+				 <input type="hidden" class="dataInput" name="currency_code" value="<?php if (isset($currency_code)) echo "$currency_code"; ?>" />
+				 <input type="hidden" class="dataInput" name="currency_symbol" value="<?php if (isset($currency_symbol)) echo "$currency_symbol"; ?>" />
 				 <input  type="image" name="next" value="Next" id="next_btn" src="include/install/images/cwBtnNext.gif" onClick="window.location=('install.php');createtablejs();" />
 				 </form>
 					

Modified: vtigercrm/trunk/install/5createTables.inc.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.inc.php (original)
+++ vtigercrm/trunk/install/5createTables.inc.php Tue Aug 29 07:21:11 2006
@@ -271,22 +271,8 @@
 $db->getUniqueID("vtiger_freetags");
 
 //Master currency population
-$currencies = array('Euro'=>array('name'=>'Euro','symbol'=>'&euro','code'=>'EUR'),
-		'United States Dollar'=>array('name'=>'United States Dollar','symbol'=>'&#36','code'=>'USD'),
-		'United Kingdom Pounds'=>array('name'=>'United Kingdom Pounds','symbol'=>'&pound','code'=>'GBP'),
-		'Canada Dollars'=>array('name'=>'Canada Dollars','symbol'=>'&#36','code'=>'CAD'),
-		'Australia Dollars'=>array('name'=>'Australia Dollars','symbol'=>'&#36','code'=>'AUD'),
-		'Japan Yen'=>array('name'=>'Japan Yen','symbol'=>'&yen','code'=>'JPY'),
-		'Indian Rupee'=>array('name'=>'Indian Rupee','symbol'=>'&#8360','code'=>'INR'),
-		'New Zealand Dollars'=>array('name'=>'New Zealand Dollars','symbol'=>'&#36','code'=>''),
-		'South Africa Rand'=>array('name'=>'South Africa Rand','symbol'=>'&#82','code'=>'ZAR'),
-		);		
-	
-$symbol = $currencies[$sel_currency]['symbol'];
-$code = $currencies[$sel_currency]['code'];
-
 //Insert into vtiger_currency vtiger_table
-               $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$sel_currency','$code','$symbol',1,'Active','-11')");
+               $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')");
 
 // populate the db with seed data
 if ($db_populate) {

Modified: vtigercrm/trunk/install/5createTables.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.php (original)
+++ vtigercrm/trunk/install/5createTables.php Tue Aug 29 07:21:11 2006
@@ -24,7 +24,9 @@
 if (isset($_REQUEST['db_populate'])) $db_populate		= $_REQUEST['db_populate'];
 if (isset($_REQUEST['admin_email'])) $admin_email		= $_REQUEST['admin_email'];
 if (isset($_REQUEST['admin_password'])) $admin_password	= $_REQUEST['admin_password'];
-if (isset($_REQUEST['currency'])) $sel_currency	= $_REQUEST['currency'];
+if (isset($_REQUEST['currency_name'])) $currency_name	= $_REQUEST['currency_name'];
+if (isset($_REQUEST['currency_code'])) $currency_code	= $_REQUEST['currency_code'];
+if (isset($_REQUEST['currency_symbol'])) $currency_symbol	= $_REQUEST['currency_symbol'];
 
 ?>
 





More information about the vtigercrm-commits mailing list