[Vtigercrm-commits] [vtiger-commits] r9762 - in /vtigercrm/trunk: ./ Smarty/templates/ Smarty/templates/Inventory/ Smarty/templates/Settings/ data/ include/ include/js/ include/language/ include/nusoap/ include/utils/ install/ modules/Accounts/ modules/Accounts/language/ modules/Calendar/ modules/Calendar/language/ modules/Campaigns/ modules/Contacts/ modules/CustomView/ modules/Emails/ modules/Faq/ modules/HelpDesk/ modules/Home/ modules/Import/ modules/Invoice/ modules/Leads/ modules/Migration/ modules/Migration/ModifyDatabase/ modules/Notes/ modules/Portal/ modules/Potentials/ modules/Potentials/language/ modules/PriceBooks/ modules/Products/ modules/PurchaseOrder/ modules/Quotes/ modules/Reports/ modules/SalesOrder/ modules/SalesOrder/pdf_templates/ modules/Settings/ modules/Users/ modules/Vendors/ modules/Webmails/ schema/ soap/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Oct 31 05:44:09 EST 2006


Author: richie
Date: Tue Oct 31 03:40:43 2006
New Revision: 9762

Log:
5.0.2 changes added

Removed:
    vtigercrm/trunk/INSTALLATION.txt
Modified:
    vtigercrm/trunk/Popup.php
    vtigercrm/trunk/Release_Notes.html
    vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl
    vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl
    vtigercrm/trunk/Smarty/templates/ActivityListView.tpl
    vtigercrm/trunk/Smarty/templates/Buttons_List.tpl
    vtigercrm/trunk/Smarty/templates/Buttons_List1.tpl
    vtigercrm/trunk/Smarty/templates/CreateEmailTemplate.tpl
    vtigercrm/trunk/Smarty/templates/CreateView.tpl
    vtigercrm/trunk/Smarty/templates/DetailView.tpl
    vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl
    vtigercrm/trunk/Smarty/templates/DisplayFields.tpl
    vtigercrm/trunk/Smarty/templates/EmailDetailView.tpl
    vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
    vtigercrm/trunk/Smarty/templates/HomePage.tpl
    vtigercrm/trunk/Smarty/templates/ImportStep2.tpl
    vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl
    vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl
    vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl
    vtigercrm/trunk/Smarty/templates/ListRoles.tpl
    vtigercrm/trunk/Smarty/templates/ListView.tpl
    vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl
    vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl
    vtigercrm/trunk/Smarty/templates/QuickCreate.tpl
    vtigercrm/trunk/Smarty/templates/Settings.tpl
    vtigercrm/trunk/Smarty/templates/Settings/TaxConfig.tpl
    vtigercrm/trunk/Smarty/templates/TagCloudDisplay.tpl
    vtigercrm/trunk/Smarty/templates/salesEditView.tpl
    vtigercrm/trunk/data/CRMEntity.php
    vtigercrm/trunk/data/Tracker.php
    vtigercrm/trunk/include/RelatedListView.php
    vtigercrm/trunk/include/js/Inventory.js
    vtigercrm/trunk/include/language/en_us.lang.php
    vtigercrm/trunk/include/nusoap/class.soap_transport_http.php
    vtigercrm/trunk/include/utils/CommonUtils.php
    vtigercrm/trunk/include/utils/DetailViewUtils.php
    vtigercrm/trunk/include/utils/EditViewUtils.php
    vtigercrm/trunk/include/utils/InventoryUtils.php
    vtigercrm/trunk/include/utils/ListViewUtils.php
    vtigercrm/trunk/include/utils/UserInfoUtil.php
    vtigercrm/trunk/include/utils/export.php
    vtigercrm/trunk/include/utils/utils.php
    vtigercrm/trunk/index.php
    vtigercrm/trunk/install/0welcome.php
    vtigercrm/trunk/install/1checkSystem.php
    vtigercrm/trunk/install/2setConfig.php
    vtigercrm/trunk/install/4createConfigFile.php
    vtigercrm/trunk/install/5createTables.inc.php
    vtigercrm/trunk/install/5createTables.php
    vtigercrm/trunk/install/populateSeedData.php
    vtigercrm/trunk/modules/Accounts/CallRelatedList.php
    vtigercrm/trunk/modules/Accounts/Delete.php
    vtigercrm/trunk/modules/Accounts/DetailView.php
    vtigercrm/trunk/modules/Accounts/DetailViewAjax.php
    vtigercrm/trunk/modules/Accounts/EditView.php
    vtigercrm/trunk/modules/Accounts/HeadLines.php
    vtigercrm/trunk/modules/Accounts/ListView.php
    vtigercrm/trunk/modules/Accounts/ListViewTop.php
    vtigercrm/trunk/modules/Accounts/Merge.php
    vtigercrm/trunk/modules/Accounts/Save.php
    vtigercrm/trunk/modules/Accounts/Tickerdetail.php
    vtigercrm/trunk/modules/Accounts/language/en_us.lang.php
    vtigercrm/trunk/modules/Calendar/Activity.php
    vtigercrm/trunk/modules/Calendar/ActivityAjax.php
    vtigercrm/trunk/modules/Calendar/Appointment.php
    vtigercrm/trunk/modules/Calendar/CalendarCommon.php
    vtigercrm/trunk/modules/Calendar/DetailView.php
    vtigercrm/trunk/modules/Calendar/ListView.php
    vtigercrm/trunk/modules/Calendar/OpenListView.php
    vtigercrm/trunk/modules/Calendar/RenderRelatedListUI.php
    vtigercrm/trunk/modules/Calendar/addEventUI.php
    vtigercrm/trunk/modules/Calendar/language/en_us.lang.php
    vtigercrm/trunk/modules/Campaigns/CallRelatedList.php
    vtigercrm/trunk/modules/Campaigns/Delete.php
    vtigercrm/trunk/modules/Campaigns/DetailView.php
    vtigercrm/trunk/modules/Campaigns/DetailViewAjax.php
    vtigercrm/trunk/modules/Campaigns/EditView.php
    vtigercrm/trunk/modules/Campaigns/ListView.php
    vtigercrm/trunk/modules/Campaigns/Save.php
    vtigercrm/trunk/modules/Contacts/CallRelatedList.php
    vtigercrm/trunk/modules/Contacts/Delete.php
    vtigercrm/trunk/modules/Contacts/DetailView.php
    vtigercrm/trunk/modules/Contacts/DetailViewAjax.php
    vtigercrm/trunk/modules/Contacts/EditView.php
    vtigercrm/trunk/modules/Contacts/ListView.php
    vtigercrm/trunk/modules/Contacts/Save.php
    vtigercrm/trunk/modules/CustomView/CustomView.php
    vtigercrm/trunk/modules/CustomView/EditView.php
    vtigercrm/trunk/modules/CustomView/PopulateCustomView.php
    vtigercrm/trunk/modules/Emails/CallRelatedList.php
    vtigercrm/trunk/modules/Emails/ChooseEmail.php
    vtigercrm/trunk/modules/Emails/Delete.php
    vtigercrm/trunk/modules/Emails/DetailView.php
    vtigercrm/trunk/modules/Emails/EditView.php
    vtigercrm/trunk/modules/Emails/EmailsAjax.php
    vtigercrm/trunk/modules/Emails/ListView.php
    vtigercrm/trunk/modules/Emails/Save.php
    vtigercrm/trunk/modules/Emails/class.phpmailer.php
    vtigercrm/trunk/modules/Emails/mail.php
    vtigercrm/trunk/modules/Emails/mailsend.php
    vtigercrm/trunk/modules/Emails/sendmail.php
    vtigercrm/trunk/modules/Faq/Faq.php
    vtigercrm/trunk/modules/HelpDesk/ConvertAsFAQ.php
    vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
    vtigercrm/trunk/modules/HelpDesk/ListView.php
    vtigercrm/trunk/modules/Home/UnifiedSearch.php
    vtigercrm/trunk/modules/Import/ImportAccount.php
    vtigercrm/trunk/modules/Import/ImportAjax.php
    vtigercrm/trunk/modules/Import/ImportContact.php
    vtigercrm/trunk/modules/Import/ImportLead.php
    vtigercrm/trunk/modules/Import/ImportMap.php
    vtigercrm/trunk/modules/Import/ImportOpportunity.php
    vtigercrm/trunk/modules/Import/ImportProduct.php
    vtigercrm/trunk/modules/Import/ImportStep2.php
    vtigercrm/trunk/modules/Import/ImportSteplast.php
    vtigercrm/trunk/modules/Invoice/EditView.php
    vtigercrm/trunk/modules/Invoice/Invoice.php
    vtigercrm/trunk/modules/Invoice/ListTopInvoice.php
    vtigercrm/trunk/modules/Invoice/ListView.php
    vtigercrm/trunk/modules/Invoice/Save.php
    vtigercrm/trunk/modules/Leads/CallRelatedList.php
    vtigercrm/trunk/modules/Leads/Delete.php
    vtigercrm/trunk/modules/Leads/DetailView.php
    vtigercrm/trunk/modules/Leads/DetailViewAjax.php
    vtigercrm/trunk/modules/Leads/EditView.php
    vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php
    vtigercrm/trunk/modules/Leads/ListView.php
    vtigercrm/trunk/modules/Leads/Save.php
    vtigercrm/trunk/modules/Leads/result.php
    vtigercrm/trunk/modules/Migration/MigrationStep1.php
    vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php
    vtigercrm/trunk/modules/Notes/Delete.php
    vtigercrm/trunk/modules/Notes/DetailView.php
    vtigercrm/trunk/modules/Notes/DetailViewAjax.php
    vtigercrm/trunk/modules/Notes/EditView.php
    vtigercrm/trunk/modules/Notes/ListView.php
    vtigercrm/trunk/modules/Notes/Save.php
    vtigercrm/trunk/modules/Portal/Portal.js
    vtigercrm/trunk/modules/Portal/Save.php
    vtigercrm/trunk/modules/Potentials/CallRelatedList.php
    vtigercrm/trunk/modules/Potentials/Charts.php
    vtigercrm/trunk/modules/Potentials/Delete.php
    vtigercrm/trunk/modules/Potentials/DetailView.php
    vtigercrm/trunk/modules/Potentials/DetailViewAjax.php
    vtigercrm/trunk/modules/Potentials/EditView.php
    vtigercrm/trunk/modules/Potentials/ListView.php
    vtigercrm/trunk/modules/Potentials/ListViewTop.php
    vtigercrm/trunk/modules/Potentials/Save.php
    vtigercrm/trunk/modules/Potentials/language/en_us.lang.php
    vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php
    vtigercrm/trunk/modules/PriceBooks/Delete.php
    vtigercrm/trunk/modules/PriceBooks/DetailView.php
    vtigercrm/trunk/modules/PriceBooks/DetailViewAjax.php
    vtigercrm/trunk/modules/PriceBooks/EditView.php
    vtigercrm/trunk/modules/PriceBooks/ListView.php
    vtigercrm/trunk/modules/PriceBooks/Save.php
    vtigercrm/trunk/modules/Products/AddProductToPriceBooks.php
    vtigercrm/trunk/modules/Products/AddProductsToPriceBook.php
    vtigercrm/trunk/modules/Products/CallRelatedList.php
    vtigercrm/trunk/modules/Products/Delete.php
    vtigercrm/trunk/modules/Products/DetailView.php
    vtigercrm/trunk/modules/Products/DetailViewAjax.php
    vtigercrm/trunk/modules/Products/EditView.php
    vtigercrm/trunk/modules/Products/ListView.php
    vtigercrm/trunk/modules/Products/Save.php
    vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php
    vtigercrm/trunk/modules/PurchaseOrder/CreatePDF.php
    vtigercrm/trunk/modules/PurchaseOrder/Delete.php
    vtigercrm/trunk/modules/PurchaseOrder/DetailView.php
    vtigercrm/trunk/modules/PurchaseOrder/DetailViewAjax.php
    vtigercrm/trunk/modules/PurchaseOrder/EditView.php
    vtigercrm/trunk/modules/PurchaseOrder/ListTopPurchaseOrder.php
    vtigercrm/trunk/modules/PurchaseOrder/ListView.php
    vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
    vtigercrm/trunk/modules/PurchaseOrder/Save.php
    vtigercrm/trunk/modules/Quotes/CallRelatedList.php
    vtigercrm/trunk/modules/Quotes/CreatePDF.php
    vtigercrm/trunk/modules/Quotes/Delete.php
    vtigercrm/trunk/modules/Quotes/DetailView.php
    vtigercrm/trunk/modules/Quotes/DetailViewAjax.php
    vtigercrm/trunk/modules/Quotes/EditView.php
    vtigercrm/trunk/modules/Quotes/ListTopQuotes.php
    vtigercrm/trunk/modules/Quotes/ListView.php
    vtigercrm/trunk/modules/Quotes/Save.php
    vtigercrm/trunk/modules/Reports/ReportColumns.php
    vtigercrm/trunk/modules/Reports/ReportRun.php
    vtigercrm/trunk/modules/Reports/Reports.php
    vtigercrm/trunk/modules/SalesOrder/EditView.php
    vtigercrm/trunk/modules/SalesOrder/ListTopSalesOrder.php
    vtigercrm/trunk/modules/SalesOrder/ListView.php
    vtigercrm/trunk/modules/SalesOrder/SalesOrder.php
    vtigercrm/trunk/modules/SalesOrder/Save.php
    vtigercrm/trunk/modules/SalesOrder/pdf_templates/header.php
    vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php
    vtigercrm/trunk/modules/Settings/CustomFieldList.php
    vtigercrm/trunk/modules/Settings/DeleteCustomField.php
    vtigercrm/trunk/modules/Settings/EditComboField.php
    vtigercrm/trunk/modules/Settings/TaxConfig.php
    vtigercrm/trunk/modules/Users/Authenticate.php
    vtigercrm/trunk/modules/Users/ChangePassword.php
    vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
    vtigercrm/trunk/modules/Users/DefaultDataPopulator.php
    vtigercrm/trunk/modules/Users/DetailView.php
    vtigercrm/trunk/modules/Users/DetailViewAjax.php
    vtigercrm/trunk/modules/Users/EditView.php
    vtigercrm/trunk/modules/Users/ListLoginHistory.php
    vtigercrm/trunk/modules/Users/ListView.php
    vtigercrm/trunk/modules/Users/Logout.php
    vtigercrm/trunk/modules/Users/Save.php
    vtigercrm/trunk/modules/Users/ShowAuditTrail.php
    vtigercrm/trunk/modules/Users/ShowHistory.php
    vtigercrm/trunk/modules/Users/about_us.php
    vtigercrm/trunk/modules/Users/massChangeStatus.php
    vtigercrm/trunk/modules/Users/populatetemplate.php
    vtigercrm/trunk/modules/Users/profilePrivileges.php
    vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
    vtigercrm/trunk/modules/Vendors/CallRelatedList.php
    vtigercrm/trunk/modules/Vendors/Delete.php
    vtigercrm/trunk/modules/Vendors/DetailView.php
    vtigercrm/trunk/modules/Vendors/DetailViewAjax.php
    vtigercrm/trunk/modules/Vendors/EditView.php
    vtigercrm/trunk/modules/Vendors/ListView.php
    vtigercrm/trunk/modules/Vendors/Save.php
    vtigercrm/trunk/modules/Webmails/CallRelatedList.php
    vtigercrm/trunk/modules/Webmails/Save.php
    vtigercrm/trunk/schema/DatabaseSchema.xml
    vtigercrm/trunk/soap/firefoxtoolbar.php
    vtigercrm/trunk/soap/thunderbirdplugin.php
    vtigercrm/trunk/soap/vtigerolservice.php
    vtigercrm/trunk/soap/webforms.php
    vtigercrm/trunk/soap/wordplugin.php
    vtigercrm/trunk/vtigerversion.php

Modified: vtigercrm/trunk/Popup.php
==============================================================================
--- vtigercrm/trunk/Popup.php (original)
+++ vtigercrm/trunk/Popup.php Tue Oct 31 03:40:43 2006
@@ -33,8 +33,8 @@
 switch($currentModule)
 {
 	case 'Contacts':
-		require_once("modules/$currentModule/Contact.php");
-		$focus = new Contact();
+		require_once("modules/$currentModule/Contacts.php");
+		$focus = new Contacts();
 		$log = LoggerManager::getLogger('contact_list');
 		$comboFieldNames = Array('leadsource'=>'leadsource_dom');
 		$comboFieldArray = getComboArray($comboFieldNames);
@@ -47,8 +47,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","","");
 		break;
 	case 'Campaigns':
-		require_once("modules/$currentModule/Campaign.php");
-		$focus = new Campaign();
+		require_once("modules/$currentModule/Campaigns.php");
+		$focus = new Campaigns();
 		$log = LoggerManager::getLogger('campaign_list');
 		$comboFieldNames = Array('campaignstatus'=>'campaignstatus_dom',
 					 'campaigntype'=>'campaigntype_dom');
@@ -60,8 +60,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','campaignname','true','basic',$popuptype,"","","");
 		break;
 	case 'Accounts':
-		require_once("modules/$currentModule/Account.php");
-		$focus = new Account();
+		require_once("modules/$currentModule/Accounts.php");
+		$focus = new Accounts();
 		$log = LoggerManager::getLogger('account_list');
 		$comboFieldNames = Array('accounttype'=>'account_type_dom'
 				,'industry'=>'industry_dom');
@@ -74,8 +74,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','accountname','true','basic',$popuptype,"","","");
 		break;
 	case 'Leads':
-		require_once("modules/$currentModule/Lead.php");
-		$focus = new Lead();
+		require_once("modules/$currentModule/Leads.php");
+		$focus = new Leads();
 		$log = LoggerManager::getLogger('contact_list');
 		$comboFieldNames = Array('leadsource'=>'leadsource_dom'
 				,'leadstatus'=>'leadstatus_dom'
@@ -91,8 +91,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','lastname','true','basic',$popuptype,"","","");
 		break;
 	case 'Potentials':
-		require_once("modules/$currentModule/Opportunity.php");
-		$focus = new Potential();
+		require_once("modules/$currentModule/Potentials.php");
+		$focus = new Potentials();
 		$log = LoggerManager::getLogger('potential_list');
 		$comboFieldNames = Array('leadsource'=>'leadsource_dom'
 				,'opportunity_type'=>'opportunity_type_dom'
@@ -104,8 +104,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','potentialname','true','basic',$popuptype,"","","");
 		break;
 	case 'Quotes':
-		require_once("modules/$currentModule/Quote.php");	
-		$focus = new Quote();
+		require_once("modules/$currentModule/Quotes.php");	
+		$focus = new Quotes();
 		$log = LoggerManager::getLogger('quotes_list');
 		$comboFieldNames = Array('quotestage'=>'quotestage_dom');
 		$comboFieldArray = getComboArray($comboFieldNames);
@@ -121,8 +121,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","","");
 		break;
 	case 'Products':
-		require_once("modules/$currentModule/Product.php");
-		$focus = new Product();
+		require_once("modules/$currentModule/Products.php");
+		$focus = new Products();
 		$smarty->assign("SINGLE_MOD",'Product');
 		if(isset($_REQUEST['curr_row']))
 		{
@@ -135,8 +135,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','productname','true','basic',$popuptype,"","","");
 		break;
 	case 'Vendors':
-		require_once("modules/$currentModule/Vendor.php");
-		$focus = new Vendor();
+		require_once("modules/$currentModule/Vendors.php");
+		$focus = new Vendors();
 		$smarty->assign("SINGLE_MOD",'Vendor');
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','vendorname','true','basic',$popuptype,"","","");
 		break;
@@ -150,15 +150,15 @@
 		break;
 	case 'PurchaseOrder':
 		require_once("modules/$currentModule/PurchaseOrder.php");
-		$focus = new Order();
+		$focus = new PurchaseOrder();
 		$smarty->assign("SINGLE_MOD",'PurchaseOrder');
 		if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
 			$smarty->assign("RETURN_MODULE",$_REQUEST['return_module']);
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','subject','true','basic',$popuptype,"","","");
 		break;
 	case 'PriceBooks':
-		require_once("modules/$currentModule/PriceBook.php");
-		$focus = new PriceBook();
+		require_once("modules/$currentModule/PriceBooks.php");
+		$focus = new PriceBooks();
 		$smarty->assign("SINGLE_MOD",'PriceBook');
 		if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
 			$smarty->assign("RETURN_MODULE",$_REQUEST['return_module']);
@@ -175,8 +175,8 @@
 		$alphabetical = AlphabeticalSearch($currentModule,'Popup','bookname','true','basic',$popuptype,"","","");
 		break;
 	case 'Users':
-                require_once("modules/$currentModule/User.php");
-                $focus = new User();
+                require_once("modules/$currentModule/Users.php");
+                $focus = new Users();
                 $smarty->assign("SINGLE_MOD",'Users');
                 if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] !='')
                     $smarty->assign("RETURN_MODULE",$_REQUEST['return_module']);

Modified: vtigercrm/trunk/Release_Notes.html
==============================================================================
--- vtigercrm/trunk/Release_Notes.html (original)
+++ vtigercrm/trunk/Release_Notes.html Tue Oct 31 03:40:43 2006
@@ -1,5 +1,5 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html lang="en"><head><title>vtiger CRM 5 Beta: Release Notes</title>
+<html lang="en"><head><title>vtiger CRM 5.0.2 : Release Notes</title>
   
   <style>
 p {  font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
@@ -27,6 +27,108 @@
 
 <body class="background">
 <p><img src="vtiger.jpg" width="112" height="48"></p>
+<p>&nbsp;</p>
+<h1>vtiger CRM 5.0.2: Release Notes</h1>
+<p><b>Date: October 31, 2006</b></p>
+<p>Hi All,</p>
+<p>Welcome to vtiger CRM!</p>
+<p>We are happy to announce the release of vtiger CRM 5.0.2. In this release, 
+  we have focused mainly on the bug fixes and minor enhancements so that our end-user 
+  community will have better experience with our product.</p>
+<p><b><a name="TOC4" id="TOC3"></a>Table of Contents</b></p>
+<ol>
+  <li><a href="#Summary5">Summary</a></li>
+  <li><a href="#feature">Enhancements</a></li>
+  <li><a href="#bugfix5">Bug Fixes</a></li>
+  <li><a href="#ki">Known Issues </a></li>
+  <li><a href="#patch">How to update the patch</a></li>
+</ol>
+<h3><a name="summary5"></a>1. Summary</h3>
+<table border="1" cellpadding="5" cellspacing="0" width="73%">
+  <tbody> 
+  <tr bgcolor="#ccccff"> 
+    <td width="5%"><b><font color="#990000">S. No</font></b></td>
+    <td width="40%"><b><font color="#990000">Item</font></b></td>
+    <td width="55%"><b><font color="#990000">Status</font></b></td>
+  </tr>
+  <tr> 
+    <td width="5%">1 </td>
+    <td width="40%">Features</td>
+    <td width="55%">&nbsp; </td>
+  </tr>
+  <tr> 
+    <td width="5%">2</td>
+    <td width="40%">Product Size</td>
+    <td width="55%"><b>Platform Independent - 6.1 MB<br>
+      Windows (EXE) - 26 MB<br>
+      Linux (BIN) - 43 MB</b></td>
+  </tr>
+  <tr> 
+    <td width="5%">3</td>
+    <td width="40%">Database Migration</td>
+    <td width="55%"><span class="style2">Available for migrating data from 4.2Patch2/4.2.3/4.2.4/5.0.0 to 5.0.2</span></td>
+  </tr>
+  <tr> 
+    <td>4</td>
+    <td>Product Download </td>
+    <td><a href="http://www.vtiger.com/index.php?option=com_content&task=view&id=30&Itemid=57" target="_blank">Click 
+      Here</a></td>
+  </tr>
+  <tr> 
+    <td width="5%">5</td>
+    <td width="40%">vtiger CRM - PHP Documentation</td>
+    <td width="55%"> URL: <a href="http://api.vtiger.com/index.php" target="_blank">Click 
+      Here</a></td>
+  </tr>
+  <tr> 
+    <td width="5%">6</td>
+    <td width="40%">Product Documentation</td>
+    <td width="55%"> 
+      <p>Available at the <a href="http://wiki.vtiger.com/index.php" target="_blank">Wiki</a></p>
+    </td>
+  </tr>
+  </tbody> 
+</table>
+<h3><a name="feature"></a>2. Enhancements</h3>
+<ul>
+	<li>Viewing  quantity in stock in the product list view</li>
+  <li>Display of Event date in the Activity history</li>
+  <li>Facility to add tags within the Tag cloud box.</li>
+  <li>Today's and All views are enabled in the Home page under Upcoming and Pending Activities sections<br>
+  </li>
+</ul>
+<p>&nbsp;</p>
+<h3><a name="bugfix5"></a>3. Bug Fixes</h3>
+<ul>
+  <li>Editing a calender entry resets the start and end time (Ticket 2271 )</li>
+  <li>Error in custom list view when a custom field related to that view is deleted 
+    has been handled (Ticket 2432)</li>
+  <li>Display of currency rate in campaign page (Ticket 2333 )</li>
+  <li>Formating issues in HTML editor.(Ticket 2290 )</li>
+  <li>Using the $contacts-salutationtype$ from Contacts in an email template, 
+    the email client does not send the email-this issue has been fixed. (Ticket 
+    2273)</li>
+  <li>PHP Version check during installation (Ticket 2329 )</li>
+  <li>Issue in removing contacts from Events and To dos (Ticket 2048 )</li>
+  <li>Product stock reduced twice - SO and Invoice -quantity (Ticket 1497 )</li>
+</ul>
+<p> For more information, please refer our <strong><a href="http://vtiger.fosslabs.com/cgi-bin/trac.cgi/query?status=closed&group=owner&milestone=5.0.2&order=priority" target="_blank">vtiger CRM Bug Tracker.</a></strong></p>
+<h3><a name="ki"></a>4. Known Issues</h3>
+<p>We have about 125 issues to be fixed. You can refer our <a href="http://vtiger.fosslabs.com/cgi-bin/trac.cgi/query?status=new&status=assigned&status=reopened&milestone=5.0.3&milestone=5.1.0&type=defect&order=priority"><b>vtiger CRM Bug Tracker</b></a> for the details of these issues.<strong> </strong></p>
+<p>
+<b><a name="patch"></a>5.How to update the patch</b>
+<p></p>
+<p>To upgrade from the version 5.0.0 or 5.0.1 to the latest version 5.0.2
+<ol>
+	<li> Login as admin user
+	<li> Click on the Settings tab 
+	<li> Go to Migration Wizard. 
+	<li> Use the link 'Click here to apply the 5.0.2 Database changes from 5.0.0/5.0.1'
+</ol>
+</p>
+<p>&nbsp;</p>
+<hr />
+
 <p>&nbsp;</p>
 <h1>vtiger CRM 5.0.1: Release Notes</h1>
 <p><b>Date: Octoer 10, 2006</b></p>

Modified: vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ActivityDetailView.tpl Tue Oct 31 03:40:43 2006
@@ -400,19 +400,14 @@
 	<td width=22% valign=top style="border-left:2px dashed #cccccc;padding:13px">
 						<!-- right side relevant info -->
 
-		<!-- Add Tag link added just above the tag cloud image -->
-		<table border=0 cellspacing=0 cellpadding=5 width=100% >
-		<tr>
-			<td align="left" class="genHeaderSmall"  nowrap><div id="addtagdiv"><a href="javascript:;" onClick="show('tagdiv'),fnhide('addtagdiv'),document.getElementById('txtbox_tagfields').focus()"><b>{$APP.LBL_ADD_TAG}</b></a></div><div id="tagdiv" style="display:none;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value=""></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/><input name="close" type="button" class="crmbutton small cancel" value="{$APP.LBL_CLOSE}" onClick="fnhide('tagdiv'),show('addtagdiv')"></div></td>
-		</tr>
-		</table>
-		<br>
-		<!-- Eng Add Tag Link -->
 		<!-- Tag cloud display -->
 		<table border=0 cellspacing=0 cellpadding=0 width=100% class="tagCloud">
 		<tr>
 			<td class="tagCloudTopBg"><img src="{$IMAGE_PATH}tagCloudName.gif" border=0></td>
 		</tr>
+		<tr>
+                      	<td><div id="tagdiv" style="display:visible;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value="" style="width:100px;margin-left:5px;"></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/></div></td>
+                </tr>
 		<tr>
 			<td class="tagCloudDisplay" valign=top> <span id="tagfields">{$ALL_TAG}</span></td>
 		</tr>

Modified: vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ActivityEditView.tpl Tue Oct 31 03:40:43 2006
@@ -152,8 +152,8 @@
                                                                                         {foreach item=arr from=$ACTIVITYDATA.eventstatus}
                                                                                         {foreach key=sel_value item=value from=$arr}
                                                                                         <option value="{$sel_value}" {$value}>
-                                                                                                {if $APP[$sel_value] neq ''}
-                                                                                                {$APP[$sel_value]}
+                                                                                                {if $MOD.$sel_value neq ''}
+                                                                                                {$MOD.$sel_value}
                                                                                                 {else}
                                                                                                         {$sel_value}
                                                                                                 {/if}
@@ -224,8 +224,8 @@
                                                                                         {foreach item=arr from=$ACTIVITYDATA.taskpriority}
                                                                                         {foreach key=sel_value item=value from=$arr}
                                                                                         <option value="{$sel_value}" {$value}>
-                                                                                                {if $APP[$sel_value] neq ''}
-                                                                                                {$APP[$sel_value]}
+                                                                                                {if $MOD.$sel_value neq ''}
+                                                                                                {$MOD.$sel_value}
                                                                                                 {else}
                                                                                                         {$sel_value}
                                                                                                 {/if}
@@ -456,7 +456,7 @@
 													<input type="checkbox" name="recurringcheck" onClick="showhide('repeatOptions')">
 													{/if}
 													</td>
-													<td colspan=2>Enable Repeat</td>
+													<td colspan=2>{$MOD.LBL_ENABLE_REPEAT}<td>
 												</tr>
 												<tr>
 													<td colspan=2>
@@ -609,8 +609,8 @@
                                         			{foreach item=arr from=$ACTIVITYDATA.taskstatus}
                                         			{foreach key=sel_value item=value from=$arr}
                                                 			<option value="{$sel_value}" {$value}>
-                                                        		{if $APP[$sel_value] neq ''}
-                                                                		{$APP[$sel_value]}
+                                                        		{if $MOD.$sel_value neq ''}
+                                                                		{$MOD.$sel_value}
                                                         		{else}
                                                                 		{$sel_value}
                                                         		{/if}
@@ -626,8 +626,8 @@
         			                                {foreach item=arr from=$ACTIVITYDATA.taskpriority}
                                 			        {foreach key=sel_value item=value from=$arr}
 			                                                <option value="{$sel_value}" {$value}>
-                        		                                {if $APP[$sel_value] neq ''}
-                                        		                        {$APP[$sel_value]}
+                        		                                {if $MOD.$sel_value neq ''}
+                                        		                        {$MOD.$sel_value}
                                                        			{else}
                                                                 		{$sel_value}
                                                         		{/if}
@@ -658,9 +658,9 @@
                                                 			{assign var=style_user value='display:none'}
                                                 			{assign var=style_group value='display:block'}
                                         			{/if}
-				                                <input type="radio" name="assigntype" {$select_user} value="U" onclick="toggleAssignType(this.value)">&nbsp;User
+				                                <input type="radio" name="assigntype" {$select_user} value="U" onclick="toggleAssignType(this.value)">&nbsp;{$APP.LBL_USER}
 				                                {if $secondvalue.assigned_user_id neq ''}
-                                			        <input type="radio" name="assigntype" {$select_group} value="T" onclick="toggleAssignType(this.value)">&nbsp;Group
+                                			        <input type="radio" name="assigntype" {$select_group} value="T" onclick="toggleAssignType(this.value)">&nbsp;{$APP.LBL_GROUP}
                                         			{/if}
                                         			<span id="assign_user" style="{$style_user}">
                                                 		<select name="assigned_user_id" class=small>

Modified: vtigercrm/trunk/Smarty/templates/ActivityListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ActivityListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ActivityListView.tpl Tue Oct 31 03:40:43 2006
@@ -18,7 +18,21 @@
 <script language="JavaScript" type="text/javascript" src="include/js/search.js"></script>
 <script language="JavaScript" type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
 <script language="javascript">
-
+function checkgroup()
+{ldelim}
+
+  if(document.change_ownerform_name.user_lead_owner[1].checked)
+  {ldelim}
+          document.change_ownerform_name.lead_group_owner.style.display = "block";
+          document.change_ownerform_name.lead_owner.style.display = "none";
+  {rdelim}
+  else
+  {ldelim}
+          document.change_ownerform_name.lead_owner.style.display = "block";
+          document.change_ownerform_name.lead_group_owner.style.display = "none";
+  {rdelim}    
+  
+{rdelim}
 function callSearch(searchtype)
 {ldelim}
 	for(i=1;i<=26;i++)
@@ -424,9 +438,16 @@
 	<td width="50%"><b>{$APP.LBL_TRANSFER_OWNERSHIP}</b></td>
 	<td width="2%"><b>:</b></td>
 	<td width="48%">
-	<select name="lead_owner" id="lead_owner" class="detailedViewTextBox">
-	{$CHANGE_OWNER}
-	</select>
+	         <form name="change_ownerform_name">
+	        <input type = "radio" name = "user_lead_owner"  onclick=checkgroup();  checked>{$APP.LBL_USER}&nbsp;
+					<input type = "radio" name = "user_lead_owner" onclick=checkgroup(); >{$APP.LBL_GROUP}<br>
+					<select name="lead_owner" id="lead_owner" class="detailedViewTextBox">
+					{$CHANGE_OWNER}
+					</select>
+					<select name="lead_group_owner" id="lead_group_owner" class="detailedViewTextBox" style="display:none;">
+					{$CHANGE_GROUP_OWNER}
+					</select>
+					</form>
 	</td>
 </tr>
 <tr><td colspan="3" style="border-bottom:1px dashed #CCCCCC;">&nbsp;</td></tr>
@@ -457,12 +478,23 @@
 	}
 	else if(statusname == 'owner')
 	{
-		fninvsh('changeowner');
-		var url='&user_id='+document.getElementById('lead_owner').options[document.getElementById('lead_owner').options.selectedIndex].value;
 		
-{/literal}
-		var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
-{literal}
+	   if(document.change_ownerform_name.user_lead_owner[0].checked)
+	   {
+		    fninvsh('changeowner');
+		    var url='&user_id='+document.getElementById('lead_owner').options[document.getElementById('lead_owner').options.selectedIndex].value;
+		    {/literal}
+		        var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
+		    {literal}
+     }
+    else
+    {
+        fninvsh('changeowner');
+		    var url='&group_id='+document.getElementById('lead_group_owner').options[document.getElementById('lead_group_owner').options.selectedIndex].value;
+	       {/literal}
+		        var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
+		    {literal}
+    }
 
 	}
 	new Ajax.Request(

Modified: vtigercrm/trunk/Smarty/templates/Buttons_List.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Buttons_List.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Buttons_List.tpl Tue Oct 31 03:40:43 2006
@@ -47,7 +47,7 @@
 			        		{if $MODULE eq 'Calendar'}
 		                      	        	<td style="padding-right:0px;padding-left:10px;"><img src="{$IMAGE_PATH}btnL3Add-Faded.gif" border=0></td>
                 	   			 {else}
-	                        		       	<td style="padding-right:0px;padding-left:10px;"><a href="index.php?module={$MODULE}&action=EditView&return_action=DetailView&parenttab={$CATEGORY}"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$MODULE}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$MODULE}..." border=0></a></td>
+	                        		       	<td style="padding-right:0px;padding-left:10px;"><a href="index.php?module={$MODULE}&action=EditView&return_action=DetailView&parenttab={$CATEGORY}"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$SINGLE_MOD}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$SINGLE_MOD}..." border=0></a></td>
 			                       	{/if}
 					{else}
 						<td style="padding-right:0px;padding-left:10px;"><img src="{$IMAGE_PATH}btnL3Add-Faded.gif" border=0></td>	

Modified: vtigercrm/trunk/Smarty/templates/Buttons_List1.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Buttons_List1.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Buttons_List1.tpl Tue Oct 31 03:40:43 2006
@@ -50,9 +50,9 @@
 				<tr>
 					{if $CHECK.EditView eq 'yes'}
 			        		{if $MODULE eq 'Calendar'}
-		                      	        	<td style="padding-right:0px;padding-left:10px;"><a href="javascript:;" id="showSubMenu"  onMouseOver="fnvshobj(this,'reportLay');" onMouseOut="fninvsh('reportLay');"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}..." border=0></a></td>
+		                      	        	<td style="padding-right:0px;padding-left:10px;"><a href="javascript:;" id="showSubMenu"  onMouseOver="fnvshobj(this,'reportLay');" onMouseOut="fninvsh('reportLay');"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}..." border=0></a></td>
                 	   			 {else}
-	                        		       	<td style="padding-right:0px;padding-left:10px;"><a href="index.php?module={$MODULE}&action=EditView&return_action=DetailView&parenttab={$CATEGORY}"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}..." border=0></a></td>
+	                        		       	<td style="padding-right:0px;padding-left:10px;"><a href="index.php?module={$MODULE}&action=EditView&return_action=DetailView&parenttab={$CATEGORY}"><img src="{$IMAGE_PATH}btnL3Add.gif" alt="{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}..." title="{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}..." border=0></a></td>
 			                       	{/if}
 					{else}
 						<td style="padding-right:0px;padding-left:10px;"><img src="{$IMAGE_PATH}btnL3Add-Faded.gif" border=0></td>	

Modified: vtigercrm/trunk/Smarty/templates/CreateEmailTemplate.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CreateEmailTemplate.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CreateEmailTemplate.tpl Tue Oct 31 03:40:43 2006
@@ -60,7 +60,7 @@
                 
                 options[1] = new Option('Contact: First Name', '$contacts-firstname$'); 
                 options[2] = new Option('Contact: Last Name', '$contacts-lastname$'); 
-                options[3] = new Option('Contact: Salutation', '$contacts-salutationtype$'); 
+                options[3] = new Option('Contact: Salutation', '$contacts-salutation$'); 
                 options[4] = new Option('Contact: Title', '$contacts-title$'); 
                 options[5] = new Option('Contact: Email', '$contacts-email$'); 
                 options[6] = new Option('Contact: Department', '$contacts-department$'); 
@@ -86,7 +86,7 @@
                 options[8] = new Option('Lead: Email', '$leads-email$'); 
                 options[9] = new Option('Lead: Annual Revenue', '$leads-annualrevenue$'); 
                 options[10] = new Option('Lead: Title', '$leads-designation$'); 
-                options[11] = new Option('Lead: Salutation', '$leads-salutationtype$'); 
+                options[11] = new Option('Lead: Salutation', '$leads-salutation$'); 
             
 	        allOpts[3] = options;
 

Modified: vtigercrm/trunk/Smarty/templates/CreateView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CreateView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CreateView.tpl Tue Oct 31 03:40:43 2006
@@ -119,7 +119,7 @@
 
 								   {foreach key=header item=data from=$BASBLOCKS}
 								   <tr>
-									{if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
+									{if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
                                                                         <td colspan=2 class="detailedViewHeader">
                                                                         <b>{$header}</b></td>
                                                                         <td class="detailedViewHeader">
@@ -127,7 +127,7 @@
                                                                         <td class="detailedViewHeader">
                                                                         <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_LCPY_ADDRESS}</b></td>
 
-									{elseif $header== 'Address Information' && $MODULE == 'Contacts'}
+									{elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'}
 									<td colspan=2 class="detailedViewHeader">
                                                                         <b>{$header}</b></td>
                                                                         <td class="detailedViewHeader">

Modified: vtigercrm/trunk/Smarty/templates/DetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DetailView.tpl Tue Oct 31 03:40:43 2006
@@ -73,20 +73,28 @@
 </script>
 {if $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads'}
         {if $MODULE eq 'Accounts'}
-                {assign var=address1 value='Billing'}
-                {assign var=address2 value='Shipping'}
+                {assign var=address1 value='$MOD.LBL_BILLING_ADDRESS'}
+                {assign var=address2 value='$MOD.LBL_SHIPPING_ADDRESS'}
         {/if}
         {if $MODULE eq 'Contacts'}
-                {assign var=address1 value='Mailing'}
-                {assign var=address2 value='Other'}
+                {assign var=address1 value='$MOD.LBL_PRIMARY_ADDRESS'}
+                {assign var=address2 value='$MOD.LBL_ALTERNATE_ADDRESS'}
         {/if}
         <div id="locateMap" onMouseOut="fninvsh('locateMap')" onMouseOver="fnvshNrm('locateMap')">
                 <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
                         <tr>
                                 <td>
-                                        <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Main' );" class="calMnu">{$address1} {$APP.LBL_ADDRESS}</a>
-                                        <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Other' );" class="calMnu">{$address2} {$APP.LBL_ADDRESS}</a>
-                                </td>
+                                {if $MODULE eq 'Accounts'}
+                                        <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Main' );" class="calMnu">{$MOD.LBL_BILLING_ADDRESS}</a>
+                                        <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Other' );" class="calMnu">{$MOD.LBL_SHIPPING_ADDRESS}</a>
+                               {/if}
+                               
+                               {if $MODULE eq 'Contacts'}
+                                <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Main' );" class="calMnu">{$MOD.LBL_PRIMARY_ADDRESS}</a>
+                                        <a href="javascript:;" onClick="fninvsh('locateMap'); searchMapLocation( 'Other' );" class="calMnu">{$MOD.LBL_ALTERNATE_ADDRESS}</a>
+                               {/if}
+                                        
+                                         </td>
                         </tr>
                 </table>
         </div>
@@ -221,7 +229,7 @@
                             <td>&nbsp;</td>
                             <td>&nbsp;</td>
                              <td align=right>
-							{if $header eq 'Address Information' && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') }
+							{if $header eq $MOD.LBL_ADDRESS_INFORMATION && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') }
                              {if $MODULE eq 'Leads'}
                              <input name="mapbutton" value="{$APP.LBL_LOCATE_MAP}" class="crmbutton small create" type="button" onClick="searchMapLocation( 'Main' )" title="{$APP.LBL_LOCATE_MAP}">
                              {else}
@@ -380,19 +388,14 @@
 		<td width=22% valign=top style="border-left:2px dashed #cccccc;padding:13px">
 						<!-- right side relevant info -->
 
-		<!-- Add Tag link added just above the tag cloud image -->
-		<table border=0 cellspacing=0 cellpadding=5 width=100% >
-		<tr>
-			<td align="left" class="genHeaderSmall"  nowrap><div id="addtagdiv"><a href="javascript:;" onClick="show('tagdiv'),fnhide('addtagdiv'),document.getElementById('txtbox_tagfields').focus()"><b>{$APP.LBL_ADD_TAG}</b></a></div><div id="tagdiv" style="display:none;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value=""></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/><input name="close" type="button" class="crmbutton small cancel" value="{$APP.LBL_CLOSE}" onClick="fnhide('tagdiv'),show('addtagdiv')"></div></td>
-		</tr>
-		</table>
-		<br>
-		<!-- Eng Add Tag Link -->
 		<!-- Tag cloud display -->
 		<table border=0 cellspacing=0 cellpadding=0 width=100% class="tagCloud">
 		<tr>
 			<td class="tagCloudTopBg"><img src="{$IMAGE_PATH}tagCloudName.gif" border=0></td>
 		</tr>
+		<tr>
+                      	<td><div id="tagdiv" style="display:visible;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value="" style="width:100px;margin-left:5px;"></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/></div></td>
+                </tr>
 		<tr>
 			<td class="tagCloudDisplay" valign=top> <span id="tagfields">{$ALL_TAG}</span></td>
 		</tr>

Modified: vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DetailViewUI.tpl Tue Oct 31 03:40:43 2006
@@ -42,7 +42,8 @@
                     							   <select id="txtbox_{$label}" name="{$keyfldname}">
                     								{foreach item=arr from=$keyoptions}
                     									{foreach key=sel_value item=value from=$arr}
-                    										<option value="{$sel_value}" {$value}>{$sel_value}</option>
+                    										<option value="{$sel_value}" {$value}>{if $APP.$sel_value}{$APP.$sel_value}{else}{$sel_value}{/if}</option>
+                    									
                     									{/foreach}
                     								{/foreach}
                     							   </select>
@@ -130,10 +131,10 @@
 						{if $label eq $MOD.LBL_ADD_COMMENT}
 							{assign var=keyval value=''}
 						{/if}
-							{assign var="DESCRIPTION_SEPARATOR_STRING" value=" "}  {* Separates Description *}
-							{assign var="DESCRIPTION_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Description *}
+							<!--{assign var="DESCRIPTION_SEPARATOR_STRING" value=" "}  {* Separates Description *}-->
+							<!--{assign var="DESCRIPTION_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Description *}-->
                                                   <td width=25% class="dvtCellInfo" align="left" id="mouseArea_{$label}" onmouseover="hndMouseOver({$keyid},'{$label}');" onmouseout="fnhide('crmspanid');">&nbsp;<span id="dtlview_{$label}">
-							{$keyval|replace:$DESCRIPTION_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$DESCRIPTION_SEPARATOR_STRING|wordwrap:$DESCRIPTION_WORDWRAP_WIDTH:"<br>&nbsp;"|replace:"\x0":"&nbsp;"}
+							{$keyval}<!--|replace:$DESCRIPTION_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$DESCRIPTION_SEPARATOR_STRING|wordwrap:$DESCRIPTION_WORDWRAP_WIDTH:"<br>&nbsp;"|replace:"\x0":"&nbsp;"}-->
 							</span>
                                               		<div id="editarea_{$label}" style="display:none;">
                                               		  <textarea id="txtbox_{$label}" name="{$keyfldname}"  class=detailedViewTextBox onFocus="this.className='detailedViewTextBoxOn'"onBlur="this.className='detailedViewTextBox'" cols="90" rows="8">{$keyval}</textarea>                                            		  

Modified: vtigercrm/trunk/Smarty/templates/DisplayFields.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/DisplayFields.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/DisplayFields.tpl Tue Oct 31 03:40:43 2006
@@ -81,12 +81,12 @@
 				{$fldlabel}
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
-			   <select name="{$fldname}" tabindex="{$vt_tab}" >
+			   <select name="{$fldname}" tabindex="{$vt_tab}" class="small">
 				{foreach item=arr from=$fldvalue}
 					{foreach key=sel_value item=value from=$arr}
 						<option value="{$sel_value}" {$value}>
-                                                {if $APP[$sel_value] neq ''}
-                                                        {$APP[$sel_value]}
+                                                {if $APP.$sel_value neq ''}
+                                                {$APP.$sel_value}
                                                 {else}
                                                         {$sel_value}
                                                 {/if}
@@ -100,12 +100,11 @@
 				{$fldlabel}
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
-			   <select MULTIPLE name="{$fldname}[]" size="4" style="width:160px;" tabindex="{$vt_tab}" >
-				{foreach item=arr from=$fldvalue}
-					{foreach key=sel_value item=value from=$arr}
-						<option value="{$sel_value}" {$value}>{$sel_value}</option>
-					{/foreach}
-				{/foreach}
+			   <select MULTIPLE name="{$fldname}[]" size="4" style="width:160px;" tabindex="{$vt_tab}" class="small">
+				                    									{foreach key=sel_value item=value from=$arr}
+                    										<option value="{$sel_value}" {$value}>{if $APP.$sel_value}{$APP.$sel_value}{else}{$sel_value}{/if}</option>
+                    									
+                    									{/foreach}
 			   </select>
 			</td>
 
@@ -135,13 +134,13 @@
 					{assign var=style_group value='display:block'}
 				{/if}
 
-				<input type="radio" tabindex="{$vt_tab}" name="assigntype" {$select_user} value="U" onclick="toggleAssignType(this.value)">&nbsp;{$APP.LBL_USER}
+				<input type="radio" tabindex="{$vt_tab}" name="assigntype" {$select_user} value="U" onclick="toggleAssignType(this.value)" >&nbsp;{$APP.LBL_USER}
 
 				{if $secondvalue neq ''}
 					<input type="radio" name="assigntype" {$select_group} value="T" onclick="toggleAssignType(this.value)">&nbsp;{$APP.LBL_GROUP}
 				{/if}
 				<span id="assign_user" style="{$style_user}">
-					<select name="assigned_user_id">
+					<select name="assigned_user_id" class="small">
 						{foreach key=key_one item=arr from=$fldvalue}
 							{foreach key=sel_value item=value from=$arr}
 								<option value="{$key_one}" {$value}>{$sel_value}</option>
@@ -152,7 +151,7 @@
 
 				{if $secondvalue neq ''}
 					<span id="assign_team" style="{$style_group}">
-						<select name="assigned_group_name">';
+						<select name="assigned_group_name" class="small">';
 							{foreach key=key_one item=arr from=$secondvalue}
 								{foreach key=sel_value item=value from=$arr}
 									<option value="{$sel_value}" {$value}>{$sel_value}</option>
@@ -168,11 +167,11 @@
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
 				{if $uitype eq 52}
-					<select name="assigned_user_id">
+					<select name="assigned_user_id" class="small">
 				{elseif $uitype eq 77}
-					<select name="assigned_user_id1" tabindex="{$vt_tab}" >
-				{else}
-					<select name="{$fldname}" tabindex="{$vt_tab}" >
+					<select name="assigned_user_id1" tabindex="{$vt_tab}" class="small">
+				{else}
+					<select name="{$fldname}" tabindex="{$vt_tab}" class="small">
 				{/if}
 
 				{foreach key=key_one item=arr from=$fldvalue}
@@ -361,7 +360,7 @@
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
 				<input name="{$fldname}" type="text" size="2" value="{$fldvalue}" tabindex="{$vt_tab}" >&nbsp;
-				<select name="duration_minutes" tabindex="{$vt_tab}" >
+				<select name="duration_minutes" tabindex="{$vt_tab}" class="small">
 					{foreach key=labelval item=selectval from=$secondvalue}
 						<option value="{$labelval}" {$selectval}>{$labelval}</option>
 					{/foreach}
@@ -369,7 +368,7 @@
 
 		{elseif $uitype eq 68 || $uitype eq 66 || $uitype eq 62}
 			<td width="20%" class="dvtCellLabel" align=right>
-				<select name="parent_type" onChange='document.EditView.parent_name.value=""; document.EditView.parent_id.value=""'>
+				<select class="small" name="parent_type" onChange='document.EditView.parent_name.value=""; document.EditView.parent_id.value=""'>
 					{section name=combo loop=$fldlabel}
 						<option value="{$fldlabel_combo[combo]}" {$fldlabel_sel[combo]}>{$fldlabel[combo]}</option>
 					{/section}
@@ -386,7 +385,7 @@
 			<td width="90%" colspan="3">
 				<input name="{$fldname}" type="hidden" value="{$secondvalue}">
 				<textarea readonly name="parent_name" cols="70" rows="2">{$fldvalue}</textarea>&nbsp;
-				<select name="parent_type">
+				<select name="parent_type" class="small">
 					{foreach key=labelval item=selectval from=$fldlabel}
 						<option value="{$labelval}" {$selectval}>{$labelval}</option>
 					{/foreach}
@@ -416,7 +415,7 @@
 		{elseif $uitype eq 55} 
 			<td width="20%" class="dvtCellLabel" align=right>{$fldlabel}</td>
 			<td width="30%" align=left class="dvtCellInfo">
-				<select name="salutationtype">
+				<select name="salutationtype" class="small">
 					{foreach item=arr from=$fldvalue}
 						{foreach key=sel_value item=value from=$arr}
 							<option value="{$sel_value}" {$value}>{$sel_value}</option>
@@ -528,9 +527,9 @@
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
 			   {if $secondvalue eq 1}
-			   	<select name="{$fldname}" tabindex="{$vt_tab}" >
+			   	<select name="{$fldname}" tabindex="{$vt_tab}" class="small">
 			   {else}
-			   	<select disabled name="{$fldname}">
+			   	<select disabled name="{$fldname}" class="small">
 			   {/if} 
 				{foreach item=arr from=$fldvalue}
 					{foreach key=sel_value item=value from=$arr}
@@ -568,9 +567,9 @@
 			</td>
 			<td width="30%" align=left class="dvtCellInfo">
 			   {if $secondvalue eq 1}
-			   	<select name="{$fldname}" tabindex="{$vt_tab}" >
+			   	<select name="{$fldname}" tabindex="{$vt_tab}" class="small">
 			   {else}
-			   	<select disabled name="{$fldname}" tabindex="{$vt_tab}" >
+			   	<select disabled name="{$fldname}" tabindex="{$vt_tab}" class="small">
 			   {/if} 
 
 				{foreach item=arr key=uivalueid from=$fldvalue}
@@ -618,7 +617,7 @@
 					{assign var=sendname value="$val_arr[2]"}
 					{assign var=disp_text value="$val_arr[3]"}
 					{assign var=sel_val value="$val_arr[4]"}
-					<select name="{$sendname}">
+					<select name="{$sendname}" class="small">
 						{section name=reminder start=$start max=$end loop=$end step=1 }
 							{if $smarty.section.reminder.index eq $sel_val}
 								{assign var=sel_value value="SELECTED"}

Modified: vtigercrm/trunk/Smarty/templates/EmailDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EmailDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EmailDetailView.tpl Tue Oct 31 03:40:43 2006
@@ -61,7 +61,7 @@
    </tr>
    {elseif $elements.fldname eq 'description'}
    <tr>
-	<td style="padding: 5px;" colspan="3" valign="top"><div style="overflow:auto;height:415px;width:100%;">{$BLOCKS.4.Description.value}</div></td>
+	<td style="padding: 5px;" colspan="3" valign="top"><div style="overflow:auto;height:415px;width:100%;">{$elements.value}</div></td>
 
    </tr>
    {elseif $elements.fldname eq 'filename'}

Modified: vtigercrm/trunk/Smarty/templates/EmailDetails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EmailDetails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EmailDetails.tpl Tue Oct 31 03:40:43 2006
@@ -56,7 +56,7 @@
 		</table>
 		{elseif $elements.fldname eq 'description'}
 		<div>
-			{$BLOCKS.4.Description.value}
+			{$elements.value}
 		</div>
 		{/if}
 	{/foreach}

Modified: vtigercrm/trunk/Smarty/templates/HomePage.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/HomePage.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/HomePage.tpl Tue Oct 31 03:40:43 2006
@@ -18,7 +18,26 @@
 <script language="javascript" type="text/javascript" src="include/scriptaculous/slider.js"></script>
 <script language="javascript" type="text/javascript" src="include/scriptaculous/dom-drag.js"></script>
 <script type="text/javascript" language="JavaScript" src="include/js/general.js"></script>
-
+<script language="javascript">
+function getHomeActivities(mode,view)
+
+{ldelim}
+        new Ajax.Request(
+                'index.php',
+                {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+                        method: 'post',
+                        postBody: 'module=Calendar&action=ActivityAjax&file=OpenListView&activity_view='+view+'&mode='+mode+'&parenttab=My Home Page&ajax=true',
+                        onComplete: function(response) {ldelim}
+                                if(mode == 0)
+                                        $("upcomingActivities").innerHTML=response.responseText;
+                                else
+                                        $("pendingActivities").innerHTML=response.responseText;
+                        {rdelim}
+                {rdelim}
+        );
+{rdelim}
+
+</script>
 
 {*<!--Home Page Entries  -->*}
 
@@ -141,7 +160,7 @@
 							{/if}	
 							{else}
 								<div class="MatrixLayer" style="float:left;width:61%;" id="homepagedb">
-									<table width="100%" border="0" cellpadding="5" cellspacing="0" class="small">
+									<table width="100%" border="0" cellpadding="8" cellspacing="0" class="small">
 										<tr style="cursor:move;">
 											<td align="left" class="homePageMatrixHdr"><b>{$APP.LBL_HOMEPAGE_DASHBOARD}</b></td>
 											<td align="right" class="homePageMatrixHdr"><img src="{$IMAGE_PATH}uparrow.gif" align="absmiddle" /></td>
@@ -169,75 +188,12 @@
 			</div>
 		</td>
 		<td width="25%" valign="top" style="padding:5px;">
-			{if $ACTIVITIES.0.Entries.noofactivities > 0}	
-				<table width="100%" border="0" cellpadding="0" cellspacing="0">
-					<tr>
-						<td><img src="{$IMAGE_PATH}upcoming_left.gif" align="top"  /></td>
-						<td width="100%" background="{$IMAGE_PATH}upcomingEvents.gif" style="background-repeat:repeat-x; "></td>
-						<td><img src="{$IMAGE_PATH}upcoming_right.gif" align="top"  /></td>
-					</tr>		
-					<tr>
-						<td colspan="3" bgcolor="#FFFFCF" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;padding-left:10px;"><b class="fontBold">{$MOD.LBL_UPCOMING_EVENTS}</b><br />
-						<!-- Check for Single/Multiple Event(s) -->
-						{if $ACTIVITIES.0.Entries.noofactivities eq 1}
-						{$ACTIVITIES.0.Entries.noofactivities} {$APP.Event} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]}
-						{else}	
-							{$ACTIVITIES.0.Entries.noofactivities} {$APP.Events} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]}
-						{/if}
-						</td>
-					</tr>
-					<tr>
-						<td colspan="3" bgcolor="#FFFFCF" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;border-bottom:2px solid #A6A4A5;">
-							<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-bottom:1px dashed #aaaaaa;">
-								
-						
-						{foreach item=entries from=$ACTIVITIES.0.Entries}
-						<tr bgcolor="#FFFFCF">
-						<td style="border-bottom:1px dotted #dddddd;" align="right" width="20" valign=top>{$entries.IMAGE}</td>
-						<td style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b>{$entries.0}</b><br />{$entries.ACCOUNT_NAME}</td>
-					</tr>
-						{/foreach}
-						</table>
-						</td>
-					</tr>
-				</table>
-				<br>
-			{/if}
-		
-
-{if $ACTIVITIES.1.Entries.noofactivities > 0}	
-<table width="100%" border="0" cellpadding="0" cellspacing="0" class="small">
-	<tr>
-		<td><img src="{$IMAGE_PATH}pending_left.gif"></td>
-		<td width="100%" background="{$IMAGE_PATH}pendingEvents.gif" valign="bottom" style="background-repeat:repeat-x;">
-			<b class="fontBold">{$MOD.LBL_PENDING_EVENTS}</b><br />
-				<!-- Check for Single/Multiple Event(s) --> 
-	 	                {if $ACTIVITIES.1.Entries.noofactivities eq 1}   
-	 	                        {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_SINGLE_PENDING_EVENT} 
-	 	                {else} 
-	 	                        {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_MULTIPLE_PENDING_EVENTS} 
-	 	                {/if}    
-	 	        </td> 
-		
-		<td><img src="{$IMAGE_PATH}pending_right.gif"></td>
-	</tr>		
-	<tr>
-		<td colspan="3" bgcolor="#FEF7C1" style="border-left:2px solid #A6A4A5;border-right:2px solid #A6A4A5;border-bottom:2px solid #A6A4A5;">
-			<table width="100%" border="0" cellpadding="5" cellspacing="0">
-				{foreach item=entries from=$ACTIVITIES.1.Entries}
-				<tr>	
-					<td  style="border-bottom:1px dotted #dddddd;"  align="right" width="20">{$entries.IMAGE}</td>
-					<td  style="border-bottom:1px dotted #dddddd;" align="left" valign="middle" colspan="2" width="85%"><b class="style_Gray">{$entries.0}</b><br />{$entries.ACCOUNT_NAME}</td>
-				</tr>
-				{/foreach}
-			</table>
-		</td>
-</tr>
-</table>
-
-<br>
-{/if}
-
+			<div id="upcomingActivities">
+                                {include file="upcomingActivities.tpl"}
+                        </div><br>
+                        <div id="pendingActivities">
+                                {include file="pendingActivities.tpl"}
+                        </div><br>
 <table border=0 cellspacing=0 cellpadding=0 width=100% class="tagCloud">
 <tr>
 <td class="tagCloudTopBg"><img src="{$IMAGE_PATH}tagCloudName.gif" border=0></td>

Modified: vtigercrm/trunk/Smarty/templates/ImportStep2.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ImportStep2.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ImportStep2.tpl Tue Oct 31 03:40:43 2006
@@ -18,6 +18,13 @@
 function getImportSavedMap(impoptions)
 {ldelim}
 	var mapping = impoptions.options[impoptions.options.selectedIndex].value;
+
+	//added to show the delete link
+	if(mapping != -1)
+		document.getElementById("delete_mapping").style.visibility = "visible";
+	else
+		document.getElementById("delete_mapping").style.visibility = "hidden";
+
 	new Ajax.Request(
 		'index.php',
 		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
@@ -28,6 +35,27 @@
 				{rdelim}
 			{rdelim}
 		);
+{rdelim}
+function deleteMapping()
+{ldelim}
+	var options_collection = document.getElementById("saved_source").options;
+	var mapid = options_collection[options_collection.selectedIndex].value;
+
+	new Ajax.Request(
+		'index.php',
+		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+			method: 'post',
+			postBody: 'module=Import&mapping='+mapid+'&action=ImportAjax&delete_map='+mapid,
+			onComplete: function(response) {ldelim}
+					$("importmapform").innerHTML = response.responseText;
+				{rdelim}
+			{rdelim}
+		);
+
+	//we have emptied the map name from the select list
+	document.getElementById("saved_source").options[options_collection.selectedIndex] = null;
+	document.getElementById("delete_mapping").style.visibility = "hidden";
+	alert("This map has been deleted. You cannot use this map again");
 {rdelim}
 
 </script>

Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryCreateView.tpl Tue Oct 31 03:40:43 2006
@@ -125,7 +125,7 @@
 
 								   {foreach key=header item=data from=$blockInfo}
 								   <tr>
-									{if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
+									{if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
                                                                         <td colspan=2 class="detailedViewHeader">
                                                                         <b>{$header}</b></td>
                                                                         <td class="detailedViewHeader">

Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryDetailView.tpl Tue Oct 31 03:40:43 2006
@@ -287,14 +287,6 @@
 										{include file="Inventory/InventoryActions.tpl"}
 
 										<br>
-										<!-- Add Tag link added just above the tag cloud image -->
-										<table border=0 cellspacing=0 cellpadding=5 width=100% >
-										<tr>
-											<td align="left" class="genHeaderSmall" nowrap><div id="addtagdiv"><a href="javascript:;" onClick="show('tagdiv'),fnhide('addtagdiv'),document.getElementById('txtbox_tagfields').focus()"><b>{$APP.LBL_ADD_TAG}</b></a></div><div id="tagdiv" style="display:none;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value=""></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/><input name="close" type="button" class="crmbutton small cancel" value="{$APP.LBL_CLOSE}" onClick="fnhide('tagdiv'),show('addtagdiv')"></div></td>
-										</tr>
-										</table>
-										<!-- Eng Add Tag Link -->
-										<br>
 										<!-- To display the Tag Clouds -->
 										<div>
 										      {include file="TagCloudDisplay.tpl"}

Modified: vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Inventory/InventoryEditView.tpl Tue Oct 31 03:40:43 2006
@@ -111,7 +111,7 @@
 									   <!-- included to handle the edit fields based on ui types -->
 									   {foreach key=header item=data from=$BLOCKS}
 									      <tr>
-										{if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
+										{if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
                                                                         	<td colspan=2 class="detailedViewHeader">
 	                                                                        <b>{$header}</b></td>
         	                                                                <td class="detailedViewHeader">

Modified: vtigercrm/trunk/Smarty/templates/ListRoles.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListRoles.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListRoles.tpl Tue Oct 31 03:40:43 2006
@@ -247,21 +247,21 @@
 function showhide(argg,imgId)
 {ldelim}
 	var harray=argg.split(",");
-	var harrlen = harray.length;
+	var harrlen = harray.length;	
 	var i;
 	for(i=0; i<harrlen; i++)
 	{ldelim}
-			var x=document.getElementById(harray[i]).style;
+		var x=document.getElementById(harray[i]).style;
         	if (x.display=="none")
         	{ldelim}
-            		x.display="block";
-					//document.all[imgId].src = "{$IMAGE_PATH}minus.gif";   By Ela	
-        	{rdelim}
+           		x.display="block";
+			document.getElementById(imgId).src="{$IMAGE_PATH}minus.gif";
+         	{rdelim}
         	else
-			{ldelim}
-            			x.display="none";
-						//document.all[imgId].src = "{$IMAGE_PATH}plus.gif"; By Ela
-            {rdelim}
+		{ldelim}
+			x.display="none";
+			document.getElementById(imgId).src="{$IMAGE_PATH}plus.gif";
+		{rdelim}
 	{rdelim}
 {rdelim}
 

Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Tue Oct 31 03:40:43 2006
@@ -21,7 +21,20 @@
 {/if}
 <script language="JavaScript" type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
 <script language="javascript">
-
+function checkgroup()
+{ldelim}
+  if(document.change_ownerform_name.user_lead_owner[1].checked)
+  {ldelim}
+  document.change_ownerform_name.lead_group_owner.style.display = "block";
+  document.change_ownerform_name.lead_owner.style.display = "none";
+  {rdelim}
+  else
+  {ldelim}
+  document.change_ownerform_name.lead_owner.style.display = "block";
+  document.change_ownerform_name.lead_group_owner.style.display = "none";
+  {rdelim}    
+  
+{rdelim}
 function callSearch(searchtype)
 {ldelim}
 	for(i=1;i<=26;i++)
@@ -258,18 +271,24 @@
 		<td class=small >
 		
 			<!-- popup specific content fill in starts -->
-
+      <form name="change_ownerform_name">
 			<table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
 				<tr>
 					<td width="50%"><b>{$APP.LBL_TRANSFER_OWNERSHIP}</b></td>
 					<td width="2%"><b>:</b></td>
 					<td width="48%">
+					<input type = "radio" name = "user_lead_owner"  onclick=checkgroup(); checked>{$APP.LBL_USER}&nbsp;
+					<input type = "radio" name = "user_lead_owner" onclick=checkgroup(); >{$APP.LBL_GROUP}<br>
 					<select name="lead_owner" id="lead_owner" class="detailedViewTextBox">
 					{$CHANGE_OWNER}
+					</select>
+					<select name="lead_group_owner" id="lead_group_owner" class="detailedViewTextBox" style="display:none;">
+					{$CHANGE_GROUP_OWNER}
 					</select>
 					</td>
 				</tr>
 			</table>
+			</form>
 		</td>
 	</tr>
 </table>
@@ -342,13 +361,22 @@
 	}
 	else if(statusname == 'owner')
 	{
-		fninvsh('changeowner');
-		var url='&user_id='+document.getElementById('lead_owner').options[document.getElementById('lead_owner').options.selectedIndex].value;
-		
-{/literal}
-		var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
-{literal}
-
+	   if(document.change_ownerform_name.user_lead_owner[0].checked)
+	   {
+		    fninvsh('changeowner');
+		    var url='&user_id='+document.getElementById('lead_owner').options[document.getElementById('lead_owner').options.selectedIndex].value;
+		    {/literal}
+		        var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
+		    {literal}
+     }
+    else
+    {
+        fninvsh('changeowner');
+		    var url='&group_id='+document.getElementById('lead_group_owner').options[document.getElementById('lead_group_owner').options.selectedIndex].value;
+	       {/literal}
+		        var urlstring ="module=Users&action=updateLeadDBStatus&return_module={$MODULE}"+url+"&viewname="+viewid+"&idlist="+idstring;
+        {literal}
+    }
 	}
 	new Ajax.Request(
                 'index.php',

Modified: vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/MigrationStep1.tpl Tue Oct 31 03:40:43 2006
@@ -25,6 +25,12 @@
    <tr>
 	<td class="showPanelBg" valign="top" width="95%"  style="padding-left:20px; "><br />
 		<span class="lvtHeaderText"> {$MOD.LBL_SETTINGS} &gt; {$MOD.LBL_UPGRADE_VTIGER}</span>
+		<span class="lvtHeaderText" align="right">
+			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+			{if $502_PATCH eq 'apply'}
+				<a style="color:red;" href="index.php?module=Migration&action=502DBChanges&parenttab=Settings">Click here to apply the 5.0.2 Database changes from 5.0.0/5.0.1</a>
+			{/if}
+		</span>
 		<hr noshade="noshade" size="1" />
 	</td>
 	<td width="5%" class="showPanelBg">&nbsp;</td>

Modified: vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Tue Oct 31 03:40:43 2006
@@ -20,6 +20,45 @@
 </style>
 {/literal}
 <script language="JAVASCRIPT" type="text/javascript" src="include/js/smoothscroll.js"></script>
+<script language="JAVASCRIPT" type="text/javascript" src="include/js/general.js"></script>
+<script language="JAVASCRIPT" type="text/javascript">
+{literal}
+function UpdateProfile()
+{
+	var prof_name = $('profile_name').value;
+	var prof_desc = $('description').value;
+	if(prof_name == '')
+	{
+		
+		$('profile_name').focus();
+		alert("Profile Name Cannot be empty");
+	}
+	else
+	{
+		
+{/literal}
+		
+		var urlstring ="module=Users&action=UsersAjax&file=RenameProfile&profileid="+{$PROFILEID}+"&profilename="+prof_name+"&description="+prof_desc;
+{literal}
+	new Ajax.Request(
+                'index.php',
+                {queue: {position: 'end', scope: 'command'},
+                        method: 'post',
+                        postBody:urlstring,
+			onComplete: function(response)
+			{
+				$('renameProfile').style.display="none";
+				window.location.reload();
+				alert("Profile Details are updated");
+			}
+                }
+		);
+	}
+		
+	
+}
+</script>
+{/literal}
 
 <br>
 <table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
@@ -29,13 +68,15 @@
         <br>
 	<div align=center>
 			{include file='SetMenu.tpl'}
-				<form action="index.php" method="post" name="new" id="form">
+			
+				<form  method="post" name="new" id="form">
 			        <input type="hidden" name="module" value="Users">
 			        <input type="hidden" name="action" value="profilePrivileges">
 			        <input type="hidden" name="parenttab" value="Settings">
 			        <input type="hidden" name="return_action" value="profilePrivileges">
 			        <input type="hidden" name="mode" value="edit">
 			        <input type="hidden" name="profileid" value="{$PROFILEID}">
+				
 				<!-- DISPLAY -->
 				<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
 				<tbody><tr>
@@ -79,9 +120,47 @@
 
                                                     </tr>
                                                 </tbody></table></td>
-                                              <td align="right" valign="bottom">&nbsp;<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit">											  </td>
-                                            </tr>
-                                          </tbody></table>
+                                              <td align="right" valign="bottom">&nbsp;<input type="button" value="{$APP.LBL_RENAMEPROFILE_BUTTON_LABEL}" class="crmButton small edit" name="rename_profile"  onClick = "fnvshobj(this,'renameProfile');">&nbsp;<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit" >
+                              		     </td>
+					    	
+                                            </tr></tbody></table>
+					    <!-- RenameProfile Div start -->	 
+					    <div id="renameProfile" style="left: 49px; top: 152px; display: none; visibility: visible;position:absolute;" class="layerPopup">
+						<table class="layerHeadingULine" border="0" cellpadding="3" cellspacing="0" width="100%">
+						<tr style="cursor:move;">
+						<td class="layerPopupHeading" id = "renameUI" align="left" width="60%">{$APP.LBL_RENAME_PROFILE}</td>
+						<td align="right" width="40%"><a href="javascript:fninvsh('renameProfile');"><img src="themes/bluelagoon/images/close.gif" align="middle" border="0"></a></td>
+						</tr>
+						</table>
+					    <table align="center" border="0" cellpadding="5" cellspacing="0" width="95%">
+
+						<tr>
+						<td class="small">
+							<table celspacing="0" align="center" bgcolor="white" border="0" cellpadding="5" width="100%">
+								<tr>
+								<td align="right" width="25%" style="padding-right:10px;" nowrap><b>{$APP.LBL_PROFILE_NAME} :</b></td>
+								<td align="left" width="75%" style="padding-right:10px;"><input id = "profile_name" name="profile_name" class="txtBox" value="{$Profile_Name}" type="text"></td>
+								</tr>
+								<tr>
+                                                                <td align="right" width="25%" style="padding-right:10px;" nowrap><b>{$APP.LBL_DESCRIPTION} :</b></td>
+                                                                <td align="left" width="75%" style="padding-right:10px;"><textarea name="description" id = "description" class="txtBox">{$Profile_Description} </textarea></td>
+                                                                </tr>
+							</table>
+						</td>
+						</tr>
+					    </table>
+					    <table class="layerPopupTransport" border="0" cellpadding="5" cellspacing="0" width="100%">
+					    <tr>
+						<td align = "center">
+							<input name="save" value="Update" class="crmbutton small save" onclick="UpdateProfile();" type="button">&nbsp;&nbsp;
+							<input name="cancel" value="Cancel" class="crmbutton small save" onclick="fninvsh('renameProfile');" type="button">&nbsp;&nbsp;
+						</td>
+					    </tr>		
+					    </table>		
+					    </div>		
+				             <!- RenameProfile Div end -->		
+
+                                         
                                             <!-- privilege lists -->
                                             <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                               <tbody><tr>
@@ -309,4 +388,11 @@
 		document.getElementById(obj).className = 'hideTable';
 }
 {/literal}
+{literal}
+        //for move RenameProfile
+        var theEventHandle = document.getElementById("renameUI");
+        var theEventRoot   = document.getElementById("renameProfile");
+        Drag.init(theEventHandle, theEventRoot);
+{/literal}
 </script>
+

Modified: vtigercrm/trunk/Smarty/templates/QuickCreate.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/QuickCreate.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/QuickCreate.tpl Tue Oct 31 03:40:43 2006
@@ -68,10 +68,9 @@
 				<td width="30%" align=left class="cellText">
 					<select name="{$fldname}">
 					{foreach item=arr from=$fldvalue}
-					{foreach key=sel_value item=value from=$arr}
-					<option value="{$sel_value}" {$value}>{$sel_value}</option>
-					{/foreach}
-					
+						{foreach key=sel_value item=value from=$arr}
+							<option value="{$sel_value}" {$value}>{$MOD.$sel_value}</option>
+						{/foreach}
 					{/foreach}
 					</select>
 				</td>

Modified: vtigercrm/trunk/Smarty/templates/Settings.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Settings.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Settings.tpl Tue Oct 31 03:40:43 2006
@@ -11,20 +11,14 @@
 -->*}
 
 	{include file="Buttons_List1.tpl"}
+
 <table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
 <tbody><tr>
         <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
 	<td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
 	<br>
 	<div align=center>
-	<table border=0 cellspacing=0 cellpadding=10 width=90% class="settingsUI">
-	<tr>
-		<td>
-		<!-- heading -->
-
-		<span class="heading2">{$MOD.LBL_SETTINGS}</span>
-		</td>
-	</tr>
+	<table border=0 cellspacing=0 cellpadding=20 width=90% class="settingsUI">
 	<tr>
 		<td>
 			<!--All Icons table -->

Modified: vtigercrm/trunk/Smarty/templates/Settings/TaxConfig.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Settings/TaxConfig.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Settings/TaxConfig.tpl Tue Oct 31 03:40:43 2006
@@ -13,6 +13,7 @@
 <script language="JavaScript" type="text/javascript" src="include/js/menu.js"></script>
 <script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
 <script language="JavaScript" type="text/javascript" src="include/js/Inventory.js"></script>
+
 {literal}
 <style>
 	
@@ -91,7 +92,7 @@
 			</td>
 			<td class="small" align=right nowrap>
 			{if $EDIT_MODE eq 'true'}	
-				<input class="crmButton small save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"  onclick="this.form.action.value='TaxConfig'; this.form.save_tax.value='true'; this.form.parenttab.value='Settings'; return validateTaxes('tax_count')" type="submit" name="button2" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  ">&nbsp;
+				<input class="crmButton small save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"  onclick="this.form.action.value='TaxConfig'; this.form.save_tax.value='true'; this.form.parenttab.value='Settings'; return validateTaxes('tax_count');" type="submit" name="button2" value=" {$APP.LBL_SAVE_BUTTON_LABEL}  ">&nbsp;
 				<input class="crmButton small cancel" title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" onclick="this.form.action.value='TaxConfig'; this.form.module.value='Settings'; this.form.save_tax.value='false'; this.form.parenttab.value='Settings';" type="submit" name="button22" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  ">
 			{elseif $TAX_COUNT > 0}
 				<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" onclick="this.form.action.value='TaxConfig'; this.form.edit_tax.value='true'; this.form.parenttab.value='Settings';" type="submit" name="button" value="  {$APP.LBL_EDIT_BUTTON_LABEL}  " class="crmButton small edit">
@@ -114,8 +115,17 @@
 				{else}
 				   <tr><!-- set color to taxes which are disabled now-->
 				{/if}
-
-				<td width=35% class="cellLabel small">{$tax.taxlabel} </td>
+				
+				<!--assinging tax label name for javascript validation-->
+				{assign var=tax_label value="taxlabel_"|cat:$tax.taxname} 
+        
+				<td width=35% class="cellLabel small" >
+					{if $EDIT_MODE eq 'true'}
+						<input name="{$tax.taxlabel}" id={$tax_label} type="text" value="{$tax.taxlabel}" class="detailedViewTextBox small">
+					{else}
+						{$tax.taxlabel}
+					{/if}
+				</td>
 				<td width=55% class="cellText small">
 					{if $EDIT_MODE eq 'true'}
 						<input name="{$tax.taxname}" id="{$tax.taxname}" type="text" value="{$tax.percentage}" class="detailedViewTextBox small">&nbsp;%
@@ -165,7 +175,7 @@
 			</td>
 			<td class="small" align=right nowrap>
 				{if $SH_EDIT_MODE eq 'true'}
-					<input class="crmButton small save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"  onclick="this.form.action.value='TaxConfig'; this.form.sh_save_tax.value='true'; this.form.parenttab.value='Settings'; return validateTaxes('sh_tax_count')" type="submit" name="button2" value="  {$APP.LBL_SAVE_BUTTON_LABEL}  ">
+					<input class="crmButton small save" title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}"  onclick="this.form.action.value='TaxConfig'; this.form.sh_save_tax.value='true'; this.form.parenttab.value='Settings'; return validateTaxes('sh_tax_count');" type="submit" name="button2" value=" {$APP.LBL_SAVE_BUTTON_LABEL}  ">
 					&nbsp;
 					<input class="crmButton small cancel" title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" onclick="this.form.action.value='TaxConfig'; this.form.module.value='Settings'; this.form.sh_save_tax.value='false'; this.form.parenttab.value='Settings';" type="submit" name="button22" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  ">
 				{elseif $SH_TAX_COUNT > 0}
@@ -190,7 +200,15 @@
 			   <tr><!-- set color to taxes which are disabled now-->
 			{/if}
 
-			<td width=35% class="cellLabel small">{$tax.taxlabel} </td>
+			{assign var=tax_label value="taxlabel_"|cat:$tax.taxname} 
+			<td width=35% class="cellLabel small">
+			 	{if $SH_EDIT_MODE eq 'true'}
+			 	
+					<input name="{$tax.taxlabel}" id="{$tax_label}" type="text" value="{$tax.taxlabel}" class="detailedViewTextBox small">
+			 	{else} 
+					{$tax.taxlabel}
+				{/if}
+			</td>
 			<td width=55% class="cellText small">
 				{if $SH_EDIT_MODE eq 'true'}
 					<input name="{$tax.taxname}" id="{$tax.taxname}" type="text" value="{$tax.percentage}" class="detailedViewTextBox small">

Modified: vtigercrm/trunk/Smarty/templates/TagCloudDisplay.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/TagCloudDisplay.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/TagCloudDisplay.tpl Tue Oct 31 03:40:43 2006
@@ -19,6 +19,9 @@
 		<td class="tagCloudTopBg"><img src="{$IMAGE_PATH}tagCloudName.gif" border=0></td>
 	</tr>
 	<tr>
+                      	<td><div id="tagdiv" style="display:visible;"><input class="textbox"  type="text" id="txtbox_tagfields" name="textbox_First Name" value="" style="width:100px;margin-left:5px;"></input>&nbsp;&nbsp;<input name="button_tagfileds" type="button" class="crmbutton small save" value="{$APP.LBL_TAG_IT}" onclick="return tagvalidate()"/></div></td>
+        </tr>
+	<tr>
 		<td class="tagCloudDisplay" valign=top> <span id="tagfields">{$ALL_TAG}</span></td>
 	</tr>
 	</table>

Modified: vtigercrm/trunk/Smarty/templates/salesEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/salesEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/salesEditView.tpl Tue Oct 31 03:40:43 2006
@@ -131,14 +131,14 @@
 
 
 									      <tr>
-										{if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
+										{if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')}
                                                                                 <td colspan=2 class="detailedViewHeader">
                                                                                 <b>{$header}</b></td>
                                                                                 <td class="detailedViewHeader">
                                                                                 <input name="cpy" onclick="return copyAddressLeft(EditView)" type="radio"><b>{$APP.LBL_RCPY_ADDRESS}</b></td>
                                                                                 <td class="detailedViewHeader">
                                                                                 <input name="cpy" onclick="return copyAddressRight(EditView)" type="radio"><b>{$APP.LBL_LCPY_ADDRESS}</b></td>
-										{elseif $header== 'Address Information' && $MODULE == 'Contacts'}
+										{elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'}
 										<td colspan=2 class="detailedViewHeader">
                                                                                 <b>{$header}</b></td>
                                                                                 <td class="detailedViewHeader">

Modified: vtigercrm/trunk/data/CRMEntity.php
==============================================================================
--- vtigercrm/trunk/data/CRMEntity.php (original)
+++ vtigercrm/trunk/data/CRMEntity.php Tue Oct 31 03:40:43 2006
@@ -48,164 +48,29 @@
 	$this->db->println("TRANS saveentity starts $module");
 	$this->db->startTransaction();
 	
-	// Code included by Jaguar - starts    
-	if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='')
-		$recur_type = trim($this->column_fields['recurringtype']);
-	else
-    		$recur_type='';	
-	// Code included by Jaguar - Ends
-
-	//Code included by Minnie - Starts
-	if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='')
-	{
-		$selected_users_string =  $_REQUEST['inviteesid'];
-		$invitees_array = explode(';',$selected_users_string);
-
-	}
-	else
-		$invitees_array='';
-	//Code included by Minnie - Ends	
 
 	foreach($this->tab_name as $table_name)
 	{
+			
 		if($table_name == "vtiger_crmentity")
 		{
 			$this->insertIntoCrmEntity($module);
 		}
-		elseif($table_name == "vtiger_salesmanactivityrel")
-		{
-			$this->insertIntoSmActivityRel($module);
-		}
-		//added by raju
-		elseif($table_name=="vtiger_seactivityrel" )
-		{
-		  //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code
-			if($module=="Emails" && $_REQUEST['smodule']!='webmails' && (!$this->plugin_save))
-		  {
-				if($_REQUEST['currentid']!='')
-				{
-					$actid=$_REQUEST['currentid'];
-				}
-				else 
-				{
-					$actid=$_REQUEST['record'];
-				}
-				$parentid=$_REQUEST['parent_id'];
-				if($_REQUEST['module'] != 'Emails' && $_REQUEST['module'] != 'Webmails')
-				{
-					if(!$parentid) {
-						$parentid = $adb->getUniqueID('vtiger_seactivityrel');
-					}
-					$mysql='insert into vtiger_seactivityrel values('.$parentid.','.$actid.')';
-					$adb->query($mysql);
-				}
-				else
-				{	  
-					$myids=explode("|",$parentid);  //2 at 71|
-					for ($i=0;$i<(count($myids)-1);$i++)
-					{
-						$realid=explode("@",$myids[$i]);
-						$mycrmid=$realid[0];
-						//added to handle the relationship of emails with vtiger_users
-						if($realid[1] == -1)
-							$mysql='insert into vtiger_salesmanactivityrel values('.$mycrmid.','.$actid.')';
-						else	
-							$mysql='insert into vtiger_seactivityrel values('.$mycrmid.','.$actid.')';
-						$adb->query($mysql);
-					}
-				}
-			}
-			else
-			{
-				if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')
-				{
-					$this->insertIntoEntityTable($table_name, $module);
-				}
-				elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit")
-				{
-					$this->deleteRelation($table_name);
-				}
-			}			
-		}
-		elseif($table_name == "vtiger_seticketsrel" || $table_name ==  "vtiger_seproductsrel" || $table_name ==  "vtiger_senotesrel")
-		{
-			if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')//raju - mass mailing ends
-			{
-				$this->insertIntoEntityTable($table_name, $module);
-			}
-			elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit")
-			{
-				$this->deleteRelation($table_name);
-			}
-		}
-		elseif($table_name ==  "vtiger_cntactivityrel")
-		{
-			if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '')
-			{
-				$this->insertIntoEntityTable($table_name, $module);
-			}
-			elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit")
-			{
-				$this->deleteRelation($table_name);
-			}
-
-		}
-		elseif($table_name ==  "vtiger_ticketcomments")
-		{
-                	$this->insertIntoTicketCommentTable($table_name, $module);
-		}
-		elseif($table_name ==  "vtiger_faqcomments")
-		{
-                	$this->insertIntoFAQCommentTable($table_name, $module);
-		}
-		elseif($table_name == "vtiger_activity_reminder")
-		{
-			if($recur_type == "--None--")
-			{
-				$this->insertIntoReminderTable($table_name,$module,"");
-			}
-		}
-		elseif($table_name == "vtiger_recurringevents") // Code included by Jaguar -  starts
-		{
-			$recur_type = trim($this->column_fields['recurringtype']);
-			if($recur_type != "--None--"  && $recur_type != '')
-		      	{		   
-				//Modified by Minnie
-				$recur_data = getrecurringObjValue();
-				if(is_object($recur_data))
-	      				$this->insertIntoRecurringTable($recur_data);
-			}		
-		}// Code included by Jaguar - Ends
-		// Code included by Minnie  -  starts	
-		elseif($table_name == "vtiger_invitees") 
-		{
-			if($invitees_array != '')
-			{
-				$this->insertIntoInviteeTable($table_name,$module,$invitees_array);
-			}
-		}
-		// Code included by Minnie  -  Ends
-		elseif($table_name == 'vtiger_producttaxrel')
-		{
-			//avoid call this function when we use ajax edit -> save
-			if($_REQUEST['ajxaction'] != 'DETAILVIEW')
-				$this->insertTaxInformation($table_name, $module);
-		}
-		elseif($table_name == 'vtiger_attachments')
-		{
-			$this->insertIntoAttachment($this->id,$module);
-		}
 		else
 		{
 			$this->insertIntoEntityTable($table_name, $module);			
 		}
 	}
 
+	//Calling the Module specific save code
+	$this->save_module($module);
+	
 	$this->db->completeTransaction();
         $this->db->println("TRANS saveentity ends");
   }
 
 
+	
 	function insertIntoAttachment1($id,$module,$filedata,$filename,$filesize,$filetype,$user_id)
 	{
 		$date_var = date('YmdHis');
@@ -247,60 +112,8 @@
 		$sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')';
 		$adb->query($sql3);
 	}
-
-
-	/**
-	 *      This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database.
-	 *      @param int $id  - entity id to which the vtiger_files to be uploaded
-	 *      @param string $module  - the current module name
-	*/
-	function insertIntoAttachment($id,$module)
-	{
-		global $log, $adb;
-		$log->debug("Entering into insertIntoAttachment($id,$module) method.");
-		
-		$file_saved = false;
-
-		//This is to added to store the existing attachment id of the contact where we should delete this when we give new image
-		if($module == 'Contacts')
-		{
-			//if a image attached already then remove that otherwise do not delete the attachment
-			$query = "select vtiger_attachments.attachmentsid from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid inner join vtiger_contactdetails on vtiger_contactdetails.imagename=vtiger_attachments.name where vtiger_seattachmentsrel.crmid=$id";
-			$old_attachmentid = $adb->query_result($adb->query($query),0,'attachmentsid');
-		}
-
-		foreach($_FILES as $fileindex => $files)
-		{
-			if($files['name'] != '' && $files['size'] > 0)
-			{
-				$file_saved = $this->uploadAndSaveFile($id,$module,$files);
-			}
-		}
-
-		//This is to handle the delete image for contacts
-		if($module == 'Contacts' && $file_saved && $old_attachmentid != '')
-		{
-			$del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid");
-			$del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid");
-		}
-
-
-		//Remove the deleted vtiger_attachments from db - Products
-		if($module == 'Products' && $_REQUEST['del_file_list'] != '')
-		{
-			$del_file_list = explode("###",trim($_REQUEST['del_file_list'],"###"));
-			foreach($del_file_list as $del_file_name)
-			{
-				$attach_res = $adb->query("select vtiger_attachments.attachmentsid from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where crmid=$id and name=\"$del_file_name\"");
-				$attachments_id = $adb->query_result($attach_res,0,'attachmentsid');
-				
-				$del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$attachments_id");
-				$del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$attachments_id");
-			}
-		}
-
-		$log->debug("Exiting from insertIntoAttachment($id,$module) method.");
-	}
+	
+
 
 	/**
 	 *      This function is used to upload the attachment in the server and save that attachment information in db.
@@ -388,13 +201,11 @@
 			$sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')';
 			$adb->query($sql3);
 
-			$log->debug("Exiting from uploadAndSaveFile($id,$module,$file_details) method. return true");
 			return true;
 		}
 		else
 		{
 			$log->debug("Skip the save attachment process.");
-			$log->debug("Exiting from uploadAndSaveFile($id,$module,$file_details) method. return false");
 			return false;
 		}
 	}
@@ -481,26 +292,6 @@
     }
 
 
-	/** Function to insert values in vtiger_salesmanactivityrel table for the specified module
-  	  * @param $module -- module:: Type varchar
- 	 */
-
-  function insertIntoSmActivityRel($module)
-  {
-    global $adb;
-    global $current_user;
-    if($this->mode == 'edit')
-    {
-
-      $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id']."";
-      $adb->query($sql);
-
-    }
-	$sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")";
-    $adb->query($sql_qry);
-
-  }
-
 	/** Function to insert values in the specifed table for the specified module
   	  * @param $table_name -- table name:: Type varchar
   	  * @param $module -- module:: Type varchar
@@ -635,11 +426,6 @@
 			  if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '')
 			  {
 				  $fldvalue = $this->getOldFileName($this->id);
-			  }
-			  if($table_name == 'vtiger_products' && $columname == 'imagename')
-			  {
-					  
-
 			  }
 			  if($table_name != 'vtiger_ticketcomments')
 			  {
@@ -930,230 +716,13 @@
 	}
 	return "'".$filename."'";
 }
-	/** Function to insert values in vtiger_ticketcomments  for the specified tablename and  module
-  	  * @param $table_name -- table name:: Type varchar
-  	  * @param $module -- module:: Type varchar
- 	 */	
-function insertIntoTicketCommentTable($table_name, $module)
-{
-	global $log;
-	$log->info("in insertIntoTicketCommentTable  ".$table_name."    module is  ".$module);
-        global $adb;
-	global $current_user;
-
-        $current_time = $adb->formatDate(date('YmdHis'));
-	if($this->column_fields['assigned_user_id'] != '')
-		$ownertype = 'user';
-	else
-		$ownertype = 'customer';
-
-	if($this->column_fields['comments'] != '')
-		$comment = $this->column_fields['comments'];
-	else
-		$comment = $_REQUEST['comments'];
-
-	if($comment != '')
-	{
-		$comment = addslashes($comment);
-		$sql = "insert into vtiger_ticketcomments values('',".$this->id.",'".$comment."','".$current_user->id."','".$ownertype."',".$current_time.")";	
-	        $adb->query($sql);
-	}
-}
-	/** Function to insert values in vtiger_faqcomments table for the specified module,
-  	  * @param $table_name -- table name:: Type varchar
-  	  * @param $module -- module:: Type varchar
- 	 */	
-function insertIntoFAQCommentTable($table_name, $module)
-{
-	global $log;
-	$log->info("in insertIntoFAQCommentTable  ".$table_name."    module is  ".$module);
-        global $adb;
-
-        $current_time = $adb->formatDate(date('YmdHis'));
-
-	if($this->column_fields['comments'] != '')
-		$comment = $this->column_fields['comments'];
-	else
-		$comment = $_REQUEST['comments'];
-
-	if($comment != '')
-	{
-		$comment = addslashes($comment);
-		$sql = "insert into vtiger_faqcomments values('',".$this->id.",'".$comment."',".$current_time.")";	
-		$adb->query($sql);
-	}
-}
-	/** Function to insert values in vtiger_faqcomments table for the specified module,
-  	  * @param $table_name -- table name:: Type varchar
-  	  * @param $module -- module:: Type varchar
- 	 */
-function insertIntoReminderTable($table_name,$module,$recurid)
-{
-	 global $log;
-$log->info("in insertIntoReminderTable  ".$table_name."    module is  ".$module);
-	if($_REQUEST['set_reminder'] == 'Yes')
-	{
-$log->debug("set reminder is set");
-		$rem_days = $_REQUEST['remdays'];
-$log->debug("rem_days is ".$rem_days);
-		$rem_hrs = $_REQUEST['remhrs'];
-$log->debug("rem_hrs is ".$rem_hrs);
-		$rem_min = $_REQUEST['remmin'];
-$log->debug("rem_minutes is ".$rem_min);
-		$reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min;
-$log->debug("reminder_time is ".$reminder_time);
-		if ($recurid == "")
-		{
-			if($_REQUEST['mode'] == 'edit')
-			{
-				$this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit');
-			}
-			else
-			{
-				$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
-			}
-		}
-		else
-		{
-			$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
-		}
-	}
-	elseif($_REQUEST['set_reminder'] == 'No')
-	{
-		$this->activity_reminder($this->id,'0',0,$recurid,'delete');
-	}
-}
-
-// Code included by Minnie - starts
-	/** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array
-  	  * @param $table_name -- table name:: Type varchar
-  	  * @param $module -- module:: Type varchar
-	  * @param $invitees_array Array
- 	 */
-function insertIntoInviteeTable($table_name,$module,$invitees_array)
-{
-	global $log,$adb;
-	$log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ...");
-	foreach($invitees_array as $inviteeid)
-	{
-		if($inviteeid != '')
-		{
-			$query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")";
-			$adb->query($query);
-		}
-	}
-	$log->debug("Exiting insertIntoInviteeTable method ...");
-
-}
-// Code included by Minnie - Ends
-
-// Code included by Jaguar - starts
-	/** Function to insert values in vtiger_recurringevents table for the specified tablename,module
-  	  * @param $recurObj -- Recurring Object:: Type varchar
- 	 */	
-function insertIntoRecurringTable(& $recurObj)
-{
-	global $log,$adb;
-	$log->info("in insertIntoRecurringTable  ");
-	$st_date = $recurObj->startdate->get_formatted_date();
-	$log->debug("st_date ".$st_date);
-	$end_date = $recurObj->enddate->get_formatted_date();
-	$log->debug("end_date is set ".$end_date);
-	$type = $recurObj->recur_type;
-	$log->debug("type is ".$type);
-        $flag="true";
-
-	if($_REQUEST['mode'] == 'edit')
-	{
-		$activity_id=$this->id;
-
-		$sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype';
-		
-		$result = $adb->query($sql);
-		$noofrows = $adb->num_rows($result);
-		for($i=0; $i<$noofrows; $i++)
-		{
-			$recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype");
-			$date_start_b4edit = $adb->query_result($result,$i,"min_date");
-			$end_date_b4edit = $adb->query_result($result,$i,"max_date");
-		}
-		if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit))
-		{
-			if($_REQUEST['set_reminder'] == 'Yes')
-			{
-				$sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id;
-				$adb->query($sql);
-				$sql = 'delete  from vtiger_recurringevents where activityid='.$activity_id;
-				$adb->query($sql);
-				$flag="true";
-			}
-			elseif($_REQUEST['set_reminder'] == 'No')
-			{
-				$sql = 'delete  from vtiger_activity_reminder where activity_id='.$activity_id;
-				$adb->query($sql);
-				$flag="false";
-			}
-			else
-				$flag="false";
-		}
-		else
-		{
-			$sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id;
-			$adb->query($sql);
-			$sql = 'delete  from vtiger_recurringevents where activityid='.$activity_id;
-			$adb->query($sql);
-		}
-	}
-	$date_array = $recurObj->recurringdates;
-	if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null)
-		$recur_freq = $recurObj->recur_freq;
-	else
-		$recur_freq = 1;
-	if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly')
-		$recurringinfo = $recurObj->recur_type;
-	elseif($recurObj->recur_type == 'Weekly')
-	{
-		$recurringinfo = $recurObj->recur_type;
-		if($recurObj->dayofweek_to_rpt != null)
-			$recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt);
-	}
-	elseif($recurObj->recur_type == 'Monthly')
-	{
-		$recurringinfo =  $recurObj->recur_type.'::'.$recurObj->repeat_monthby;
-		if($recurObj->repeat_monthby == 'date')
-			$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue;
-		else
-			$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0];
-	}
-	else
-	{
-		$recurringinfo = '';
-	}
-	if($flag=="true")
-	{
-		for($k=0; $k< count($date_array); $k++)
-		{
-			$tdate=$date_array[$k];
-			if($tdate <= $end_date)
-			{
-				$max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;';
-				$result = $adb->query($max_recurid_qry);
-				$noofrows = $adb->num_rows($result);
-				for($i=0; $i<$noofrows; $i++)
-				{
-					$recur_id = $adb->query_result($result,$i,"recurid");
-				}
-				$current_id =$recur_id+1;
-				$recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')";
-				$adb->query($recurring_insert);
-				if($_REQUEST['set_reminder'] == 'Yes')
-				{
-					$this->insertIntoReminderTable("activity_reminder",$module,$current_id,'');
-				}
-			}
-		}
-	}
-}
+	
+	
+	
+
+
+
+
 
 // Code included by Jaguar - Ends 
 
@@ -1424,53 +993,6 @@
         }
 
 
-	/**	function to save the product tax information in producttarel vtiger_table
-	 *	@param string $tablename - vtiger_tablename to save the product tax relationship (producttaxrel)
-	 *	@param string $module	 - current module name
-	 *	$return void
-	*/
-	function insertTaxInformation($tablename, $module)
-	{
-		global $adb, $log;
-		$log->debug("Entering into insertTaxInformation($tablename, $module) method ...");
-		$tax_details = getAllTaxes();
-
-		$tax_per = '';
-		//Save the Product - tax relationship if corresponding tax check box is enabled
-		//Delete the existing tax if any
-		if($this->mode == 'edit')
-		{
-			for($i=0;$i<count($tax_details);$i++)
-			{
-				$taxid = getTaxId($tax_details[$i]['taxname']);
-				$sql = "delete from vtiger_producttaxrel where productid=$this->id and taxid=$taxid";
-				$adb->query($sql);
-			}
-		}
-		for($i=0;$i<count($tax_details);$i++)
-		{
-			$tax_name = $tax_details[$i]['taxname'];
-			$tax_checkname = $tax_details[$i]['taxname']."_check";
-			if($_REQUEST[$tax_checkname] == 'on' || $_REQUEST[$tax_checkname] == 1)
-			{
-				$taxid = getTaxId($tax_name);
-				$tax_per = $_REQUEST[$tax_name];
-				if($tax_per == '')
-				{
-					$log->debug("Tax selected but value not given so default value will be saved.");
-					$tax_per = getTaxPercentage($tax_name);
-				}
-				
-				$log->debug("Going to save the Product - $tax_name tax relationship");
-
-				$query = "insert into vtiger_producttaxrel values($this->id,$taxid,$tax_per)";
-				$adb->query($query);
-			}
-		}
-
-		$log->debug("Exiting from insertTaxInformation($tablename, $module) method ...");
-	}	
-
 	/**
 	 * This function returns a full (ie non-paged) list of the current object type.  
 	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
@@ -1498,5 +1020,7 @@
 		$tracker->track_view($user_id, $current_module, $id, '');
 	}
 
+	
+
 }
 ?>

Modified: vtigercrm/trunk/data/Tracker.php
==============================================================================
--- vtigercrm/trunk/data/Tracker.php (original)
+++ vtigercrm/trunk/data/Tracker.php Tue Oct 31 03:40:43 2006
@@ -73,144 +73,28 @@
         
 //No genius required. Just add an if case and change the query so that it puts the tracker entry whenever you touch on the DetailView of the required entity
          //get the first name and last name from the respective modules
-          if($current_module =='Leads')
-          {
-            $query = 'select firstname,lastname from vtiger_leaddetails where leadid=' .$item_id;
-            $result = $this->db->query($query);
-            $firstname = $adb->query_result($result,0,'firstname');
-            $lastname =  $adb->query_result($result,0,'lastname');
-            $item_summary = $lastname.' '.$firstname;
-          }
-          elseif ($current_module =='Accounts')
-          {
-            $query = 'select accountname from vtiger_account where accountid=' .$item_id;
-            $result = $this->db->query($query);
-            $accountname = $adb->query_result($result,0,'accountname');
-            $item_summary = $accountname;
-            
-          }
-          elseif($current_module =='Contacts')
-          {
-            $query = 'select firstname,lastname from vtiger_contactdetails where contactid=' .$item_id;
-            $result = $this->db->query($query);
-            $firstname = $adb->query_result($result,0,'firstname');
-            $lastname =  $adb->query_result($result,0,'lastname');
-            $item_summary = $lastname.' '.$firstname;
-            
-          }
-          elseif($current_module =='Potentials')
-          {
-            $query = 'select potentialname from vtiger_potential where potentialid=' .$item_id;
-            $result = $this->db->query($query);
-            $potentialname =  $adb->query_result($result,0,'potentialname');
-            $item_summary = $potentialname;
-          }
-          elseif($current_module =='Notes')
-          {
-            $query = 'select title from vtiger_notes where notesid=' .$item_id;
-            $result = $this->db->query($query);
-            $title = $adb->query_result($result,0,'title');
-            $item_summary = $title;
-            
-          }
-          elseif($current_module =='HelpDesk')
-          {
-            $query = 'select title from vtiger_troubletickets where ticketid=' .$item_id;
-            $result = $this->db->query($query);
-            $title = $adb->query_result($result,0,'title');
-            $item_summary = $title;
-          }
-          elseif($current_module =='Calendar')
-          {
-            //$query = 'select name from calls where callid=' .$item_id;
-	    $query = 'select subject from vtiger_activity where activityid=' .$item_id;
-            $result = $this->db->query($query);
-            $name = $adb->query_result($result,0,'subject');
-            $item_summary = $name;
-          }
-          elseif($current_module =='Emails')
-          {
-            //$query = 'select name from emails where emailid=' .$item_id;
-	    $query = 'select subject from vtiger_activity where activityid=' .$item_id;
-            $result = $this->db->query($query);
-            $name = $adb->query_result($result,0,'subject');
-            $item_summary = $name;
-          }
-          elseif($current_module =='Products')
-          {
-            $query = 'select productname from vtiger_products where productid=' .$item_id;
-            $result = $this->db->query($query);
-            $productname = $adb->query_result($result,0,'productname');
-            $item_summary = $productname;
-          }
-          elseif($current_module =='Users')
-          {
-            $query = 'select first_name,last_name from vtiger_users where id=' .$item_id;
-            $result = $this->db->query($query);
-            $firstname = $adb->query_result($result,0,'first_name');
-            $lastname = $adb->query_result($result,0,'last_name');
-            $item_summary = $lastname.' '.$firstname;
-          }
-	  elseif($current_module =='Invoice')
-          {
-            $query = 'select subject from vtiger_invoice where invoiceid=' .$item_id;
-            $result = $this->db->query($query);
-            $invoice = $adb->query_result($result,0,'subject');
-            $item_summary = $invoice;
-          }
-          elseif($current_module =='Quotes')
-          {
-            $query = 'select subject from vtiger_quotes where quoteid=' .$item_id;
-            $result = $this->db->query($query);
-            $quote = $adb->query_result($result,0,'subject');
-            $item_summary = $quote;
-          }
-	  elseif($current_module =='PurchaseOrder')
-          {
-            $query = 'select subject from vtiger_purchaseorder where purchaseorderid=' .$item_id;
-            $result = $this->db->query($query);
-            $po = $adb->query_result($result,0,'subject');
-            $item_summary = $po;
-          }
-	  elseif($current_module =='SalesOrder')
-          {
-            $query = 'select subject from vtiger_salesorder where salesorderid=' .$item_id;
-            $result = $this->db->query($query);
-            $so = $adb->query_result($result,0,'subject');
-            $item_summary = $so;
-          }
-	  elseif($current_module =='Vendors')
-          {
-            $query = 'select vendorname from vtiger_vendor where vendorid=' .$item_id;
-            $result = $this->db->query($query);
-            $vendor = $adb->query_result($result,0,'vendorname');
-            $item_summary = $vendor;
-          }
-	  elseif($current_module =='PriceBooks')
-          {
-            $query = 'select bookname from vtiger_pricebook where pricebookid=' .$item_id;
-            $result = $this->db->query($query);
-            $pb = $adb->query_result($result,0,'bookname');
-            $item_summary = $pb;
-          }	
-  	  elseif($current_module =='Campaigns')
-          {
-            $query = 'select campaignname from vtiger_campaign where campaignid=' .$item_id;
-            $result = $this->db->query($query);
-            $pb = $adb->query_result($result,0,'campaignname');
-            $item_summary = $pb;
-          }
-  	  elseif($current_module =='Faq')
-          {
-            $query = 'select question from vtiger_faq where id=' .$item_id;
-            $result = $this->db->query($query);
-            $pb = $adb->query_result($result,0,'question');
-	    if(strlen($pb) > 30)
-	    {
-		    $pb=substr($pb,0,30).'...';
-	    } 	    
-            $item_summary = $pb;
-          }		  
+	 if($current_module != '')
+	 {
+		 $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$current_module'";
+		 $result = $adb->query($query);
+		 $fieldsname = $adb->query_result($result,0,'fieldname');
+		 $tablename = $adb->query_result($result,0,'tablename'); 
+		 $entityidfield = $adb->query_result($result,0,'entityidfield'); 
+		 if(!(strpos($fieldsname,',') === false))
+		 {
+			 $fieldlists = explode(',',$fieldsname);
+			 $fieldsname = "concat(";
+			 $fieldsname = $fieldsname.implode(",' ',",$fieldlists);
+			 $fieldsname = $fieldsname.")";
+		 }	
+		 $query1 = "select $fieldsname as entityname from $tablename where $entityidfield =" .$item_id; 
+		 $result = $adb->query($query1);
+		 $item_summary = $adb->query_result($result,0,'entityname');
+		 if(strlen($item_summary) > 30)
+	     {
+		    $item_summary=substr($item_summary,0,30).'...';
+	     }
+	 }
 	 
 	 #if condition added to skip vtiger_faq in last viewed history
           $query = "INSERT into $this->table_name (user_id, module_name, item_id, item_summary) values ('$user_id', '$current_module', '$esc_item_id', ".$this->db->formatString($this->table_name,'item_summary',$item_summary).")";

Modified: vtigercrm/trunk/include/RelatedListView.php
==============================================================================
--- vtigercrm/trunk/include/RelatedListView.php (original)
+++ vtigercrm/trunk/include/RelatedListView.php Tue Oct 31 03:40:43 2006
@@ -372,72 +372,22 @@
         }
 	$result=$adb->query($query);
 	$noofrows = $adb->num_rows($result);
-	
-	$button .= '<table cellspacing=0 cellpadding=2><tr><td>';
-	$button .= '</td></tr></table>';
 
 	if($noofrows == 0)
 	{
+		//There is no entries for history
 	}
 	else
 	{
-		$list .= '<table border="0" cellpadding="0" cellspacing="0" class="FormBorder" width="100%" >';
-		$list .= '<tr class="ModuleListTitle" height=20>';
-
-// Armando Lüscher 15.07.2005 -> §scrollableTables
-// Desc: class="blackLine" deleted because of vertical line in title <tr>
-
-		$class_black="";
-		if($noofrows<=15)
-		{
-			$class_black='class="blackLine"';	
-			$colspan = 'colspan=2';
-		}
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-		$list .= '<td width="90" '.$colspan.' class="moduleListTitle" style="padding:0px 3px 0px 3px;" noWrap>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 25% to 90, inserted noWrap
-
-		$colspan = ($noofrows<=15)?'colspan="3"':''; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Inserted
-		$list .= $app_strings['LBL_CREATED'].'</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed LBL_SUBJECT to LBL_CREATED
-		$header[] = $app_strings['LBL_CREATED'];
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-		$list .= '<td '.$colspan.' width="30%" class="moduleListTitle" style="padding:0px 3px 0px 3px;" noWrap>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 10% to 30%, inserted '.$colspan.' noWrap
-	
-		$list .= $app_strings['LBL_SUBJECT'].'</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed LBL_STATUS to LBL_SUBJECT
+		//Form the header columns
+		$header[] = $app_strings['LBL_TYPE'];
 		$header[] = $app_strings['LBL_SUBJECT'];
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-		$list .= '<td width="70%" class="moduleListTitle" style="padding:0px 3px 0px 3px;" noWrap>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 18% to 70%, inserted noWrap
-
-		$list .= $app_strings['LBL_DESCRIPTION'].'</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed LBL_LIST_CONTACT_NAME to LBL_DESCRIPTION
-		$header[] = $app_strings['LBL_DESCRIPTION'];
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-		$list .= '<td width="80" class="moduleListTitle" style="padding:0px 3px 0px 3px;" noWrap>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 18% to 80, inserted noWrap
-
-		$list .= $app_strings['LBL_ACTION'].'</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed LBL_RELATED_TO to LBL_ACTION
-		$header[] = $app_strings['LBL_TIME'];
+		$header[] = $app_strings['LBL_RELATED_TO'];
+		$header[] = $app_strings['LBL_START_DATE'];
+		$header[] = $app_strings['LBL_END_DATE'];
+		//$header[] = $app_strings['LBL_DESCRIPTION'];
 		$header[] = $app_strings['LBL_ACTION'];
-		$header[] = $app_strings['LBL_RELATED_TO'];
 		$header[] = $app_strings['LBL_ASSIGNED_TO'];
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-/* // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Commented out because this is not used for the title row
-*/
-		$list .= '</td>';
-		$colspan = 9;
-		if($noofrows>15)
-		{
-			$list .= '<td style="width:20px">&nbsp;&nbsp&nbsp;&nbsp;</td>';
-			$colspan = 11;
-		}
-		$list .= '</tr>';
-	
-		$list .= '<tr><td COLSPAN="'.$colspan.'" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
-
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: 'X'
-//			 Insert new vtiger_table with 1 cell where all entries are in a new vtiger_table.
-//			 This cell will be scrollable when too many entries exist
-		$list .= ($noofrows>15) ? '<tr><td colspan="'.$colspan.'"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTables
 
 		$i=1;
 		while($row = $adb->fetch_array($result))
@@ -455,125 +405,47 @@
 				$icon = 'Activities.gif';
 				$status = $row['eventstatus'];
 			}
-			if ($i%2==0)
-				$trowclass = 'evenListRow';
-			else
-				$trowclass = 'oddListRow';
-	
-			$created_arr = explode(" ",getDisplayDate($row['createdtime']));
-			$created_date = $created_arr[0];
-			$created_time = substr($created_arr[1],0,5);
-
-			$list .= '<tr class="'. $trowclass.'">';
-			$entries[] = $created_date;	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			$list .= '<td colspan="2" valign="top" class="visibleDescriptionLink" width="90" style="padding:0px 3px 0px 3px;" noWrap>'.$created_date.'</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 4% to 90, inserted colspan="2" align="right" valign="top" class="visibleDescriptionLink" style="padding:0px 3px 0px 3px;" noWrap, replaced <IMG SRC="'.$image_path.'/'.$icon.'"> with $created_date
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			$list .= '<td valign="top" colspan="3" width="30%" height="21" class="visibleDescriptionLink" style="padding:0px 3px 0px 3px;">'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 25% to 30%, inserted colspan="3" valign="top" class="visibleDescriptionLink"
+
+			$entries[] = $row['activitytype'];
+
 			$activity = '<a href="index.php?module=Calendar&action=DetailView&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["activityid"] .'&activity_mode='.$activitymode.'&return_id='.$_REQUEST['record'].'" title="'.$row['description'].'">'.$row['subject'].'</a></td>';
 			$entries[] = $activity;
-			$list .= '</td>';
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			$list .= '<td valign="top" rowspan="2" width="70%" height="21" class="visibleDescription" style="padding:0px 3px 0px 3px;">'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 10% to 70%, inserted rowspan="2" valign="top" class="visibleDescription"
-			$entries[] = nl2br($row['description']);
-			$list .= nl2br($row['description']); // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Replaced $status with nl2br($row['description'])
-			$list .= '</td>';
-
-			if($row['firstname'] != 'NULL')	
-				$contactname = $row['firstname'].' ';
-			if($ros['lastname'] != 'NULL')
-				$contactname .= $row['lastname'];
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td valign="top" width="80" height="21" style="padding:0px 3px 0px 3px;" noWrap>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 18% to 80, inserted valign="top" noWrap
-			// Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: This if-statement replaces the line above
+	
+			$parentname = getRelatedTo('Calendar',$result,$i-1);
+			$entries[] = $parentname;
+
+			$entries[] = $row['date_start'];
+			$entries[] = $row['due_date'];
+
+			//$entries[] = nl2br($row['description']);
+
 			if(isPermitted("Calendar",1,$row["activityid"]) == 'yes')
 			{
 				$list .= '<a href="index.php?module=Calendar&action=EditView&return_module='.$parentmodule.'&return_action='.$parentaction.'&activity_mode='.$activitymode.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_EDIT'].'</a>';
 			
 			}
-			$list .= '</td>';
-
-			// begin: Armando Lüscher 26.09.2005 -> §visibleDescription
-			// Desc: Inserted because entries are displayed on 2 rows
-			$list .= '</tr><tr class="'.$trowclass.'">';
-			// end: Armando Lüscher 26.09.2005 -> §visibleDescription 
-
-			$parentname = getRelatedTo('Calendar',$result,$i-1);
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			
-			// begin: Armando Lüscher 26.09.2005 -> §visibleDescription
-			// Desc: Added
-			$list .= '<td valign="top" width="20" style="padding:0px 0px 0px 10px;">';
-			$list .= '<IMG SRC="'.$image_path.'/'.$icon.'">';
-			$list .= '</td>';
-			// end: Armando Lüscher 26.09.2005 -> §visibleDescription
-	
-			$list .= '<td align="right" valign="top" width="70" style="padding:0px 3px 0px 3px;">'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 18% to 70, inserted align="right" valign="top"
-			$list .= $created_time; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Replaced $parentname with $created_time
-			$list .= '</td>';	
-			$entries[] = $created_time;
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			$list .= '<td valign="top" width="8%" style="padding:0px 3px 0px 3px;">'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 15% to 8%, inserted valign="top"
-			$list .= $status; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Replaced $modifiedtime with $status
+
 			$entries[] = $status;
-			$list .= '</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Inserted
-
-//			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td valign="top" width="18%" style="padding:0px 3px 0px 3px;">'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Changed width from 10% to 18%, inserted valign="top"
-			$entries[] = $parentname;
-			$list .= $parentname; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Inserted
-			$list .= '</td>'; // Armando Lüscher 26.09.2005 -> §visibleDescription -> Desc: Inserted
-			
-			// begin: Armando Lüscher 26.09.2005 -> §visibleDescription
-			// Desc: Added
-			$list .= '<td valign="top" width="4%" style="padding:0px 3px 0px 3px;">';
+
 			if($row['user_name']==NULL && $row['groupname']!=NULL)
 			{
-				$list .= $row['groupname'];
 				$entries[] = $row['groupname'];
 			}
 			else
 			{
-				$list .= $row['user_name'];
  				$entries[] = $row['user_name'];
 				
 			}
-			$list .= '</td>';
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
 			
-			// the description is in this space
-			
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td>';
-			$list .= '<td valign="top" width="80" style="padding:0px 3px 0px 3px;">';
 			if(isPermitted("Calendar",2,$row["activityid"]) == 'yes')
 			{
 				$list .= '<a href="index.php?module=Calendar&action=Delete&return_module='.$parentmodule.'&return_action='.$parentaction.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_DELETE'].'</a>';
 			}
-			$list .= '</td>';
-			
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-
-			$list .= '</tr>';
-
-			$list .= '<tr width="'.$colspan.'"><td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif"></td></tr>';
 
 			$i++;
 			$entries_list[] = $entries;
 		}
 
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: Close vtiger_table from 
-		$list .= ($noofrows>15) ? '</table></div></td></tr>':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTables
-
-		$list .= '<tr><td colspan="14" class="blackLine"></td></tr>';
-
-		$list .= '</table>';
 		$return_data = array('header'=>$header,'entries'=>$entries_list);
 		$log->debug("Exiting getHistory method ...");
 		return $return_data; 

Modified: vtigercrm/trunk/include/js/Inventory.js
==============================================================================
--- vtigercrm/trunk/include/js/Inventory.js (original)
+++ vtigercrm/trunk/include/js/Inventory.js Tue Oct 31 03:40:43 2006
@@ -414,13 +414,29 @@
 	taxcount = eval(document.getElementById(countname).value)+1;
 
 	if(countname == 'tax_count')
+	{
 		taxprefix = 'tax';
+		taxLabelPrefix = 'taxlabel_tax';
+	}
 	else
+	{
 		taxprefix = 'shtax';
+		taxLabelPrefix = 'taxlabel_shtax';
+	}
 
 	for(var i=1;i<=taxcount;i++)
 	{
 		taxval = document.getElementById(taxprefix+i).value;
+		taxLabelVal = document.getElementById(taxLabelPrefix+i).value;
+		document.getElementById(taxLabelPrefix+i).value = taxLabelVal.replace(/^\s*|\s*$/g,'').replace(/\s+/g,'');
+
+		if(document.getElementById(taxLabelPrefix+i).value.length == 0)
+		{
+			alert("The tax label name should not be empty");
+			return false
+		} 
+
+		//Tax value - numeric validation	
 		var temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(taxval);
 		if(!temp)
 		{
@@ -430,6 +446,7 @@
 	}
 	return true;
 }
+
 
 
 //Function used to add a new product row in PO, SO, Quotes and Invoice
@@ -501,12 +518,18 @@
 function decideTaxDiv()
 {
 	var taxtype = document.getElementById("taxtype").value
+
+	calcTotal();
+
 	if(taxtype == 'group')
+	{
+		//if group tax selected then we have to hide the individual taxes and also calculate the group tax
 		hideIndividualTaxes()
+		calcGroupTax();
+	}
 	else if(taxtype == 'individual')
 		hideGroupTax()
 
-	calcTotal();
 }
 
 function hideIndividualTaxes()

Modified: vtigercrm/trunk/include/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/include/language/en_us.lang.php (original)
+++ vtigercrm/trunk/include/language/en_us.lang.php Tue Oct 31 03:40:43 2006
@@ -59,6 +59,20 @@
 'LBL_SEARCH'=>'Search',
 
 'LBL_LAST_VIEWED'=>'Last Viewed',
+
+'LBL_TODAY'=>'Today',
+
+'LBL_ALL'=>'All',
+
+'LBL_SHOW'=>'Show :',
+
+'today'=>"Today's",
+
+'all'=>'All',
+
+'LBL_UPCOMING_EVENTS'=>'Upcoming Activities',
+
+'LBL_PENDING_EVENTS'=>'Pending Activities',
 
 'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!",
 
@@ -1028,6 +1042,26 @@
 //Record deleted message
 'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.',
 'Part Number'=>'Part Number',
+
+//Added after 5.0.1
+'Salutation'=>'Salutation ',
+'Rating'=>'Rating',
+'industry'=>'Industry',
+'Severity'=>'Severity',
+'Product Category'=>'Product Category',
+'GL Account'=>'GL Account',
+'Usage Unit'=>'Usage Unit',
+'Carrier'=>'Carrier',
+'Expected Response'=>'Expected Response',
+'LBL_ADDRESS_INF'=>'Address Information',
+
+'yes'=>'yes',
+'LBL_RENAMEPROFILE_BUTTON_LABEL'=>'Rename',
+'LBL_RENAME_PROFILE'=>'Rename Profile',
+'LBL_PROFILE_NAME'=>'Profile Name',
+'LBL_START_DATE'=>'Start Date',
+'LBL_END_DATE'=>'End Date',
+
 );
 
 

Modified: vtigercrm/trunk/include/nusoap/class.soap_transport_http.php
==============================================================================
--- vtigercrm/trunk/include/nusoap/class.soap_transport_http.php (original)
+++ vtigercrm/trunk/include/nusoap/class.soap_transport_http.php Tue Oct 31 03:40:43 2006
@@ -1,1038 +1,1038 @@
-<?php
-
-
-
-
-/**
-* transport class for sending/receiving data via HTTP and HTTPS
-* NOTE: PHP must be compiled with the CURL extension for HTTPS support
-*
-* @author   Dietrich Ayala <dietrich at ganx4.com>
-* @version  $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $
-* @access public
-*/
-class soap_transport_http extends nusoap_base {
-
-	var $url = '';
-	var $uri = '';
-	var $digest_uri = '';
-	var $scheme = '';
-	var $host = '';
-	var $port = '';
-	var $path = '';
-	var $request_method = 'POST';
-	var $protocol_version = '1.0';
-	var $encoding = '';
-	var $outgoing_headers = array();
-	var $incoming_headers = array();
-	var $incoming_cookies = array();
-	var $outgoing_payload = '';
-	var $incoming_payload = '';
-	var $useSOAPAction = true;
-	var $persistentConnection = false;
-	var $ch = false;	// cURL handle
-	var $username = '';
-	var $password = '';
-	var $authtype = '';
-	var $digestRequest = array();
-	var $certRequest = array();	// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional)
-								// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
-								// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
-								// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
-								// passphrase: SSL key password/passphrase
-								// verifypeer: default is 1
-								// verifyhost: default is 1
-
-	/**
-	* constructor
-	*/
-	function soap_transport_http($url){
-		parent::nusoap_base();
-		$this->setURL($url);
-		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
-		$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
-		$this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
-	}
-
-	function setURL($url) {
-		$this->url = $url;
-
-		$u = parse_url($url);
-		foreach($u as $k => $v){
-			$this->debug("$k = $v");
-			$this->$k = $v;
-		}
-		
-		// add any GET params to path
-		if(isset($u['query']) && $u['query'] != ''){
-            $this->path .= '?' . $u['query'];
-		}
-		
-		// set default port
-		if(!isset($u['port'])){
-			if($u['scheme'] == 'https'){
-				$this->port = 443;
-			} else {
-				$this->port = 80;
-			}
-		}
-		
-		$this->uri = $this->path;
-		$this->digest_uri = $this->uri;
-		
-		// build headers
-		if (!isset($u['port'])) {
-			$this->outgoing_headers['Host'] = $this->host;
-		} else {
-			$this->outgoing_headers['Host'] = $this->host.':'.$this->port;
-		}
-		$this->debug('set Host: ' . $this->outgoing_headers['Host']);
-
-		if (isset($u['user']) && $u['user'] != '') {
-			$this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
-		}
-	}
-	
-	function connect($connection_timeout=0,$response_timeout=30){
-	  	// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
-	  	// "regular" socket.
-	  	// TODO: disabled for now because OpenSSL must be *compiled* in (not just
-	  	//       loaded), and until PHP5 stream_get_wrappers is not available.
-//	  	if ($this->scheme == 'https') {
-//		  	if (version_compare(phpversion(), '4.3.0') >= 0) {
-//		  		if (extension_loaded('openssl')) {
-//		  			$this->scheme = 'ssl';
-//		  			$this->debug('Using SSL over OpenSSL');
-//		  		}
-//		  	}
-//		}
-		$this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
-	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
-		// use persistent connection
-		if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
-			if (!feof($this->fp)) {
-				$this->debug('Re-use persistent connection');
-				return true;
-			}
-			fclose($this->fp);
-			$this->debug('Closed persistent connection at EOF');
-		}
-
-		// munge host if using OpenSSL
-		if ($this->scheme == 'ssl') {
-			$host = 'ssl://' . $this->host;
-		} else {
-			$host = $this->host;
-		}
-		$this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);
-
-		// open socket
-		if($connection_timeout > 0){
-			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
-		} else {
-			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
-		}
-		
-		// test pointer
-		if(!$this->fp) {
-			$msg = 'Couldn\'t open socket connection to server ' . $this->url;
-			if ($this->errno) {
-				$msg .= ', Error ('.$this->errno.'): '.$this->error_str;
-			} else {
-				$msg .= ' prior to connect().  This is often a problem looking up the host name.';
-			}
-			$this->debug($msg);
-			$this->setError($msg);
-			return false;
-		}
-		
-		// set response timeout
-		$this->debug('set response timeout to ' . $response_timeout);
-		socket_set_timeout( $this->fp, $response_timeout);
-
-		$this->debug('socket connected');
-		return true;
-	  } else if ($this->scheme == 'https') {
-		if (!extension_loaded('curl')) {
-			$this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
-			return false;
-		}
-		$this->debug('connect using https');
-		// init CURL
-		$this->ch = curl_init();
-		// set url
-		$hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host";
-		// add path
-		$hostURL .= $this->path;
-		curl_setopt($this->ch, CURLOPT_URL, $hostURL);
-		// follow location headers (re-directs)
-		curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
-		// ask for headers in the response output
-		curl_setopt($this->ch, CURLOPT_HEADER, 1);
-		// ask for the response output as the return value
-		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
-		// encode
-		// We manage this ourselves through headers and encoding
-//		if(function_exists('gzuncompress')){
-//			curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate');
-//		}
-		// persistent connection
-		if ($this->persistentConnection) {
-			// The way we send data, we cannot use persistent connections, since
-			// there will be some "junk" at the end of our request.
-			//curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true);
-			$this->persistentConnection = false;
-			$this->outgoing_headers['Connection'] = 'close';
-			$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
-		}
-		// set timeout
-		if ($connection_timeout != 0) {
-			curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout);
-		}
-		// TODO: cURL has added a connection timeout separate from the response timeout
-		//if ($connection_timeout != 0) {
-		//	curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
-		//}
-		//if ($response_timeout != 0) {
-		//	curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout);
-		//}
-
-		// recent versions of cURL turn on peer/host checking by default,
-		// while PHP binaries are not compiled with a default location for the
-		// CA cert bundle, so disable peer/host checking.
-//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');		
-		curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
-		curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
-
-		// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
-		if ($this->authtype == 'certificate') {
-			if (isset($this->certRequest['cainfofile'])) {
-				curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']);
-			}
-			if (isset($this->certRequest['verifypeer'])) {
-				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
-			} else {
-				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1);
-			}
-			if (isset($this->certRequest['verifyhost'])) {
-				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
-			} else {
-				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1);
-			}
-			if (isset($this->certRequest['sslcertfile'])) {
-				curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
-			}
-			if (isset($this->certRequest['sslkeyfile'])) {
-				curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
-			}
-			if (isset($this->certRequest['passphrase'])) {
-				curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']);
-			}
-		}
-		$this->debug('cURL connection set up');
-		return true;
-	  } else {
-		$this->setError('Unknown scheme ' . $this->scheme);
-		$this->debug('Unknown scheme ' . $this->scheme);
-		return false;
-	  }
-	}
-	
-	/**
-	* send the SOAP message via HTTP
-	*
-	* @param    string $data message data
-	* @param    integer $timeout set connection timeout in seconds
-	* @param	integer $response_timeout set response timeout in seconds
-	* @param	array $cookies cookies to send
-	* @return	string data
-	* @access   public
-	*/
-	function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) {
-		
-		$this->debug('entered send() with data of length: '.strlen($data));
-
-		$this->tryagain = true;
-		$tries = 0;
-		while ($this->tryagain) {
-			$this->tryagain = false;
-			if ($tries++ < 2) {
-				// make connnection
-				if (!$this->connect($timeout, $response_timeout)){
-					return false;
-				}
-				
-				// send request
-				if (!$this->sendRequest($data, $cookies)){
-					return false;
-				}
-				
-				// get response
-				$respdata = $this->getResponse();
-			} else {
-				$this->setError('Too many tries to get an OK response');
-			}
-		}		
-		$this->debug('end of send()');
-		return $respdata;
-	}
-
-
-	/**
-	* send the SOAP message via HTTPS 1.0 using CURL
-	*
-	* @param    string $msg message data
-	* @param    integer $timeout set connection timeout in seconds
-	* @param	integer $response_timeout set response timeout in seconds
-	* @param	array $cookies cookies to send
-	* @return	string data
-	* @access   public
-	*/
-	function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
-		return $this->send($data, $timeout, $response_timeout, $cookies);
-	}
-	
-	/**
-	* if authenticating, set user credentials here
-	*
-	* @param    string $username
-	* @param    string $password
-	* @param	string $authtype (basic, digest, certificate)
-	* @param	array $digestRequest (keys must be nonce, nc, realm, qop)
-	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
-	* @access   public
-	*/
-	function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) {
-		$this->debug("Set credentials for authtype $authtype");
-		// cf. RFC 2617
-		if ($authtype == 'basic') {
-			$this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password);
-		} elseif ($authtype == 'digest') {
-			if (isset($digestRequest['nonce'])) {
-				$digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
-				
-				// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
-	
-				// A1 = unq(username-value) ":" unq(realm-value) ":" passwd
-				$A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
-	
-				// H(A1) = MD5(A1)
-				$HA1 = md5($A1);
-	
-				// A2 = Method ":" digest-uri-value
-				$A2 = 'POST:' . $this->digest_uri;
-	
-				// H(A2)
-				$HA2 =  md5($A2);
-	
-				// KD(secret, data) = H(concat(secret, ":", data))
-				// if qop == auth:
-				// request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
-				//                              ":" nc-value
-				//                              ":" unq(cnonce-value)
-				//                              ":" unq(qop-value)
-				//                              ":" H(A2)
-				//                            ) <">
-				// if qop is missing,
-				// request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
-	
-				$unhashedDigest = '';
-				$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
-				$cnonce = $nonce;
-				if ($digestRequest['qop'] != '') {
-					$unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
-				} else {
-					$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
-				}
-	
-				$hashedDigest = md5($unhashedDigest);
-	
-				$this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"';
-			}
-		} elseif ($authtype == 'certificate') {
-			$this->certRequest = $certRequest;
-		}
-		$this->username = $username;
-		$this->password = $password;
-		$this->authtype = $authtype;
-		$this->digestRequest = $digestRequest;
-		
-		if (isset($this->outgoing_headers['Authorization'])) {
-			$this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...');
-		} else {
-			$this->debug('Authorization header not set');
-		}
-	}
-	
-	/**
-	* set the soapaction value
-	*
-	* @param    string $soapaction
-	* @access   public
-	*/
-	function setSOAPAction($soapaction) {
-		$this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"';
-		$this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']);
-	}
-	
-	/**
-	* use http encoding
-	*
-	* @param    string $enc encoding style. supported values: gzip, deflate, or both
-	* @access   public
-	*/
-	function setEncoding($enc='gzip, deflate') {
-		if (function_exists('gzdeflate')) {
-			$this->protocol_version = '1.1';
-			$this->outgoing_headers['Accept-Encoding'] = $enc;
-			$this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']);
-			if (!isset($this->outgoing_headers['Connection'])) {
-				$this->outgoing_headers['Connection'] = 'close';
-				$this->persistentConnection = false;
-				$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
-			}
-			set_magic_quotes_runtime(0);
-			// deprecated
-			$this->encoding = $enc;
-		}
-	}
-	
-	/**
-	* set proxy info here
-	*
-	* @param    string $proxyhost
-	* @param    string $proxyport
-	* @param	string $proxyusername
-	* @param	string $proxypassword
-	* @access   public
-	*/
-	function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
-		$this->uri = $this->url;
-		$this->host = $proxyhost;
-		$this->port = $proxyport;
-		if ($proxyusername != '' && $proxypassword != '') {
-			$this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword);
-			$this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']);
-		}
-	}
-	
-	/**
-	* decode a string that is encoded w/ "chunked' transfer encoding
- 	* as defined in RFC2068 19.4.6
-	*
-	* @param    string $buffer
-	* @param    string $lb
-	* @returns	string
-	* @access   public
-	* @deprecated
-	*/
-	function decodeChunked($buffer, $lb){
-		// length := 0
-		$length = 0;
-		$new = '';
-		
-		// read chunk-size, chunk-extension (if any) and CRLF
-		// get the position of the linebreak
-		$chunkend = strpos($buffer, $lb);
-		if ($chunkend == FALSE) {
-			$this->debug('no linebreak found in decodeChunked');
-			return $new;
-		}
-		$temp = substr($buffer,0,$chunkend);
-		$chunk_size = hexdec( trim($temp) );
-		$chunkstart = $chunkend + strlen($lb);
-		// while (chunk-size > 0) {
-		while ($chunk_size > 0) {
-			$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
-			$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
-		  	
-			// Just in case we got a broken connection
-		  	if ($chunkend == FALSE) {
-		  	    $chunk = substr($buffer,$chunkstart);
-				// append chunk-data to entity-body
-		    	$new .= $chunk;
-		  	    $length += strlen($chunk);
-		  	    break;
-			}
-			
-		  	// read chunk-data and CRLF
-		  	$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
-		  	// append chunk-data to entity-body
-		  	$new .= $chunk;
-		  	// length := length + chunk-size
-		  	$length += strlen($chunk);
-		  	// read chunk-size and CRLF
-		  	$chunkstart = $chunkend + strlen($lb);
-			
-		  	$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
-			if ($chunkend == FALSE) {
-				break; //Just in case we got a broken connection
-			}
-			$temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
-			$chunk_size = hexdec( trim($temp) );
-			$chunkstart = $chunkend;
-		}
-		return $new;
-	}
-	
-	/*
-	 *	Writes payload, including HTTP headers, to $this->outgoing_payload.
-	 */
-	function buildPayload($data, $cookie_str = '') {
-		// add content-length header
-		$this->outgoing_headers['Content-Length'] = strlen($data);
-		$this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']);
-
-		// start building outgoing payload:
-		$req = "$this->request_method $this->uri HTTP/$this->protocol_version";
-		$this->debug("HTTP request: $req");
-		$this->outgoing_payload = "$req\r\n";
-
-		// loop thru headers, serializing
-		foreach($this->outgoing_headers as $k => $v){
-			$hdr = $k.': '.$v;
-			$this->debug("HTTP header: $hdr");
-			$this->outgoing_payload .= "$hdr\r\n";
-		}
-
-		// add any cookies
-		if ($cookie_str != '') {
-			$hdr = 'Cookie: '.$cookie_str;
-			$this->debug("HTTP header: $hdr");
-			$this->outgoing_payload .= "$hdr\r\n";
-		}
-
-		// header/body separator
-		$this->outgoing_payload .= "\r\n";
-		
-		// add data
-		$this->outgoing_payload .= $data;
-	}
-
-	function sendRequest($data, $cookies = NULL) {
-		// build cookie string
-		$cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));
-
-		// build payload
-		$this->buildPayload($data, $cookie_str);
-
-	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
-		// send payload
-		if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
-			$this->setError('couldn\'t write message data to socket');
-			$this->debug('couldn\'t write message data to socket');
-			return false;
-		}
-		$this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
-		return true;
-	  } else if ($this->scheme == 'https') {
-		// set payload
-		// TODO: cURL does say this should only be the verb, and in fact it
-		// turns out that the URI and HTTP version are appended to this, which
-		// some servers refuse to work with
-		//curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
-		foreach($this->outgoing_headers as $k => $v){
-			$curl_headers[] = "$k: $v";
-		}
-		if ($cookie_str != '') {
-			$curl_headers[] = 'Cookie: ' . $cookie_str;
-		}
-		curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers);
-		if ($this->request_method == "POST") {
-	  		curl_setopt($this->ch, CURLOPT_POST, 1);
-	  		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
-	  	} else {
-	  	}
-		$this->debug('set cURL payload');
-		return true;
-	  }
-	}
-
-	function getResponse(){
-		$this->incoming_payload = '';
-	    
-	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
-	    // loop until headers have been retrieved
-	    $data = '';
-	    while (!isset($lb)){
-
-			// We might EOF during header read.
-			if(feof($this->fp)) {
-				$this->incoming_payload = $data;
-				$this->debug('found no headers before EOF after length ' . strlen($data));
-				$this->debug("received before EOF:\n" . $data);
-				$this->setError('server failed to send headers');
-				return false;
-			}
-
-			$tmp = fgets($this->fp, 256);
-			$tmplen = strlen($tmp);
-			$this->debug("read line of $tmplen bytes: " . trim($tmp));
-
-			if ($tmplen == 0) {
-				$this->incoming_payload = $data;
-				$this->debug('socket read of headers timed out after length ' . strlen($data));
-				$this->debug("read before timeout: " . $data);
-				$this->setError('socket read of headers timed out');
-				return false;
-			}
-
-			$data .= $tmp;
-			$pos = strpos($data,"\r\n\r\n");
-			if($pos > 1){
-				$lb = "\r\n";
-			} else {
-				$pos = strpos($data,"\n\n");
-				if($pos > 1){
-					$lb = "\n";
-				}
-			}
-			// remove 100 header
-			if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
-				unset($lb);
-				$data = '';
-			}//
-		}
-		// store header data
-		$this->incoming_payload .= $data;
-		$this->debug('found end of headers after length ' . strlen($data));
-		// process headers
-		$header_data = trim(substr($data,0,$pos));
-		$header_array = explode($lb,$header_data);
-		$this->incoming_headers = array();
-		$this->incoming_cookies = array();
-		foreach($header_array as $header_line){
-			$arr = explode(':',$header_line, 2);
-			if(count($arr) > 1){
-				$header_name = strtolower(trim($arr[0]));
-				$this->incoming_headers[$header_name] = trim($arr[1]);
-				if ($header_name == 'set-cookie') {
-					// TODO: allow multiple cookies from parseCookie
-					$cookie = $this->parseCookie(trim($arr[1]));
-					if ($cookie) {
-						$this->incoming_cookies[] = $cookie;
-						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
-					} else {
-						$this->debug('did not find cookie in ' . trim($arr[1]));
-					}
-    			}
-			} else if (isset($header_name)) {
-				// append continuation line to previous header
-				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
-			}
-		}
-		
-		// loop until msg has been received
-		if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
-			$content_length =  2147483647;	// ignore any content-length header
-			$chunked = true;
-			$this->debug("want to read chunked content");
-		} elseif (isset($this->incoming_headers['content-length'])) {
-			$content_length = $this->incoming_headers['content-length'];
-			$chunked = false;
-			$this->debug("want to read content of length $content_length");
-		} else {
-			$content_length =  2147483647;
-			$chunked = false;
-			$this->debug("want to read content to EOF");
-		}
-		$data = '';
-		do {
-			if ($chunked) {
-				$tmp = fgets($this->fp, 256);
-				$tmplen = strlen($tmp);
-				$this->debug("read chunk line of $tmplen bytes");
-				if ($tmplen == 0) {
-					$this->incoming_payload = $data;
-					$this->debug('socket read of chunk length timed out after length ' . strlen($data));
-					$this->debug("read before timeout:\n" . $data);
-					$this->setError('socket read of chunk length timed out');
-					return false;
-				}
-				$content_length = hexdec(trim($tmp));
-				$this->debug("chunk length $content_length");
-			}
-			$strlen = 0;
-		    while (($strlen < $content_length) && (!feof($this->fp))) {
-		    	$readlen = min(8192, $content_length - $strlen);
-				$tmp = fread($this->fp, $readlen);
-				$tmplen = strlen($tmp);
-				$this->debug("read buffer of $tmplen bytes");
-				if (($tmplen == 0) && (!feof($this->fp))) {
-					$this->incoming_payload = $data;
-					$this->debug('socket read of body timed out after length ' . strlen($data));
-					$this->debug("read before timeout:\n" . $data);
-					$this->setError('socket read of body timed out');
-					return false;
-				}
-				$strlen += $tmplen;
-				$data .= $tmp;
-			}
-			if ($chunked && ($content_length > 0)) {
-				$tmp = fgets($this->fp, 256);
-				$tmplen = strlen($tmp);
-				$this->debug("read chunk terminator of $tmplen bytes");
-				if ($tmplen == 0) {
-					$this->incoming_payload = $data;
-					$this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
-					$this->debug("read before timeout:\n" . $data);
-					$this->setError('socket read of chunk terminator timed out');
-					return false;
-				}
-			}
-		} while ($chunked && ($content_length > 0) && (!feof($this->fp)));
-		if (feof($this->fp)) {
-			$this->debug('read to EOF');
-		}
-		$this->debug('read body of length ' . strlen($data));
-		$this->incoming_payload .= $data;
-		$this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
-		
-		// close filepointer
-		if(
-			(isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
-			(! $this->persistentConnection) || feof($this->fp)){
-			fclose($this->fp);
-			$this->fp = false;
-			$this->debug('closed socket');
-		}
-		
-		// connection was closed unexpectedly
-		if($this->incoming_payload == ''){
-			$this->setError('no response from server');
-			return false;
-		}
-		
-		// decode transfer-encoding
-//		if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
-//			if(!$data = $this->decodeChunked($data, $lb)){
-//				$this->setError('Decoding of chunked data failed');
-//				return false;
-//			}
-			//print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
-			// set decoded payload
-//			$this->incoming_payload = $header_data.$lb.$lb.$data;
-//		}
-	
-	  } else if ($this->scheme == 'https') {
-		// send and receive
-		$this->debug('send and receive with cURL');
-		$this->incoming_payload = curl_exec($this->ch);
-		$data = $this->incoming_payload;
-
-        $cErr = curl_error($this->ch);
-		if ($cErr != '') {
-        	$err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
-        	// TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
-			foreach(curl_getinfo($this->ch) as $k => $v){
-				$err .= "$k: $v<br>";
-			}
-			$this->debug($err);
-			$this->setError($err);
-			curl_close($this->ch);
-	    	return false;
-		} else {
-			//echo '<pre>';
-			//var_dump(curl_getinfo($this->ch));
-			//echo '</pre>';
-		}
-		// close curl
-		$this->debug('No cURL error, closing cURL');
-		curl_close($this->ch);
-		
-		// remove 100 header(s)
-		while (ereg('^HTTP/1.1 100',$data)) {
-			if ($pos = strpos($data,"\r\n\r\n")) {
-				$data = ltrim(substr($data,$pos));
-			} elseif($pos = strpos($data,"\n\n") ) {
-				$data = ltrim(substr($data,$pos));
-			}
-		}
-		
-		// separate content from HTTP headers
-		if ($pos = strpos($data,"\r\n\r\n")) {
-			$lb = "\r\n";
-		} elseif( $pos = strpos($data,"\n\n")) {
-			$lb = "\n";
-		} else {
-			$this->debug('no proper separation of headers and document');
-			$this->setError('no proper separation of headers and document');
-			return false;
-		}
-		$header_data = trim(substr($data,0,$pos));
-		$header_array = explode($lb,$header_data);
-		$data = ltrim(substr($data,$pos));
-		$this->debug('found proper separation of headers and document');
-		$this->debug('cleaned data, stringlen: '.strlen($data));
-		// clean headers
-		foreach ($header_array as $header_line) {
-			$arr = explode(':',$header_line,2);
-			if(count($arr) > 1){
-				$header_name = strtolower(trim($arr[0]));
-				$this->incoming_headers[$header_name] = trim($arr[1]);
-				if ($header_name == 'set-cookie') {
-					// TODO: allow multiple cookies from parseCookie
-					$cookie = $this->parseCookie(trim($arr[1]));
-					if ($cookie) {
-						$this->incoming_cookies[] = $cookie;
-						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
-					} else {
-						$this->debug('did not find cookie in ' . trim($arr[1]));
-					}
-    			}
-			} else if (isset($header_name)) {
-				// append continuation line to previous header
-				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
-			}
-		}
-	  }
-
-		$arr = explode(' ', $header_array[0], 3);
-		$http_version = $arr[0];
-		$http_status = intval($arr[1]);
-		$http_reason = count($arr) > 2 ? $arr[2] : '';
-
- 		// see if we need to resend the request with http digest authentication
- 		if (isset($this->incoming_headers['location']) && $http_status == 301) {
- 			$this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']);
- 			$this->setURL($this->incoming_headers['location']);
-			$this->tryagain = true;
-			return false;
-		}
-
- 		// see if we need to resend the request with http digest authentication
- 		if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
- 			$this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
- 			if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
- 				$this->debug('Server wants digest authentication');
- 				// remove "Digest " from our elements
- 				$digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
- 				
- 				// parse elements into array
- 				$digestElements = explode(',', $digestString);
- 				foreach ($digestElements as $val) {
- 					$tempElement = explode('=', trim($val), 2);
- 					$digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
- 				}
-
-				// should have (at least) qop, realm, nonce
- 				if (isset($digestRequest['nonce'])) {
- 					$this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
- 					$this->tryagain = true;
- 					return false;
- 				}
- 			}
-			$this->debug('HTTP authentication failed');
-			$this->setError('HTTP authentication failed');
-			return false;
- 		}
-		
-		if (
-			($http_status >= 300 && $http_status <= 307) ||
-			($http_status >= 400 && $http_status <= 417) ||
-			($http_status >= 501 && $http_status <= 505)
-		   ) {
-			$this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)");
-			return false;
-		}
-
-		// decode content-encoding
-		if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
-			if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
-    			// if decoding works, use it. else assume data wasn't gzencoded
-    			if(function_exists('gzinflate')){
-					//$timer->setMarker('starting decoding of gzip/deflated content');
-					// IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
-					// this means there are no Zlib headers, although there should be
-					$this->debug('The gzinflate function exists');
-					$datalen = strlen($data);
-					if ($this->incoming_headers['content-encoding'] == 'deflate') {
-						if ($degzdata = @gzinflate($data)) {
-	    					$data = $degzdata;
-	    					$this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
-	    					if (strlen($data) < $datalen) {
-	    						// test for the case that the payload has been compressed twice
-		    					$this->debug('The inflated payload is smaller than the gzipped one; try again');
-								if ($degzdata = @gzinflate($data)) {
-			    					$data = $degzdata;
-			    					$this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
-								}
-	    					}
-	    				} else {
-	    					$this->debug('Error using gzinflate to inflate the payload');
-	    					$this->setError('Error using gzinflate to inflate the payload');
-	    				}
-					} elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
-						if ($degzdata = @gzinflate(substr($data, 10))) {	// do our best
-							$data = $degzdata;
-	    					$this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
-	    					if (strlen($data) < $datalen) {
-	    						// test for the case that the payload has been compressed twice
-		    					$this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
-								if ($degzdata = @gzinflate(substr($data, 10))) {
-			    					$data = $degzdata;
-			    					$this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
-								}
-	    					}
-	    				} else {
-	    					$this->debug('Error using gzinflate to un-gzip the payload');
-							$this->setError('Error using gzinflate to un-gzip the payload');
-	    				}
-					}
-					//$timer->setMarker('finished decoding of gzip/deflated content');
-					//print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
-					// set decoded payload
-					$this->incoming_payload = $header_data.$lb.$lb.$data;
-    			} else {
-					$this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
-					$this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
-				}
-			} else {
-				$this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
-				$this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
-			}
-		} else {
-			$this->debug('No Content-Encoding header');
-		}
-		
-		if(strlen($data) == 0){
-			$this->debug('no data after headers!');
-			$this->setError('no data present after HTTP headers');
-			return false;
-		}
-		
-		return $data;
-	}
-
-	function setContentType($type, $charset = false) {
-		$this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : '');
-		$this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']);
-	}
-
-	function usePersistentConnection(){
-		if (isset($this->outgoing_headers['Accept-Encoding'])) {
-			return false;
-		}
-		$this->protocol_version = '1.1';
-		$this->persistentConnection = true;
-		$this->outgoing_headers['Connection'] = 'Keep-Alive';
-		$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
-		return true;
-	}
-
-	/**
-	 * parse an incoming Cookie into it's parts
-	 *
-	 * @param	string $cookie_str content of cookie
-	 * @return	array with data of that cookie
-	 * @access	private
-	 */
-	/*
-	 * TODO: allow a Set-Cookie string to be parsed into multiple cookies
-	 */
-	function parseCookie($cookie_str) {
-		$cookie_str = str_replace('; ', ';', $cookie_str) . ';';
-		$data = split(';', $cookie_str);
-		$value_str = $data[0];
-
-		$cookie_param = 'domain=';
-		$start = strpos($cookie_str, $cookie_param);
-		if ($start > 0) {
-			$domain = substr($cookie_str, $start + strlen($cookie_param));
-			$domain = substr($domain, 0, strpos($domain, ';'));
-		} else {
-			$domain = '';
-		}
-
-		$cookie_param = 'expires=';
-		$start = strpos($cookie_str, $cookie_param);
-		if ($start > 0) {
-			$expires = substr($cookie_str, $start + strlen($cookie_param));
-			$expires = substr($expires, 0, strpos($expires, ';'));
-		} else {
-			$expires = '';
-		}
-
-		$cookie_param = 'path=';
-		$start = strpos($cookie_str, $cookie_param);
-		if ( $start > 0 ) {
-			$path = substr($cookie_str, $start + strlen($cookie_param));
-			$path = substr($path, 0, strpos($path, ';'));
-		} else {
-			$path = '/';
-		}
-						
-		$cookie_param = ';secure;';
-		if (strpos($cookie_str, $cookie_param) !== FALSE) {
-			$secure = true;
-		} else {
-			$secure = false;
-		}
-
-		$sep_pos = strpos($value_str, '=');
-
-		if ($sep_pos) {
-			$name = substr($value_str, 0, $sep_pos);
-			$value = substr($value_str, $sep_pos + 1);
-			$cookie= array(	'name' => $name,
-			                'value' => $value,
-							'domain' => $domain,
-							'path' => $path,
-							'expires' => $expires,
-							'secure' => $secure
-							);		
-			return $cookie;
-		}
-		return false;
-	}
-  
-	/**
-	 * sort out cookies for the current request
-	 *
-	 * @param	array $cookies array with all cookies
-	 * @param	boolean $secure is the send-content secure or not?
-	 * @return	string for Cookie-HTTP-Header
-	 * @access	private
-	 */
-	function getCookiesForRequest($cookies, $secure=false) {
-		$cookie_str = '';
-		if ((! is_null($cookies)) && (is_array($cookies))) {
-			foreach ($cookies as $cookie) {
-				if (! is_array($cookie)) {
-					continue;
-				}
-	    		$this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
-				if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
-					if (strtotime($cookie['expires']) <= time()) {
-						$this->debug('cookie has expired');
-						continue;
-					}
-				}
-				if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
-					$domain = preg_quote($cookie['domain']);
-					if (! preg_match("'.*$domain$'i", $this->host)) {
-						$this->debug('cookie has different domain');
-						continue;
-					}
-				}
-				if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
-					$path = preg_quote($cookie['path']);
-					if (! preg_match("'^$path.*'i", $this->path)) {
-						$this->debug('cookie is for a different path');
-						continue;
-					}
-				}
-				if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
-					$this->debug('cookie is secure, transport is not');
-					continue;
-				}
-				$cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
-	    		$this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
-			}
-		}
-		return $cookie_str;
-  }
-}
-
-
+<?php
+
+
+
+
+/**
+* transport class for sending/receiving data via HTTP and HTTPS
+* NOTE: PHP must be compiled with the CURL extension for HTTPS support
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $
+* @access public
+*/
+class soap_transport_http extends nusoap_base {
+
+	var $url = '';
+	var $uri = '';
+	var $digest_uri = '';
+	var $scheme = '';
+	var $host = '';
+	var $port = '';
+	var $path = '';
+	var $request_method = 'POST';
+	var $protocol_version = '1.0';
+	var $encoding = '';
+	var $outgoing_headers = array();
+	var $incoming_headers = array();
+	var $incoming_cookies = array();
+	var $outgoing_payload = '';
+	var $incoming_payload = '';
+	var $useSOAPAction = true;
+	var $persistentConnection = false;
+	var $ch = false;	// cURL handle
+	var $username = '';
+	var $password = '';
+	var $authtype = '';
+	var $digestRequest = array();
+	var $certRequest = array();	// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional)
+								// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
+								// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
+								// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
+								// passphrase: SSL key password/passphrase
+								// verifypeer: default is 1
+								// verifyhost: default is 1
+
+	/**
+	* constructor
+	*/
+	function soap_transport_http($url){
+		parent::nusoap_base();
+		$this->setURL($url);
+		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+		$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
+		$this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
+	}
+
+	function setURL($url) {
+		$this->url = $url;
+
+		$u = parse_url($url);
+		foreach($u as $k => $v){
+			$this->debug("$k = $v");
+			$this->$k = $v;
+		}
+		
+		// add any GET params to path
+		if(isset($u['query']) && $u['query'] != ''){
+            $this->path .= '?' . $u['query'];
+		}
+		
+		// set default port
+		if(!isset($u['port'])){
+			if($u['scheme'] == 'https'){
+				$this->port = 443;
+			} else {
+				$this->port = 80;
+			}
+		}
+		
+		$this->uri = $this->path;
+		$this->digest_uri = $this->uri;
+		
+		// build headers
+		if (!isset($u['port'])) {
+			$this->outgoing_headers['Host'] = $this->host;
+		} else {
+			$this->outgoing_headers['Host'] = $this->host.':'.$this->port;
+		}
+		$this->debug('set Host: ' . $this->outgoing_headers['Host']);
+
+		if (isset($u['user']) && $u['user'] != '') {
+			$this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
+		}
+	}
+	
+	function connect($connection_timeout=0,$response_timeout=30){
+	  	// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
+	  	// "regular" socket.
+	  	// TODO: disabled for now because OpenSSL must be *compiled* in (not just
+	  	//       loaded), and until PHP5 stream_get_wrappers is not available.
+//	  	if ($this->scheme == 'https') {
+//		  	if (version_compare(phpversion(), '4.3.0') >= 0) {
+//		  		if (extension_loaded('openssl')) {
+//		  			$this->scheme = 'ssl';
+//		  			$this->debug('Using SSL over OpenSSL');
+//		  		}
+//		  	}
+//		}
+		$this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// use persistent connection
+		if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
+			if (!feof($this->fp)) {
+				$this->debug('Re-use persistent connection');
+				return true;
+			}
+			fclose($this->fp);
+			$this->debug('Closed persistent connection at EOF');
+		}
+
+		// munge host if using OpenSSL
+		if ($this->scheme == 'ssl') {
+			$host = 'ssl://' . $this->host;
+		} else {
+			$host = $this->host;
+		}
+		$this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);
+
+		// open socket
+		if($connection_timeout > 0){
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
+		} else {
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
+		}
+		
+		// test pointer
+		if(!$this->fp) {
+			$msg = 'Couldn\'t open socket connection to server ' . $this->url;
+			if ($this->errno) {
+				$msg .= ', Error ('.$this->errno.'): '.$this->error_str;
+			} else {
+				$msg .= ' prior to connect().  This is often a problem looking up the host name.';
+			}
+			$this->debug($msg);
+			$this->setError($msg);
+			return false;
+		}
+		
+		// set response timeout
+		$this->debug('set response timeout to ' . $response_timeout);
+		socket_set_timeout( $this->fp, $response_timeout);
+
+		$this->debug('socket connected');
+		return true;
+	  } else if ($this->scheme == 'https') {
+		if (!extension_loaded('curl')) {
+			$this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
+			return false;
+		}
+		$this->debug('connect using https');
+		// init CURL
+		$this->ch = curl_init();
+		// set url
+		$hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host";
+		// add path
+		$hostURL .= $this->path;
+		curl_setopt($this->ch, CURLOPT_URL, $hostURL);
+		// follow location headers (re-directs)
+		curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
+		// ask for headers in the response output
+		curl_setopt($this->ch, CURLOPT_HEADER, 1);
+		// ask for the response output as the return value
+		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
+		// encode
+		// We manage this ourselves through headers and encoding
+//		if(function_exists('gzuncompress')){
+//			curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate');
+//		}
+		// persistent connection
+		if ($this->persistentConnection) {
+			// The way we send data, we cannot use persistent connections, since
+			// there will be some "junk" at the end of our request.
+			//curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true);
+			$this->persistentConnection = false;
+			$this->outgoing_headers['Connection'] = 'close';
+			$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		}
+		// set timeout
+		if ($connection_timeout != 0) {
+			curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout);
+		}
+		// TODO: cURL has added a connection timeout separate from the response timeout
+		//if ($connection_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
+		//}
+		//if ($response_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout);
+		//}
+
+		// recent versions of cURL turn on peer/host checking by default,
+		// while PHP binaries are not compiled with a default location for the
+		// CA cert bundle, so disable peer/host checking.
+//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');		
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
+
+		// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
+		if ($this->authtype == 'certificate') {
+			if (isset($this->certRequest['cainfofile'])) {
+				curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']);
+			}
+			if (isset($this->certRequest['verifypeer'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1);
+			}
+			if (isset($this->certRequest['verifyhost'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1);
+			}
+			if (isset($this->certRequest['sslcertfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
+			}
+			if (isset($this->certRequest['sslkeyfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
+			}
+			if (isset($this->certRequest['passphrase'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']);
+			}
+		}
+		$this->debug('cURL connection set up');
+		return true;
+	  } else {
+		$this->setError('Unknown scheme ' . $this->scheme);
+		$this->debug('Unknown scheme ' . $this->scheme);
+		return false;
+	  }
+	}
+	
+	/**
+	* send the SOAP message via HTTP
+	*
+	* @param    string $data message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) {
+		
+		$this->debug('entered send() with data of length: '.strlen($data));
+
+		$this->tryagain = true;
+		$tries = 0;
+		while ($this->tryagain) {
+			$this->tryagain = false;
+			if ($tries++ < 2) {
+				// make connnection
+				if (!$this->connect($timeout, $response_timeout)){
+					return false;
+				}
+				
+				// send request
+				if (!$this->sendRequest($data, $cookies)){
+					return false;
+				}
+				
+				// get response
+				$respdata = $this->getResponse();
+			} else {
+				$this->setError('Too many tries to get an OK response');
+			}
+		}		
+		$this->debug('end of send()');
+		return $respdata;
+	}
+
+
+	/**
+	* send the SOAP message via HTTPS 1.0 using CURL
+	*
+	* @param    string $msg message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
+		return $this->send($data, $timeout, $response_timeout, $cookies);
+	}
+	
+	/**
+	* if authenticating, set user credentials here
+	*
+	* @param    string $username
+	* @param    string $password
+	* @param	string $authtype (basic, digest, certificate)
+	* @param	array $digestRequest (keys must be nonce, nc, realm, qop)
+	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
+	* @access   public
+	*/
+	function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) {
+		$this->debug("Set credentials for authtype $authtype");
+		// cf. RFC 2617
+		if ($authtype == 'basic') {
+			$this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password);
+		} elseif ($authtype == 'digest') {
+			if (isset($digestRequest['nonce'])) {
+				$digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
+				
+				// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
+	
+				// A1 = unq(username-value) ":" unq(realm-value) ":" passwd
+				$A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
+	
+				// H(A1) = MD5(A1)
+				$HA1 = md5($A1);
+	
+				// A2 = Method ":" digest-uri-value
+				$A2 = 'POST:' . $this->digest_uri;
+	
+				// H(A2)
+				$HA2 =  md5($A2);
+	
+				// KD(secret, data) = H(concat(secret, ":", data))
+				// if qop == auth:
+				// request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
+				//                              ":" nc-value
+				//                              ":" unq(cnonce-value)
+				//                              ":" unq(qop-value)
+				//                              ":" H(A2)
+				//                            ) <">
+				// if qop is missing,
+				// request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
+	
+				$unhashedDigest = '';
+				$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
+				$cnonce = $nonce;
+				if ($digestRequest['qop'] != '') {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
+				} else {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
+				}
+	
+				$hashedDigest = md5($unhashedDigest);
+	
+				$this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"';
+			}
+		} elseif ($authtype == 'certificate') {
+			$this->certRequest = $certRequest;
+		}
+		$this->username = $username;
+		$this->password = $password;
+		$this->authtype = $authtype;
+		$this->digestRequest = $digestRequest;
+		
+		if (isset($this->outgoing_headers['Authorization'])) {
+			$this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...');
+		} else {
+			$this->debug('Authorization header not set');
+		}
+	}
+	
+	/**
+	* set the soapaction value
+	*
+	* @param    string $soapaction
+	* @access   public
+	*/
+	function setSOAPAction($soapaction) {
+		$this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"';
+		$this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']);
+	}
+	
+	/**
+	* use http encoding
+	*
+	* @param    string $enc encoding style. supported values: gzip, deflate, or both
+	* @access   public
+	*/
+	function setEncoding($enc='gzip, deflate') {
+		if (function_exists('gzdeflate')) {
+			$this->protocol_version = '1.1';
+			$this->outgoing_headers['Accept-Encoding'] = $enc;
+			$this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']);
+			if (!isset($this->outgoing_headers['Connection'])) {
+				$this->outgoing_headers['Connection'] = 'close';
+				$this->persistentConnection = false;
+				$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+			}
+			set_magic_quotes_runtime(0);
+			// deprecated
+			$this->encoding = $enc;
+		}
+	}
+	
+	/**
+	* set proxy info here
+	*
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @access   public
+	*/
+	function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
+		$this->uri = $this->url;
+		$this->host = $proxyhost;
+		$this->port = $proxyport;
+		if ($proxyusername != '' && $proxypassword != '') {
+			$this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword);
+			$this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']);
+		}
+	}
+	
+	/**
+	* decode a string that is encoded w/ "chunked' transfer encoding
+ 	* as defined in RFC2068 19.4.6
+	*
+	* @param    string $buffer
+	* @param    string $lb
+	* @returns	string
+	* @access   public
+	* @deprecated
+	*/
+	function decodeChunked($buffer, $lb){
+		// length := 0
+		$length = 0;
+		$new = '';
+		
+		// read chunk-size, chunk-extension (if any) and CRLF
+		// get the position of the linebreak
+		$chunkend = strpos($buffer, $lb);
+		if ($chunkend == FALSE) {
+			$this->debug('no linebreak found in decodeChunked');
+			return $new;
+		}
+		$temp = substr($buffer,0,$chunkend);
+		$chunk_size = hexdec( trim($temp) );
+		$chunkstart = $chunkend + strlen($lb);
+		// while (chunk-size > 0) {
+		while ($chunk_size > 0) {
+			$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
+			$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
+		  	
+			// Just in case we got a broken connection
+		  	if ($chunkend == FALSE) {
+		  	    $chunk = substr($buffer,$chunkstart);
+				// append chunk-data to entity-body
+		    	$new .= $chunk;
+		  	    $length += strlen($chunk);
+		  	    break;
+			}
+			
+		  	// read chunk-data and CRLF
+		  	$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+		  	// append chunk-data to entity-body
+		  	$new .= $chunk;
+		  	// length := length + chunk-size
+		  	$length += strlen($chunk);
+		  	// read chunk-size and CRLF
+		  	$chunkstart = $chunkend + strlen($lb);
+			
+		  	$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
+			if ($chunkend == FALSE) {
+				break; //Just in case we got a broken connection
+			}
+			$temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+			$chunk_size = hexdec( trim($temp) );
+			$chunkstart = $chunkend;
+		}
+		return $new;
+	}
+	
+	/*
+	 *	Writes payload, including HTTP headers, to $this->outgoing_payload.
+	 */
+	function buildPayload($data, $cookie_str = '') {
+		// add content-length header
+		$this->outgoing_headers['Content-Length'] = strlen($data);
+		$this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']);
+
+		// start building outgoing payload:
+		$req = "$this->request_method $this->uri HTTP/$this->protocol_version";
+		$this->debug("HTTP request: $req");
+		$this->outgoing_payload = "$req\r\n";
+
+		// loop thru headers, serializing
+		foreach($this->outgoing_headers as $k => $v){
+			$hdr = $k.': '.$v;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// add any cookies
+		if ($cookie_str != '') {
+			$hdr = 'Cookie: '.$cookie_str;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// header/body separator
+		$this->outgoing_payload .= "\r\n";
+		
+		// add data
+		$this->outgoing_payload .= $data;
+	}
+
+	function sendRequest($data, $cookies = NULL) {
+		// build cookie string
+		$cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));
+
+		// build payload
+		$this->buildPayload($data, $cookie_str);
+
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// send payload
+		if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
+			$this->setError('couldn\'t write message data to socket');
+			$this->debug('couldn\'t write message data to socket');
+			return false;
+		}
+		$this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
+		return true;
+	  } else if ($this->scheme == 'https') {
+		// set payload
+		// TODO: cURL does say this should only be the verb, and in fact it
+		// turns out that the URI and HTTP version are appended to this, which
+		// some servers refuse to work with
+		//curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
+		foreach($this->outgoing_headers as $k => $v){
+			$curl_headers[] = "$k: $v";
+		}
+		if ($cookie_str != '') {
+			$curl_headers[] = 'Cookie: ' . $cookie_str;
+		}
+		curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers);
+		if ($this->request_method == "POST") {
+	  		curl_setopt($this->ch, CURLOPT_POST, 1);
+	  		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
+	  	} else {
+	  	}
+		$this->debug('set cURL payload');
+		return true;
+	  }
+	}
+
+	function getResponse(){
+		$this->incoming_payload = '';
+	    
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+	    // loop until headers have been retrieved
+	    $data = '';
+	    while (!isset($lb)){
+
+			// We might EOF during header read.
+			if(feof($this->fp)) {
+				$this->incoming_payload = $data;
+				$this->debug('found no headers before EOF after length ' . strlen($data));
+				$this->debug("received before EOF:\n" . $data);
+				$this->setError('server failed to send headers');
+				return false;
+			}
+
+			$tmp = fgets($this->fp, 256);
+			$tmplen = strlen($tmp);
+			$this->debug("read line of $tmplen bytes: " . trim($tmp));
+
+			if ($tmplen == 0) {
+				$this->incoming_payload = $data;
+				$this->debug('socket read of headers timed out after length ' . strlen($data));
+				$this->debug("read before timeout: " . $data);
+				$this->setError('socket read of headers timed out');
+				return false;
+			}
+
+			$data .= $tmp;
+			$pos = strpos($data,"\r\n\r\n");
+			if($pos > 1){
+				$lb = "\r\n";
+			} else {
+				$pos = strpos($data,"\n\n");
+				if($pos > 1){
+					$lb = "\n";
+				}
+			}
+			// remove 100 header
+			if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
+				unset($lb);
+				$data = '';
+			}//
+		}
+		// store header data
+		$this->incoming_payload .= $data;
+		$this->debug('found end of headers after length ' . strlen($data));
+		// process headers
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$this->incoming_headers = array();
+		$this->incoming_cookies = array();
+		foreach($header_array as $header_line){
+			$arr = explode(':',$header_line, 2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+		
+		// loop until msg has been received
+		if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
+			$content_length =  2147483647;	// ignore any content-length header
+			$chunked = true;
+			$this->debug("want to read chunked content");
+		} elseif (isset($this->incoming_headers['content-length'])) {
+			$content_length = $this->incoming_headers['content-length'];
+			$chunked = false;
+			$this->debug("want to read content of length $content_length");
+		} else {
+			$content_length =  2147483647;
+			$chunked = false;
+			$this->debug("want to read content to EOF");
+		}
+		$data = '';
+		do {
+			if ($chunked) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk line of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk length timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk length timed out');
+					return false;
+				}
+				$content_length = hexdec(trim($tmp));
+				$this->debug("chunk length $content_length");
+			}
+			$strlen = 0;
+		    while (($strlen < $content_length) && (!feof($this->fp))) {
+		    	$readlen = min(8192, $content_length - $strlen);
+				$tmp = fread($this->fp, $readlen);
+				$tmplen = strlen($tmp);
+				$this->debug("read buffer of $tmplen bytes");
+				if (($tmplen == 0) && (!feof($this->fp))) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of body timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of body timed out');
+					return false;
+				}
+				$strlen += $tmplen;
+				$data .= $tmp;
+			}
+			if ($chunked && ($content_length > 0)) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk terminator of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk terminator timed out');
+					return false;
+				}
+			}
+		} while ($chunked && ($content_length > 0) && (!feof($this->fp)));
+		if (feof($this->fp)) {
+			$this->debug('read to EOF');
+		}
+		$this->debug('read body of length ' . strlen($data));
+		$this->incoming_payload .= $data;
+		$this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
+		
+		// close filepointer
+		if(
+			(isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
+			(! $this->persistentConnection) || feof($this->fp)){
+			fclose($this->fp);
+			$this->fp = false;
+			$this->debug('closed socket');
+		}
+		
+		// connection was closed unexpectedly
+		if($this->incoming_payload == ''){
+			$this->setError('no response from server');
+			return false;
+		}
+		
+		// decode transfer-encoding
+//		if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
+//			if(!$data = $this->decodeChunked($data, $lb)){
+//				$this->setError('Decoding of chunked data failed');
+//				return false;
+//			}
+			//print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
+			// set decoded payload
+//			$this->incoming_payload = $header_data.$lb.$lb.$data;
+//		}
+	
+	  } else if ($this->scheme == 'https') {
+		// send and receive
+		$this->debug('send and receive with cURL');
+		$this->incoming_payload = curl_exec($this->ch);
+		$data = $this->incoming_payload;
+
+        $cErr = curl_error($this->ch);
+		if ($cErr != '') {
+        	$err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
+        	// TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
+			foreach(curl_getinfo($this->ch) as $k => $v){
+				$err .= "$k: $v<br>";
+			}
+			$this->debug($err);
+			$this->setError($err);
+			curl_close($this->ch);
+	    	return false;
+		} else {
+			//echo '<pre>';
+			//var_dump(curl_getinfo($this->ch));
+			//echo '</pre>';
+		}
+		// close curl
+		$this->debug('No cURL error, closing cURL');
+		curl_close($this->ch);
+		
+		// remove 100 header(s)
+		while (ereg('^HTTP/1.1 100',$data)) {
+			if ($pos = strpos($data,"\r\n\r\n")) {
+				$data = ltrim(substr($data,$pos));
+			} elseif($pos = strpos($data,"\n\n") ) {
+				$data = ltrim(substr($data,$pos));
+			}
+		}
+		
+		// separate content from HTTP headers
+		if ($pos = strpos($data,"\r\n\r\n")) {
+			$lb = "\r\n";
+		} elseif( $pos = strpos($data,"\n\n")) {
+			$lb = "\n";
+		} else {
+			$this->debug('no proper separation of headers and document');
+			$this->setError('no proper separation of headers and document');
+			return false;
+		}
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$data = ltrim(substr($data,$pos));
+		$this->debug('found proper separation of headers and document');
+		$this->debug('cleaned data, stringlen: '.strlen($data));
+		// clean headers
+		foreach ($header_array as $header_line) {
+			$arr = explode(':',$header_line,2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+	  }
+
+		$arr = explode(' ', $header_array[0], 3);
+		$http_version = $arr[0];
+		$http_status = intval($arr[1]);
+		$http_reason = count($arr) > 2 ? $arr[2] : '';
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['location']) && $http_status == 301) {
+ 			$this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']);
+ 			$this->setURL($this->incoming_headers['location']);
+			$this->tryagain = true;
+			return false;
+		}
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
+ 			$this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
+ 			if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
+ 				$this->debug('Server wants digest authentication');
+ 				// remove "Digest " from our elements
+ 				$digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
+ 				
+ 				// parse elements into array
+ 				$digestElements = explode(',', $digestString);
+ 				foreach ($digestElements as $val) {
+ 					$tempElement = explode('=', trim($val), 2);
+ 					$digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
+ 				}
+
+				// should have (at least) qop, realm, nonce
+ 				if (isset($digestRequest['nonce'])) {
+ 					$this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
+ 					$this->tryagain = true;
+ 					return false;
+ 				}
+ 			}
+			$this->debug('HTTP authentication failed');
+			$this->setError('HTTP authentication failed');
+			return false;
+ 		}
+		
+		if (
+			($http_status >= 300 && $http_status <= 307) ||
+			($http_status >= 400 && $http_status <= 417) ||
+			($http_status >= 501 && $http_status <= 505)
+		   ) {
+			$this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)");
+			return false;
+		}
+
+		// decode content-encoding
+		if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
+			if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
+    			// if decoding works, use it. else assume data wasn't gzencoded
+    			if(function_exists('gzinflate')){
+					//$timer->setMarker('starting decoding of gzip/deflated content');
+					// IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
+					// this means there are no Zlib headers, although there should be
+					$this->debug('The gzinflate function exists');
+					$datalen = strlen($data);
+					if ($this->incoming_headers['content-encoding'] == 'deflate') {
+						if ($degzdata = @gzinflate($data)) {
+	    					$data = $degzdata;
+	    					$this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The inflated payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate($data)) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to inflate the payload');
+	    					$this->setError('Error using gzinflate to inflate the payload');
+	    				}
+					} elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
+						if ($degzdata = @gzinflate(substr($data, 10))) {	// do our best
+							$data = $degzdata;
+	    					$this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate(substr($data, 10))) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to un-gzip the payload');
+							$this->setError('Error using gzinflate to un-gzip the payload');
+	    				}
+					}
+					//$timer->setMarker('finished decoding of gzip/deflated content');
+					//print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
+					// set decoded payload
+					$this->incoming_payload = $header_data.$lb.$lb.$data;
+    			} else {
+					$this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+					$this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+				}
+			} else {
+				$this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+				$this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+			}
+		} else {
+			$this->debug('No Content-Encoding header');
+		}
+		
+		if(strlen($data) == 0){
+			$this->debug('no data after headers!');
+			$this->setError('no data present after HTTP headers');
+			return false;
+		}
+		
+		return $data;
+	}
+
+	function setContentType($type, $charset = false) {
+		$this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : '');
+		$this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']);
+	}
+
+	function usePersistentConnection(){
+		if (isset($this->outgoing_headers['Accept-Encoding'])) {
+			return false;
+		}
+		$this->protocol_version = '1.1';
+		$this->persistentConnection = true;
+		$this->outgoing_headers['Connection'] = 'Keep-Alive';
+		$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		return true;
+	}
+
+	/**
+	 * parse an incoming Cookie into it's parts
+	 *
+	 * @param	string $cookie_str content of cookie
+	 * @return	array with data of that cookie
+	 * @access	private
+	 */
+	/*
+	 * TODO: allow a Set-Cookie string to be parsed into multiple cookies
+	 */
+	function parseCookie($cookie_str) {
+		$cookie_str = str_replace('; ', ';', $cookie_str) . ';';
+		$data = split(';', $cookie_str);
+		$value_str = $data[0];
+
+		$cookie_param = 'domain=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$domain = substr($cookie_str, $start + strlen($cookie_param));
+			$domain = substr($domain, 0, strpos($domain, ';'));
+		} else {
+			$domain = '';
+		}
+
+		$cookie_param = 'expires=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$expires = substr($cookie_str, $start + strlen($cookie_param));
+			$expires = substr($expires, 0, strpos($expires, ';'));
+		} else {
+			$expires = '';
+		}
+
+		$cookie_param = 'path=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ( $start > 0 ) {
+			$path = substr($cookie_str, $start + strlen($cookie_param));
+			$path = substr($path, 0, strpos($path, ';'));
+		} else {
+			$path = '/';
+		}
+						
+		$cookie_param = ';secure;';
+		if (strpos($cookie_str, $cookie_param) !== FALSE) {
+			$secure = true;
+		} else {
+			$secure = false;
+		}
+
+		$sep_pos = strpos($value_str, '=');
+
+		if ($sep_pos) {
+			$name = substr($value_str, 0, $sep_pos);
+			$value = substr($value_str, $sep_pos + 1);
+			$cookie= array(	'name' => $name,
+			                'value' => $value,
+							'domain' => $domain,
+							'path' => $path,
+							'expires' => $expires,
+							'secure' => $secure
+							);		
+			return $cookie;
+		}
+		return false;
+	}
+  
+	/**
+	 * sort out cookies for the current request
+	 *
+	 * @param	array $cookies array with all cookies
+	 * @param	boolean $secure is the send-content secure or not?
+	 * @return	string for Cookie-HTTP-Header
+	 * @access	private
+	 */
+	function getCookiesForRequest($cookies, $secure=false) {
+		$cookie_str = '';
+		if ((! is_null($cookies)) && (is_array($cookies))) {
+			foreach ($cookies as $cookie) {
+				if (! is_array($cookie)) {
+					continue;
+				}
+	    		$this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
+				if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
+					if (strtotime($cookie['expires']) <= time()) {
+						$this->debug('cookie has expired');
+						continue;
+					}
+				}
+				if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
+					$domain = preg_quote($cookie['domain']);
+					if (! preg_match("'.*$domain$'i", $this->host)) {
+						$this->debug('cookie has different domain');
+						continue;
+					}
+				}
+				if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
+					$path = preg_quote($cookie['path']);
+					if (! preg_match("'^$path.*'i", $this->path)) {
+						$this->debug('cookie is for a different path');
+						continue;
+					}
+				}
+				if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
+					$this->debug('cookie is secure, transport is not');
+					continue;
+				}
+				$cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
+	    		$this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
+			}
+		}
+		return $cookie_str;
+  }
+}
+
+
 ?>

Modified: vtigercrm/trunk/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/CommonUtils.php (original)
+++ vtigercrm/trunk/include/utils/CommonUtils.php Tue Oct 31 03:40:43 2006
@@ -219,6 +219,33 @@
 	$log->debug("Exiting from_html method ...");
         return $string;
 }
+
+/**
+ *	Function used to decodes the given single quote and double quote only. This function used for popup selection 
+ *	@param string $string - string to be converted, $encode - flag to decode
+ *	@return string $string - the decoded value in string fromat where as only single and double quotes will be decoded
+ */
+
+function popup_from_html($string, $encode=true)
+{
+	global $log;
+	$log->debug("Entering popup_from_html(".$string.",".$encode.") method ...");
+
+	$popup_toHtml = array(
+        			'"' => '&quot;',
+			        "'" =>  '&#039;',
+			     );
+
+        //if($encode && is_string($string))$string = html_entity_decode($string, ENT_QUOTES);
+        if($encode && is_string($string))
+	{
+                $string = addslashes(str_replace(array_values($popup_toHtml), array_keys($popup_toHtml), $string));
+        }
+
+	$log->debug("Exiting popup_from_html method ...");
+        return $string;
+}
+
 
 /** To get the Currency of the specified user
   * @param $id -- The user Id:: Type integer
@@ -1973,7 +2000,10 @@
 
 	foreach($object_column_fields as $fieldname => $fieldlabel)
 	{
-		$description .= $fieldlabel.' : <b>'.$focus->column_fields[$fieldname].'</b><br>';
+		//Get the translated string
+		$temp_label = isset($app_strings[$fieldlabel])?$app_strings[$fieldlabel]:(isset($mod_strings[$fieldlabel])?$mod_strings[$fieldlabel]:$fieldlabel);
+
+		$description .= $temp_label.' : <b>'.$focus->column_fields[$fieldname].'</b><br>';
 	}
 
 	$description .= '<br><br>Thank You <br>';
@@ -1996,6 +2026,26 @@
 	$change_owner = get_select_options_with_id($usernamelist,'admin');
 	$log->debug("Exiting getUserslist method ...");
 	return $change_owner;
+}
+
+
+function getGroupslist()
+{
+	global $log;
+	$log->debug("Entering getGroupslist() method ...");
+	global $adb;
+	$result=$adb->query("select * from vtiger_groups");
+	
+	for($i=0;$i<$adb->num_rows($result);$i++)
+	{
+	       $groupidlist[$i]=$adb->query_result($result,$i,'groupid');
+	       $groupnamelist[$groupidlist[$i]]=$adb->query_result($result,$i,'groupname');
+	       
+	}
+	$change_groups_owner = get_select_options_with_id($groupnamelist,'');
+	$log->debug("Exiting getGroupslist method ...");
+
+	return $change_groups_owner;
 }
 
 
@@ -2039,214 +2089,30 @@
 	global $log;
 	$log->debug("Entering getEntityName(".$module.") method ...");
 		
-	switch ($module)
-	{
-		case "Accounts" : $query = "select accountname from vtiger_account where accountid in (".$list.")";
-				  $result = $adb->query($query);
-				  $numrows = $adb->num_rows($result);
-				  $account_name = array();	
-				  	for ($i = 0; $i < $numrows; $i++)
-				  	{
-				 		$acc_id = $ids_list[$i];
-						$account_name[$acc_id] = $adb->query_result($result,$i,'accountname');
-				  	}
-					return $account_name;
-					break;
-
-		  case "Leads" :  $query = "select concat(firstname,' ',lastname) as leadname from vtiger_leaddetails where leadid in (".$list.")";
-				  $result = $adb->query($query);
-				  $numrows = $adb->num_rows($result);
-				  $lead_name = array();
-					for($i = 0; $i < $numrows; $i++)
-					{
-						$lead_id = $ids_list[$i];
-						$lead_name[$lead_id] = $adb->query_result($result,$i,'leadname');
-					}	
-								
-					return $lead_name;
-					break;
-		
-	       case "Contacts" : $query = "select concat(firstname,' ',lastname) as contactname from vtiger_contactdetails where contactid in (".$list.")"; 
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $contact_name = array();
-					for($i=0; $i < $numrows; $i++)
-					{
-						$cont_id = $ids_list[$i];
-						$contact_name[$cont_id] = $adb->query_result($result,$i,'contactname');
-					}
-					
-					return $contact_name;
-					break;
-
-	    case "Potentials"  : $query = "select potentialname from vtiger_potential where potentialid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $potential_name = array();
-					for($i=0; $i < $numrows; $i++)
-					{
-						$pot_id = $ids_list[$i];
-						$potential_name[$pot_id] = $adb->query_result($result,$i,'potentialname');
-					}
-					
-					return $potential_name;
-					break;
-
-	        case "Quotes"  : $query = "select subject from vtiger_quotes where quoteid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $quote_subject = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$quote_id = $ids_list[$i];
-						$quote_subject[$quote_id] = $adb->query_result($result,$i,'subject'); 
-				 	}
-					
-					return $quote_subject;
-					break;	
-
-	    case "SalesOrder"  : $query = "select subject from vtiger_salesorder where salesorderid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $so_subject = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$so_id = $ids_list[$i];
-						$so_subject[$so_id] = $adb->query_result($result,$i,'subject'); 
-				 	}
-					
-					return $so_subject;
-					break;
-	
-	       case "Invoice"  : $query = "select subject from vtiger_invoice where invoiceid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $inv_subject = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$inv_id = $ids_list[$i];
-						$inv_subject[$inv_id] = $adb->query_result($result,$i,'subject'); 
-				 	}
-					
-					return $inv_subject;
-					break;
-		
-	      case "Products"  : $query = "select productname from vtiger_products where productid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $product_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$prod_id = $ids_list[$i];
-						$product_name[$prod_id] = $adb->query_result($result,$i,'productname'); 
-				 	}
-					
-					return $product_name;
-					break;
-
-	   case "PriceBooks"  :  $query = "select bookname from vtiger_pricebook where pricebookid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $pbook_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$pbook_id = $ids_list[$i];
-						$pbook_name[$pbook_id] = $adb->query_result($result,$i,'bookname'); 
-				 	}
-					
-					return $pbook_name;
-					break;
-
-	        case "Notes"  :  $query = "select title from vtiger_notes where notesid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $notes_title = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$note_id = $ids_list[$i];
-						$notes_title[$note_id] = $adb->query_result($result,$i,'title'); 
-				 	}
-					
-					return $notes_title;
-					break;
-		
-	  case "Calendar"  :  $query = "select subject from vtiger_activity where activityid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $activity_subject = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$act_id = $ids_list[$i];
-						$activity_subject[$act_id] = $adb->query_result($result,$i,'subject'); 
-				 	}
-					
-					return $activity_subject;
-					break;
-
-	    case "Campaigns"  :  $query = "select campaignname from vtiger_campaign where campaignid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $campaign_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$cmpn_id = $ids_list[$i];
-						$campaign_name[$cmpn_id] = $adb->query_result($result,$i,'campaignname'); 
-				 	}
-					
-					return $campaign_name;
-					break;
-
-	          case "Faq"  :  $query = "select question from vtiger_faq where id in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $faq_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$faq_id = $ids_list[$i];
-						$faq_name[$faq_id] = $adb->query_result($result,$i,'question'); 
-				 	}
-					
-					return $faq_name;
-					break;
-		
-	      case "Vendors"  :  $query = "select vendorname from vtiger_vendor where vendorid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $vendor_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$ven_id = $ids_list[$i];
-						$vendor_name[$ven_id] = $adb->query_result($result,$i,'vendorname'); 
-				 	}
-					
-					return $vendor_name;
-					break;
-
-	case "PurchaseOrder"  :  $query = "select subject from vtiger_purchaseorder where purchaseorderid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $po_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$po_id = $ids_list[$i];
-						$po_name[$po_id] = $adb->query_result($result,$i,'subject'); 
-				 	}
-					
-					return $po_name;
-					break;
-
-	     case "HelpDesk"  :  $query = "select title from vtiger_troubletickets where ticketid in (".$list.")";
-				 $result = $adb->query($query);
-				 $numrows = $adb->num_rows($result);
-				 $ticket_name = array();		    	
-					for($i=0; $i < $numrows; $i++)
-					{
-						$tick_id = $ids_list[$i];
-						$ticket_name[$tick_id] = $adb->query_result($result,$i,'title'); 
-				 	}
-					
-					return $ticket_name;
-					break;
+	if($module != '')
+	{
+		 $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$module'";
+		 $result = $adb->query($query);
+		 $fieldsname = $adb->query_result($result,0,'fieldname');
+		 $tablename = $adb->query_result($result,0,'tablename'); 
+		 $entityidfield = $adb->query_result($result,0,'entityidfield'); 
+		 if(!(strpos($fieldsname,',') === false))
+		 {
+			 $fieldlists = explode(',',$fieldsname);
+			 $fieldsname = "concat(";
+			 $fieldsname = $fieldsname.implode(",' ',",$fieldlists);
+			 $fieldsname = $fieldsname.")";
+		 }	
+		 $query1 = "select $fieldsname as entityname from $tablename where $entityidfield in (".$list.")"; 
+		 $result = $adb->query($query1);
+		 $numrows = $adb->num_rows($result);
+	  	 $account_name = array();
+		 for ($i = 0; $i < $numrows; $i++)
+		 {
+			$entity_id = $ids_list[$i];
+			$entity_info[$entity_id] = $adb->query_result($result,$i,'entityname');
+		 }
+		 return $entity_info;
 	}
 	$log->debug("Exiting getEntityName method ...");
 }

Modified: vtigercrm/trunk/include/utils/DetailViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/DetailViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/DetailViewUtils.php Tue Oct 31 03:40:43 2006
@@ -333,7 +333,8 @@
 		$value = $col_fields[$fieldname];
 		if($value == 1)
 		{
-			$display_val = 'yes';
+			//Since "yes" is not been translated it is given as app strings here..
+			$display_val = $app_strings['yes'];
 		}
 		else
 		{
@@ -945,7 +946,8 @@
               $col_fields[$fieldname]='';
 	 if($uitype == 1 && ($fieldname=='expectedrevenue' || $fieldname=='budgetcost' || $fieldname=='actualcost' || $fieldname=='expectedroi' || $fieldname=='actualroi' ))
 	 {
-		$label_fld[] = convertFromDollar($col_fields[$fieldname],$rate);
+		  $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']);
+		  $label_fld[] = convertFromDollar($col_fields[$fieldname],$rate_symbol['rate']);
 	 }
 	else
 		$label_fld[] = $col_fields[$fieldname];

Modified: vtigercrm/trunk/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/EditViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/EditViewUtils.php Tue Oct 31 03:40:43 2006
@@ -863,15 +863,15 @@
 				$nemail=count($realid);
 
 				if ($pmodule=='Accounts'){
-					require_once('modules/Accounts/Account.php');
-					$myfocus = new Account();
+					require_once('modules/Accounts/Accounts.php');
+					$myfocus = new Accounts();
 					$myfocus->retrieve_entity_info($entityid,"Accounts");
 					$fullname=br2nl($myfocus->column_fields['accountname']);
 					$account_selected = 'selected';
 				}
 				elseif ($pmodule=='Contacts'){
-					require_once('modules/Contacts/Contact.php');
-					$myfocus = new Contact();
+					require_once('modules/Contacts/Contacts.php');
+					$myfocus = new Contacts();
 					$myfocus->retrieve_entity_info($entityid,"Contacts");
 					$fname=br2nl($myfocus->column_fields['firstname']);
 					$lname=br2nl($myfocus->column_fields['lastname']);
@@ -879,8 +879,8 @@
 					$contact_selected = 'selected';
 				}
 				elseif ($pmodule=='Leads'){
-					require_once('modules/Leads/Lead.php');
-					$myfocus = new Lead();
+					require_once('modules/Leads/Leads.php');
+					$myfocus = new Leads();
 					$myfocus->retrieve_entity_info($entityid,"Leads");
 					$fname=br2nl($myfocus->column_fields['firstname']);
 					$lname=br2nl($myfocus->column_fields['lastname']);
@@ -1233,7 +1233,8 @@
 		$editview_label[]=$mod_strings[$fieldlabel];
 		if($uitype == 1 && ($fieldname=='expectedrevenue' || $fieldname=='budgetcost' || $fieldname=='actualcost' || $fieldname=='expectedroi' || $fieldname=='actualroi' ) && ($module_name=='Campaigns'))
 		{
-			$fieldvalue[] = convertFromDollar($value,$rate);
+			$rate_symbol = getCurrencySymbolandCRate($user_info['currency_id']);
+			$fieldvalue[] = convertFromDollar($value,$rate_symbol['rate']);
 		}
 		else
 			$fieldvalue[] = $value;

Modified: vtigercrm/trunk/include/utils/InventoryUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/InventoryUtils.php (original)
+++ vtigercrm/trunk/include/utils/InventoryUtils.php Tue Oct 31 03:40:43 2006
@@ -469,7 +469,7 @@
  *	@param $update_prod_stock - true or false (default), if true we have to update the stock for PO only
  *	@return void
  */
-function saveInventoryProductDetails($focus, $module, $update_prod_stock='false', $updateStockAndDemand='false', $updateDemand='false')
+function saveInventoryProductDetails($focus, $module, $update_prod_stock='false', $updateDemand='')
 {
 	global $log, $adb;
 	$log->debug("Entering into function saveInventoryProductDetails($focus, $module).");
@@ -488,6 +488,10 @@
 	}
 
 	$tot_no_prod = $_REQUEST['totalProductCount'];
+
+	//If the taxtype is group then retrieve all available taxes, else retrive associated taxes for each product inside loop
+	if($_REQUEST['taxtype'] == 'group')
+		$all_available_taxes = getAllTaxes('available');
 
 	$prod_seq=1;
 	for($i=1; $i<=$tot_no_prod; $i++)
@@ -510,12 +514,11 @@
 		}
 		if($module == 'SalesOrder')
 		{
-			if($updateStockAndDemand == 'true')
+			if($updateDemand == '-')
 			{
-				deductFromProductStock($prod_id,$qty);
 				deductFromProductDemand($prod_id,$qty);
 			}
-			if($updateDemand == 'true')
+			elseif($updateDemand == '+')
 			{
 				addToProductDemand($prod_id,$qty);
 			}
@@ -531,8 +534,6 @@
 			updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,$module);
 		}
 
-		$taxes_for_product = getTaxDetailsForProduct($prod_id,'all');
-
 		//we should update discount and tax details
 		$updatequery = "update vtiger_inventoryproductrel set ";
 
@@ -547,12 +548,11 @@
 			$updatequery .= " discount_amount='".$discount_amount."',";
 		}
 
-
 		if($_REQUEST['taxtype'] == 'group')
 		{
-			for($tax_count=0;$tax_count<count($taxes_for_product);$tax_count++)
+			for($tax_count=0;$tax_count<count($all_available_taxes);$tax_count++)
 			{
-				$tax_name = $taxes_for_product[$tax_count]['taxname'];
+				$tax_name = $all_available_taxes[$tax_count]['taxname'];
 				$request_tax_name = $tax_name."_group_percentage";
 			
 				$updatequery .= "$tax_name = '".$_REQUEST[$request_tax_name]."',";
@@ -561,6 +561,7 @@
 		}
 		else
 		{
+			$taxes_for_product = getTaxDetailsForProduct($prod_id,'all');
 			for($tax_count=0;$tax_count<count($taxes_for_product);$tax_count++)
 			{
 				$tax_name = $taxes_for_product[$tax_count]['taxname'];

Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Tue Oct 31 03:40:43 2006
@@ -1309,12 +1309,13 @@
 					}
 
 					$temp_val = str_replace("'",'\"',$temp_val);
+					$temp_val = popup_from_html($temp_val);
 
 					//Added to avoid the error when select SO from Invoice through AjaxEdit
 					if($module == 'SalesOrder')
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_specific("'.$entity_id.'", "'.br2nl($temp_val).'","'.$_REQUEST['form'].'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'set_return_specific("'.$entity_id.'", "'.br2nl($temp_val).'","'.$_REQUEST['form'].'");\'>'.$temp_val.'</a>';
 					else
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_specific("'.$entity_id.'", "'.br2nl($temp_val).'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'set_return_specific("'.$entity_id.'", "'.br2nl($temp_val).'");\'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "detailview")
 				{
@@ -1323,18 +1324,20 @@
 					elseif($colname == "lastname" && $module == 'Leads')
 						$firstname=$adb->query_result($list_result,$list_result_count,'firstname');
 					$temp_val =$temp_val.' '.$firstname;
+					$temp_val = popup_from_html($temp_val);
 
 					$focus->record_id = $_REQUEST['recordid'];
 					if($_REQUEST['return_module'] == "Calendar")
 					{
-						$value = '<a href="a" id="calendarCont'.$entity_id.'" LANGUAGE=javascript onclick=\'add_data_to_relatedlist_incal("'.$entity_id.'","'.$temp_val.'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" id="calendarCont'.$entity_id.'" LANGUAGE=javascript onclick=\'add_data_to_relatedlist_incal("'.$entity_id.'","'.$temp_val.'");\'>'.$temp_val.'</a>';
 					}
 					else
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'add_data_to_relatedlist("'.$entity_id.'","'.$focus->record_id.'","'.$module.'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'add_data_to_relatedlist("'.$entity_id.'","'.$focus->record_id.'","'.$module.'");\'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "formname_specific")
 				{
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_formname_specific("'.$_REQUEST['form'].'", "'.$entity_id.'", "'.br2nl($temp_val).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_formname_specific("'.$_REQUEST['form'].'", "'.$entity_id.'", "'.br2nl($temp_val).'");\'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "inventory_prod")
 				{
@@ -1354,7 +1357,8 @@
 					$unitprice = convertFromDollar($unitprice,$rate);
 					$qty_stock=$adb->query_result($list_result,$list_result_count,'qtyinstock');
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_inventory("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$unitprice.'", "'.$qty_stock.'","'.$tax_str.'","'.$row_id.'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_inventory("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$unitprice.'", "'.$qty_stock.'","'.$tax_str.'","'.$row_id.'");\'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "inventory_prod_po")
 				{
@@ -1372,7 +1376,9 @@
 					$rate = $rate_symbol['rate'];
 					$unitprice=$adb->query_result($list_result,$list_result_count,'unit_price');
 					$unitprice = convertFromDollar($unitprice,$rate);
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_inventory_po("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$unitprice.'", "'.$tax_str.'","'.$row_id.'"); window.close()\'>'.$temp_val.'</a>';
+
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_inventory_po("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$unitprice.'", "'.$tax_str.'","'.$row_id.'"); \'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "inventory_pb")
 				{
@@ -1381,36 +1387,39 @@
 					$flname =  $_REQUEST['fldname'];
 					$listprice=getListPrice($prod_id,$entity_id);	
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_inventory_pb("'.$listprice.'", "'.$flname.'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_inventory_pb("'.$listprice.'", "'.$flname.'"); \'>'.$temp_val.'</a>';
 				}
 				elseif($popuptype == "specific_account_address")
 				{
-					require_once('modules/Accounts/Account.php');
-					$acct_focus = new Account();
+					require_once('modules/Accounts/Accounts.php');
+					$acct_focus = new Accounts();
 					$acct_focus->retrieve_entity_info($entity_id,"Accounts");
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.'</a>';
 
 				}
 				elseif($popuptype == "specific_contact_account_address")
 				{
-					require_once('modules/Accounts/Account.php');
-					$acct_focus = new Account();
+					require_once('modules/Accounts/Accounts.php');
+					$acct_focus = new Accounts();
 					$acct_focus->retrieve_entity_info($entity_id,"Accounts");
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_contact_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_contact_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.'</a>';
 
 				}
-
 				elseif($popuptype == "specific_potential_account_address")
 				{
 					$acntid = $adb->query_result($list_result,$list_result_count,"accountid");
-					require_once('modules/Accounts/Account.php');
-					$acct_focus = new Account();
+					require_once('modules/Accounts/Accounts.php');
+					$acct_focus = new Accounts();
 					$acct_focus->retrieve_entity_info($acntid,"Accounts");
 					$account_name = getAccountName($acntid);
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$acntid.'", "'.br2nl($account_name).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.$acntid.'", "'.br2nl($account_name).'", "'.br2nl($acct_focus->column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.'</a>';
 
 				}
 				//added by rdhital/Raju for better emails 
@@ -1429,7 +1438,7 @@
 						//Change this index 0 - to get the vtiger_fieldid based on email1 or email2
 						$fieldid = $adb->query_result($queryres,0,'fieldid');
 
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'return set_return_emails('.$entity_id.','.$fieldid.',"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'return set_return_emails('.$entity_id.','.$fieldid.',"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
 
 					}elseif ($module=='Contacts' || $module=='Leads')
 					{
@@ -1445,7 +1454,7 @@
 						//Change this index 0 - to get the vtiger_fieldid based on email or yahooid
 						$fieldid = $adb->query_result($queryres,0,'fieldid');
 
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'return set_return_emails('.$entity_id.','.$fieldid.',"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'return set_return_emails('.$entity_id.','.$fieldid.',"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
 
 					}else
 					{
@@ -1454,23 +1463,25 @@
 						$name=$lastname.' '.$firstname;
 						$emailaddress=$adb->query_result($list_result,$list_result_count,"email1");
 
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'return set_return_emails('.$entity_id.',-1,"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'return set_return_emails('.$entity_id.',-1,"'.$name.'","'.$emailaddress.'"); \'>'.$name.'</a>';
 						
 					}
 						
 				}	
 				elseif($popuptype == "specific_vendor_address")
 				{
-					require_once('modules/Vendors/Vendor.php');
-					$acct_focus = new Vendor();
+					require_once('modules/Vendors/Vendors.php');
+					$acct_focus = new Vendors();
 					$acct_focus->retrieve_entity_info($entity_id,"Vendors");
 
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_address("'.$entity_id.'", "'.br2nl($temp_val).'", "'.br2nl($acct_focus->column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'");\'>'.$temp_val.'</a>';
 
 				}
 				elseif($popuptype == "specific_campaign")
 				{
-					$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_specific_campaign("'.$entity_id.'", "'.br2nl($temp_val).'"); window.close()\'>'.$temp_val.'</a>';
+					$temp_val = popup_from_html($temp_val);
+					$value = '<a href="javascript:window.close();" onclick=\'set_return_specific_campaign("'.$entity_id.'", "'.br2nl($temp_val).'");\'>'.$temp_val.'</a>';
 				}
 				else
 				{
@@ -1479,12 +1490,13 @@
 					$temp_val =$temp_val.' '.$firstname;
 
 					$temp_val = str_replace("'",'\"',$temp_val);
+					$temp_val = popup_from_html($temp_val);
 
 					$log->debug("Exiting getValue method ...");
 					if($_REQUEST['maintab'] == 'Calendar')
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return_todo("'.$entity_id.'", "'.br2nl($temp_val).'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'set_return_todo("'.$entity_id.'", "'.br2nl($temp_val).'");\'>'.$temp_val.'</a>';
 					else
-						$value = '<a href="a" LANGUAGE=javascript onclick=\'set_return("'.$entity_id.'", "'.br2nl($temp_val).'"); window.close()\'>'.$temp_val.'</a>';
+						$value = '<a href="javascript:window.close();" onclick=\'set_return("'.$entity_id.'", "'.br2nl($temp_val).'");\'>'.$temp_val.'</a>';
 				}
 			}
 			else
@@ -2080,7 +2092,7 @@
 			LEFT JOIN vtiger_campaigngrouprelation
 				ON vtiger_campaign.campaignid = vtiger_campaigngrouprelation.campaignid
 			INNER JOIN vtiger_campaignscf
-			        ON vtiger_campaignscf.campaignid = vtiger_campaignscf.campaignid
+			        ON vtiger_campaign.campaignid = vtiger_campaignscf.campaignid
 			LEFT JOIN vtiger_groups
 				ON vtiger_groups.groupname = vtiger_campaigngrouprelation.groupname
 			LEFT JOIN vtiger_users

Modified: vtigercrm/trunk/include/utils/UserInfoUtil.php
==============================================================================
--- vtigercrm/trunk/include/utils/UserInfoUtil.php (original)
+++ vtigercrm/trunk/include/utils/UserInfoUtil.php Tue Oct 31 03:40:43 2006
@@ -1346,6 +1346,23 @@
 	$log->debug("Exiting getProfileName method ...");
 	return $profilename;	
 }
+/** Function to get the vtiger_profile Description from the vtiger_profileid
+  * @param $profileid -- Profile Id:: Type integer
+  * @returns $rolename -- Role Name:: Type varchar
+  *
+ */
+function getProfileDescription($profileid)
+{
+        global $log;
+        $log->debug("Entering getProfileDescription(".$profileid.") method ...");
+        global $adb;
+        $sql1 = "select  description from vtiger_profile where profileid=".$profileid;
+        $result = $adb->query($sql1);
+        $profileDescription = $adb->query_result($result,0,"description");
+        $log->debug("Exiting getProfileName method ...");
+        return $profileDescription;
+}
+
 
 /** Function to check if the currently logged in user is permitted to perform the specified action  
   * @param $module -- Module Name:: Type varchar

Modified: vtigercrm/trunk/include/utils/export.php
==============================================================================
--- vtigercrm/trunk/include/utils/export.php (original)
+++ vtigercrm/trunk/include/utils/export.php Tue Oct 31 03:40:43 2006
@@ -20,23 +20,23 @@
 require_once('config.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
-require_once('modules/Accounts/Account.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Leads/Lead.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Accounts/Accounts.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Leads/Leads.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Emails/Emails.php');
 require_once('modules/Calendar/Activity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Users/User.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Potentials/Potentials.php');
+require_once('modules/Users/Users.php');
+require_once('modules/Products/Products.php');
 require_once('include/utils/UserInfoUtil.php');
 
 global $allow_exports;
 
 session_start();
 
-$current_user = new User();
+$current_user = new Users();
 
 if(isset($_SESSION['authenticated_user_id']))
 {
@@ -87,51 +87,15 @@
 {
 	global $log;
 	$log->debug("Entering export_all(".$type.") method ...");
-	$contact_fields = Array();
-	$account_fields = Array();
 	global $adb;
+
 	$focus = 0;
 	$content = '';
 
-	if ($type == "Contacts")
+	if ($type != "")
 	{
-		$focus = new Contact;
+		$focus = new $type;
 	}
-	else if ($type == "Accounts")
-	{
-		$focus = new Account;
-		$exp_query="SELECT columnname, fieldlabel FROM vtiger_field where tabid=6";
-		$account_result=$adb->query($exp_query);
-		if($adb->num_rows($account_result)!=0)
-		{
-			while($result = $adb->fetch_array($account_result))
-			{
-				$account_columnname = $result['columnname'];
-				$account_fieldlabel = $result['fieldlabel'];
-				$account_fields[$account_columnname] = $account_fieldlabel;
-			}
-		}
-	}
-	else if ($type == "Potentials")
-	{
-        	$focus = new Potential;
-	}
-	else if ($type == "Notes")
-	{
-		$focus = new Note;
-	}
-	else if ($type == "Leads")
-	{
-		$focus = new Lead;
-	}
-	else if ($type == "Emails")
-	{
-		$focus = new Email;
-	}
-	else if ($type == "Products")
-        {
-                $focus = new Product;
-        }
 
 	$log = LoggerManager::getLogger('export_'.$type);
 	$db = new PearDatabase();

Modified: vtigercrm/trunk/include/utils/utils.php
==============================================================================
--- vtigercrm/trunk/include/utils/utils.php (original)
+++ vtigercrm/trunk/include/utils/utils.php Tue Oct 31 03:40:43 2006
@@ -385,6 +385,35 @@
 
 	$return_value = $mod_strings;
 	$mod_strings = $temp_mod_strings;
+
+	$log->debug("Exiting return_module_language method ...");
+	return $return_value;
+}
+
+/*This function returns the mod_strings for the current language and the specified module
+*/
+
+function return_specified_module_language($language, $module)
+{
+	global $log;
+	global $default_language, $translation_string_prefix;
+
+	@include("modules/$module/language/$language.lang.php");
+	if(!isset($mod_strings))
+	{
+		$log->warn("Unable to find the module language file for language: ".$language." and module: ".$module);
+		require("modules/$module/language/$default_language.lang.php");
+		$language_used = $default_language;
+	}
+
+	if(!isset($mod_strings))
+	{
+		$log->fatal("Unable to load the module($module) language file for the selected language($language) or the default language($default_language)");
+		$log->debug("Exiting return_module_language method ...");
+		return null;
+	}
+
+	$return_value = $mod_strings;
 
 	$log->debug("Exiting return_module_language method ...");
 	return $return_value;
@@ -2048,9 +2077,9 @@
 	$log->debug("Entering getEmailParentsList(".$module.",".$id.") method ...");
         global $adb;
 	if($module == 'Contacts')
-		$focus = new Contact();
+		$focus = new Contacts();
 	if($module == 'Leads')
-		$focus = new Lead();
+		$focus = new Leads();
         
 	$focus->retrieve_entity_info($id,$module);
         $fieldid = 0;

Modified: vtigercrm/trunk/index.php
==============================================================================
--- vtigercrm/trunk/index.php (original)
+++ vtigercrm/trunk/index.php Tue Oct 31 03:40:43 2006
@@ -101,7 +101,7 @@
  	
 set_default_config($default_config_values);
 require_once('include/logging.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 
 global $currentModule;
 
@@ -352,7 +352,7 @@
 $lang_crm = (isset($_SESSION['authenticated_user_language'])) ? $_SESSION['authenticated_user_language'] : "";
 $GLOBALS['request_string'] = "&module=$module&action=$action&record=$record&lang_crm=$lang_crm";
 
-$current_user = new User();
+$current_user = new Users();
 
 if($use_current_login)
 {
@@ -432,90 +432,22 @@
 	// Use the record to track the viewing.
 	// todo - Have a record of modules and thier primary object names.
 	//Getting the actual module
-	$actualModule = $currentModule;
 	switch($currentModule)
 	{
-		case 'Leads':
-			require_once("modules/$currentModule/Lead.php");
-			$focus = new Lead();
-			break;
-		case 'Contacts':
-			require_once("modules/$currentModule/Contact.php");
-			$focus = new Contact();
-			break;
-		case 'Accounts':
-			require_once("modules/$currentModule/Account.php");
-			$focus = new Account();
-			break;
-		case 'Potentials':
-			require_once("modules/$currentModule/Opportunity.php");
-			$focus = new Potential();
-			break;
 		case 'Calendar':
 			require_once("modules/$currentModule/Activity.php");
 			$focus = new Activity();
 			break;
-		case 'Notes':
-			require_once("modules/$currentModule/Note.php");
-			$focus = new Note();
-			break;
-		case 'Emails':
-			require_once("modules/$currentModule/Email.php");
-			$focus = new Email();
-			break;
-		case 'Users':
-			require_once("modules/$currentModule/User.php");
-			$focus = new User();
-			break;
-		case 'Products':
-			require_once("modules/$currentModule/Product.php");
-			$focus = new Product();
-			break;
-		case 'Vendors':
-			require_once("modules/$currentModule/Vendor.php");
-			$focus = new Vendor();
-			$actualModule = 'Vendors';
-			break;
-		case 'PriceBooks':
-			require_once("modules/$currentModule/PriceBook.php");
-			$focus = new PriceBook();
-			$actualModule = 'PriceBooks';
-			break;
-		case 'HelpDesk':
-			require_once("modules/$currentModule/HelpDesk.php");
-			$focus = new HelpDesk();
-			break;
-		case 'Faq':
-			require_once("modules/$currentModule/Faq.php");
-			$focus = new Faq();
-			break;
-		case 'Quotes':
-			require_once("modules/$currentModule/Quote.php");
-			$focus = new Quote();
-			break;
-		case 'PurchaseOrder':
-                        require_once("modules/$currentModule/PurchaseOrder.php");
-                        $focus = new Order();
-                        break;
-                case 'SalesOrder':
-                        require_once("modules/$currentModule/SalesOrder.php");
-                        $focus = new SalesOrder();
-                        break;
-
-		case 'Invoice':
-			require_once("modules/$currentModule/Invoice.php");
-			$focus = new Invoice();
-			break;
-		case 'Campaigns':
-			require_once("modules/$currentModule/Campaign.php");
-			$focus = new Campaign();
+		default:
+			require_once("modules/$currentModule/$currentModule.php");
+			$focus = new $currentModule();
 			break;
 		}
 	
 	if(isset($_REQUEST['record']) && $_REQUEST['record']!='' && $_REQUEST["module"] != "Webmails") 
         {
                 // Only track a viewing if the record was retrieved.
-                $focus->track_view($current_user->id, $actualModule,$_REQUEST['record']);
+                $focus->track_view($current_user->id, $currentModule,$_REQUEST['record']);
         }
 
 }	
@@ -707,7 +639,7 @@
 		echo "<script language = 'JavaScript' type='text/javascript' src = 'include/js/popup.js'></script>";
 		echo '<style type="text/css">@import url("themes/'.$theme.'/style.css"); </style>';
 		echo "<br><br><br><table border=0 cellspacing=0 cellpadding=5 width=100% class=settingsSelectedUI >";
-		echo "<tr><td class=small align=left>vtiger CRM 5.0.0 | Visit <a href='http://www.vtiger.com'>www.vtiger.com</a> for more information </td>";
+		echo "<tr><td class=small align=left>vtiger CRM 5.0.2 | Visit <a href='http://www.vtiger.com'>www.vtiger.com</a> for more information </td>";
 		echo "<td class=small align=right> &copy; <a href='javascript:mypopup()'>Copyright Details</a></td></tr></table>";
 			
 	//	echo "<table align='center'><tr><td align='center'>";

Modified: vtigercrm/trunk/install/0welcome.php
==============================================================================
--- vtigercrm/trunk/install/0welcome.php (original)
+++ vtigercrm/trunk/install/0welcome.php Tue Oct 31 03:40:43 2006
@@ -97,10 +97,10 @@
 
 					<tr>
 						<td align=left class="small" style="padding-left:20px">
-		<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Configuration Wizard will create vtiger CRM 5.0.1 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. 
+		<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Configuration Wizard will create vtiger CRM 5.0.2 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. 
 <br><br>
-<p><span style="color:#555555">- vtiger CRM 5.0.1 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.</p> 
-<p align="center"><font color='red'><b>vtiger CRM 5.0.1 will not work on mysql 4.0.x versions</b></font></center><center><font color='blue'><b>vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements</b></font></center>
+<p><span style="color:#555555">- vtiger CRM 5.0.2 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.</p> 
+<p align="center"><font color='red'><b>vtiger CRM 5.0.2 will not work on mysql 4.0.x versions</b></font></center><center><font color='blue'><b>vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements</b></font></center>
 <p>The installation wizard will guide you with the installation regardless of the setup you may have.</span>
 						
 					  </td>

Modified: vtigercrm/trunk/install/1checkSystem.php
==============================================================================
--- vtigercrm/trunk/install/1checkSystem.php (original)
+++ vtigercrm/trunk/install/1checkSystem.php Tue Oct 31 03:40:43 2006
@@ -203,7 +203,7 @@
 	    				<table cellpadding="10" cellspacing="1" width="90%" border="0" class="small" style="background-color:#cccccc">
 					<tr bgcolor="#efefef"><td colspan=2><span style="color:#003399"><strong>Core Components</strong></span></td></tr>
 					<tr bgcolor="#fafafa">
-						<td valign=top ><strong>PHP version 5.0.x</strong><BR></td>
+						<td valign=top ><strong>PHP version</strong><BR></td>
 						<td  valign=top bgcolor="white"><?php $php_version = phpversion(); echo (str_replace(".", "", $php_version) < "430") ? "<strong><font color=\"#FF0000\">Failed.</strong><br> Invalid version ($php_version) Installed</font>" : "<strong><font color=\"#00CC00\">Passed</strong><br>Version $php_version Installed</font>"; ?></td>
     					</tr>
 					<tr bgcolor="#fafafa">

Modified: vtigercrm/trunk/install/2setConfig.php
==============================================================================
--- vtigercrm/trunk/install/2setConfig.php (original)
+++ vtigercrm/trunk/install/2setConfig.php Tue Oct 31 03:40:43 2006
@@ -99,7 +99,7 @@
 	elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_')
 	$db_name = $dbconfig['db_name'];
 	else
-	$db_name = 'vtigercrm501';
+	$db_name = 'vtigercrm502';
 
 	!isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables'];
 	if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name'];
@@ -145,7 +145,7 @@
 	}
 	else {
 		!isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname'];
-		!isset($_REQUEST['db_name']) ? $db_name = "vtigercrm501" : $db_name = $_REQUEST['db_name'];
+		!isset($_REQUEST['db_name']) ? $db_name = "vtigercrm502" : $db_name = $_REQUEST['db_name'];
 		!isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables'];
 		!isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name'];
 		!isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL'];
@@ -155,7 +155,7 @@
 		!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'];
-		}
+	}
 		!isset($_REQUEST['check_createdb']) ? $check_createdb = "" : $check_createdb = $_REQUEST['check_createdb'];
 		!isset($_REQUEST['root_user']) ? $root_user = "" : $root_user = $_REQUEST['root_user'];
 		!isset($_REQUEST['root_password']) ? $root_password = "" : $root_password = $_REQUEST['root_password'];
@@ -367,7 +367,7 @@
                <td width="25%" nowrap bgcolor="#F5F5F5" ><strong>Database Type</strong> <sup><font color=red>*</font></sup></td>
                <td width="75%" bgcolor="white" align="left">
 		<?php if(!$db_options) : ?>
-			No Database Support Deteched
+			No Database Support Detected
 		<?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 ?>

Modified: vtigercrm/trunk/install/4createConfigFile.php
==============================================================================
--- vtigercrm/trunk/install/4createConfigFile.php (original)
+++ vtigercrm/trunk/install/4createConfigFile.php Tue Oct 31 03:40:43 2006
@@ -45,8 +45,8 @@
 
 // vtiger CRM version number; do not edit!
 
-$vtiger_version = "5.0.1";
-$release_date = "10 October 2006";
+$vtiger_version = "5.0.2";
+$release_date = "31 October 2006";
 
 
 if (isset($_REQUEST['db_hostname']))

Modified: vtigercrm/trunk/install/5createTables.inc.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.inc.php (original)
+++ vtigercrm/trunk/install/5createTables.inc.php Tue Oct 31 03:40:43 2006
@@ -22,14 +22,14 @@
 require_once('config.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/logging.php');
-require_once('modules/Leads/Lead.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Accounts/Account.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Leads/Leads.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Accounts/Accounts.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('modules/Calendar/Activity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Emails/Email.php');
-require_once('modules/Users/User.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Emails/Emails.php');
+require_once('modules/Users/Users.php');
 require_once('modules/Import/ImportMap.php');
 require_once('modules/Import/UsersLastImport.php');
 require_once('modules/Users/LoginHistory.php');
@@ -66,7 +66,7 @@
         global $default_user_is_admin;
 
         // create default admin user
-    	$user = new User();
+    	$user = new Users();
         $user->column_fields["last_name"] = 'Administrator';
         $user->column_fields["user_name"] = 'admin';
         $user->column_fields["status"] = 'Active';
@@ -122,7 +122,7 @@
 
 
 	//Creating the Standard User
-    	$user = new User();
+    	$user = new Users();
         $user->column_fields["last_name"] = 'StandardUser';
         $user->column_fields["user_name"] = 'standarduser';
         $user->column_fields["is_admin"] = 'off';

Modified: vtigercrm/trunk/install/5createTables.php
==============================================================================
--- vtigercrm/trunk/install/5createTables.php (original)
+++ vtigercrm/trunk/install/5createTables.php Tue Oct 31 03:40:43 2006
@@ -123,7 +123,7 @@
 		<table border=0 cellspacing=0 cellpadding=5 align="center" width=75% style="background-color:#E1E1FD;border:1px dashed #111111;">
 		<tr>
 			<td align=center class=small>
-			<b>vtigercrm-5.0.1 is all set to go!</b>
+			<b>vtigercrm-5.0.2 is all set to go!</b>
 			<hr noshade size=1>
 			<div style="width:100%;padding:10px; "align=left>
 			<ul>

Modified: vtigercrm/trunk/install/populateSeedData.php
==============================================================================
--- vtigercrm/trunk/install/populateSeedData.php (original)
+++ vtigercrm/trunk/install/populateSeedData.php Tue Oct 31 03:40:43 2006
@@ -19,29 +19,29 @@
 
 require_once('config.php');
 
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('modules/Contacts/contactSeedData.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Accounts/Account.php');
-require_once('modules/Campaigns/Campaign.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Accounts/Accounts.php');
+require_once('modules/Campaigns/Campaigns.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('modules/Calendar/Activity.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 require_once('include/language/en_us.lang.php');
 require_once('include/ComboStrings.php');
 require_once('include/ComboUtil.php');
-require_once('modules/Products/Product.php');
-require_once('modules/PriceBooks/PriceBook.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Products/Products.php');
+require_once('modules/PriceBooks/PriceBooks.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('modules/Faq/Faq.php');
 require_once('modules/HelpDesk/HelpDesk.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('modules/SalesOrder/SalesOrder.php');
 require_once('modules/PurchaseOrder/PurchaseOrder.php');
 require_once('modules/Invoice/Invoice.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/utils/InventoryUtils.php'); //Included to save inventory related products in demo data
 
 global $first_name_array;
@@ -113,7 +113,7 @@
 }
 
 // Look up the user id for the assigned user
-$seed_user = new User();
+$seed_user = new Users();
 
 //$adb->println("PSD assignname=".$assigned_user_name);
 
@@ -121,7 +121,7 @@
 
 global $current_user;
 
-$current_user = new User();
+$current_user = new Users();
 $result = $current_user->retrieve_entity_info($assigned_user_id,'Users');
 
 $tagkey = 1;
@@ -147,7 +147,7 @@
 	$account_name = $company_name_array[$i];
 
 	// Create new accounts.
-	$account = new Account();
+	$account = new Accounts();
 	$account->column_fields["accountname"] = $account_name;
 	$account->column_fields["phone"] = create_phone_number();
 	$account->column_fields["assigned_user_id"] = $assigned_user_id;
@@ -196,7 +196,7 @@
 
 		
 //Create new opportunities
-	$opp = new Potential();
+	$opp = new Potentials();
 
 	$opp->column_fields["assigned_user_id"] = $assigned_user_id;
 	$opp->column_fields["potentialname"] = $account_name." - 1000 units";
@@ -235,7 +235,7 @@
 
 for($i=0; $i<10; $i++)
 {
-	$contact = new Contact();
+	$contact = new Contacts();
 	$contact->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i]));
 	$contact->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i]));
 	$contact->column_fields["assigned_user_id"] = $assigned_user_id;
@@ -327,7 +327,7 @@
 	$company_count=0;
 for($i=0; $i<10; $i++)
 {
-	$lead = new Lead();
+	$lead = new Leads();
 	$lead->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i]));
 	$lead->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i]));
 
@@ -404,7 +404,7 @@
 //Populating Vendor Data
 for($i=0; $i<10; $i++)
 {
-	$vendor = new Vendor();
+	$vendor = new Vendors();
 	$vendor->column_fields["vendorname"] = ucfirst(strtolower($first_name_array[$i]));
 	$vendor->column_fields["phone"] = create_phone_number();
 	$vendor->column_fields["email"] = strtolower($vendor->column_fields["vendorname"])."@company.com";
@@ -442,7 +442,7 @@
 .jpeg###","product7.jpeg###product8.jpeg###product9.jpeg###product10.jpeg###");
 for($i=0; $i<10; $i++)
 {
-        $product = new Product();
+        $product = new Products();
 	if($i>4)
 	{
 		$parent_key = array_rand($opportunity_ids);
@@ -579,7 +579,7 @@
 $validtill_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18");
 for($i=0;$i<5;$i++)
 {
-	$quote = new Quote();
+	$quote = new Quotes();
 	
 	$quote->column_fields["assigned_user_id"] = $assigned_user_id;
 	$account_key = array_rand($account_ids);
@@ -730,7 +730,7 @@
 
 for($i=0;$i<5;$i++)
 {
-	$po = new Order();
+	$po = new PurchaseOrder();
 	
 	$po->column_fields["assigned_user_id"] = $assigned_user_id;
 	$vendor_key = array_rand($vendor_ids);
@@ -896,7 +896,7 @@
 
 for($i=0;$i<5;$i++)
 {
-	$email = new Email();
+	$email = new Emails();
 
 	$email->column_fields["assigned_user_id"] = $assigned_user_id;
 	
@@ -923,7 +923,7 @@
 //$num_array = array(0,1,2,3,4);
 for($i=0;$i<12;$i++)
 {
-	$pricebook = new PriceBook();
+	$pricebook = new PriceBooks();
 
 	$rand = array_rand($num_array);
 	$pricebook->column_fields["bookname"]   = $PB_array[$i];
@@ -940,7 +940,7 @@
 
 for($i=0;$i<7;$i++)
 {
-	$notes = new Note();
+	$notes = new Notes();
 
 	$rand = array_rand($num_array);
 	$contact_key = array_rand($contact_ids);
@@ -1118,7 +1118,7 @@
 //$expected_response = Array(null,null,null);
 for($i=0;$i<count($campaign_name_array);$i++)
 {
-	$campaign = new Campaign();
+	$campaign = new Campaigns();
 	$campaign_name = $campaign_name_array[$i];
 	$campaign->column_fields["campaignname"] = $campaign_name;
 	$campaign->column_fields["campaigntype"] = $campaign_type_array[$i];

Modified: vtigercrm/trunk/modules/Accounts/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Accounts/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/utils/utils.php');
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
@@ -22,7 +22,7 @@
 }
 else
 {
-$focus = new Account();
+$focus = new Accounts();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {

Modified: vtigercrm/trunk/modules/Accounts/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/Delete.php (original)
+++ vtigercrm/trunk/modules/Accounts/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('contact_delete');
 
-$focus = new Account();
+$focus = new Accounts();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Accounts/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/DetailView.php (original)
+++ vtigercrm/trunk/modules/Accounts/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
@@ -32,7 +32,7 @@
 global $app_list_strings;
 global $log, $currentModule, $singlepane_view;
 
-$focus = new Account();
+$focus = new Accounts();
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
     $focus->retrieve_entity_info($_REQUEST['record'],"Accounts");
     $focus->id = $_REQUEST['record'];	

Modified: vtigercrm/trunk/modules/Accounts/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Accounts/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
      $fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
      if($crmid != "")
 	 {
-	     $acntObj = new Account();
+	     $acntObj = new Accounts();
 	     $acntObj->retrieve_entity_info($crmid,"Accounts");
 	     $acntObj->column_fields[$fieldname] = $fieldvalue;
 	     if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving

Modified: vtigercrm/trunk/modules/Accounts/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/EditView.php (original)
+++ vtigercrm/trunk/modules/Accounts/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -31,7 +31,7 @@
 global $app_strings,$mod_strings,$currentModule,$theme;
 $smarty=new vtigerCRM_Smarty;
 
-$focus = new Account();
+$focus = new Accounts();
 
 if(isset($_REQUEST['record'])) 
 {

Modified: vtigercrm/trunk/modules/Accounts/HeadLines.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/HeadLines.php (original)
+++ vtigercrm/trunk/modules/Accounts/HeadLines.php Tue Oct 31 03:40:43 2006
@@ -8,7 +8,7 @@
  * All Rights Reserved.
 *
  ********************************************************************************/
-include("modules/Accounts/Account.php");
+include("modules/Accounts/Accounts.php");
 include("getCompanyProfile.php");
 $variable = $_REQUEST['tickersymbol'];
 $url = "http://finance.yahoo.com/q?s=".$variable;

Modified: vtigercrm/trunk/modules/Accounts/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/ListView.php (original)
+++ vtigercrm/trunk/modules/Accounts/ListView.php Tue Oct 31 03:40:43 2006
@@ -15,7 +15,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -43,7 +43,7 @@
 
 $url_string = '';
 
-$focus = new Account();
+$focus = new Accounts();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 
@@ -80,6 +80,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {
 	list($where, $ustring) = split("#@@#",getWhereCondition($currentModule));

Modified: vtigercrm/trunk/modules/Accounts/ListViewTop.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/ListViewTop.php (original)
+++ vtigercrm/trunk/modules/Accounts/ListViewTop.php Tue Oct 31 03:40:43 2006
@@ -28,7 +28,7 @@
 	$log = LoggerManager::getLogger('top accounts_list');
 	$log->debug("Entering getTopAccounts() method ...");
 	require_once("data/Tracker.php");
-	require_once('modules/Potentials/Opportunity.php');
+	require_once('modules/Potentials/Potentials.php');
 	require_once('include/logging.php');
 	require_once('include/ListView/ListView.php');
 	global $app_strings;

Modified: vtigercrm/trunk/modules/Accounts/Merge.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/Merge.php (original)
+++ vtigercrm/trunk/modules/Accounts/Merge.php Tue Oct 31 03:40:43 2006
@@ -1,259 +1,259 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-?>
-<html>
-<body>
-<script>
-if (document.layers)
-{
-	document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
-	document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");
-}	
-else if (document.layers || (!document.all && document.getElementById))
-{
-	document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
-	document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");	
-}
-else if(document.all)
-{
-	document.write("<OBJECT Name='vtigerCRM' codebase='modules/Settings/vtigerCRM.CAB#version=1,5,0,0' id='objMMPage' classid='clsid:0FC436C2-2E62-46EF-A3FB-E68E94705126' width=0 height=0></object>");
-}
-</script>
-<?php
-require_once('include/database/PearDatabase.php');
-require_once('config.php');
-
-$templateid = $_REQUEST['mergefile'];
-
-if($templateid == "")
-{
-	die("Select Mail Merge Template");
-}
-//get the particular file from db and store it in the local hard disk.
-//store the path to the location where the file is stored and pass it  as parameter to the method 
-$sql = "select filename,data,filesize from vtiger_wordtemplates where templateid=".$templateid;
-
-$result = $adb->query($sql);
-$temparray = $adb->fetch_array($result);
-
-$fileContent = $temparray['data'];
-$filename=$temparray['filename'];
-$filesize=$temparray['filesize'];
-$wordtemplatedownloadpath =$root_directory ."/test/wordtemplatedownload/";
-
-
-$handle = fopen($wordtemplatedownloadpath.$temparray['filename'],"wb");
-fwrite($handle,base64_decode($fileContent),$filesize);
-fclose($handle);
-
-//<<<<<<<<<<<<<<<<<<<<<<<<<<<for mass merge>>>>>>>>>>>>>>>>>>>>>>>>>>>
-$mass_merge = $_REQUEST['idlist'];
-$single_record = $_REQUEST['record'];
-
-if($mass_merge != "")
-{	
-	$mass_merge = explode(";",$mass_merge);
-	$temp_mass_merge = $mass_merge;
-	if(array_pop($temp_mass_merge)=="")
-		array_pop($mass_merge);
-	$mass_merge = implode(",",$mass_merge);
-}else if($single_record != "")
-{
-	$mass_merge = $single_record;	
-}else
-{
-	die("Record Id is not found, cannot merge the document");
-}
-
-//echo $mass_merge;
-//die;
-//for setting vtiger_accountid=0 for the contacts which are deleted
-$ct_query = "select crmid from vtiger_crmentity where setype='Contacts' and deleted=1";
-$result = $adb->query($ct_query);
-
-while($row = $adb->fetch_array($result))
-{
-	$deleted_id[] = $row['crmid'];
-}
-
-if(count($deleted_id) > 0)
-{
-	$deleted_id = implode(",",$deleted_id);
-	$update_query = "update vtiger_contactdetails set accountid = 0 where contactid in (".$deleted_id.")";
-	$result = $adb->query($update_query);
-}
-//End setting vtiger_accountid=0 for the contacts which are deleted
-
-//<<<<<<<<<<<<<<<<header for csv and select columns for query>>>>>>>>>>>>>>>>>>>>>>>>
-$query1="select vtiger_tab.name,vtiger_field.tablename,vtiger_field.columnname,vtiger_field.fieldlabel from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid where vtiger_field.tabid in (4,6) and vtiger_field.block <> 6 and vtiger_field.block <> 75 order by vtiger_field.tablename";
-
-$result = $adb->query($query1);
-$y=$adb->num_rows($result);
-	
-for ($x=0; $x<$y; $x++)
-{ 
-  $tablename = $adb->query_result($result,$x,"tablename");
-  $columnname = $adb->query_result($result,$x,"columnname");
-  $modulename = $adb->query_result($result,$x,"name");
-  
-  if($tablename == "crmentity")
-  {
-  	if($modulename == "Contacts")
-  	{
-  		$tablename = "crmentityContacts";
-  	}
-  }
-  $querycolumns[$x] = $tablename.".".$columnname;
-	if($columnname == "smownerid")
-  {
-      if($modulename == "Accounts")
-      {
-  			$querycolumns[$x] = "concat(vtiger_users.last_name,' ',vtiger_users.first_name) as userjoinname,vtiger_users.first_name,vtiger_users.last_name,vtiger_users.user_name,vtiger_users.yahoo_id,vtiger_users.title,vtiger_users.phone_work,vtiger_users.department,vtiger_users.phone_mobile,vtiger_users.phone_other,vtiger_users.phone_fax,vtiger_users.email1,vtiger_users.phone_home,vtiger_users.email2,vtiger_users.address_street,vtiger_users.address_city,vtiger_users.address_state,vtiger_users.address_postalcode,vtiger_users.address_country";
-      }
-  		if($modulename == "Contacts")
-      {
-      	$querycolumns[$x] = "concat(usersContacts.last_name,' ',usersContacts.first_name) as userjoincname";
-      }
-  }
-	if($columnname == "parentid")
-	{
-		$querycolumns[$x] = "accountAccount.accountname";
-	}
-	if($columnname == "accountid")
-	{
-		$querycolumns[$x] = "accountContacts.accountname";
-	}
-	if($columnname == "reportsto")
-	{
-		$querycolumns[$x] = "contactdetailsContacts.lastname";
-	}
-
-	if($modulename == "Accounts")
-  {
-    	$field_label[$x] = "ACCOUNT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
-  		if($columnname == "smownerid")
-  		{
-  		$field_label[$x] = $field_label[$x].",USER_FIRSTNAME,USER_LASTNAME,USER_USERNAME,USER_YAHOOID,USER_TITLE,USER_OFFICEPHONE,USER_DEPARTMENT,USER_MOBILE,USER_OTHERPHONE,USER_FAX,USER_EMAIL,USER_HOMEPHONE,USER_OTHEREMAIL,USER_PRIMARYADDRESS,USER_CITY,USER_STATE,USER_POSTALCODE,USER_COUNTRY";
-  		}
-	}
-	
-	if($modulename == "Contacts")
-  {
-  	$field_label[$x] = "CONTACT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
-  }
-  
-}
-
-$csvheader = implode(",",$field_label);
-//<<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>
-	
-if(count($querycolumns) > 0)
-{
-	$selectcolumns = implode($querycolumns,",");
-
-$query = "select  ".$selectcolumns." from vtiger_account 
-				inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid 
-				inner join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid 
-				inner join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid 
-				inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid 
-				left join vtiger_account as vtiger_accountAccount on vtiger_accountAccount.accountid = vtiger_account.parentid
-				left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
-				left join vtiger_contactdetails on vtiger_contactdetails.accountid=vtiger_account.accountid
-				left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid 
-				left join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid 
-				left join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid 
-				left join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid 
-				left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto
-				left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid 
-				left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid
-				where vtiger_crmentity.deleted=0 and (crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")";
-//echo $query;
-//die;	
-$result = $adb->query($query);
-	
-while($columnValues = $adb->fetch_array($result))
-{
-	$y=$adb->num_fields($result);
-  for($x=0; $x<$y; $x++)
-  {
-  	$value = $columnValues[$x];
-  	//<<<<<<<<<<<<<<<for modifing default values>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-	if($value == "0")
-  	{
-  		$value = "";
-  	}
-  	if(trim($value) == "--None--" || trim($value) == "--none--")
-  	{
-  		$value = "";
-  	}
-	//<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-		$actual_values[$x] = $value;
-		$actual_values[$x] = str_replace('"'," ",$actual_values[$x]);
-		//if value contains any line feed or carriage return replace the value with ".value."
-		if (preg_match ("/(\r\n)/", $actual_values[$x])) 
-		{
-			$actual_values[$x] = '"'.$actual_values[$x].'"';
-		}
-		$actual_values[$x] = str_replace(","," ",$actual_values[$x]);
-  }
-	$mergevalue[] = implode($actual_values,",");  	
-}
-$csvdata = implode($mergevalue,"###");
-}else
-{
-	die("No fields to do Merge");
-}
-
-$handle = fopen($wordtemplatedownloadpath."datasrc.csv","wb");
-fwrite($handle,$csvheader."\r\n");
-fwrite($handle,str_replace("###","\r\n",$csvdata));
-fclose($handle);
-?>
-<script>
-if (window.ActiveXObject){
-	try 
-	{
-  		ovtigerVM = eval("new ActiveXObject('vtigerCRM.ActiveX');");
-  		if(ovtigerVM)
-  		{
-        	var filename = "<?php echo $filename?>";
-        	if(filename != "")
-        	{
-        		if(objMMPage.bDLTempDoc("<?php echo $site_URL;?>/test/wordtemplatedownload/<?php echo $filename; ?>","MMTemplate.doc"))
-        		{
-        			try
-        			{
-        				if(objMMPage.Init())
-        				{
-        					objMMPage.vLTemplateDoc();
-        					objMMPage.bBulkHDSrc("<?php echo $site_URL;?>/test/wordtemplatedownload/datasrc.csv");
-        					objMMPage.vBulkOpenDoc();
-        					objMMPage.UnInit()
-        					window.history.back();
-        				}		
-        			}catch(errorObject)
-        			{
-        				document.write("Error while processing mail merge operation");
-        			}
-        		}else
-        		{
-        			document.write("Cannot get template document");
-        		}
-        	}
-  		}
-		}
-	catch(e) {
-		document.write("Requires to download ActiveX Control from vtigerCRM. Please, ensure that you have administration privilage");
-	}
-}
-</script>
-</body>
-</html>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+?>
+<html>
+<body>
+<script>
+if (document.layers)
+{
+	document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
+	document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");
+}	
+else if (document.layers || (!document.all && document.getElementById))
+{
+	document.write("This feature requires IE 5.5 or higher for Windows on Microsoft Windows 2000, Windows NT4 SP6, Windows XP.");
+	document.write("<br><br>Click <a href='#' onclick='window.history.back();'>here</a> to return to the previous page");	
+}
+else if(document.all)
+{
+	document.write("<OBJECT Name='vtigerCRM' codebase='modules/Settings/vtigerCRM.CAB#version=1,5,0,0' id='objMMPage' classid='clsid:0FC436C2-2E62-46EF-A3FB-E68E94705126' width=0 height=0></object>");
+}
+</script>
+<?php
+require_once('include/database/PearDatabase.php');
+require_once('config.php');
+
+$templateid = $_REQUEST['mergefile'];
+
+if($templateid == "")
+{
+	die("Select Mail Merge Template");
+}
+//get the particular file from db and store it in the local hard disk.
+//store the path to the location where the file is stored and pass it  as parameter to the method 
+$sql = "select filename,data,filesize from vtiger_wordtemplates where templateid=".$templateid;
+
+$result = $adb->query($sql);
+$temparray = $adb->fetch_array($result);
+
+$fileContent = $temparray['data'];
+$filename=$temparray['filename'];
+$filesize=$temparray['filesize'];
+$wordtemplatedownloadpath =$root_directory ."/test/wordtemplatedownload/";
+
+
+$handle = fopen($wordtemplatedownloadpath.$temparray['filename'],"wb");
+fwrite($handle,base64_decode($fileContent),$filesize);
+fclose($handle);
+
+//<<<<<<<<<<<<<<<<<<<<<<<<<<<for mass merge>>>>>>>>>>>>>>>>>>>>>>>>>>>
+$mass_merge = $_REQUEST['idlist'];
+$single_record = $_REQUEST['record'];
+
+if($mass_merge != "")
+{	
+	$mass_merge = explode(";",$mass_merge);
+	$temp_mass_merge = $mass_merge;
+	if(array_pop($temp_mass_merge)=="")
+		array_pop($mass_merge);
+	$mass_merge = implode(",",$mass_merge);
+}else if($single_record != "")
+{
+	$mass_merge = $single_record;	
+}else
+{
+	die("Record Id is not found, cannot merge the document");
+}
+
+//echo $mass_merge;
+//die;
+//for setting vtiger_accountid=0 for the contacts which are deleted
+$ct_query = "select crmid from vtiger_crmentity where setype='Contacts' and deleted=1";
+$result = $adb->query($ct_query);
+
+while($row = $adb->fetch_array($result))
+{
+	$deleted_id[] = $row['crmid'];
+}
+
+if(count($deleted_id) > 0)
+{
+	$deleted_id = implode(",",$deleted_id);
+	$update_query = "update vtiger_contactdetails set accountid = 0 where contactid in (".$deleted_id.")";
+	$result = $adb->query($update_query);
+}
+//End setting vtiger_accountid=0 for the contacts which are deleted
+
+//<<<<<<<<<<<<<<<<header for csv and select columns for query>>>>>>>>>>>>>>>>>>>>>>>>
+$query1="select vtiger_tab.name,vtiger_field.tablename,vtiger_field.columnname,vtiger_field.fieldlabel from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid where vtiger_field.tabid in (4,6) and vtiger_field.block <> 6 and vtiger_field.block <> 75 order by vtiger_field.tablename";
+
+$result = $adb->query($query1);
+$y=$adb->num_rows($result);
+	
+for ($x=0; $x<$y; $x++)
+{ 
+  $tablename = $adb->query_result($result,$x,"tablename");
+  $columnname = $adb->query_result($result,$x,"columnname");
+  $modulename = $adb->query_result($result,$x,"name");
+  
+  if($tablename == "crmentity")
+  {
+  	if($modulename == "Contacts")
+  	{
+  		$tablename = "vtiger_crmentityContacts";
+  	}
+  }
+  $querycolumns[$x] = $tablename.".".$columnname;
+	if($columnname == "smownerid")
+  {
+      if($modulename == "Accounts")
+      {
+  			$querycolumns[$x] = "concat(vtiger_users.last_name,' ',vtiger_users.first_name) as userjoinname,vtiger_users.first_name,vtiger_users.last_name,vtiger_users.user_name,vtiger_users.yahoo_id,vtiger_users.title,vtiger_users.phone_work,vtiger_users.department,vtiger_users.phone_mobile,vtiger_users.phone_other,vtiger_users.phone_fax,vtiger_users.email1,vtiger_users.phone_home,vtiger_users.email2,vtiger_users.address_street,vtiger_users.address_city,vtiger_users.address_state,vtiger_users.address_postalcode,vtiger_users.address_country";
+      }
+  		if($modulename == "Contacts")
+      {
+      	$querycolumns[$x] = "concat(vtiger_usersContacts.last_name,' ',vtiger_usersContacts.first_name) as userjoincname";
+      }
+  }
+	if($columnname == "parentid")
+	{
+		$querycolumns[$x] = "vtiger_accountAccount.accountname";
+	}
+	if($columnname == "accountid")
+	{
+		$querycolumns[$x] = "vtiger_accountContacts.accountname";
+	}
+	if($columnname == "reportsto")
+	{
+		$querycolumns[$x] = "vtiger_contactdetailsContacts.lastname";
+	}
+
+	if($modulename == "Accounts")
+  {
+    	$field_label[$x] = "ACCOUNT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
+  		if($columnname == "smownerid")
+  		{
+  		$field_label[$x] = $field_label[$x].",USER_FIRSTNAME,USER_LASTNAME,USER_USERNAME,USER_YAHOOID,USER_TITLE,USER_OFFICEPHONE,USER_DEPARTMENT,USER_MOBILE,USER_OTHERPHONE,USER_FAX,USER_EMAIL,USER_HOMEPHONE,USER_OTHEREMAIL,USER_PRIMARYADDRESS,USER_CITY,USER_STATE,USER_POSTALCODE,USER_COUNTRY";
+  		}
+	}
+	
+	if($modulename == "Contacts")
+  {
+  	$field_label[$x] = "CONTACT_".strtoupper(str_replace(" ","",$adb->query_result($result,$x,"fieldlabel")));
+  }
+  
+}
+
+$csvheader = implode(",",$field_label);
+//<<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>
+	
+if(count($querycolumns) > 0)
+{
+	$selectcolumns = implode($querycolumns,",");
+
+$query = "select  ".$selectcolumns." from vtiger_account 
+				inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid 
+				inner join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid 
+				inner join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid 
+				inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid 
+				left join vtiger_account as vtiger_accountAccount on vtiger_accountAccount.accountid = vtiger_account.parentid
+				left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
+				left join vtiger_contactdetails on vtiger_contactdetails.accountid=vtiger_account.accountid
+				left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid 
+				left join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid 
+				left join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid 
+				left join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid 
+				left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto
+				left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid 
+				left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid
+				where vtiger_crmentity.deleted=0 and (vtiger_crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")";
+//echo $query;
+//die;	
+$result = $adb->query($query);
+	
+while($columnValues = $adb->fetch_array($result))
+{
+	$y=$adb->num_fields($result);
+  for($x=0; $x<$y; $x++)
+  {
+  	$value = $columnValues[$x];
+  	//<<<<<<<<<<<<<<<for modifing default values>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+	if($value == "0")
+  	{
+  		$value = "";
+  	}
+  	if(trim($value) == "--None--" || trim($value) == "--none--")
+  	{
+  		$value = "";
+  	}
+	//<<<<<<<<<<<<<<<End>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+		$actual_values[$x] = $value;
+		$actual_values[$x] = str_replace('"'," ",$actual_values[$x]);
+		//if value contains any line feed or carriage return replace the value with ".value."
+		if (preg_match ("/(\r\n)/", $actual_values[$x])) 
+		{
+			$actual_values[$x] = '"'.$actual_values[$x].'"';
+		}
+		$actual_values[$x] = str_replace(","," ",$actual_values[$x]);
+  }
+	$mergevalue[] = implode($actual_values,",");  	
+}
+$csvdata = implode($mergevalue,"###");
+}else
+{
+	die("No fields to do Merge");
+}
+
+$handle = fopen($wordtemplatedownloadpath."datasrc.csv","wb");
+fwrite($handle,$csvheader."\r\n");
+fwrite($handle,str_replace("###","\r\n",$csvdata));
+fclose($handle);
+?>
+<script>
+if (window.ActiveXObject){
+	try 
+	{
+  		ovtigerVM = eval("new ActiveXObject('vtigerCRM.ActiveX');");
+  		if(ovtigerVM)
+  		{
+        	var filename = "<?php echo $filename?>";
+        	if(filename != "")
+        	{
+        		if(objMMPage.bDLTempDoc("<?php echo $site_URL;?>/test/wordtemplatedownload/<?php echo $filename; ?>","MMTemplate.doc"))
+        		{
+        			try
+        			{
+        				if(objMMPage.Init())
+        				{
+        					objMMPage.vLTemplateDoc();
+        					objMMPage.bBulkHDSrc("<?php echo $site_URL;?>/test/wordtemplatedownload/datasrc.csv");
+        					objMMPage.vBulkOpenDoc();
+        					objMMPage.UnInit()
+        					window.history.back();
+        				}		
+        			}catch(errorObject)
+        			{
+        				document.write("Error while processing mail merge operation");
+        			}
+        		}else
+        		{
+        			document.write("Cannot get template document");
+        		}
+        	}
+  		}
+		}
+	catch(e) {
+		document.write("Requires to download ActiveX Control from vtigerCRM. Please, ensure that you have administration privilage");
+	}
+}
+</script>
+</body>
+</html>

Modified: vtigercrm/trunk/modules/Accounts/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/Save.php (original)
+++ vtigercrm/trunk/modules/Accounts/Save.php Tue Oct 31 03:40:43 2006
@@ -21,14 +21,14 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Accounts/Account.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/logging.php');
 //require_once('database/DatabaseConnection.php');
 require_once('include/database/PearDatabase.php');
 
 $local_log =& LoggerManager::getLogger('index');
 global $log;
-$focus = new Account();
+$focus = new Accounts();
 global $current_user;
 $currencyid=fetchCurrency($current_user->id);
 $rate_symbol = getCurrencySymbolandCRate($currencyid);

Modified: vtigercrm/trunk/modules/Accounts/Tickerdetail.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/Tickerdetail.php (original)
+++ vtigercrm/trunk/modules/Accounts/Tickerdetail.php Tue Oct 31 03:40:43 2006
@@ -8,7 +8,7 @@
  * All Rights Reserved.
 *
  ********************************************************************************/
-require_once("modules/Accounts/Account.php");
+require_once("modules/Accounts/Accounts.php");
 require_once("getCompanyProfile.php");
 $variable = $_REQUEST['tickersymbol'];
 $url = "http://moneycentral.msn.com/investor/research/profile.asp?Symbol=".trim($variable);

Modified: vtigercrm/trunk/modules/Accounts/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Accounts/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Accounts/language/en_us.lang.php Tue Oct 31 03:40:43 2006
@@ -205,6 +205,8 @@
 'Press'=>'Press',
 'Prospect'=>'Prospect',
 'Reseller'=>'Reseller',
+'LBL_START_DATE' => 'Start Date',
+'LBL_END_DATE' => 'End Date',
 
 
 

Modified: vtigercrm/trunk/modules/Calendar/Activity.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Activity.php (original)
+++ vtigercrm/trunk/modules/Calendar/Activity.php Tue Oct 31 03:40:43 2006
@@ -30,19 +30,8 @@
 class Activity extends CRMEntity {
 	var $log;
 	var $db;
-
-	var $table_name = "vtiger_activity";
-	#var $object_name = "activity";	
-		// Mike Crowe Mod --------------------------------------------------------Renamed to match vtiger_tab
-	var $object_name = "Activities";
-	// Mike Crowe Mod --------------------------------------------------------added for general search
-    var $base_table_name = "vtiger_activity";
-    var $cf_table_name = "";
-	var $module_id = "activityid";
-	
-	var $reminder_table = "vtiger_activity_reminder";
-	
-	var $tab_name = Array('vtiger_crmentity','vtiger_activity','vtiger_seactivityrel','vtiger_cntactivityrel','vtiger_salesmanactivityrel','vtiger_activity_reminder','vtiger_recurringevents','vtiger_invitees');
+	var $reminder_table = 'vtiger_activity_reminder';
+	var $tab_name = Array('vtiger_crmentity','vtiger_activity');
 
 	var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid');
 
@@ -104,8 +93,261 @@
 		$this->column_fields = getColumnFields('Calendar');
 	}
 
-	var $new_schema = true;
-
+
+	function save_module($module)
+	{
+		//Handling module specific save
+		//Insert into seactivity rel			
+				if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')
+				{
+					$this->insertIntoEntityTable("vtiger_seactivityrel", $module);
+				}
+				elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit")
+				{
+					$this->deleteRelation("vtiger_seactivityrel");
+				}
+		//Insert into cntactivity rel		
+
+			if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '')
+			{
+				$this->insertIntoEntityTable('vtiger_cntactivityrel', $module);
+			}
+			elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit")
+			{
+				$this->deleteRelation('vtiger_cntactivityrel');
+			}
+		
+		//Handling for recurring type
+			//Insert into vtiger_activity_remainder table
+			if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='')
+				$recur_type = trim($this->column_fields['recurringtype']);
+			else
+    				$recur_type='';	
+		
+			if($recur_type == "--None--")
+			{
+				$this->insertIntoReminderTable('vtiger_activity_reminder',$module,"");
+			}
+
+			//Insert into vtiger_recurring event table
+			$recur_type = trim($this->column_fields['recurringtype']);
+			if($recur_type != "--None--"  && $recur_type != '')
+		      	{		   
+				$recur_data = getrecurringObjValue();
+				if(is_object($recur_data))
+	      				$this->insertIntoRecurringTable($recur_data);
+			}
+
+		//Handling for invitees
+		if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='')
+		{
+			$selected_users_string =  $_REQUEST['inviteesid'];
+			$invitees_array = explode(';',$selected_users_string);
+			$this->insertIntoInviteeTable('vtiger_invitees',$module,$invitees_array);
+
+		}
+
+		//Inserting into sales man activity rel
+		$this->insertIntoSmActivityRel($module);
+
+
+			
+	}	
+
+
+	/** Function to insert values in vtiger_activity_remainder table for the specified module,
+  	  * @param $table_name -- table name:: Type varchar
+  	  * @param $module -- module:: Type varchar
+ 	 */
+	function insertIntoReminderTable($table_name,$module,$recurid)
+	{
+	 	global $log;
+		$log->info("in insertIntoReminderTable  ".$table_name."    module is  ".$module);
+		if($_REQUEST['set_reminder'] == 'Yes')
+		{
+			$log->debug("set reminder is set");
+			$rem_days = $_REQUEST['remdays'];
+			$log->debug("rem_days is ".$rem_days);
+			$rem_hrs = $_REQUEST['remhrs'];
+			$log->debug("rem_hrs is ".$rem_hrs);
+			$rem_min = $_REQUEST['remmin'];
+			$log->debug("rem_minutes is ".$rem_min);
+			$reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min;
+			$log->debug("reminder_time is ".$reminder_time);
+			if ($recurid == "")
+			{
+				if($_REQUEST['mode'] == 'edit')
+				{
+					$this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit');
+				}
+				else
+				{
+					$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
+				}
+			}
+			else
+			{
+				$this->activity_reminder($this->id,$reminder_time,0,$recurid,'');
+			}
+		}
+		elseif($_REQUEST['set_reminder'] == 'No')
+		{
+			$this->activity_reminder($this->id,'0',0,$recurid,'delete');
+		}
+	}
+	
+
+	// Code included by Jaguar - starts
+	/** Function to insert values in vtiger_recurringevents table for the specified tablename,module
+  	  * @param $recurObj -- Recurring Object:: Type varchar
+ 	 */	
+function insertIntoRecurringTable(& $recurObj)
+{
+	global $log,$adb;
+	$log->info("in insertIntoRecurringTable  ");
+	$st_date = $recurObj->startdate->get_formatted_date();
+	$log->debug("st_date ".$st_date);
+	$end_date = $recurObj->enddate->get_formatted_date();
+	$log->debug("end_date is set ".$end_date);
+	$type = $recurObj->recur_type;
+	$log->debug("type is ".$type);
+        $flag="true";
+
+	if($_REQUEST['mode'] == 'edit')
+	{
+		$activity_id=$this->id;
+
+		$sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype';
+		
+		$result = $adb->query($sql);
+		$noofrows = $adb->num_rows($result);
+		for($i=0; $i<$noofrows; $i++)
+		{
+			$recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype");
+			$date_start_b4edit = $adb->query_result($result,$i,"min_date");
+			$end_date_b4edit = $adb->query_result($result,$i,"max_date");
+		}
+		if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit))
+		{
+			if($_REQUEST['set_reminder'] == 'Yes')
+			{
+				$sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id;
+				$adb->query($sql);
+				$sql = 'delete  from vtiger_recurringevents where activityid='.$activity_id;
+				$adb->query($sql);
+				$flag="true";
+			}
+			elseif($_REQUEST['set_reminder'] == 'No')
+			{
+				$sql = 'delete  from vtiger_activity_reminder where activity_id='.$activity_id;
+				$adb->query($sql);
+				$flag="false";
+			}
+			else
+				$flag="false";
+		}
+		else
+		{
+			$sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id;
+			$adb->query($sql);
+			$sql = 'delete  from vtiger_recurringevents where activityid='.$activity_id;
+			$adb->query($sql);
+		}
+	}
+	$date_array = $recurObj->recurringdates;
+	if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null)
+		$recur_freq = $recurObj->recur_freq;
+	else
+		$recur_freq = 1;
+	if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly')
+		$recurringinfo = $recurObj->recur_type;
+	elseif($recurObj->recur_type == 'Weekly')
+	{
+		$recurringinfo = $recurObj->recur_type;
+		if($recurObj->dayofweek_to_rpt != null)
+			$recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt);
+	}
+	elseif($recurObj->recur_type == 'Monthly')
+	{
+		$recurringinfo =  $recurObj->recur_type.'::'.$recurObj->repeat_monthby;
+		if($recurObj->repeat_monthby == 'date')
+			$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue;
+		else
+			$recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0];
+	}
+	else
+	{
+		$recurringinfo = '';
+	}
+	if($flag=="true")
+	{
+		for($k=0; $k< count($date_array); $k++)
+		{
+			$tdate=$date_array[$k];
+			if($tdate <= $end_date)
+			{
+				$max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;';
+				$result = $adb->query($max_recurid_qry);
+				$noofrows = $adb->num_rows($result);
+				for($i=0; $i<$noofrows; $i++)
+				{
+					$recur_id = $adb->query_result($result,$i,"recurid");
+				}
+				$current_id =$recur_id+1;
+				$recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')";
+				$adb->query($recurring_insert);
+				if($_REQUEST['set_reminder'] == 'Yes')
+				{
+					$this->insertIntoReminderTable("vtiger_activity_reminder",$module,$current_id,'');
+				}
+			}
+		}
+	}
+}
+
+
+	/** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array
+  	  * @param $table_name -- table name:: Type varchar
+  	  * @param $module -- module:: Type varchar
+	  * @param $invitees_array Array
+ 	 */
+	function insertIntoInviteeTable($table_name,$module,$invitees_array)
+	{
+		global $log,$adb;
+		$log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ...");
+		foreach($invitees_array as $inviteeid)
+		{
+			if($inviteeid != '')
+			{
+				$query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")";
+				$adb->query($query);
+			}
+		}
+		$log->debug("Exiting insertIntoInviteeTable method ...");
+
+	}
+
+
+	/** Function to insert values in vtiger_salesmanactivityrel table for the specified module
+  	  * @param $module -- module:: Type varchar
+ 	 */
+
+  	function insertIntoSmActivityRel($module)
+  	{
+    		global $adb;
+    		global $current_user;
+    		if($this->mode == 'edit')
+    		{
+
+      			$sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id']."";
+      			$adb->query($sql);
+
+    		}
+		$sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")";
+    		$adb->query($sql_qry);
+
+  	}
+	
 	
 	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
 	/**
@@ -154,7 +396,7 @@
                         $log->debug("Entering get_contacts(".$id.") method ...");
 			global $app_strings;
 
-			$focus = new Contact();
+			$focus = new Contacts();
 
 			$button = '';
 
@@ -177,7 +419,7 @@
                 $log->debug("Entering get_contacts(".$id.") method ...");
 		global $app_strings;
 
-		$focus = new User();
+		$focus = new Users();
 
 		$button = '';
 
@@ -395,8 +637,8 @@
 	global $log,$adb;
 	$log->debug("Entering get_tasksforol(".$username.") method ...");
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -447,8 +689,8 @@
 	global $log,$adb;
 	$log->debug("Entering get_calendarsforol(".$user_name.") method ...");
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');

Modified: vtigercrm/trunk/modules/Calendar/ActivityAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/ActivityAjax.php (original)
+++ vtigercrm/trunk/modules/Calendar/ActivityAjax.php Tue Oct 31 03:40:43 2006
@@ -19,6 +19,27 @@
 $cal_log =& LoggerManager::getLogger('calendar');
 $cal_log->debug("In CalendarAjax file");
 $mysel = $_REQUEST['view'];
+if($_REQUEST['file'] == 'OpenListView')
+{
+	require_once('Smarty_setup.php');
+	$smarty = new vtigerCRM_Smarty;
+	require_once("modules/Calendar/OpenListView.php");
+	$smarty->assign("APP",$app_strings);
+	$smarty->assign("IMAGE_PATH",$image_path);
+	if($_REQUEST['mode'] == '0')
+	{
+		$activities[0] = getPendingActivities(0);
+		$smarty->assign("ACTIVITIES",$activities);
+		$smarty->display("upcomingActivities.tpl");
+	}
+	else if($_REQUEST['mode'] == '1')
+	{
+		$activities[1] = getPendingActivities(1);
+		$smarty->assign("ACTIVITIES",$activities);
+		$smarty->display("pendingActivities.tpl");
+	}
+	die();
+}
 $calendar_arr = Array();
 $calendar_arr['IMAGE_PATH'] = $image_path;
 $date_data = array();

Modified: vtigercrm/trunk/modules/Calendar/Appointment.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/Appointment.php (original)
+++ vtigercrm/trunk/modules/Calendar/Appointment.php Tue Oct 31 03:40:43 2006
@@ -60,7 +60,7 @@
 		require('user_privileges/user_privileges_'.$current_user->id.'.php');
 		require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
 		$shared_ids = getSharedCalendarId($current_user->id);
-                $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') ";
+                $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') ";
 		if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3)
 		{
 			$sec_parameter=getListViewSecurityParameter('Calendar');
@@ -83,7 +83,7 @@
                         unset($obj);
                 }
 		//Get Recurring events
-		$q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid";
+		$q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname ";
 
                 $q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (recurringdate < '".$to_datetime->get_formatted_date()."' AND recurringdate >= '".$from_datetime->get_formatted_date(). "') ";
 
@@ -93,7 +93,7 @@
 			$q .= $sec_parameter;
 		}
 													
-                $q .= " ORDER by recurringid";
+                $q .= " ORDER by vtiger_recurringevents.recurringid";
                 $r = $adb->query($q);
                 $n = $adb->getRowCount($r);
                 $a = 0;

Modified: vtigercrm/trunk/modules/Calendar/CalendarCommon.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/CalendarCommon.php (original)
+++ vtigercrm/trunk/modules/Calendar/CalendarCommon.php Tue Oct 31 03:40:43 2006
@@ -206,7 +206,7 @@
 				$hrsel = 'selected';
 			else
 				$hrsel = '';
-			$combo .= '<option value="'.$hrvalue.'" "'.$hrsel.'">'.$hrtext.'</option>';
+			$combo .= '<option value="'.$hrvalue.'" '.$hrsel.'>'.$hrtext.'</option>';
 		}
 		$combo .= '</select>&nbsp;';
 		$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small>';
@@ -223,7 +223,7 @@
 				$minsel = 'selected';
 			else
 				$minsel = '';
-				$combo .= '<option value="'.$value.'" "'.$minsel.'">'.$value.'</option>';
+				$combo .= '<option value="'.$value.'" '.$minsel.'>'.$value.'</option>';
 		}
 		$combo .= '</select>&nbsp;';
 		$combo .= '<select name="'.$bimode.'fmt" id="'.$bimode.'fmt" class=small>';
@@ -255,7 +255,7 @@
 					$hrsel = 'selected';
 				else
 					$hrsel = '';
-				$combo .= '<option value="'.$hrvalue.'" "'.$hrsel.'">'.$hrvalue.'</option>';
+				$combo .= '<option value="'.$hrvalue.'" '.$hrsel.'>'.$hrvalue.'</option>';
 			}
 			$combo .= '</select>Hr&nbsp;';
 			$combo .= '<select name="'.$bimode.'min" id="'.$bimode.'min" class=small>';
@@ -272,7 +272,7 @@
 					$minsel = 'selected';
 				else
 					$minsel = '';
-				$combo .= '<option value="'.$value.'" "'.$minsel.'">'.$value.'</option>';
+				$combo .= '<option value="'.$value.'" '.$minsel.'>'.$value.'</option>';
 			}
 			$combo .= '</select>&nbsp;min<input type="hidden" name="'.$bimode.'fmt" id="'.$bimode.'fmt">';
 		}

Modified: vtigercrm/trunk/modules/Calendar/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/DetailView.php (original)
+++ vtigercrm/trunk/modules/Calendar/DetailView.php Tue Oct 31 03:40:43 2006
@@ -136,21 +136,21 @@
 $data['date_start'] = $stdate;
 $data['due_date'] = $enddate;
 $data['assigned_user_id'] = $finaldata['assigned_user_id'];
-$data['taskpriority'] = $finaldata['taskpriority'];
+$data['taskpriority'] = $mod_strings[$finaldata['taskpriority']];
 $data['modifiedtime'] = $finaldata['modifiedtime'];
 $data['createdtime'] = $finaldata['createdtime'];
 $data['parent_name'] = $finaldata['parent_id'];
 $data['description'] = $finaldata['description'];
 if($activity_mode == 'Task')
 {
-	$data['taskstatus'] = $finaldata['taskstatus'];
+	$data['taskstatus'] = $mod_strings[$finaldata['taskstatus']];
 	$data['activitytype'] = $activity_mode;
 	$data['contact_id'] = $finaldata['contact_id'];
 }
 elseif($activity_mode == 'Events')
 {
 	$data['visibility'] = $finaldata['visibility'];
-	$data['eventstatus'] = $finaldata['eventstatus'];
+	$data['eventstatus'] = $mod_strings[$finaldata['eventstatus']];
 	$data['activitytype'] = $finaldata['activitytype'];
 	$data['location'] = $finaldata['location'];
 	//Calculating reminder time

Modified: vtigercrm/trunk/modules/Calendar/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/ListView.php (original)
+++ vtigercrm/trunk/modules/Calendar/ListView.php Tue Oct 31 03:40:43 2006
@@ -76,6 +76,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 $where = "";
 
 $url_string = ''; // assigning http url string

Modified: vtigercrm/trunk/modules/Calendar/OpenListView.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/OpenListView.php (original)
+++ vtigercrm/trunk/modules/Calendar/OpenListView.php Tue Oct 31 03:40:43 2006
@@ -49,82 +49,67 @@
 	//code added to customize upcomming and pending activities
 	if($_REQUEST['activity_view']=='')
 	{	
-		$query = "select activity_view from vtiger_users where id ='$current_user->id'";
-		$result=$adb->query($query);
-		$activity_view=$adb->query_result($result,0,'activity_view');
+		$activity_view='today';
 	}
 	else
 		$activity_view=$_REQUEST['activity_view'];
 
 	$today = date("Y-m-d", time());
 
-	if($activity_view == 'Today')
-	{	
-		$later = date("Y-m-d",strtotime("$today +1 day"));
-	}	
-	else if($activity_view == 'This Week')
-	{
-		$later = date("Y-m-d", strtotime("$today +7 days"));
-	}
-	else if($activity_view == 'This Month')
-	{	
-		$later = date("Y-m-d", strtotime("$today +1 month"));
-	}	
-	else if($activity_view == 'This Year')	
-	{
-		$later = date("Y-m-d", strtotime("$today +1 year"));
-	}
-	else if($activity_view == 'OverDue')	
-	{
-		$later = date("Y-m-d", strtotime("$today +1 day"));
-	}
-	$last_tendays = date("Y-m-d",strtotime("$today -10 days"));
+	if($activity_view == 'today')
+	{	
+		$upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
+		$pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')";
+	}	
+	else if($activity_view == 'all')
+	{
+		$upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')";
+		$pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')";
+	}
 	if($mode != 1)
 	{
 		//for upcoming avtivities
-		$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and  (  vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Not Held' ) AND ((date_start > '$today' AND date_start < '$later')  OR (vtiger_recurringevents.recurringdate between '$today' and '$later') ) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'";
+		$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and  (  vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'";
 	}	
 	else
 	{
-		//for pending activities for the last 10 days
-		$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and (  vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Not Held' ) AND ((due_date > '$last_tendays' AND due_date <= '$today') OR (vtiger_recurringevents.recurringdate > '$last_tendays' AND vtiger_recurringevents.recurringdate <= '$today')) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'";
-	}
+		//for pending activities
+		$list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and (  vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'";
+	}
+	
 	$res = $adb->query($list_query);
 	$noofrecords = $adb->num_rows($res);
-	$list_result = $adb->limitQuery($list_query,0,5);
 	$open_activity_list = array();
-	$noofrows = $adb->num_rows($list_result);
-	if (count($list_result)>0)
+	$noofrows = $adb->num_rows($res);
+	if (count($res)>0)
 		for($i=0;$i<$noofrows;$i++) 
 		{
-			$parent_name=getRelatedTo("Calendar",$list_result,$i);
-			$open_activity_list[] = Array('name' => $adb->query_result($list_result,$i,'subject'),
-					'id' => $adb->query_result($list_result,$i,'activityid'),
-					'type' => $adb->query_result($list_result,$i,'activitytype'),
-					'module' => $adb->query_result($list_result,$i,'setype'),
-					'status' => $adb->query_result($list_result,$i,'status'),
-					'firstname' => $adb->query_result($list_result,$i,'firstname'),
-					'lastname' => $adb->query_result($list_result,$i,'lastname'),
-					'accountname' => $adb->query_result($list_result,$i,'accountname'),
-					'accountid' => $adb->query_result($list_result, $i, 'accountid'),
-					'contactid' => $adb->query_result($list_result,$i,'contactid'),
-					'date_start' => getDisplayDate($adb->query_result($list_result,$i,'date_start')),
-					'due_date' => getDisplayDate($adb->query_result($list_result,$i,'due_date')),
-					'recurringtype' => getDisplayDate($adb->query_result($list_result,$i,'recurringtype')),
-					'recurringdate' => getDisplayDate($adb->query_result($list_result,$i,'recurringdate')),
+			$parent_name=getRelatedTo("Calendar",$res,$i);
+			$open_activity_list[] = Array('name' => $adb->query_result($res,$i,'subject'),
+					'id' => $adb->query_result($res,$i,'activityid'),
+					'type' => $adb->query_result($res,$i,'activitytype'),
+					'module' => $adb->query_result($res,$i,'setype'),
+					'status' => $adb->query_result($res,$i,'status'),
+					'firstname' => $adb->query_result($res,$i,'firstname'),
+					'lastname' => $adb->query_result($res,$i,'lastname'),
+					'accountname' => $adb->query_result($res,$i,'accountname'),
+					'accountid' => $adb->query_result($res, $i, 'accountid'),
+					'contactid' => $adb->query_result($res,$i,'contactid'),
+					'date_start' => getDisplayDate($adb->query_result($res,$i,'date_start')),
+					'due_date' => getDisplayDate($adb->query_result($res,$i,'due_date')),
+					'recurringtype' => getDisplayDate($adb->query_result($res,$i,'recurringtype')),
+					'recurringdate' => getDisplayDate($adb->query_result($res,$i,'recurringdate')),
 					'parent'=> $parent_name,
 					// Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
-					'priority' => $adb->query_result($list_result,$i,'priority'), // Armando Lüscher 04.07.2005 -> §priority -> Desc: Get vtiger_priority from db
+					'priority' => $adb->query_result($res,$i,'priority'), // Armando Lüscher 04.07.2005 -> §priority -> Desc: Get vtiger_priority from db
 					);
 		}
-	$later_day = getDisplayDate(date("Y-m-d", strtotime("$later -1 day ")));
 	
 	$title=array();
 	$title[]=$activity_view;
 	$title[]='myUpcoPendAct.gif';
-	//.'('.$current_module_strings["LBL_TODAY"].' '.$later_day.')';
 	$title[]='home_myact';
-	$title[]=getActivityView($activity_view);
+	//$title[]=getActivityView($activity_view);
 	$title[]='showActivityView';		
 	$title[]='MyUpcumingFrm';
 	$title[]='activity_view';
@@ -229,7 +214,6 @@
 			}
 		}
 		// Code by Jaguar Ends
-		$entries['noofactivities'] = $noofrecords;
 		$entries[$event['id']] = array(
 				'0' => '<a href="index.php?action=DetailView&module='.$event["module"].'&activity_mode='.$activity_type.'&record='.$event["id"].''.$return_url.'" style="'.$font_color.';">'.$event["name"].'</a>',
 				'IMAGE' => '<IMG src="'.$image_path.$event["type"].'s.gif">',
@@ -241,7 +225,7 @@
 				'RECURRINGTYPE' => ereg_replace('--','',$event['recurringtype']),
 				);
 	}
-	$values=Array('Title'=>$title,'Header'=>$header,'Entries'=>$entries);
+	$values=Array('noofactivities'=>$noofrecords,'Title'=>$title,'Header'=>$header,'Entries'=>$entries);
 	$log->debug("Exiting getPendingActivities method ...");
 		return $values;
 }

Modified: vtigercrm/trunk/modules/Calendar/RenderRelatedListUI.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/RenderRelatedListUI.php (original)
+++ vtigercrm/trunk/modules/Calendar/RenderRelatedListUI.php Tue Oct 31 03:40:43 2006
@@ -10,8 +10,8 @@
  ********************************************************************************/
 
 require_once('include/RelatedListView.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Products/Products.php');
 require_once('include/utils/UserInfoUtil.php');
 
 // functions added for group calendar	-Jaguar

Modified: vtigercrm/trunk/modules/Calendar/addEventUI.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/addEventUI.php (original)
+++ vtigercrm/trunk/modules/Calendar/addEventUI.php Tue Oct 31 03:40:43 2006
@@ -202,8 +202,8 @@
 	<input type="hidden" name="subtab" value="">
 	<input type="hidden" name="maintab" value="Calendar">
 		<table border=0 cellspacing=0 cellpadding=5 width=100% class="layerHeadingULine">
-		<tr>
-			<td class="layerPopupHeading"><?php echo $mod_strings['LBL_ADD_EVENT']?></b></td>
+		<tr style="cursor:move;">
+			<td class="layerPopupHeading" id="moveEvent"><?php echo $mod_strings['LBL_ADD_EVENT']?></b></td>
 				<td align=right><a href="javascript:ghide('addEvent');"><img src="<?php echo $image_path ?>close.gif" border="0"  align="absmiddle" /></a></td>
 		</tr>
 		</table>
@@ -649,7 +649,7 @@
 	<tr><td><a href='' id="addtodo" class='drop_down'><?php echo $mod_strings['LBL_ADDTODO']?></a></td></tr>
 </table>
 </div>
-<div class="calAddEvent layerPopup" style="display:none" id="createTodo" align=center>
+<div class="calAddEvent layerPopup" style="display:none;width:550px;left:200px;" id="createTodo" align=center>
 <form name="createTodo" onSubmit="task_check_form();return formValidate();" method="POST" action="index.php">
 <input type="hidden" name="return_action" value="index">
 <input type="hidden" name="return_module" value="Calendar">
@@ -669,8 +669,8 @@
   <input type="hidden" name="subtab" value="">
   <input type="hidden" name="maintab" value="Calendar">
 	<table border=0 cellspacing=0 cellpadding=5 width=100% class="layerHeadingULine">
-		<tr>
-                	<td class="lvtHeaderText"><?php echo $mod_strings['LBL_ADD_TODO'] ?></b></td>
+		<tr style="cursor:move;">
+                	<td class="lvtHeaderText" id="moveTodo"><?php echo $mod_strings['LBL_ADD_TODO'] ?></b></td>
 			<td align=right><a href="javascript:ghide('createTodo');"><img src="<?php echo $image_path ?>close.gif" border="0"  align="absmiddle" /></a></td>
 		</tr>
         </table>
@@ -902,4 +902,14 @@
                 </tr>
         </table>
 </div>
-
+<script>
+	//for move addEventUI
+	var theEventHandle = document.getElementById("moveEvent");
+	var theEventRoot   = document.getElementById("addEvent");
+	Drag.init(theEventHandle, theEventRoot);
+
+	//for move addToDo
+	var theTodoHandle = document.getElementById("moveTodo");
+	var theTodoRoot   = document.getElementById("createTodo");
+	Drag.init(theTodoHandle, theTodoRoot);
+</script>

Modified: vtigercrm/trunk/modules/Calendar/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Calendar/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Calendar/language/en_us.lang.php Tue Oct 31 03:40:43 2006
@@ -402,6 +402,8 @@
 'Pending Input'=>'Pending Input',
 'LBL_REMAINDER_DAY'=>'days',
 'LBL_REMAINDER_HRS'=>'hrs',
+'Call'=>'Call',
+'Meeting'=>'Meeting',
 
 );
 

Modified: vtigercrm/trunk/modules/Campaigns/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Campaigns/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('modules/CustomView/CustomView.php');
 require_once('include/utils/utils.php');
 //Redirecting Header for single page layout 
@@ -23,7 +23,7 @@
 }
 else
 {
-$focus = new Campaign();
+$focus = new Campaigns();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {

Modified: vtigercrm/trunk/modules/Campaigns/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/Delete.php (original)
+++ vtigercrm/trunk/modules/Campaigns/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('ticket_delete');
 
-$focus = new Campaign();
+$focus = new Campaigns();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Campaigns/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/DetailView.php (original)
+++ vtigercrm/trunk/modules/Campaigns/DetailView.php Tue Oct 31 03:40:43 2006
@@ -11,12 +11,12 @@
 
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('modules/CustomView/CustomView.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
 
-$focus = new Campaign();
+$focus = new Campaigns();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record']!= null ) 
 {

Modified: vtigercrm/trunk/modules/Campaigns/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Campaigns/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Campaign();
+		$modObj = new Campaigns();
 		$modObj->retrieve_entity_info($crmid,"Campaigns");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Campaigns/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/EditView.php (original)
+++ vtigercrm/trunk/modules/Campaigns/EditView.php Tue Oct 31 03:40:43 2006
@@ -11,12 +11,12 @@
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
 require_once('include/utils/utils.php');
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('include/FormValidationUtil.php');
 
 global $app_strings,$mod_strings,$currentModule,$theme;
 
-$focus = new Campaign();
+$focus = new Campaigns();
 $smarty = new vtigerCRM_Smarty();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] !='') 

Modified: vtigercrm/trunk/modules/Campaigns/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/ListView.php (original)
+++ vtigercrm/trunk/modules/Campaigns/ListView.php Tue Oct 31 03:40:43 2006
@@ -8,7 +8,7 @@
  * All Rights Reserved.
 *
  ********************************************************************************/
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
@@ -28,7 +28,7 @@
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 
-$focus = new Campaign();
+$focus = new Campaigns();
 $category = getParentTab();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
@@ -77,6 +77,7 @@
 $customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 //<<<<<customview>>>>>
 
 if($viewid != 0)

Modified: vtigercrm/trunk/modules/Campaigns/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/Save.php (original)
+++ vtigercrm/trunk/modules/Campaigns/Save.php Tue Oct 31 03:40:43 2006
@@ -21,11 +21,11 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Campaigns/Campaign.php');
+require_once('modules/Campaigns/Campaigns.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 
-$focus = new Campaign();
+$focus = new Campaigns();
  global $current_user;
  $currencyid=fetchCurrency($current_user->id);
  $rate_symbol = getCurrencySymbolandCRate($currencyid);

Modified: vtigercrm/trunk/modules/Contacts/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Contacts/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('Smarty_setup.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/utils/utils.php');
 
 //Redirecting Header for single page layout
@@ -22,7 +22,7 @@
 }
 else
 {
-$focus = new Contact();
+$focus = new Contacts();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 

Modified: vtigercrm/trunk/modules/Contacts/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Delete.php (original)
+++ vtigercrm/trunk/modules/Contacts/Delete.php Tue Oct 31 03:40:43 2006
@@ -17,13 +17,13 @@
  * Description:  TODO: To be written.
  ********************************************************************************/
 
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('contact_delete');
 
-$focus = new Contact();
+$focus = new Contacts();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Contacts/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/DetailView.php (original)
+++ vtigercrm/trunk/modules/Contacts/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
@@ -33,7 +33,7 @@
 global $app_strings;
 global $currentModule, $singlepane_view;
 
-$focus = new Contact();
+$focus = new Contacts();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {
 

Modified: vtigercrm/trunk/modules/Contacts/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Contacts/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 	      
 require_once('include/logging.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
      $fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
      if($crmid != "")
 	 {
-		 $cntObj = new Contact();
+		 $cntObj = new Contacts();
 		 $cntObj->retrieve_entity_info($crmid,"Contacts");
 		 $cntObj->column_fields[$fieldname] = $fieldvalue;
 		 $cntObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Contacts/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/EditView.php (original)
+++ vtigercrm/trunk/modules/Contacts/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -39,7 +39,7 @@
  $image_error=isset($_REQUEST['image_error'])?$_REQUEST['image_error']:"false";
 //end
 
-$focus = new Contact();
+$focus = new Contacts();
 $smarty = new vtigerCRM_Smarty;
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) 
@@ -68,9 +68,9 @@
 
 if(isset($_REQUEST['account_id']) && $_REQUEST['account_id']!='' && $_REQUEST['record']=='')
 {
-        require_once('modules/Accounts/Account.php');
+        require_once('modules/Accounts/Accounts.php');
         $focus->column_fields['account_id'] = $_REQUEST['account_id'];
-        $acct_focus = new Account();
+        $acct_focus = new Accounts();
         $acct_focus->retrieve_entity_info($_REQUEST['account_id'],"Accounts");
         $focus->column_fields['fax']=$acct_focus->column_fields['fax'];
         $focus->column_fields['otherphone']=$acct_focus->column_fields['phone'];

Modified: vtigercrm/trunk/modules/Contacts/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/ListView.php (original)
+++ vtigercrm/trunk/modules/Contacts/ListView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -39,7 +39,7 @@
 
 global $currentModule,$theme;
 
-$focus = new Contact();
+$focus = new Contacts();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 
@@ -114,6 +114,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 // Buttons and View options
 if($viewid != 0)
 {

Modified: vtigercrm/trunk/modules/Contacts/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Save.php (original)
+++ vtigercrm/trunk/modules/Contacts/Save.php Tue Oct 31 03:40:43 2006
@@ -20,7 +20,7 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once("modules/Emails/mail.php");
@@ -51,7 +51,7 @@
 $local_log =& LoggerManager::getLogger('index');
 
 global $log,$adb;
-$focus = new Contact();
+$focus = new Contacts();
 
 setObjectValuesFromRequest(&$focus);
 

Modified: vtigercrm/trunk/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/CustomView.php (original)
+++ vtigercrm/trunk/modules/CustomView/CustomView.php Tue Oct 31 03:40:43 2006
@@ -36,25 +36,7 @@
 
 
 
-	var $module_list = Array("Leads"=>Array("Information"=>13,"Address"=>15,"Description"=>16,"Custom Information"=>14),
-				 "Contacts"=>Array("Information"=>4,"Address"=>7,"Description"=>8,"Custom Information"=>5),
-				 "Accounts"=>Array("Information"=>9,"Address"=>11,"Description"=>12,"Custom Information"=>10),
-				 "Potentials"=>Array("Information"=>1,"Description"=>3,"Custom Information"=>2),
-				 "Calendar"=>Array("Information"=>19,"Description"=>20),
- 		                 "Campaigns"=>Array("Information"=>76,"Expectations"=>78,"Description"=>82,"Custom Information"=>77),
-				 "Products"=>Array("Information"=>31,"Description"=>36,"Pricing Information"=>32,"Stock Information"=>33,"Custom Information"=>34),
-				 "Vendors"=>Array("Information"=>44,"Address"=>46,"Description"=>47,"Custom Information"=>45),
-				 "PriceBooks"=>Array("Information"=>48,"Description"=>50,"Custom Information"=>49),
-				 "Notes"=>Array("Information"=>17,"Description"=>18),
-				 "Emails"=>Array("Information"=>'21,22,23',"Description"=>24),
-				 "HelpDesk"=>Array("Information"=>'25,26',"Description"=>28,"Custom Information"=>27,"Solution"=>29),
-				 "Quotes"=>Array("Information"=>51,"Address"=>53,"Description"=>56,"Terms and Conditions"=>55,"Custom Information"=>52),
-				 "PurchaseOrder"=>Array("Information"=>57,"Address"=>59,"Description"=>62,"Terms and Conditions"=>61,"Custom Information"=>58),
-				 "SalesOrder"=>Array("Information"=>63,"Address"=>65,"Description"=>68,"Terms and Conditions"=>67,"Custom Information"=>64),
-				 "Faq"=>Array("Information"=>'37,38,39'),
-				 "Invoice"=>Array("Information"=>69,"Address"=>71,"Description"=>74,"Terms and Conditions"=>73,"Custom Information"=>70)
-				);
-
+	var $module_list = Array();
 
 	var $customviewmodule;
 
@@ -292,6 +274,8 @@
 
 	function getModuleColumnsList($module)
 	{
+
+		$module_info = $this->getCustomViewModuleInfo($module);
 		foreach($this->module_list[$module] as $key=>$value)
 		{
 			$columnlist = $this->getColumnsListbyBlock($module,$value);
@@ -342,7 +326,7 @@
 		global $current_user;
         	require('user_privileges/user_privileges_'.$current_user->id.'.php');
 
-
+		$module_info = $this->getCustomViewModuleInfo($module);
 		foreach($this->module_list[$module] as $key=>$blockid)
 		{
 			$blockids[] = $blockid;
@@ -1525,5 +1509,35 @@
 		return $calist;	
 	}
 
+
+	/* This function sets the block information for the given module to the class variable module_list
+	* and return the array
+	*/
+
+	function getCustomViewModuleInfo($module)
+	{
+		global $adb;
+		global $current_language;
+		$current_mod_strings = return_specified_module_language($current_language, $module); 
+		$block_info = Array();
+		$Sql = "select distinct block,vtiger_field.tabid,name,blocklabel from vtiger_field inner join vtiger_blocks on vtiger_blocks.blockid=vtiger_field.block inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where displaytype != 3 and vtiger_field.block not in(40,6,75,35,30,54,60,66,72) and vtiger_tab.name='$module' order by block";
+		$result = $adb->query($Sql);
+		while($block_result = $adb->fetch_array($result))
+		{
+			$block_label = $block_result['blocklabel'];
+			if (trim($block_label) == '')
+			{
+				$block_info[$pre_block_label] = $block_info[$pre_block_label].",".$block_result['block'];
+			}else
+			{
+				$lan_block_label = $current_mod_strings[$block_label];
+				$block_info[$lan_block_label] = $block_result['block'];
+			}
+			$pre_block_label = $lan_block_label;
+		}
+		$this->module_list[$module] = $block_info;
+		return $this->module_list;
+	}
+
 }
 ?>

Modified: vtigercrm/trunk/modules/CustomView/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/EditView.php (original)
+++ vtigercrm/trunk/modules/CustomView/EditView.php Tue Oct 31 03:40:43 2006
@@ -221,7 +221,7 @@
 	foreach($oCustomView->module_list[$module] as $key=>$value)
 	{
 		$advfilter = array();			
-		$label = $app_list_strings['moduleList'][$module]." ".$key;
+		$label = $key;
 		if(isset($columnslist[$module][$key]))
 		{
 			foreach($columnslist[$module][$key] as $field=>$fieldlabel)

Modified: vtigercrm/trunk/modules/CustomView/PopulateCustomView.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/PopulateCustomView.php (original)
+++ vtigercrm/trunk/modules/CustomView/PopulateCustomView.php Tue Oct 31 03:40:43 2006
@@ -315,6 +315,7 @@
 		  Array('vtiger_products:productname:productname:Products_Product_Name:V',
                         'vtiger_products:productcode:productcode:Products_Product_Code:V',
                         'vtiger_products:commissionrate:commissionrate:Products_Commission_Rate:V',
+			'vtiger_products:qtyinstock:qtyinstock:Products_Quantity_In_Stock:V',
                         'vtiger_products:qty_per_unit:qty_per_unit:Products_Qty/Unit:V',
                         'vtiger_products:unit_price:unit_price:Products_Unit_Price:V'),
 		  

Modified: vtigercrm/trunk/modules/Emails/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Emails/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,10 +11,10 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/utils/utils.php');
 
-$focus = new Email();
+$focus = new Emails();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {

Modified: vtigercrm/trunk/modules/Emails/ChooseEmail.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/ChooseEmail.php (original)
+++ vtigercrm/trunk/modules/Emails/ChooseEmail.php Tue Oct 31 03:40:43 2006
@@ -29,20 +29,20 @@
 
 if ($pmodule=='Accounts')
 {
-	require_once('modules/Accounts/Account.php');
-	$myfocus = new Account();
+	require_once('modules/Accounts/Accounts.php');
+	$myfocus = new Accounts();
 	$myfocus->retrieve_entity_info($entityid,"Accounts");
 }
 elseif ($pmodule=='Contacts')
 {
-	require_once('modules/Contacts/Contact.php');
-	$myfocus = new Contact();
+	require_once('modules/Contacts/Contacts.php');
+	$myfocus = new Contacts();
 	$myfocus->retrieve_entity_info($entityid,"Contacts");
 }
 elseif ($pmodule=='Leads')
 {
-	require_once('modules/Leads/Lead.php');
-	$myfocus = new Lead();
+	require_once('modules/Leads/Leads.php');
+	$myfocus = new Leads();
 	$myfocus->retrieve_entity_info($entityid,"Leads");
 }
 ?>

Modified: vtigercrm/trunk/modules/Emails/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/Delete.php (original)
+++ vtigercrm/trunk/modules/Emails/Delete.php Tue Oct 31 03:40:43 2006
@@ -17,12 +17,12 @@
  * Description:  TODO: To be written.
  ********************************************************************************/
 
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('email_delete');
 
-$focus = new Email();
+$focus = new Emails();
 
 if(!isset($_REQUEST['record']))
 	die("A record number must be specified to delete the email.");

Modified: vtigercrm/trunk/modules/Emails/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/DetailView.php (original)
+++ vtigercrm/trunk/modules/Emails/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/upload_file.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
@@ -32,7 +32,7 @@
 global $mod_strings;
 global $currentModule;
 
-$focus = new Email();
+$focus = new Emails();
 
 $smarty = new vtigerCRM_Smarty;
 if(isset($_REQUEST['record'])) 

Modified: vtigercrm/trunk/modules/Emails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/EditView.php (original)
+++ vtigercrm/trunk/modules/Emails/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('include/FormValidationUtil.php');
@@ -34,7 +34,7 @@
 global $current_user;
 global $currentModule;
 
-$focus = new Email();
+$focus = new Emails();
 $smarty = new vtigerCRM_Smarty();
 
 if($_REQUEST['upload_error'] == true)

Modified: vtigercrm/trunk/modules/Emails/EmailsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/EmailsAjax.php (original)
+++ vtigercrm/trunk/modules/Emails/EmailsAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = $_REQUEST["fieldValue"];
 	if($crmid != "")
 	{
-		$modObj = new Email();
+		$modObj = new Emails();
 		$modObj->retrieve_entity_info($crmid,"Emails");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Emails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/ListView.php (original)
+++ vtigercrm/trunk/modules/Emails/ListView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/utils/utils.php');
@@ -42,7 +42,7 @@
 
 $url_string = ''; // assigning http url string
 
-$focus = new Email();
+$focus = new Emails();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 

Modified: vtigercrm/trunk/modules/Emails/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/Save.php (original)
+++ vtigercrm/trunk/modules/Emails/Save.php Tue Oct 31 03:40:43 2006
@@ -51,13 +51,13 @@
 	$mailbox = 'INBOX';
 }
 
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 
 $local_log =& LoggerManager::getLogger('index');
 
-$focus = new Email();
+$focus = new Emails();
 
 global $current_user;
 setObjectValuesFromRequest(&$focus);

Modified: vtigercrm/trunk/modules/Emails/class.phpmailer.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/class.phpmailer.php (original)
+++ vtigercrm/trunk/modules/Emails/class.phpmailer.php Tue Oct 31 03:40:43 2006
@@ -365,14 +365,14 @@
         // Choose the mailer
         switch($this->Mailer)
         {
-            case "sendmail":
-                $result = $this->SendmailSend($header, $body);
+             case "sendmail":
+                $result = $this->SendmailSend($header, html_entity_decode($body));
                 break;
             case "mail":
-                $result = $this->MailSend($header, $body);
+                $result = $this->MailSend($header, html_entity_decode($body));
                 break;
             case "smtp":
-                $result = $this->SmtpSend($header, $body);
+                $result = $this->SmtpSend($header, html_entity_decode($body));
                 break;
             default:
             $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));

Modified: vtigercrm/trunk/modules/Emails/mail.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/mail.php (original)
+++ vtigercrm/trunk/modules/Emails/mail.php Tue Oct 31 03:40:43 2006
@@ -137,7 +137,7 @@
 	$adb->println("Inside the function setMailerProperties");
 
 	$mail->Subject = $subject;
-	$mail->Body = nl2br($contents);
+	$mail->Body = $contents;
 	//$mail->Body = html_entity_decode(nl2br($contents));	//if we get html tags in mail then we will use this line
 	$mail->AltBody = strip_tags(preg_replace(array("/<p>/i","/<br>/i","/<br \/>/i"),array("\n","\n","\n"),$contents));
 

Modified: vtigercrm/trunk/modules/Emails/mailsend.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/mailsend.php (original)
+++ vtigercrm/trunk/modules/Emails/mailsend.php Tue Oct 31 03:40:43 2006
@@ -124,24 +124,27 @@
 			$fresult=$adb->query($myquery);			
 			if ($pmodule=='Contacts')
 			{
-				require_once('modules/Contacts/Contact.php');
-				$myfocus = new Contact();
+				require_once('modules/Contacts/Contacts.php');
+				$myfocus = new Contacts();
 				$myfocus->retrieve_entity_info($mycrmid,"Contacts");
 			}
 			elseif ($pmodule=='Accounts')
 			{
-				require_once('modules/Accounts/Account.php');
-				$myfocus = new Account();
+				require_once('modules/Accounts/Accounts.php');
+				$myfocus = new Accounts();
 				$myfocus->retrieve_entity_info($mycrmid,"Accounts");
 			} 
 			elseif ($pmodule=='Leads')
 			{
-				require_once('modules/Leads/Lead.php');
-				$myfocus = new Lead();
+				require_once('modules/Leads/Leads.php');
+				$myfocus = new Leads();
 				$myfocus->retrieve_entity_info($mycrmid,"Leads");
 			}
 			$fldname=$adb->query_result($fresult,0,"columnname");
 			$emailadd=br2nl($myfocus->column_fields[$fldname]);
+
+//This is to convert the html encoded string to original html entities so that in mail description contents will be displayed correctly
+	$focus->column_fields['description'] = from_html($focus->column_fields['description']);
 
 			if($emailadd != '')
 			{

Modified: vtigercrm/trunk/modules/Emails/sendmail.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/sendmail.php (original)
+++ vtigercrm/trunk/modules/Emails/sendmail.php Tue Oct 31 03:40:43 2006
@@ -18,7 +18,7 @@
  * @copyright 2001 - 2003 Brent R. Matzelle
  */
 
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('include/logging.php');
 require("modules/Emails/class.phpmailer.php");
 require_once('include/database/PearDatabase.php');

Modified: vtigercrm/trunk/modules/Faq/Faq.php
==============================================================================
--- vtigercrm/trunk/modules/Faq/Faq.php (original)
+++ vtigercrm/trunk/modules/Faq/Faq.php Tue Oct 31 03:40:43 2006
@@ -33,7 +33,7 @@
 	var $log;
 	var $db;
 
-	var $tab_name = Array('vtiger_crmentity','vtiger_faq','vtiger_faqcomments');
+	var $tab_name = Array('vtiger_crmentity','vtiger_faq');
 	var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_faq'=>'id','vtiger_faqcomments'=>'faqid');
 				
 	var $entity_table = "vtiger_crmentity";
@@ -86,6 +86,40 @@
 		$this->log->debug("Exiting Faq method ...");
 	}
 
+	function save_module($module)
+	{
+		//Inserting into Faq comment table
+		$this->insertIntoFAQCommentTable('vtiger_faqcomments', $module);
+		
+	}
+
+
+	/** Function to insert values in vtiger_faqcomments table for the specified module,
+  	  * @param $table_name -- table name:: Type varchar
+  	  * @param $module -- module:: Type varchar
+ 	 */	
+	function insertIntoFAQCommentTable($table_name, $module)
+	{
+		global $log;
+		$log->info("in insertIntoFAQCommentTable  ".$table_name."    module is  ".$module);
+        	global $adb;
+
+        	$current_time = $adb->formatDate(date('YmdHis'));
+
+		if($this->column_fields['comments'] != '')
+			$comment = $this->column_fields['comments'];
+		else
+			$comment = $_REQUEST['comments'];
+
+		if($comment != '')
+		{
+			$comment = addslashes($comment);
+			$sql = "insert into vtiger_faqcomments values('',".$this->id.",'".$comment."',".$current_time.")";	
+			$adb->query($sql);
+		}
+	}	
+	
+
 	/**     Function to get the list of comments for the given FAQ id
          *      @param  int  $faqid - FAQ id
 	 *      @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag.

Modified: vtigercrm/trunk/modules/HelpDesk/ConvertAsFAQ.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/ConvertAsFAQ.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/ConvertAsFAQ.php Tue Oct 31 03:40:43 2006
@@ -49,7 +49,9 @@
 	$sql = "select ticketid, comments, createdtime from vtiger_ticketcomments where ticketid=".$_REQUEST['record'];
 	$res = $adb->query($sql);
 	$noofrows = $adb->num_rows($res);
-	$answer .= '\r\n\r\nCOMMENTS:';
+
+	if($noofrows > 0)
+		$answer .= '\r\n\r\nCOMMENTS:';
 	for($i=0; $i < $noofrows; $i++)
 	{
 		$comments = $adb->query_result($res,$i,'comments');

Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Tue Oct 31 03:40:43 2006
@@ -24,7 +24,7 @@
 	var $log;
 	var $db;
 
-	var $tab_name = Array('vtiger_crmentity','vtiger_troubletickets','vtiger_seticketsrel','vtiger_ticketcf','vtiger_ticketcomments','vtiger_attachments');
+	var $tab_name = Array('vtiger_crmentity','vtiger_troubletickets','vtiger_ticketcf');
 	var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_troubletickets'=>'ticketid','vtiger_seticketsrel'=>'ticketid','vtiger_ticketcf'=>'ticketid','vtiger_ticketcomments'=>'ticketid','vtiger_attachments'=>'attachmentsid');
 	var $column_fields = Array();
 
@@ -91,6 +91,83 @@
 		$this->log->debug("Exiting HelpDesk method ...");
 	}
 
+
+	function save_module($module)
+	{
+		//Inserting into Ticket Comment Table
+		$this->insertIntoTicketCommentTable("vtiger_ticketcomments",'HelpDesk');
+
+		//Inserting into vtiger_seticketsrel table
+		
+		if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')
+		{
+			$this->insertIntoEntityTable('vtiger_seticketsrel', 'HelpDesk');
+		}
+		elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit")
+		{
+			$this->deleteRelation('vtiger_seticketsrel');
+		}
+
+		//Inserting into vtiger_attachments
+		$this->insertIntoAttachment($this->id,'HelpDesk');
+				
+	}	
+
+	/** Function to insert values in vtiger_ticketcomments  for the specified tablename and  module
+  	  * @param $table_name -- table name:: Type varchar
+  	  * @param $module -- module:: Type varchar
+ 	 */	
+	function insertIntoTicketCommentTable($table_name, $module)
+	{
+		global $log;
+		$log->info("in insertIntoTicketCommentTable  ".$table_name."    module is  ".$module);
+        	global $adb;
+		global $current_user;
+
+        	$current_time = $adb->formatDate(date('YmdHis'));
+		if($this->column_fields['assigned_user_id'] != '')
+			$ownertype = 'user';
+		else
+			$ownertype = 'customer';
+
+		if($this->column_fields['comments'] != '')
+			$comment = $this->column_fields['comments'];
+		else
+			$comment = $_REQUEST['comments'];
+
+		if($comment != '')
+		{
+			$comment = addslashes($comment);
+			$sql = "insert into vtiger_ticketcomments values('',".$this->id.",'".$comment."','".$current_user->id."','".$ownertype."',".$current_time.")";	
+	        	$adb->query($sql);
+		}
+	}
+
+
+	/**
+	 *      This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database.
+	 *      @param int $id  - entity id to which the vtiger_files to be uploaded
+	 *      @param string $module  - the current module name
+	*/
+	function insertIntoAttachment($id,$module)
+	{
+		global $log, $adb;
+		$log->debug("Entering into insertIntoAttachment($id,$module) method.");
+		
+		$file_saved = false;
+
+		foreach($_FILES as $fileindex => $files)
+		{
+			if($files['name'] != '' && $files['size'] > 0)
+			{
+				$file_saved = $this->uploadAndSaveFile($id,$module,$files);
+			}
+		}
+
+		$log->debug("Exiting from insertIntoAttachment($id,$module) method.");
+	}
+	
+	
 	/**	Function used to get the sort order for HelpDesk listview
 	 *	@return string	$sorder	- first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['HELPDESK_SORT_ORDER'] if this session value is empty then default sort order will be returned. 
 	 */
@@ -457,7 +534,7 @@
 	{
 		global $log;
 		$log->debug("Entering get_history(".$id.") method ...");
-		$query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus,
+		$query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, vtiger_activity.date_start, vtiger_activity.due_date,
 		vtiger_activity.activitytype, vtiger_troubletickets.ticketid, vtiger_troubletickets.title, vtiger_crmentity.modifiedtime,
 		vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name
 				from vtiger_activity

Modified: vtigercrm/trunk/modules/HelpDesk/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/ListView.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/ListView.php Tue Oct 31 03:40:43 2006
@@ -82,6 +82,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 if($viewid != 0)
 {
         $CActionDtls = $oCustomView->getCustomActionDetails($viewid);

Modified: vtigercrm/trunk/modules/Home/UnifiedSearch.php
==============================================================================
--- vtigercrm/trunk/modules/Home/UnifiedSearch.php (original)
+++ vtigercrm/trunk/modules/Home/UnifiedSearch.php Tue Oct 31 03:40:43 2006
@@ -21,18 +21,6 @@
  ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Accounts/Account.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Leads/Lead.php');
-require_once('modules/Faq/Faq.php');
-require_once('modules/Vendors/Vendor.php');
-require_once('modules/PriceBooks/PriceBook.php');
-require_once('modules/Quotes/Quote.php');
-require_once('modules/PurchaseOrder/PurchaseOrder.php');
-require_once('modules/SalesOrder/SalesOrder.php');
-require_once('modules/Invoice/Invoice.php');
-require_once('modules/Campaigns/Campaign.php');
 require_once('modules/Home/language/en_us.lang.php');
 require_once('include/database/PearDatabase.php');
 require_once('modules/CustomView/CustomView.php');
@@ -41,37 +29,25 @@
 global $mod_strings;
 
 $total_record_count = 0;
-//echo get_module_title("", "Search Results", true); 
-if(isset($_REQUEST['query_string']) && preg_match("/[\w]/", $_REQUEST['query_string'])) {
+
+$query_string = trim($_REQUEST['query_string']);
+if(isset($query_string) && $query_string != '')//preg_match("/[\w]/", $_REQUEST['query_string'])) 
+{
 
 	//module => object
-	$object_array = Array(
-				'Potentials'=>'Potential',
-				'Accounts'=>'Account',
-				'Contacts'=>'Contact',
-				'Leads'=>'Lead',
-				'Notes'=>'Note',
-				'Calendar'=>'Activity',
-				'Emails'=>'Email',
-				'HelpDesk'=>'HelpDesk',
-				'Products'=>'Product',
-				'Faq'=>'Faq',
-				//'Events'=>'',
-				'Vendors'=>'Vendor',
-				'PriceBooks'=>'PriceBook',
-				'Quotes'=>'Quote',
-				'PurchaseOrder'=>'Order',
-				'SalesOrder'=>'SalesOrder',
-				'Invoice'=>'Invoice',
-				'Campaigns'=>'Campaign'
-			     );
+	$object_array = getSearchModules();
+	foreach($object_array as $curr_module=>$curr_object)
+	{
+		require_once("modules/$curr_module/$curr_object.php");
+	}
+
 	global $adb;
 	global $current_user;
 	global $theme;
 	$theme_path="themes/".$theme."/";
 	$image_path=$theme_path."images/";
 
-	$search_val = $_REQUEST['query_string'];
+	$search_val = $query_string;
 	$search_module = $_REQUEST['search_module'];
 
 	getSearchModulesComboList($search_module);
@@ -285,4 +261,28 @@
 		</table>
 	<?php
 }
+
+/*To get the modules allowed for global search this function returns all the 
+ * modules which supports global search as an array in the following structure 
+ * array($module_name1=>$object_name1,$module_name2=>$object_name2,$module_name3=>$object_name3,$module_name4=>$object_name4,-----);
+ */
+ function getSearchModules()
+ {
+	 global $adb;
+	 $sql = 'select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where vtiger_tab.tabid not in (16,29)';
+	$result = $adb->query($sql);
+	while($module_result = $adb->fetch_array($result))
+	{
+		$modulename = $module_result['name'];
+		if($modulename != 'Calendar')
+		{
+			$return_arr[$modulename] = $modulename;
+		}else
+		{
+			$return_arr[$modulename] = 'Activity';
+		}
+	}
+	return $return_arr;
+ }
+
 ?>

Modified: vtigercrm/trunk/modules/Import/ImportAccount.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportAccount.php (original)
+++ vtigercrm/trunk/modules/Import/ImportAccount.php Tue Oct 31 03:40:43 2006
@@ -22,15 +22,15 @@
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once('data/SugarBean.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Emails/Email.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Potentials/Potentials.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Emails/Emails.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/ComboUtil.php');
 
 // Account is used to store vtiger_account information.
-class ImportAccount extends Account {
+class ImportAccount extends Accounts {
 	 var $db;
 
 	// Get _dom arrays from Database

Modified: vtigercrm/trunk/modules/Import/ImportAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportAjax.php (original)
+++ vtigercrm/trunk/modules/Import/ImportAjax.php Tue Oct 31 03:40:43 2006
@@ -12,6 +12,14 @@
 require_once('Smarty_setup.php');
 include('modules/Import/ImportMap.php');
 include('modules/Import/Forms.php');
+
+//This is to delete the map
+if($_REQUEST['delete_map'] != '')
+{
+	$query = "update vtiger_import_maps set deleted=1 where id = ".$_REQUEST['mapping'];
+	$adb->query($query);
+}
+
 $mapping_file = new ImportMap();
 $mapping_arr = $mapping_file->getSavedMappingContent($_REQUEST['mapping']);
 

Modified: vtigercrm/trunk/modules/Import/ImportContact.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportContact.php (original)
+++ vtigercrm/trunk/modules/Import/ImportContact.php Tue Oct 31 03:40:43 2006
@@ -18,7 +18,7 @@
  ********************************************************************************/
 include_once('config.php');
 require_once('include/logging.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('modules/Import/UsersLastImport.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/ComboUtil.php');
@@ -28,7 +28,7 @@
 $comboFieldArray = getComboArray($comboFieldNames);
 
 // Contact is used to store customer information.
-class ImportContact extends Contact {
+class ImportContact extends Contacts {
 	// these are vtiger_fields that may be set on import
 	// but are to be processed and incorporated
 	// into vtiger_fields of the parent class
@@ -169,7 +169,7 @@
                 $arr = array();
 
 		// check if it already exists
-                $focus = new Account();
+                $focus = new Accounts();
 
 		$query = '';
 

Modified: vtigercrm/trunk/modules/Import/ImportLead.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportLead.php (original)
+++ vtigercrm/trunk/modules/Import/ImportLead.php Tue Oct 31 03:40:43 2006
@@ -26,16 +26,16 @@
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once('data/SugarBean.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Emails/Email.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Potentials/Potentials.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Emails/Emails.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/ComboUtil.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 
 
-class ImportLead extends Lead {
+class ImportLead extends Leads {
 	 var $db;
 
 	// This is the list of the functions to run when importing

Modified: vtigercrm/trunk/modules/Import/ImportMap.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportMap.php (original)
+++ vtigercrm/trunk/modules/Import/ImportMap.php Tue Oct 31 03:40:43 2006
@@ -99,6 +99,14 @@
 		$this->content = "".$this->db->getEmptyBlob()."";
                 $this->has_header = $has_header;
                 $this->deleted = 0;
+
+		//check whether this map name is already exist, if yes then overwrite the existing one, else create new
+	        $res = $this->db->query("select id from vtiger_import_maps where name='".trim($name)."'");
+		if($this->db->num_rows($res) > 0)
+		{
+			$this->id = $this->db->query_result($res,0,'id');
+		}
+
                 $returnid = $this->save();
 
 		$this->db->updateBlob($this->table_name,"content","name='".$name."' and module='".$module."'",$content);
@@ -180,7 +188,7 @@
 	 */
 	function getSavedMappingsList($module)
 	{
-		$query = "SELECT * FROM $this->table_name where module='".$module."'";
+		$query = "SELECT * FROM $this->table_name where module='".$module."' and deleted=0";
 		$result = $this->db->query($query,true," Error: ");
 		$map_lists = array();
 
@@ -197,7 +205,7 @@
 	 */
 	function getSavedMappingContent($mapid)
 	{
-		$query = "SELECT * FROM $this->table_name where id='".$mapid."'";
+		$query = "SELECT * FROM $this->table_name where id='".$mapid."' and deleted=0";
 		$result = $this->db->query($query,true," Error: ");
 		$mapping_arr = array();
 

Modified: vtigercrm/trunk/modules/Import/ImportOpportunity.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportOpportunity.php (original)
+++ vtigercrm/trunk/modules/Import/ImportOpportunity.php Tue Oct 31 03:40:43 2006
@@ -22,11 +22,11 @@
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once('data/SugarBean.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Emails/Email.php');
-require_once('modules/Accounts/Account.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Potentials/Potentials.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Emails/Emails.php');
+require_once('modules/Accounts/Accounts.php');
 require_once('include/ComboUtil.php');
 
 // Get _dom arrays from Database
@@ -36,7 +36,7 @@
 $comboFieldArray = getComboArray($comboFieldNames);
 
 // Account is used to store vtiger_account information.
-class ImportOpportunity extends Potential {
+class ImportOpportunity extends Potentials {
 	 var $db;
 
 	// This is the list of vtiger_fields that are required.
@@ -131,7 +131,7 @@
                 $arr = array();
 
 		// check if it already exists
-                $focus = new Account();
+                $focus = new Accounts();
 
 		$query = '';
 

Modified: vtigercrm/trunk/modules/Import/ImportProduct.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportProduct.php (original)
+++ vtigercrm/trunk/modules/Import/ImportProduct.php Tue Oct 31 03:40:43 2006
@@ -26,17 +26,17 @@
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once('data/SugarBean.php');
-require_once('modules/Contacts/Contact.php');
-require_once('modules/Potentials/Opportunity.php');
-require_once('modules/Notes/Note.php');
-require_once('modules/Emails/Email.php');
-require_once('modules/Accounts/Account.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Contacts/Contacts.php');
+require_once('modules/Potentials/Potentials.php');
+require_once('modules/Notes/Notes.php');
+require_once('modules/Emails/Emails.php');
+require_once('modules/Accounts/Accounts.php');
+require_once('modules/Products/Products.php');
 require_once('include/ComboUtil.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 
 
-class ImportProduct extends Product {
+class ImportProduct extends Products {
 	 var $db;
 
 	// This is the list of the functions to run when importing

Modified: vtigercrm/trunk/modules/Import/ImportStep2.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportStep2.php (original)
+++ vtigercrm/trunk/modules/Import/ImportStep2.php Tue Oct 31 03:40:43 2006
@@ -183,6 +183,8 @@
 	}
 }
 $map_list_combo .= '</select>';
+//This link is Delete link for the selected mapping
+$map_list_combo .= "&nbsp;&nbsp;&nbsp;<span id='delete_mapping' style='visibility:hidden;'><a href='javascript:; deleteMapping();'>Del</a></span>";
 $smarty->assign("SAVED_MAP_LISTS",$map_list_combo);
 
 
@@ -250,27 +252,27 @@
 	if($_REQUEST['module']=='Accounts')
 	{
 		$tablename='account';
-		$focus1=new Account();
+		$focus1=new Accounts();
 	}
 	if($_REQUEST['module']=='Contacts')
 	{
 		$tablename='contactdetails';
-		$focus1=new Contact();
+		$focus1=new Contacts();
  	}
 	if($_REQUEST['module']=='Leads')
  	{
 		$tablename='leaddetails';
-		$focus1=new Lead();
+		$focus1=new Leads();
 	}
 	if($_REQUEST['module']=='Potentials')
  	{
 		$tablename='potential';
-		$focus1=new Potential();
+		$focus1=new Potentials();
 	}
 	if($_REQUEST['module']=='Products')
  	{
  		$tablename='products';
- 		$focus1=new Product();
+ 		$focus1=new Products();
  	}
 
 	

Modified: vtigercrm/trunk/modules/Import/ImportSteplast.php
==============================================================================
--- vtigercrm/trunk/modules/Import/ImportSteplast.php (original)
+++ vtigercrm/trunk/modules/Import/ImportSteplast.php Tue Oct 31 03:40:43 2006
@@ -26,7 +26,7 @@
 require_once('modules/Import/UsersLastImport.php');
 require_once('modules/Import/parse_utils.php');
 require_once('include/ListView/ListView.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 require_once('include/utils/utils.php');
 
 global $mod_strings;

Modified: vtigercrm/trunk/modules/Invoice/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/EditView.php (original)
+++ vtigercrm/trunk/modules/Invoice/EditView.php Tue Oct 31 03:40:43 2006
@@ -23,9 +23,9 @@
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
 require_once('modules/Invoice/Invoice.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('modules/SalesOrder/SalesOrder.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -43,7 +43,7 @@
     if(isset($_REQUEST['convertmode']) &&  $_REQUEST['convertmode'] == 'quotetoinvoice')
     {
 	$quoteid = $_REQUEST['record'];
-	$quote_focus = new Quote();
+	$quote_focus = new Quotes();
 	$quote_focus->id = $quoteid;
 	$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 	$focus = getConvertQuoteToInvoice($focus,$quote_focus,$quoteid);
@@ -179,7 +179,7 @@
 }
 if(isset($_REQUEST['opportunity_id']) && $_REQUEST['opportunity_id'] !='')
 {
-	$potfocus = new Potential();
+	$potfocus = new Potentials();
         $potfocus->column_fields['potential_id'] = $_REQUEST['opportunity_id'];
         $associated_prod = getAssociatedProducts("Potentials",$potfocus,$potfocus->column_fields['potential_id']);
 	
@@ -194,8 +194,8 @@
  
  
 if(isset($_REQUEST['account_id']) && $_REQUEST['account_id']!='' && ($_REQUEST['record']=='' || $_REQUEST['convertmode'] == "potentoinvoice")){
-	require_once('modules/Accounts/Account.php');
-	$acct_focus = new Account();
+	require_once('modules/Accounts/Accounts.php');
+	$acct_focus = new Accounts();
 	$acct_focus->retrieve_entity_info($_REQUEST['account_id'],"Accounts");
 	$focus->column_fields['bill_city']=$acct_focus->column_fields['bill_city'];
 	$focus->column_fields['ship_city']=$acct_focus->column_fields['ship_city'];

Modified: vtigercrm/trunk/modules/Invoice/Invoice.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Invoice.php (original)
+++ vtigercrm/trunk/modules/Invoice/Invoice.php Tue Oct 31 03:40:43 2006
@@ -33,22 +33,12 @@
 class Invoice extends CRMEntity {
 	var $log;
 	var $db;
-		
+
 	var $table_name = "vtiger_invoice";
+	var $module_id = "invoiceid";	
 	var $tab_name = Array('vtiger_crmentity','vtiger_invoice','vtiger_invoicebillads','vtiger_invoiceshipads','vtiger_invoicecf');
 	var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_invoice'=>'invoiceid','vtiger_invoicebillads'=>'invoicebilladdressid','vtiger_invoiceshipads'=>'invoiceshipaddressid','vtiger_invoicecf'=>'invoiceid');
 				
-	
-	var $entity_table = "vtiger_crmentity";
-	
-	var $billadr_table = "vtiger_invoicebillads";
-
-	var $object_name = "Invoice";
-
-	var $new_schema = true;
-	
-	var $module_id = "invoiceid";
-
 	var $column_fields = Array();
 
 	var $sortby_fields = Array('subject','crmid','invoicestatus','smownerid');		
@@ -102,6 +92,25 @@
 		$this->column_fields = getColumnFields('Invoice');
 		$this->log->debug("Exiting Invoice method ...");
 	}
+
+
+	/** Function to handle the module specific save operations
+	
+	*/
+	
+	function save_module($module)
+	{
+		//Checking if vtiger_salesorderid is present and updating the quote status
+		if($this->column_fields["salesorder_id"] != '')
+		{
+        		$so_id = $this->column_fields["salesorder_id"];
+        		$query1 = "update vtiger_salesorder set sostatus='Approved' where salesorderid=".$so_id;
+        		$this->db->query($query1);
+		}
+		//Based on the total Number of rows we will save the product relationship with this entity
+		saveInventoryProductDetails(&$this, 'Invoice');
+	}
+
 
 	/**	Function used to get the sort order for Invoice listview
 	 *	@return string	$sorder	- first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['INVOICE_SORT_ORDER'] if this session value is empty then default sort order will be returned. 

Modified: vtigercrm/trunk/modules/Invoice/ListTopInvoice.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/ListTopInvoice.php (original)
+++ vtigercrm/trunk/modules/Invoice/ListTopInvoice.php Tue Oct 31 03:40:43 2006
@@ -52,9 +52,9 @@
 	$date_var = date('Y-m-d');
 
 	//Changed for Patch 2 by Don
-	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_invoice.invoicestatus != \'Paid\' ORDER BY total DESC';
+	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_invoice.invoicestatus != \'Paid\'';
 	$query = getListQuery("Invoice",$where);
-
+	$query .= " ORDER BY total DESC";
 	//<<<<<<<<customview>>>>>>>>>
 
 	$list_result = $adb->limitQuery($query,0,5);

Modified: vtigercrm/trunk/modules/Invoice/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/ListView.php (original)
+++ vtigercrm/trunk/modules/Invoice/ListView.php Tue Oct 31 03:40:43 2006
@@ -80,6 +80,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 if(isPermitted('Invoice','Delete','') == 'yes')
 {
 	$other_text['del'] = $app_strings[LBL_MASS_DELETE];

Modified: vtigercrm/trunk/modules/Invoice/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Save.php (original)
+++ vtigercrm/trunk/modules/Invoice/Save.php Tue Oct 31 03:40:43 2006
@@ -30,25 +30,9 @@
 
 $focus = new Invoice();
 global $current_user;
-$currencyid=fetchCurrency($current_user->id);
-$rate_symbol = getCurrencySymbolandCRate($currencyid);
-$rate = $rate_symbol['rate'];
 setObjectValuesFromRequest(&$focus);
 
 $focus->save("Invoice");
-
-//Checking if vtiger_salesorderid is present and updating the quote status
-if($focus->column_fields["salesorder_id"] != '')
-{
-        $so_id = $focus->column_fields["salesorder_id"];
-        $query1 = "update vtiger_salesorder set sostatus='Approved' where salesorderid=".$so_id;
-        $adb->query($query1);
-}
-
-
-//Based on the total Number of rows we will save the product relationship with this entity
-saveInventoryProductDetails(&$focus, 'Invoice');
-
 
 $return_id = $focus->id;
 

Modified: vtigercrm/trunk/modules/Leads/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Leads/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/utils/utils.php');
 //Redirecting Header for single page layout 
 require_once('user_privileges/default_module_view.php');
@@ -22,7 +22,7 @@
 }
 else
 {
-$focus = new Lead();
+$focus = new Leads();
 $MODULE = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 $currentmodule = $_REQUEST['module'];

Modified: vtigercrm/trunk/modules/Leads/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/Delete.php (original)
+++ vtigercrm/trunk/modules/Leads/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('lead_delete');
 
-$focus = new Lead();
+$focus = new Leads();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Leads/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/DetailView.php (original)
+++ vtigercrm/trunk/modules/Leads/DetailView.php Tue Oct 31 03:40:43 2006
@@ -14,7 +14,7 @@
  ********************************************************************************/
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/utils/utils.php');
@@ -25,7 +25,7 @@
 global $app_strings;
 global $currentModule, $singlepane_view;
     global $log;
-$focus = new Lead();
+$focus = new Leads();
 
 if(isset($_REQUEST['record']))
 {

Modified: vtigercrm/trunk/modules/Leads/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Leads/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 	      
 require_once('include/logging.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -24,7 +24,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$leadObj = new Lead();
+		$leadObj = new Leads();
 		$leadObj->retrieve_entity_info($crmid,"Leads");
 		$leadObj->column_fields[$fieldname] = $fieldvalue;
 		$leadObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Leads/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/EditView.php (original)
+++ vtigercrm/trunk/modules/Leads/EditView.php Tue Oct 31 03:40:43 2006
@@ -14,7 +14,7 @@
  ********************************************************************************/
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
@@ -23,7 +23,7 @@
 
 global $mod_strings,$app_strings,$theme,$currentModule;
 
-$focus = new Lead();
+$focus = new Leads();
 $smarty = new vtigerCRM_Smarty;
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {

Modified: vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php (original)
+++ vtigercrm/trunk/modules/Leads/LeadConvertToEntities.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('include/database/PearDatabase.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 //Getting the Parameters from the ConvertLead Form
 $id = $_REQUEST["record"];
 
@@ -39,7 +39,7 @@
         $potential_name = $check_unit[0];
 
 //Retrieve info from all the vtiger_tables related to leads
-$focus = new Lead();
+$focus = new Leads();
 $focus->retrieve_entity_info($id,"Leads");
 
 //get all the lead related columns 

Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue Oct 31 03:40:43 2006
@@ -19,7 +19,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -49,7 +49,7 @@
 
 $url_string = ''; // assigning http url string
 
-$focus = new Lead();
+$focus = new Leads();
 $smarty = new vtigerCRM_Smarty;
 $other_text=Array();
 
@@ -83,6 +83,7 @@
 $smarty->assign("CHANGE_STATUS",$change_status);
 
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 	
 
 

Modified: vtigercrm/trunk/modules/Leads/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/Save.php (original)
+++ vtigercrm/trunk/modules/Leads/Save.php Tue Oct 31 03:40:43 2006
@@ -13,14 +13,14 @@
  * Contributor(s): ______________________________________.
  ********************************************************************************/
 
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/UserInfoUtil.php');
 
 $local_log =& LoggerManager::getLogger('index');
 global $log,$adb;
-$focus = new Lead();
+$focus = new Leads();
 global $current_user;
 $currencyid=fetchCurrency($current_user->id);
 $rate_symbol = getCurrencySymbolandCRate($currencyid);

Modified: vtigercrm/trunk/modules/Leads/result.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/result.php (original)
+++ vtigercrm/trunk/modules/Leads/result.php Tue Oct 31 03:40:43 2006
@@ -12,7 +12,7 @@
 
 require_once('include/utils/utils.php');
 require_once 'Excel/reader.php';
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/database/PearDatabase.php');
 
 $data = new Spreadsheet_Excel_Reader();

Modified: vtigercrm/trunk/modules/Migration/MigrationStep1.php
==============================================================================
--- vtigercrm/trunk/modules/Migration/MigrationStep1.php (original)
+++ vtigercrm/trunk/modules/Migration/MigrationStep1.php Tue Oct 31 03:40:43 2006
@@ -129,6 +129,11 @@
 	}
 }
 
+//For 5.0.2 we have added this table. After 5.0.2 we have to remove this and provide the migration in some other way
+$res = $adb->query("show create table vtiger_entityname");
+if(!$res)
+	$smarty->assign("502_PATCH","apply");
+
 $smarty->display("MigrationStep1.tpl");
 
 

Modified: vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php
==============================================================================
--- vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php (original)
+++ vtigercrm/trunk/modules/Migration/ModifyDatabase/42P2_to_50.php Tue Oct 31 03:40:43 2006
@@ -1257,7 +1257,7 @@
 		"insert into vtiger_cvcolumnlist values ($cvid,0,'vtiger_contactdetails:firstname:firstname:Contacts_First_Name:V')",
 		"insert into vtiger_cvcolumnlist values ($cvid,1,'vtiger_contactdetails:lastname:lastname:Contacts_Last_Name:V')",
 		"insert into vtiger_cvcolumnlist values ($cvid,2,'vtiger_contactdetails:title:title:Contacts_Title:V')",
-		"insert into vtiger_cvcolumnlist values ($cvid,3,'vtiger_account:accountname:accountname:Contacts_Account_Name:V')",
+		"insert into vtiger_cvcolumnlist values ($cvid,3,'vtiger_contactdetails:accountid:account_id:Contacts_Account_Name:I')",
 		"insert into vtiger_cvcolumnlist values ($cvid,4,'vtiger_contactdetails:email:email:Contacts_Email:V')",
 		"insert into vtiger_cvcolumnlist values ($cvid,5,'vtiger_contactdetails:phone:phone:Contacts_Office_Phone:V')",
 		"insert into vtiger_cvcolumnlist values ($cvid,6,'vtiger_crmentity:smownerid:assigned_user_id:Contacts_Assigned_To:V')"
@@ -3766,6 +3766,59 @@
 	}
 }
 
+//Added after 5.0.1
+//we have to delete the entries from customview and report related tables for deleted customfields
+include("modules/Migration/ModifyDatabase/deleteCustomFields.php");
+
+//5.0.2 database changes - added on 27-10-06
+
+//Query added to show Manufacturer field in Products module
+Execute("update vtiger_field set displaytype=1,block=31 where tabid=14 and block=1");
+Execute("update vtiger_field set block=23,displaytype=1 where block=1 and displaytype=23 and tabid=10");
+Execute("update vtiger_field set block=22,displaytype=1 where block=1 and displaytype=22 and tabid=10");
+
+//Added to rearange the attachment in HelpDesk
+Execute(" update vtiger_field set block=25,sequence=12 where tabid=13 and fieldname='filename'");
+
+//Query added to as entityname,its tablename,its primarykey are saved in a table
+Execute(" CREATE TABLE `vtiger_entityname` (
+	`tabid` int(19) NOT NULL default '0',
+	`modulename` varchar(50) NOT NULL,
+	`tablename` varchar(50) NOT NULL,
+	`fieldname` varchar(150) NOT NULL,
+	`entityidfield` varchar(150) NOT NULL,
+	PRIMARY KEY (`tabid`),
+	KEY `entityname_tabid_idx` (`tabid`)
+)");
+
+//Data Populated for the existing modules
+Execute("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid')");
+Execute("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid')");
+Execute("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid')");
+Execute("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid')");
+Execute("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid')");
+Execute("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid')");
+Execute("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid')");
+Execute("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid')");
+Execute("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid')");
+Execute("insert into vtiger_entityname values(29,'Users','vtiger_users','last_name,first_name','id')");
+Execute("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid')");
+Execute("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid')");
+Execute("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid')");
+Execute("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid')");
+Execute("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid')");
+Execute("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid')");
+Execute("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid')");
+Execute("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id')");
+
+//added quantity in stock in product default listview - All
+$res = $conn->query("select vtiger_cvcolumnlist.cvid from vtiger_cvcolumnlist inner join vtiger_customview on vtiger_cvcolumnlist.cvid=vtiger_customview.cvid where entitytype='Products' and viewname='All'");
+if($conn->num_rows != 0)
+{
+	$cvid = $conn->query_result($res,0,'cvid');
+	Execute("insert into vtiger_cvcolumnlist values($cvid,5,'vtiger_products:qtyinstock:qtyinstock:Products_Quantity_In_Stock:V')");
+}
+
 
 
 

Modified: vtigercrm/trunk/modules/Notes/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/Delete.php (original)
+++ vtigercrm/trunk/modules/Notes/Delete.php Tue Oct 31 03:40:43 2006
@@ -17,12 +17,12 @@
  * Description:  TODO: To be written.
  ********************************************************************************/
 
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('note_delete');
 
-$focus = new Note();
+$focus = new Notes();
 
 if(!isset($_REQUEST['record']))
 	die("A record number must be specified to delete the note.");

Modified: vtigercrm/trunk/modules/Notes/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/DetailView.php (original)
+++ vtigercrm/trunk/modules/Notes/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,14 +22,14 @@
 
 require_once('data/Tracker.php');
 require_once('Smarty_setup.php');
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 require_once('include/upload_file.php');
 require_once('include/utils/utils.php');
 global $app_strings;
 global $mod_strings;
 global $currentModule;
 
-$focus = new Note();
+$focus = new Notes();
 
 if(isset($_REQUEST['record'])) {
    $focus->retrieve_entity_info($_REQUEST['record'],"Notes");

Modified: vtigercrm/trunk/modules/Notes/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Notes/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
      $fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
      if($crmid != "")
 	 {
-		 $modObj = new Note();
+		 $modObj = new Notes();
 		 $modObj->retrieve_entity_info($crmid,"Notes");
 		 $modObj->column_fields[$fieldname] = $fieldvalue;
 		 $modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Notes/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/EditView.php (original)
+++ vtigercrm/trunk/modules/Notes/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,12 +22,12 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 require_once('include/utils/utils.php');
 
 global $app_strings,$app_list_strings,$mod_strings,$theme,$currentModule;
 
-$focus = new Note();
+$focus = new Notes();
 $smarty = new vtigerCRM_Smarty();
 
 if($_REQUEST['upload_error'] == true)

Modified: vtigercrm/trunk/modules/Notes/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/ListView.php (original)
+++ vtigercrm/trunk/modules/Notes/ListView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -66,7 +66,7 @@
 
 $url_string = ''; // assigning http url string
 
-$focus = new Note();
+$focus = new Notes();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 

Modified: vtigercrm/trunk/modules/Notes/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Notes/Save.php (original)
+++ vtigercrm/trunk/modules/Notes/Save.php Tue Oct 31 03:40:43 2006
@@ -21,13 +21,13 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Notes/Note.php');
+require_once('modules/Notes/Notes.php');
 require_once('include/logging.php');
 require_once('include/upload_file.php');
 
 $local_log =& LoggerManager::getLogger('index');
 
-$focus = new Note();
+$focus = new Notes();
 
 setObjectValuesFromRequest(&$focus);
 

Modified: vtigercrm/trunk/modules/Portal/Portal.js
==============================================================================
--- vtigercrm/trunk/modules/Portal/Portal.js (original)
+++ vtigercrm/trunk/modules/Portal/Portal.js Tue Oct 31 03:40:43 2006
@@ -71,6 +71,7 @@
 	Effect.Puff('orgLay');	
 	$("status").style.display="inline";
 	var portalurl = document.getElementById('portalurl').value;
+	var portalurl = portalurl.replace(/&/g, "#$#$#");
 	var portalname = document.getElementById('portalname').value;
         new Ajax.Request(
         	'index.php',

Modified: vtigercrm/trunk/modules/Portal/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Portal/Save.php (original)
+++ vtigercrm/trunk/modules/Portal/Save.php Tue Oct 31 03:40:43 2006
@@ -13,10 +13,10 @@
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
 {
-	$result=UpdatePortal($_REQUEST['portalname'],"http://".$_REQUEST['portalurl'],$_REQUEST['record']);
+	$result=UpdatePortal($_REQUEST['portalname'],"http://".str_replace("#$#$#","&",$_REQUEST['portalurl']),$_REQUEST['record']);
 }else
 {
-	$result=SavePortal($_REQUEST['portalname'],"http://".$_REQUEST['portalurl']);
+	$result=SavePortal($_REQUEST['portalname'],"http://".str_replace("#$#$#","&",$_REQUEST['portalurl']));
 }
 header("Location: index.php?action=PortalAjax&module=Portal&file=ListView&mode=ajax&datamode=manage");
 ?>

Modified: vtigercrm/trunk/modules/Potentials/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Potentials/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
 global $singlepane_view;
@@ -21,7 +21,7 @@
 }
 else
 {
-$focus = new Potential();
+$focus = new Potentials();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 

Modified: vtigercrm/trunk/modules/Potentials/Charts.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/Charts.php (original)
+++ vtigercrm/trunk/modules/Potentials/Charts.php Tue Oct 31 03:40:43 2006
@@ -19,7 +19,7 @@
 
 require_once('config.php');
 require_once('include/logging.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('Image/Graph.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/GraphUtils.php');
@@ -102,7 +102,7 @@
 
 			//Now do the db queries
 			//query for opportunity data that matches $datay and $user
-			$opp = new Potential();
+			$opp = new Potentials();
 			$opp_list = $opp->get_full_list("amount DESC, closingdate DESC", $where);
 
 			//build pipeline by sales stage data
@@ -441,7 +441,7 @@
 
 			//Now do the db queries
 			//query for opportunity data that matches $datay and $user
-			$opp = new Potential();
+			$opp = new Potentials();
 			$opp_list = $opp->get_full_list("amount DESC, closingdate DESC", $where);
 
 			//build pipeline by sales stage data
@@ -779,7 +779,7 @@
 
 			//Now do the db queries
 			//query for opportunity data that matches $datax and $user
-			$opp = new Potential();
+			$opp = new Potentials();
 			$opp_list = $opp->get_full_list("amount DESC, closingdate DESC", $where);
 
 			//build pipeline by sales stage data
@@ -1057,7 +1057,7 @@
 				$where .= ")";
 			}
 
-			$opp = new Potential();
+			$opp = new Potentials();
 			$opp_list = $opp->get_full_list("amount DESC, closingdate DESC", $where);
 
 			//build pipeline by lead source data

Modified: vtigercrm/trunk/modules/Potentials/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/Delete.php (original)
+++ vtigercrm/trunk/modules/Potentials/Delete.php Tue Oct 31 03:40:43 2006
@@ -17,12 +17,12 @@
  * Description:  TODO: To be written.
  ********************************************************************************/
 
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('contact_delete');
 
-$focus = new Potential();
+$focus = new Potentials();
 
 if(!isset($_REQUEST['record']))
 	die("A record number must be specified to delete the opportunity.");

Modified: vtigercrm/trunk/modules/Potentials/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/DetailView.php (original)
+++ vtigercrm/trunk/modules/Potentials/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
@@ -31,7 +31,7 @@
 global $app_strings;
 global $currentModule, $singlepane_view;
 
-$focus = new Potential();
+$focus = new Potentials();
 $smarty = new vtigerCRM_Smarty;
 
 if(isset($_REQUEST['record'])  && $_REQUEST['record']!='') {

Modified: vtigercrm/trunk/modules/Potentials/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Potentials/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Potential();
+		$modObj = new Potentials();
 		$modObj->retrieve_entity_info($crmid,"Potentials");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$_REQUEST[$fieldname] = $fieldvalue;

Modified: vtigercrm/trunk/modules/Potentials/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/EditView.php (original)
+++ vtigercrm/trunk/modules/Potentials/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -30,7 +30,7 @@
 global $app_strings;
 global $mod_strings;
 global $currentModule;
-$focus = new Potential();
+$focus = new Potentials();
 $smarty = new vtigerCRM_Smarty();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') 

Modified: vtigercrm/trunk/modules/Potentials/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/ListView.php (original)
+++ vtigercrm/trunk/modules/Potentials/ListView.php Tue Oct 31 03:40:43 2006
@@ -15,7 +15,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -38,7 +38,7 @@
 
 $url_string = ''; // assigning http url string
 
-$focus = new Potential();
+$focus = new Potentials();
 $smarty = new vtigerCRM_Smarty();
 $other_text = Array();
 
@@ -108,7 +108,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
-
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 if(isPermitted('Potentials','Delete','') == 'yes')
 {
 	$other_text['del'] = $app_strings[LBL_MASS_DELETE];

Modified: vtigercrm/trunk/modules/Potentials/ListViewTop.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/ListViewTop.php (original)
+++ vtigercrm/trunk/modules/Potentials/ListViewTop.php Tue Oct 31 03:40:43 2006
@@ -28,7 +28,7 @@
 	$log = LoggerManager::getLogger('top opportunity_list');
 	$log->debug("Entering getTopPotentials() method ...");
 	require_once("data/Tracker.php");
-	require_once('modules/Potentials/Opportunity.php');
+	require_once('modules/Potentials/Potentials.php');
 	require_once('include/logging.php');
 	require_once('include/ListView/ListView.php');
 
@@ -42,7 +42,7 @@
 	$title[]='myTopOpenPotentials.gif';
 	$title[]=$current_module_strings['LBL_TOP_OPPORTUNITIES'];
 	$title[]='home_mypot';
-	$where = "AND vtiger_potential.sales_stage <> '".$app_strings['LBL_CLOSE_WON']."' AND vtiger_potential.sales_stage <> '".$app_strings['LBL_CLOSE_LOST']."' AND vtiger_crmentity.smownerid='".$current_user->id."' ORDER BY amount DESC";
+	$where = "AND vtiger_potential.sales_stage <> 'Closed Won' AND vtiger_potential.sales_stage <> 'Closed Lost' AND vtiger_crmentity.smownerid='".$current_user->id."'";
 	$header=array();
 	$header[]=$current_module_strings['LBL_LIST_OPPORTUNITY_NAME'];
 	$header[]=$current_module_strings['LBL_LIST_ACCOUNT_NAME'];
@@ -53,6 +53,7 @@
         $header[]=$current_module_strings['LBL_LIST_AMOUNT'].'('.$curr_symbol.')';
 	$header[]=$current_module_strings['LBL_LIST_DATE_CLOSED'];
 	$list_query = getListQuery("Potentials",$where);
+	$list_query .=" ORDER BY amount DESC";
 	$list_result = $adb->limitQuery($list_query,0,5);
 	$open_potentials_list = array();
 	$noofrows = $adb->num_rows($list_result);

Modified: vtigercrm/trunk/modules/Potentials/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/Save.php (original)
+++ vtigercrm/trunk/modules/Potentials/Save.php Tue Oct 31 03:40:43 2006
@@ -20,13 +20,13 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Potentials/Opportunity.php');
+require_once('modules/Potentials/Potentials.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 
 $local_log =& LoggerManager::getLogger('index');
 
-$focus = new Potential();
+$focus = new Potentials();
 global $current_user;
 $currencyid=fetchCurrency($current_user->id);
 $rate_symbol = getCurrencySymbolandCRate($currencyid);

Modified: vtigercrm/trunk/modules/Potentials/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Potentials/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Potentials/language/en_us.lang.php Tue Oct 31 03:40:43 2006
@@ -100,6 +100,7 @@
 'Account Name'=>'Account Name',
 'Currency'=>'Currency',
 'Expected Close Date'=>'Expected Close Date',
+'Opportunity Type'=>'Opportunity Type',
 'Type'=>'Type',
 'Next Step'=>'Next Step',
 'Lead Source'=>'Lead Source',

Modified: vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('Smarty_setup.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
 global $singlepane_view;
@@ -22,7 +22,7 @@
 {
 global $currentModule;
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];

Modified: vtigercrm/trunk/modules/PriceBooks/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/Delete.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('product_delete');
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/PriceBooks/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/DetailView.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/DetailView.php Tue Oct 31 03:40:43 2006
@@ -10,11 +10,11 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) 
 {

Modified: vtigercrm/trunk/modules/PriceBooks/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new PriceBook();
+		$modObj = new PriceBooks();
 		$modObj->retrieve_entity_info($crmid,"PriceBooks");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/PriceBooks/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/EditView.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/EditView.php Tue Oct 31 03:40:43 2006
@@ -11,12 +11,12 @@
 require_once('Smarty_setup.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/FormValidationUtil.php');
 
 global $app_strings,$mod_strings,$theme,$currentModule;
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 $smarty = new vtigerCRM_Smarty();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') 

Modified: vtigercrm/trunk/modules/PriceBooks/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/ListView.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/ListView.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/ListView/ListView.php');
 require_once('include/utils/utils.php');
 require_once('modules/CustomView/CustomView.php');
@@ -33,7 +33,7 @@
 $category = getParentTab();
 $smarty->assign("CATEGORY",$category);
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 $other_text=Array();
 
 if(!$_SESSION['lvs'][$currentModule])

Modified: vtigercrm/trunk/modules/PriceBooks/Save.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/Save.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/Save.php Tue Oct 31 03:40:43 2006
@@ -21,11 +21,11 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 
 setObjectValuesFromRequest(&$focus);
 

Modified: vtigercrm/trunk/modules/Products/AddProductToPriceBooks.php
==============================================================================
--- vtigercrm/trunk/modules/Products/AddProductToPriceBooks.php (original)
+++ vtigercrm/trunk/modules/Products/AddProductToPriceBooks.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/PriceBooks/PriceBook.php');
+require_once('modules/PriceBooks/PriceBooks.php');
 require_once('include/utils/utils.php');
 require_once('include/ComboUtil.php');
 
@@ -30,7 +30,7 @@
 $smarty->assign("APP", $app_strings);
 $smarty->assign("IMAGE_PATH",$image_path);
 
-$focus = new PriceBook();
+$focus = new PriceBooks();
 
 //Retreive the list of PriceBooks
 $list_query = getListQuery("PriceBooks");

Modified: vtigercrm/trunk/modules/Products/AddProductsToPriceBook.php
==============================================================================
--- vtigercrm/trunk/modules/Products/AddProductsToPriceBook.php (original)
+++ vtigercrm/trunk/modules/Products/AddProductsToPriceBook.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/utils.php');
 require_once('include/ComboUtil.php');
@@ -29,7 +29,7 @@
 $smarty->assign("APP", $app_strings);
 $smarty->assign("IMAGE_PATH",$image_path);
 
-$focus = new Product();
+$focus = new Products();
 
 if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
 

Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Products/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Products/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('Smarty_setup.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
@@ -21,7 +21,7 @@
 }
 else
 {
-$focus = new Product();
+$focus = new Products();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) 

Modified: vtigercrm/trunk/modules/Products/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Products/Delete.php (original)
+++ vtigercrm/trunk/modules/Products/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('product_delete');
 
-$focus = new Product();
+$focus = new Products();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Products/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/DetailView.php (original)
+++ vtigercrm/trunk/modules/Products/DetailView.php Tue Oct 31 03:40:43 2006
@@ -10,11 +10,11 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
 
-$focus = new Product();
+$focus = new Products();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
 	//Display the error message

Modified: vtigercrm/trunk/modules/Products/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Products/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Products/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/database/PearDatabase.php');
 global $adb,$current_user;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Product();
+		$modObj = new Products();
 		$modObj->retrieve_entity_info($crmid,"Products");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		if($fieldname == 'unit_price')//unit price converted to dollar value while saving

Modified: vtigercrm/trunk/modules/Products/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/EditView.php (original)
+++ vtigercrm/trunk/modules/Products/EditView.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 require_once('Smarty_setup.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/FormValidationUtil.php');
 
 global $app_strings;
@@ -28,7 +28,7 @@
 
 
 
-$focus = new Product();
+$focus = new Products();
 $smarty = new vtigerCRM_Smarty();
 
 if($_REQUEST['record']!="") 

Modified: vtigercrm/trunk/modules/Products/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/ListView.php (original)
+++ vtigercrm/trunk/modules/Products/ListView.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/ListView/ListView.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -56,7 +56,7 @@
 }
 $url_string = '&smodule=PRODUCTS'; // assigning http url string
 
-$focus = new Product();
+$focus = new Products();
 
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
 $sorder = $focus->getSortOrder();
@@ -84,6 +84,7 @@
 //<<<<<customview>>>>>
 
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 if($viewnamedesc['viewname'] == 'All')
 {
 	$smarty->assign("ALL", 'All');

Modified: vtigercrm/trunk/modules/Products/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Products/Save.php (original)
+++ vtigercrm/trunk/modules/Products/Save.php Tue Oct 31 03:40:43 2006
@@ -21,14 +21,14 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Products/Product.php');
+require_once('modules/Products/Products.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 global $log,$current_user;
 $currencyid=fetchCurrency($current_user->id);
 $rate_symbol = getCurrencySymbolandCRate($currencyid);
 $rate = $rate_symbol['rate'];
-$focus = new Product();
+$focus = new Products();
 if(isset($_REQUEST['record']))
 {
 	$focus->id = $_REQUEST['record'];

Modified: vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -21,7 +21,7 @@
 }
 else
 {
-$focus = new Order();
+$focus = new PurchaseOrder();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {

Modified: vtigercrm/trunk/modules/PurchaseOrder/CreatePDF.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/CreatePDF.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/CreatePDF.php Tue Oct 31 03:40:43 2006
@@ -26,7 +26,7 @@
 
 $id = $_REQUEST['record'];
 //retreiving the vtiger_invoice info
-$focus = new Order();
+$focus = new PurchaseOrder();
 $focus->retrieve_entity_info($_REQUEST['record'],"PurchaseOrder");
 $vendor_name = getVendorName($focus->column_fields[vendor_id]);
 

Modified: vtigercrm/trunk/modules/PurchaseOrder/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/Delete.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/Delete.php Tue Oct 31 03:40:43 2006
@@ -24,7 +24,7 @@
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('order_delete');
 
-$focus = new Order();
+$focus = new PurchaseOrder();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/PurchaseOrder/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/DetailView.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/DetailView.php Tue Oct 31 03:40:43 2006
@@ -29,7 +29,7 @@
 require_once('user_privileges/default_module_view.php');
 global $mod_strings,$app_strings,$theme,$currentModule,$singlepane_view;
 
-$focus = new Order();
+$focus = new PurchaseOrder();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
     $focus->retrieve_entity_info($_REQUEST['record'],"PurchaseOrder");

Modified: vtigercrm/trunk/modules/PurchaseOrder/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Order();
+		$modObj = new PurchaseOrder();
 		$modObj->retrieve_entity_info($crmid,"PurchaseOrder");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/PurchaseOrder/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/EditView.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/EditView.php Tue Oct 31 03:40:43 2006
@@ -31,7 +31,7 @@
 global $app_strings,$mod_strings,$log,$theme,$currentModule;
 
 
-$focus = new Order();
+$focus = new PurchaseOrder();
 $smarty = new vtigerCRM_Smarty();
 global $current_user;
 $currencyid=fetchCurrency($current_user->id);
@@ -60,8 +60,8 @@
 
 // Get vtiger_vendor address if vtiger_vendorid is given
 if(isset($_REQUEST['vendor_id']) && $_REQUEST['vendor_id']!='' && $_REQUEST['record']==''){
-	require_once('modules/Vendors/Vendor.php');
-	$vend_focus = new Vendor();
+	require_once('modules/Vendors/Vendors.php');
+	$vend_focus = new Vendors();
 
 	$vend_focus->retrieve_entity_info($_REQUEST['vendor_id'],"Vendors");
 	$focus->column_fields['bill_city']=$vend_focus->column_fields['city'];

Modified: vtigercrm/trunk/modules/PurchaseOrder/ListTopPurchaseOrder.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/ListTopPurchaseOrder.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/ListTopPurchaseOrder.php Tue Oct 31 03:40:43 2006
@@ -47,7 +47,7 @@
 			$viewid = "0";
 		}
 	}
-	$focus = new Order();
+	$focus = new PurchaseOrder();
 
 	$theme_path="themes/".$theme."/";
 	$image_path=$theme_path."images/";
@@ -56,9 +56,9 @@
 	//<<<<<<<<<customview>>>>>>>>>
 	$date_var = date('Y-m-d');
 
-	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_purchaseorder.duedate >= \''.$date_var.'\' ORDER BY total DESC';
+	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_purchaseorder.duedate >= \''.$date_var.'\'';
 	$query = getListQuery("PurchaseOrder",$where);
-
+	$query .=" ORDER BY total DESC";
 
 	//<<<<<<<<customview>>>>>>>>>
 

Modified: vtigercrm/trunk/modules/PurchaseOrder/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/ListView.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/ListView.php Tue Oct 31 03:40:43 2006
@@ -35,7 +35,7 @@
 
 $url_string = '&smodule=PO';
 
-$focus = new Order();
+$focus = new PurchaseOrder();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 
@@ -81,6 +81,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 
 if(isPermitted('PurchaseOrder','Delete','') == 'yes')
 {

Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Tue Oct 31 03:40:43 2006
@@ -30,7 +30,7 @@
 require_once('user_privileges/default_module_view.php');
 
 // Account is used to store vtiger_account information.
-class Order extends CRMEntity {
+class PurchaseOrder extends CRMEntity {
 	var $log;
 	var $db;
 		
@@ -42,10 +42,6 @@
 	
 	var $billadr_table = "vtiger_pobillads";
 
-	var $object_name = "Order";
-
-	var $new_schema = true;
-	
 	var $module_id = "purchaseorderid";
 
 	var $column_fields = Array();
@@ -94,12 +90,20 @@
 	 *  This function creates an instance of LoggerManager class using getLogger method
 	 *  creates an instance for PearDatabase class and get values for column_fields array of Order class.
 	 */
-	function Order() {
+	function PurchaseOrder() {
 		$this->log =LoggerManager::getLogger('PurchaseOrder');
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('PurchaseOrder');
 	}
 
+	function save_module($module)
+	{
+		//Based on the total Number of rows we will save the product relationship with this entity
+		saveInventoryProductDetails(&$this, 'PurchaseOrder', $this->update_prod_stock);
+	}	
+
+
+	
 	/**	Function used to get the sort order for Purchase Order listview
 	 *	@return string	$sorder	- first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['PURCHASEORDER_SORT_ORDER'] if this session value is empty then default sort order will be returned. 
 	 */

Modified: vtigercrm/trunk/modules/PurchaseOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/Save.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/Save.php Tue Oct 31 03:40:43 2006
@@ -27,31 +27,23 @@
 
 $local_log =& LoggerManager::getLogger('index');
 
-$focus = new Order();
+$focus = new PurchaseOrder();
 global $current_user;
-$currencyid=fetchCurrency($current_user->id);
-$rate_symbol = getCurrencySymbolandCRate($currencyid);
-$rate = $rate_symbol['rate'];
 setObjectValuesFromRequest(&$focus);
 
 //Added code for auto product stock updation on receiving goods
-$update_prod_stock='';
+$focus->update_prod_stock='';
 if($focus->column_fields['postatus'] == 'Received Shipment' && $focus->mode == 'edit')
 {
         $prev_postatus=getPoStatus($focus->id);
         if($focus->column_fields['postatus'] != $prev_postatus)
         {
-                $update_prod_stock='true';
+                $focus->update_prod_stock='true';
         }
 
 }
 
 $focus->save("PurchaseOrder");
-
-
-//Based on the total Number of rows we will save the product relationship with this entity
-saveInventoryProductDetails(&$focus, 'PurchaseOrder', $update_prod_stock);
-
 
 $return_id = $focus->id;
 

Modified: vtigercrm/trunk/modules/Quotes/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Quotes/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('Smarty_setup.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
 global $singlepane_view;
@@ -21,7 +21,7 @@
 }
 else
 {
-$focus = new Quote();
+$focus = new Quotes();
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {

Modified: vtigercrm/trunk/modules/Quotes/CreatePDF.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/CreatePDF.php (original)
+++ vtigercrm/trunk/modules/Quotes/CreatePDF.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 
 require_once('include/fpdf/pdf.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/database/PearDatabase.php');
 
 global $adb,$app_strings;
@@ -25,7 +25,7 @@
 global $products_per_page;
 $products_per_page="6";
 
-$focus = new Quote();
+$focus = new Quotes();
 $focus->retrieve_entity_info($_REQUEST['record'],"Quotes");
 $account_name = getAccountName($focus->column_fields[account_id]);
 

Modified: vtigercrm/trunk/modules/Quotes/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/Delete.php (original)
+++ vtigercrm/trunk/modules/Quotes/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('quote_delete');
 
-$focus = new Quote();
+$focus = new Quotes();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Quotes/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/DetailView.php (original)
+++ vtigercrm/trunk/modules/Quotes/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,13 +22,13 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
 global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view;
-$focus = new Quote();
+$focus = new Quotes();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
     $focus->retrieve_entity_info($_REQUEST['record'],"Quotes");

Modified: vtigercrm/trunk/modules/Quotes/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Quotes/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Quote();
+		$modObj = new Quotes();
 		$modObj->retrieve_entity_info($crmid,"Quotes");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Quotes/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/EditView.php (original)
+++ vtigercrm/trunk/modules/Quotes/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -32,7 +32,7 @@
 
 $log->debug("Inside Quote EditView");
 
-$focus = new Quote();
+$focus = new Quotes();
 $smarty = new vtigerCRM_Smarty;
 $currencyid=fetchCurrency($current_user->id);
 $rate_symbol = getCurrencySymbolandCRate($currencyid);
@@ -70,8 +70,8 @@
 
 // Get Account address if vtiger_account is given
 if(isset($_REQUEST['account_id']) && $_REQUEST['account_id']!='' && $_REQUEST['record']==''){
-	require_once('modules/Accounts/Account.php');
-	$acct_focus = new Account();
+	require_once('modules/Accounts/Accounts.php');
+	$acct_focus = new Accounts();
 	$acct_focus->retrieve_entity_info($_REQUEST['account_id'],"Accounts");
 	$focus->column_fields['bill_city']=$acct_focus->column_fields['bill_city'];
 	$focus->column_fields['ship_city']=$acct_focus->column_fields['ship_city'];

Modified: vtigercrm/trunk/modules/Quotes/ListTopQuotes.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/ListTopQuotes.php (original)
+++ vtigercrm/trunk/modules/Quotes/ListTopQuotes.php Tue Oct 31 03:40:43 2006
@@ -19,7 +19,7 @@
 function getTopQuotes()
 {
 	require_once("data/Tracker.php");
-	require_once('modules/Quotes/Quote.php');
+	require_once('modules/Quotes/Quotes.php');
 	require_once('include/logging.php');
 	require_once('include/ListView/ListView.php');
 	require_once('include/database/PearDatabase.php');
@@ -51,7 +51,7 @@
 			$viewid = "0";
 		}
 	}
-	$focus = new Quote();
+	$focus = new Quotes();
 
 	$theme_path="themes/".$theme."/";
 	$image_path=$theme_path."images/";
@@ -60,9 +60,9 @@
 	//<<<<<<<<<customview>>>>>>>>>
 	$date_var = date('Y-m-d');
 
-	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_quotes.validtill >= \''.$date_var.'\' ORDER BY total DESC';
+	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_quotes.validtill >= \''.$date_var.'\'';
 	$query = getListQuery("Quotes",$where);
-
+	$query .=" ORDER BY total DESC";
 	//<<<<<<<<customview>>>>>>>>>
 
 	$list_result = $adb->limitQuery($query,0,5);

Modified: vtigercrm/trunk/modules/Quotes/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/ListView.php (original)
+++ vtigercrm/trunk/modules/Quotes/ListView.php Tue Oct 31 03:40:43 2006
@@ -15,7 +15,7 @@
 
 require_once('Smarty_setup.php');
 require_once("data/Tracker.php");
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -33,7 +33,7 @@
 
 $url_string = '';
 
-$focus = new Quote();
+$focus = new Quotes();
 $smarty = new vtigerCRM_Smarty;
 $other_text = Array();
 
@@ -79,6 +79,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 
 if(isPermitted('Quotes','Delete','') == 'yes')
 {

Modified: vtigercrm/trunk/modules/Quotes/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/Save.php (original)
+++ vtigercrm/trunk/modules/Quotes/Save.php Tue Oct 31 03:40:43 2006
@@ -21,7 +21,7 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 include("modules/Emails/mail.php");
@@ -34,7 +34,7 @@
 $rate = $rate_symbol['rate'];
 $log->debug("Inside Quote Save");
 
-$focus = new Quote();
+$focus = new Quotes();
 
 setObjectValuesFromRequest(&$focus);
 

Modified: vtigercrm/trunk/modules/Reports/ReportColumns.php
==============================================================================
--- vtigercrm/trunk/modules/Reports/ReportColumns.php (original)
+++ vtigercrm/trunk/modules/Reports/ReportColumns.php Tue Oct 31 03:40:43 2006
@@ -113,7 +113,7 @@
 					$shtml .= "<optgroup label=\"".$app_list_strings['moduleList'][$secmodule[$i]]." ".$key."\" class=\"select\" style=\"border:none\">";
 					foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel)
 					{
-						if(isset($mod_strings[$fieldlable]))
+						if(isset($mod_strings[$fieldlabel]))
 						{
 							$shtml .= "<option value=\"".$field."\">".$mod_strings[$fieldlabel]."</option>";
 						}else

Modified: vtigercrm/trunk/modules/Reports/ReportRun.php
==============================================================================
--- vtigercrm/trunk/modules/Reports/ReportRun.php (original)
+++ vtigercrm/trunk/modules/Reports/ReportRun.php Tue Oct 31 03:40:43 2006
@@ -1269,11 +1269,14 @@
 
 
 		}	
-		if($module == "Campaigns")// added for 5.0
-		{
-			$query = "from vtiger_campaign 
-				inner join vtiger_crmentity as vtiger_crmentityCampaigns on vtiger_crmentityCampaigns.crmid=vtiger_campaign.campaignid 				             left join vtiger_users as vtiger_usersCampaigns on vtiger_usersCampaigns.id = vtiger_crmentityCampaigns.smownerid 
-				".$this->getRelatedModulesQuery($module,$this->secondarymodule)."
+		if($module == "Campaigns")
+		{
+		 $query = "from vtiger_campaign
+			        inner join vtiger_campaignscf as vtiger_campaignscf on vtiger_campaignscf.campaignid=vtiger_campaign.campaignid   
+				inner join vtiger_crmentity as vtiger_crmentityCampaigns on vtiger_crmentityCampaigns.crmid=vtiger_campaign.campaignid
+
+		             left join vtiger_users as vtiger_usersCampaigns on vtiger_usersCampaigns.id = vtiger_crmentityCampaigns.smownerid
+                                ".$this->getRelatedModulesQuery($module,$this->secondarymodule)."
 				where vtiger_crmentityCampaigns.deleted=0";
 		}
 		$log->info("ReportRun :: Successfully returned getReportsQuery".$module);

Modified: vtigercrm/trunk/modules/Reports/Reports.php
==============================================================================
--- vtigercrm/trunk/modules/Reports/Reports.php (original)
+++ vtigercrm/trunk/modules/Reports/Reports.php Tue Oct 31 03:40:43 2006
@@ -793,10 +793,20 @@
 		{
 			$fieldcolname = $adb->query_result($result,$i,"columnname");
 			$fieldlist = explode(":",$fieldcolname);
+			
+			//Fix for multilanguage support - code contribution by Ding jianting
+			$fieldlabel_array = explode("_",$fieldlist[2]);
+			$mod_strings = return_module_language($current_language,$fieldlabel_array[0]);
 			if($fieldcolname != "")
 			{
-				$shtml .= "<option value=\"".$fieldcolname."\">".str_replace($modules," ",$fieldlist[2])."</option>";
-			}
+				$fieldlabel = trim(str_replace($modules," ",$fieldlist[2]));
+				if(isset($mod_strings[$fieldlabel])) {
+					$shtml .= "<option value=\"".$fieldcolname."\">".$mod_strings[$fieldlabel]."</option>";
+				} else {
+					$shtml .= "<option value=\"".$fieldcolname."\">".$fieldlabel."</option>";
+				}
+			}
+			//Code contribution ends
 		}
 
 		$log->info("Reports :: Successfully returned getSelectedColumnsList");

Modified: vtigercrm/trunk/modules/SalesOrder/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/EditView.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/EditView.php Tue Oct 31 03:40:43 2006
@@ -23,7 +23,7 @@
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
 require_once('modules/SalesOrder/SalesOrder.php');
-require_once('modules/Quotes/Quote.php');
+require_once('modules/Quotes/Quotes.php');
 require_once('include/CustomFieldUtil.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils/utils.php');
@@ -44,7 +44,7 @@
     if(isset($_REQUEST['convertmode']) &&  $_REQUEST['convertmode'] == 'quotetoso')
     {
 	$quoteid = $_REQUEST['record'];
-	$quote_focus = new Quote();
+	$quote_focus = new Quotes();
 	$quote_focus->id = $quoteid;
 	$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 	$focus = getConvertQuoteToSoObject($focus,$quote_focus,$quoteid);
@@ -80,7 +80,7 @@
 		
 	$quoteid = $focus->column_fields['quote_id'];
 	$smarty->assign("QUOTE_ID", $focus->column_fields['quote_id']);
-	$quote_focus = new Quote();
+	$quote_focus = new Quotes();
 	$quote_focus->id = $quoteid;
 	$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 	$focus = getConvertQuoteToSoObject($focus,$quote_focus,$quoteid);
@@ -118,7 +118,7 @@
 			$focus->column_fields['duedate'] = getDBInsertDateValue($curr_due_date);
 		}		
 		$quoteid = $focus->column_fields['quote_id'];
-		$quote_focus = new Quote();
+		$quote_focus = new Quotes();
 		$quote_focus->id = $quoteid;
 		$quote_focus->retrieve_entity_info($quoteid,"Quotes");
 		$focus = getConvertQuoteToSoObject($focus,$quote_focus,$quoteid);
@@ -161,8 +161,8 @@
 
 // Get Account address if vtiger_account is given
 if(isset($_REQUEST['account_id']) && $_REQUEST['record']=='' && $_REQUEST['account_id'] != ''){
-	require_once('modules/Accounts/Account.php');
-	$acct_focus = new Account();
+	require_once('modules/Accounts/Accounts.php');
+	$acct_focus = new Accounts();
 	$acct_focus->retrieve_entity_info($_REQUEST['account_id'],"Accounts");
 	$focus->column_fields['bill_city']=$acct_focus->column_fields['bill_city'];
 	$focus->column_fields['ship_city']=$acct_focus->column_fields['ship_city'];

Modified: vtigercrm/trunk/modules/SalesOrder/ListTopSalesOrder.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/ListTopSalesOrder.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/ListTopSalesOrder.php Tue Oct 31 03:40:43 2006
@@ -56,9 +56,9 @@
 	//<<<<<<<<<customview>>>>>>>>>
 	$date_var = date('Y-m-d');
 
-	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_salesorder.duedate >= \''.$date_var.'\' ORDER BY total DESC';
+	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_salesorder.duedate >= \''.$date_var.'\'';
 	$query = getListQuery("SalesOrder",$where);
-
+	$query .=" ORDER BY total DESC";
 	//<<<<<<<<customview>>>>>>>>>
 
 	$list_result = $adb->limitQuery($query,0,5);

Modified: vtigercrm/trunk/modules/SalesOrder/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/ListView.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/ListView.php Tue Oct 31 03:40:43 2006
@@ -79,6 +79,7 @@
 $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
 //<<<<<customview>>>>>
 $smarty->assign("CHANGE_OWNER",getUserslist());
+$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
 // Buttons and View options
 if(isPermitted('SalesOrder','Delete','') == 'yes')
 {

Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrder.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/SalesOrder.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Tue Oct 31 03:40:43 2006
@@ -106,6 +106,23 @@
 		$this->db = new PearDatabase();
 		$this->column_fields = getColumnFields('SalesOrder');
 	}
+
+	function save_module($module)
+	{
+	
+		//Checking if quote_id is present and updating the quote status
+		if($this->column_fields["quote_id"] != '')
+		{
+        		$qt_id = $this->column_fields["quote_id"];
+        		$query1 = "update vtiger_quotes set quotestage='Accepted' where quoteid=".$qt_id;
+        		$this->db->query($query1);
+		}
+
+		//Based on the total Number of rows we will save the product relationship with this entity
+		saveInventoryProductDetails(&$this, 'SalesOrder');	
+
+		
+	}	
 	
 	/**	Function used to get the sort order for Sales Order listview
 	 *	@return string	$sorder	- first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['SALESORDER_SORT_ORDER'] if this session value is empty then default sort order will be returned. 

Modified: vtigercrm/trunk/modules/SalesOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/Save.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/Save.php Tue Oct 31 03:40:43 2006
@@ -31,39 +31,7 @@
 $focus = new SalesOrder();
 setObjectValuesFromRequest(&$focus);
 
-if($focus->mode == 'edit' && ($focus->column_fields['sostatus'] == 'Delivered' || $focus->column_fields['sostatus'] == 'Approved'))
-{
-	$prev_sostatus=$adb->query_result($adb->query("select sostatus from vtiger_salesorder where salesorderid=$focus->id"),0,'sostatus');
-
-	if($focus->column_fields['sostatus'] != $prev_sostatus)
-	{
-       		if($focus->column_fields['sostatus'] == 'Delivered')
-        	{
-			//Deduct the quantity from Quantity In Stock and Quantity In Demand
-                	$updateStockAndDemand = 'true';
-		}
-		elseif($focus->column_fields['sostatus'] == 'Approved')
-		{
-			//Add the quantity with Quantity In Demand
-			$updateDemand = 'true';
-		}
-        }
-
-}
-
 $focus->save("SalesOrder");
-
-//Checking if quote_id is present and updating the quote status
-if($focus->column_fields["quote_id"] != '')
-{
-        $qt_id = $focus->column_fields["quote_id"];
-        $query1 = "update vtiger_quotes set quotestage='Accepted' where quoteid=".$qt_id;
-        $adb->query($query1);
-}
-
-//Based on the total Number of rows we will save the product relationship with this entity
-saveInventoryProductDetails(&$focus, 'SalesOrder','',$updateStockAndDemand, $updateDemand);
-
 
 $return_id = $focus->id;
 

Modified: vtigercrm/trunk/modules/SalesOrder/pdf_templates/header.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/pdf_templates/header.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/pdf_templates/header.php Tue Oct 31 03:40:43 2006
@@ -69,7 +69,7 @@
 
 // vtiger_invoice number block
 $invBlock=array("145","65");
-$pdf->addRecBlock($id, "Invoice Number",$invBlock);
+$pdf->addRecBlock($id, "SO Number",$invBlock);
 
 /* ************ End Invoice Data ************************ */
 

Modified: vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php (original)
+++ vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php Tue Oct 31 03:40:43 2006
@@ -79,25 +79,7 @@
   
 	//Assigning the vtiger_table Name
 	$tableName ='';
-	if($fldmodule == 'Leads')
-	{
-		$tableName='vtiger_leadscf';
-	}
-	elseif($fldmodule == 'Accounts')
-	{
-
-		$tableName='vtiger_accountscf';
-	}
-	elseif($fldmodule == 'Contacts')
-	{
-
-		$tableName='vtiger_contactscf';
-	}
-	elseif($fldmodule == 'Potentials')
-	{
-		$tableName='vtiger_potentialscf';
-	}
-	elseif($fldmodule == 'HelpDesk')
+	if($fldmodule == 'HelpDesk')
 	{
 		$tableName='vtiger_ticketcf';
 	}
@@ -113,25 +95,9 @@
 	{
 		$tableName='vtiger_pricebookcf';
 	}
-	elseif($fldmodule == 'Quotes')
-	{
-		$tableName='vtiger_quotescf';
-	}
-	elseif($fldmodule == 'PurchaseOrder')
-	{
-		$tableName='vtiger_purchaseordercf';
-	}
-	elseif($fldmodule == 'SalesOrder')
-	{
-		$tableName='vtiger_salesordercf';
-	}
-	elseif($fldmodule == 'Invoice')
-	{
-		$tableName='vtiger_invoicecf';
-	}
-	elseif($fldmodule == 'Campaigns')
-	{
-		$tableName='vtiger_campaignscf';
+	elseif($fldmodule != '')
+	{
+		$tableName= 'vtiger_'.strtolower($fldmodule).'cf';
 	}
 	//Assigning the uitype
 	$fldlength=$_REQUEST['fldLength'];

Modified: vtigercrm/trunk/modules/Settings/CustomFieldList.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/CustomFieldList.php (original)
+++ vtigercrm/trunk/modules/Settings/CustomFieldList.php Tue Oct 31 03:40:43 2006
@@ -22,20 +22,8 @@
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 $smarty->assign("IMAGE_PATH", $image_path);
-$module_array=Array('Leads'=>'Leads',
-                        'Accounts'=>'Accounts',
-                        'Contacts'=>'Contacts',
-                        'Potentials'=>'Potentials',
-                        'HelpDesk'=>'HelpDesk',
-                        'Products'=>'Products',
-                        'Vendors'=>'Vendors',
-                        'PriceBooks'=>'PriceBooks',
-                        'PurchaseOrder'=>'PurchaseOrder',
-                        'SalesOrder'=>'SalesOrder',
-                        'Quotes'=>'Quotes',
-                        'Invoice'=>'Invoice',
-						'Campaigns'=>'Campaigns'
-                        );
+$module_array=getCustomFieldSupportedModules();
+
 $cfimagecombo = Array($image_path."text.gif",
 $image_path."number.gif",
 $image_path."percent.gif",
@@ -166,4 +154,18 @@
 	return $label;
 }
 
+/* function to get the modules supports Custom Fields
+*/
+
+function getCustomFieldSupportedModules()
+{
+	global $adb;
+	$sql="select distinct vtiger_field.tabid,name from vtiger_field inner join vtiger_tab on vtiger_field.tabid=vtiger_tab.tabid where vtiger_field.tabid not in(9,10,16,15,8,29)";
+	$result = $adb->query($sql);
+	while($moduleinfo=$adb->fetch_array($result))
+	{
+		$modulelist[$moduleinfo['name']] = $moduleinfo['name'];
+	}
+	return $modulelist;
+}
 ?>

Modified: vtigercrm/trunk/modules/Settings/DeleteCustomField.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/DeleteCustomField.php (original)
+++ vtigercrm/trunk/modules/Settings/DeleteCustomField.php Tue Oct 31 03:40:43 2006
@@ -50,7 +50,15 @@
 $adb->query($dbquery);
 
 
-//HANDLE HERE - we have to remove the entries in customview and report related tables which have this field ($colName)
+//we have to remove the entries in customview and report related tables which have this field ($colName)
+$adb->query("delete from vtiger_cvcolumnlist where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_cvstdfilter where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_cvadvfilter where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_selectcolumn where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_relcriteria where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_reportsortcol where columnname like '%".$colName."%'");
+$adb->query("delete from vtiger_reportdatefilter where datecolumnname like '%".$colName."%'");
+$adb->query("delete from vtiger_reportsummary where columnname like '%".$colName."%'");
 
 
 //Deleting from convert lead mapping vtiger_table- Jaguar
@@ -67,5 +75,7 @@
 	$adb->query($deltablequery);
 }
 
+
+
 header("Location:index.php?module=Settings&action=CustomFieldList&fld_module=".$fld_module."&parenttab=Settings");
 ?>

Modified: vtigercrm/trunk/modules/Settings/EditComboField.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/EditComboField.php (original)
+++ vtigercrm/trunk/modules/Settings/EditComboField.php Tue Oct 31 03:40:43 2006
@@ -91,7 +91,9 @@
 $smarty->assign("ENTRIES",$fldVal);
 $smarty->assign("MODULE",$moduleName);
 $smarty->assign("FIELDNAME",$tableName);
-$smarty->assign("FIELDLABEL",$fieldlabel);
+//First look into app_strings and then mod_strings and if not available then original label will be displayed
+$temp_label = isset($app_strings[$fieldlabel])?$app_strings[$fieldlabel]:(isset($mod_strings[$fieldlabel])?$mod_strings[$fieldlabel]:$fieldlabel);
+$smarty->assign("FIELDLABEL",$temp_label);
 $smarty->assign("UITYPE", $uitype);
 $smarty->assign("MOD", return_module_language($current_language,'Settings'));
 $smarty->assign("IMAGE_PATH",$image_path);

Modified: vtigercrm/trunk/modules/Settings/TaxConfig.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/TaxConfig.php (original)
+++ vtigercrm/trunk/modules/Settings/TaxConfig.php Tue Oct 31 03:40:43 2006
@@ -1,214 +1,244 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-
-require_once('Smarty_setup.php');
-global $mod_strings;
-global $app_strings;
-global $adb;
-global $log;
-
-$smarty = new vtigerCRM_Smarty;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-
-$tax_details = getAllTaxes();
-$sh_tax_details = getAllTaxes('all','sh');
-
-//To save the edited value
-if($_REQUEST['save_tax'] == 'true')
-{
-	for($i=0;$i<count($tax_details);$i++)
-	{
-		$new_percentages[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxname']];
-	}
-	updateTaxPercentages($new_percentages);
-	$getlist = true;
-}
-elseif($_REQUEST['sh_save_tax'] == 'true')
-{
-	for($i=0;$i<count($sh_tax_details);$i++)
-	{
-		$new_percentages[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxname']];
-	}
-	updateTaxPercentages($new_percentages,'sh');
-	$getlist = true;
-}
-
-//To edit
-if($_REQUEST['edit_tax'] == 'true')
-{
-	$smarty->assign("EDIT_MODE", 'true');
-}
-elseif($_REQUEST['sh_edit_tax'] == 'true')
-{
-	$smarty->assign("SH_EDIT_MODE", 'true');
-}
-
-//To add tax
-if($_REQUEST['add_tax_type'] == 'true')
-{
-	//Add the given tax name and value as a new tax type
-	echo addTaxType($_REQUEST['addTaxLabel'],$_REQUEST['addTaxValue']);
-	$getlist = true;
-}
-elseif($_REQUEST['sh_add_tax_type'] == 'true')
-{
-	echo addTaxType($_REQUEST['sh_addTaxLabel'],$_REQUEST['sh_addTaxValue'],'sh');
-	$getlist = true;
-}
-
-//To Disable ie., delete or enable
-if(($_REQUEST['disable'] == 'true' || $_REQUEST['enable'] == 'true') && $_REQUEST['taxname'] != '')
-{
-	if($_REQUEST['disable'] == 'true')
-		changeDeleted($_REQUEST['taxname'],1);
-	else
-		changeDeleted($_REQUEST['taxname'],0);
-	$getlist = true;
-}
-elseif(($_REQUEST['sh_disable'] == 'true' || $_REQUEST['sh_enable'] == 'true') && $_REQUEST['sh_taxname'] != '')
-{
-	if($_REQUEST['sh_disable'] == 'true')
-		changeDeleted($_REQUEST['sh_taxname'],1,'sh');
-	else
-		changeDeleted($_REQUEST['sh_taxname'],0,'sh');
-	$getlist = true;
-}
-
-//after done save or enable/disable or added new tax the list will be retrieved again from db
-if($getlist)
-{
-	$tax_details = getAllTaxes();
-	$sh_tax_details = getAllTaxes('all','sh');
-}
-
-$smarty->assign("TAX_COUNT", count($tax_details));
-$smarty->assign("SH_TAX_COUNT", count($sh_tax_details));
-
-if(count($tax_details) == 0)
-	$smarty->assign("TAX_COUNT", 0);
-if(count($sh_tax_details) == 0)
-	$smarty->assign("SH_TAX_COUNT", 0);
-	
-$smarty->assign("TAX_VALUES", $tax_details);
-$smarty->assign("SH_TAX_VALUES", $sh_tax_details);
-
-$smarty->assign("MOD", return_module_language($current_language,'Settings'));
-$smarty->assign("IMAGE_PATH",$image_path);
-$smarty->assign("APP", $app_strings);
-$smarty->assign("MOD", $mod_strings);
-$smarty->display("Settings/TaxConfig.tpl");
-
-
-/**	Function to update the list of Tax percentages for the passed tax types
- *	@param array $new_percentages - array of tax types and the values like [taxid]=new value ie., [1]=3.56, [2]=11.45
- *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
- *      @return void
- */
-function updateTaxPercentages($new_percentages, $sh='')
-{
-	global $adb, $log;
-	$log->debug("Entering into the function updateTaxPercentages");
-
-	$tax_percentage = Array();
-
-	foreach($new_percentages as $taxid => $new_val)
-	{
-		if($new_val != '')
-		{
-			if($sh != '' && $sh == 'sh')
-				$query = "update vtiger_shippingtaxinfo set percentage = \"$new_val\" where taxid=\"$taxid\"";
-			else
-				$query = "update vtiger_inventorytaxinfo set percentage = \"$new_val\" where taxid=\"$taxid\"";
-			$adb->query($query);
-		}
-	}
-
-	$log->debug("Exiting from the function updateTaxPercentages");
-}
-
-/**	Function used to add the tax type which will do database alterations
- *	@param string $taxlabel - tax label name to be added
- *	@param string $taxvalue - tax value to be added
- *      @param string $sh - sh or empty , if sh passed then the tax will be added in shipping and handling related table
- *      @return void
- */
-function addTaxType($taxlabel, $taxvalue, $sh='')
-{
-	global $adb, $log;
-	$log->debug("Entering into function addTaxType($taxlabel, $taxvalue, $sh)");
-
-	//First we will check whether the tax is already available or not
-	if($sh != '' && $sh == 'sh')
-		$check_query = "select taxlabel from vtiger_shippingtaxinfo where taxlabel='".addslashes($taxlabel)."'";
-	else
-		$check_query = "select taxlabel from vtiger_inventorytaxinfo where taxlabel='".addslashes($taxlabel)."'";
-	$check_res = $adb->query($check_query);
-
-	if($adb->num_rows($check_res) > 0)
-		return "<font color='red'>This tax is already available</font>";
-
-	//if the tax is not available then add this tax.
-	//Add this tax as a column in related table	
-	if($sh != '' && $sh == 'sh')
-	{
-		$taxid = $adb->getUniqueID("vtiger_shippingtaxinfo");
-		$taxname = "shtax".$taxid;
-		
-		$query = "alter table vtiger_inventoryshippingrel add column $taxname decimal(7,3) default NULL";
-	}
-	else
-	{
-		$taxid = $adb->getUniqueID("vtiger_inventorytaxinfo");
-		$taxname = "tax".$taxid;
-		$query = "alter table vtiger_inventoryproductrel add column $taxname decimal(7,3) default NULL";
-	}
-	$res = $adb->query($query);
-
-	//if the tax is added as a column then we should add this tax in the list of taxes
-	if($res)
-	{
-		if($sh != '' && $sh == 'sh')
-			$query1 = "insert into vtiger_shippingtaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
-		else
-			$query1 = "insert into vtiger_inventorytaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
-
-		$res1 = $adb->query($query1);
-	}
-
-	$log->debug("Exit from function addTaxType($taxlabel, $taxvalue)");
-	if($res1)
-		return '';
-	else
-		return "There may be some problem in adding the Tax type. Please try again";
-}
-
-/**	Function used to Enable or Disable the tax type 
- *	@param string $taxname - taxname to enable or disble
- *	@param int $deleted - 0 or 1 where 0 to enable and 1 to disable
- *	@param string $sh - sh or empty, if sh passed then the enable/disable will be done in shipping and handling tax table ie.,vtiger_shippingtaxinfo  else this enable/disable will be done in Product tax table ie., in vtiger_inventorytaxinfo
- *	@return void
- */
-function changeDeleted($taxname, $deleted, $sh='')
-{
-	global $log, $adb;
-	$log->debug("Entering into function changeDeleted($taxname, $deleted, $sh)");
-
-	if($sh == 'sh')
-		$adb->query("update vtiger_shippingtaxinfo set deleted=$deleted where taxname=\"$taxname\"");
-	else
-		$adb->query("update vtiger_inventorytaxinfo set deleted=$deleted where taxname=\"$taxname\"");
-	$log->debug("Exit from function changeDeleted($taxname, $deleted, $sh)");
-}
-
-?>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
+
+require_once('Smarty_setup.php');
+global $mod_strings;
+global $app_strings;
+global $adb;
+global $log;
+
+$smarty = new vtigerCRM_Smarty;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+$tax_details = getAllTaxes();
+$sh_tax_details = getAllTaxes('all','sh');
+
+
+//To save the edited value
+if($_REQUEST['save_tax'] == 'true')
+{
+	for($i=0;$i<count($tax_details);$i++)
+	{
+     		$new_labels[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxlabel']];
+		$new_percentages[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxname']];
+	}
+	updateTaxPercentages($new_percentages);
+	updateTaxLabels($new_labels);
+	$getlist = true;
+}
+elseif($_REQUEST['sh_save_tax'] == 'true')
+{
+ 
+	for($i=0;$i<count($sh_tax_details);$i++)
+	{
+	  $new_labels[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxlabel']];
+		$new_percentages[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxname']];
+	}
+	
+	updateTaxPercentages($new_percentages,'sh');
+	updateTaxLabels($new_labels,'sh');
+	$getlist = true;
+}
+
+//To edit
+if($_REQUEST['edit_tax'] == 'true')
+{
+	$smarty->assign("EDIT_MODE", 'true');
+}
+elseif($_REQUEST['sh_edit_tax'] == 'true')
+{
+	$smarty->assign("SH_EDIT_MODE", 'true');
+}
+
+//To add tax
+if($_REQUEST['add_tax_type'] == 'true')
+{
+	//Add the given tax name and value as a new tax type
+	echo addTaxType($_REQUEST['addTaxLabel'],$_REQUEST['addTaxValue']);
+	$getlist = true;
+}
+elseif($_REQUEST['sh_add_tax_type'] == 'true')
+{
+	echo addTaxType($_REQUEST['sh_addTaxLabel'],$_REQUEST['sh_addTaxValue'],'sh');
+	$getlist = true;
+}
+
+//To Disable ie., delete or enable
+if(($_REQUEST['disable'] == 'true' || $_REQUEST['enable'] == 'true') && $_REQUEST['taxname'] != '')
+{
+	if($_REQUEST['disable'] == 'true')
+		changeDeleted($_REQUEST['taxname'],1);
+	else
+		changeDeleted($_REQUEST['taxname'],0);
+	$getlist = true;
+}
+elseif(($_REQUEST['sh_disable'] == 'true' || $_REQUEST['sh_enable'] == 'true') && $_REQUEST['sh_taxname'] != '')
+{
+	if($_REQUEST['sh_disable'] == 'true')
+		changeDeleted($_REQUEST['sh_taxname'],1,'sh');
+	else
+		changeDeleted($_REQUEST['sh_taxname'],0,'sh');
+	$getlist = true;
+}
+
+//after done save or enable/disable or added new tax the list will be retrieved again from db
+if($getlist)
+{
+	$tax_details = getAllTaxes();
+	$sh_tax_details = getAllTaxes('all','sh');
+}
+
+$smarty->assign("TAX_COUNT", count($tax_details));
+$smarty->assign("SH_TAX_COUNT", count($sh_tax_details));
+
+if(count($tax_details) == 0)
+	$smarty->assign("TAX_COUNT", 0);
+if(count($sh_tax_details) == 0)
+	$smarty->assign("SH_TAX_COUNT", 0);
+
+$smarty->assign("TAX_VALUES", $tax_details);
+
+$smarty->assign("SH_TAX_VALUES", $sh_tax_details);
+
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("MOD", $mod_strings);
+$smarty->display("Settings/TaxConfig.tpl");
+
+
+/**	Function to update the list of Tax percentages for the passed tax types
+ *	@param array $new_percentages - array of tax types and the values like [taxid]=new value ie., [1]=3.56, [2]=11.45
+ *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
+ *      @return void
+ */
+function updateTaxPercentages($new_percentages, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into the function updateTaxPercentages");
+
+	foreach($new_percentages as $taxid => $new_val)
+	{
+		if($new_val != '')
+		{
+			if($sh != '' && $sh == 'sh')
+				$query = "update vtiger_shippingtaxinfo set percentage=\"$new_val\" where taxid=\"$taxid\"";
+			else
+				$query = "update vtiger_inventorytaxinfo set percentage = \"$new_val\" where taxid=\"$taxid\"";
+			$adb->query($query);
+		}
+	}
+
+	$log->debug("Exiting from the function updateTaxPercentages");
+}
+
+/**	Function to update the list of Tax Labels for the taxes
+ *	@param array $new_labels - array of tax types and the values like [taxid]=new label ie., [1]=aa, [2]=bb
+ *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
+ *      @return void
+ */
+function updateTaxLabels($new_labels, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into the function updateTaxPercentages");
+
+	foreach($new_labels as $taxid => $new_val)
+	{
+		if($new_val != '')
+		{
+			if($sh != '' && $sh == 'sh')
+				$query = "update vtiger_shippingtaxinfo set taxlabel= \"$new_val\" where taxid=\"$taxid\"";
+			else
+				$query = "update vtiger_inventorytaxinfo set taxlabel = \"$new_val\" where taxid=\"$taxid\"";
+			$adb->query($query);
+		}
+	}
+
+	$log->debug("Exiting from the function updateTaxPercentages");
+}
+/**	Function used to add the tax type which will do database alterations
+ *	@param string $taxlabel - tax label name to be added
+ *	@param string $taxvalue - tax value to be added
+ *      @param string $sh - sh or empty , if sh passed then the tax will be added in shipping and handling related table
+ *      @return void
+ */
+function addTaxType($taxlabel, $taxvalue, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into function addTaxType($taxlabel, $taxvalue, $sh)");
+
+	//First we will check whether the tax is already available or not
+	if($sh != '' && $sh == 'sh')
+		$check_query = "select taxlabel from vtiger_shippingtaxinfo where taxlabel='".addslashes($taxlabel)."'";
+	else
+		$check_query = "select taxlabel from vtiger_inventorytaxinfo where taxlabel='".addslashes($taxlabel)."'";
+	$check_res = $adb->query($check_query);
+
+	if($adb->num_rows($check_res) > 0)
+		return "<font color='red'>This tax is already available</font>";
+
+	//if the tax is not available then add this tax.
+	//Add this tax as a column in related table	
+	if($sh != '' && $sh == 'sh')
+	{
+		$taxid = $adb->getUniqueID("vtiger_shippingtaxinfo");
+		$taxname = "shtax".$taxid;
+		$query = "alter table vtiger_inventoryshippingrel add column $taxname decimal(7,3) default NULL";
+	}
+	else
+	{
+		$taxid = $adb->getUniqueID("vtiger_inventorytaxinfo");
+		$taxname = "tax".$taxid;
+		$query = "alter table vtiger_inventoryproductrel add column $taxname decimal(7,3) default NULL";
+	}
+	$res = $adb->query($query);
+
+	//if the tax is added as a column then we should add this tax in the list of taxes
+	if($res)
+	{
+		if($sh != '' && $sh == 'sh')
+			$query1 = "insert into vtiger_shippingtaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
+		else
+			$query1 = "insert into vtiger_inventorytaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
+
+		$res1 = $adb->query($query1);
+	}
+
+	$log->debug("Exit from function addTaxType($taxlabel, $taxvalue)");
+	if($res1)
+		return '';
+	else
+		return "There may be some problem in adding the Tax type. Please try again";
+}
+
+/**	Function used to Enable or Disable the tax type 
+ *	@param string $taxname - taxname to enable or disble
+ *	@param int $deleted - 0 or 1 where 0 to enable and 1 to disable
+ *	@param string $sh - sh or empty, if sh passed then the enable/disable will be done in shipping and handling tax table ie.,vtiger_shippingtaxinfo  else this enable/disable will be done in Product tax table ie., in vtiger_inventorytaxinfo
+ *	@return void
+ */
+function changeDeleted($taxname, $deleted, $sh='')
+{
+	global $log, $adb;
+	$log->debug("Entering into function changeDeleted($taxname, $deleted, $sh)");
+
+	if($sh == 'sh')
+		$adb->query("update vtiger_shippingtaxinfo set deleted=$deleted where taxname=\"$taxname\"");
+	else
+		$adb->query("update vtiger_inventorytaxinfo set deleted=$deleted where taxname=\"$taxname\"");
+	$log->debug("Exit from function changeDeleted($taxname, $deleted, $sh)");
+}
+
+?>

Modified: vtigercrm/trunk/modules/Users/Authenticate.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Authenticate.php (original)
+++ vtigercrm/trunk/modules/Users/Authenticate.php Tue Oct 31 03:40:43 2006
@@ -20,14 +20,14 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('modules/Users/CreateUserPrivilegeFile.php');
 require_once('include/logging.php');
 require_once('user_privileges/audit_trail.php');
 
 global $mod_strings;
 
-$focus = new User();
+$focus = new Users();
 
 // Add in defensive code here.
 $focus->column_fields["user_name"] = to_html($_REQUEST['user_name']);

Modified: vtigercrm/trunk/modules/Users/ChangePassword.php
==============================================================================
--- vtigercrm/trunk/modules/Users/ChangePassword.php (original)
+++ vtigercrm/trunk/modules/Users/ChangePassword.php Tue Oct 31 03:40:43 2006
@@ -23,7 +23,7 @@
 // The popup_picker.html file is used for generating a list from which to find and choose one instance.
 
 global $theme;
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 

Modified: vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
==============================================================================
--- vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php (original)
+++ vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('config.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/GetUserGroups.php');
@@ -32,7 +32,7 @@
 		$newbuf .="<?php\n\n";
 		$newbuf .="\n";		
 		$newbuf .= "//This is the access privilege file\n";
-		$user_focus= new User();
+		$user_focus= new Users();
 		$user_focus->retrieve_entity_info($userid,"Users");
 		$userInfo=Array();
 		$user_focus->column_fields["id"] = '';
@@ -120,7 +120,7 @@
 		$newbuf .="<?php\n\n";
 		$newbuf .="\n";		
 		$newbuf .= "//This is the sharing access privilege file\n";
-		$user_focus= new User();
+		$user_focus= new Users();
 		$user_focus->retrieve_entity_info($userid,"Users");
 		if($user_focus->is_admin == 'on')
 		{

Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original)
+++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Tue Oct 31 03:40:43 2006
@@ -412,7 +412,7 @@
 $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,10,25,2,'T~O',1,null,'BAS')");
  $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,11,25,2,'T~O',1,null,'BAS')");
  //Added on 26-12-2005 to add attachment in ticket editview
- $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_attachments',1,'61','filename','Attachment',1,0,0,100,12,26,1,'V~O',0,3,'BAS')");
+ $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_attachments',1,'61','filename','Attachment',1,0,0,100,12,25,1,'V~O',0,3,'BAS')");
 
  $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'title','vtiger_troubletickets',1,'22','ticket_title','Title',1,0,0,100,1,26,1,'V~M',0,1,'BAS')");
  $this->db->query("insert into vtiger_field values (13,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_troubletickets',1,'19','description','Description',1,0,0,100,1,28,1,'V~O',0,2,'BAS')");
@@ -428,7 +428,7 @@
 $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productname','vtiger_products',1,'2','productname','Product Name',1,0,0,100,1,31,1,'V~M',1,null,'BAS')");
  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcode','vtiger_products',1,'1','productcode','Product Code',1,0,0,100,2,31,1,'V~O',1,null,'BAS')");
  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'discontinued','vtiger_products',1,'56','discontinued','Product Active',1,0,0,100,3,31,1,'V~O',1,null,'BAS')");
- $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'manufacturer','vtiger_products',1,'15','manufacturer','Manufacturer',1,0,0,100,4,1,31,'V~O',1,null,'BAS')");
+ $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'manufacturer','vtiger_products',1,'15','manufacturer','Manufacturer',1,0,0,100,4,31,1,'V~O',1,null,'BAS')");
  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'productcategory','vtiger_products',1,'15','productcategory','Product Category',1,0,0,100,4,31,1,'V~O',1,null,'BAS')");
 $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'sales_start_date','vtiger_products',1,'5','sales_start_date','Sales Start Date',1,0,0,100,5,31,1,'D~O',1,null,'BAS')");
  $this->db->query("insert into vtiger_field values (14,".$this->db->getUniqueID("vtiger_field").",'sales_end_date','vtiger_products',1,'5','sales_end_date','Sales End Date',1,0,0,100,6,31,1,'D~O~OTH~GE~sales_start_date~Sales Start Date',1,null,'BAS')");
@@ -502,8 +502,8 @@
 	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'subject','vtiger_activity',1,'2','subject','Subject',1,0,0,100,1,23,1,'V~M',1,null,'BAS')");
 	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'filename','vtiger_attachments',1,'61','filename','Attachment',1,0,0,100,2,23,1,'V~O',1,null,'BAS')");
 	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'description','vtiger_crmentity',1,'19','description','Description',1,0,0,100,1,24,1,'V~O',1,null,'BAS')");
-	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'time_start','vtiger_activity',1,'2','time_start','Time Start',1,0,0,100,9,1,23,'T~O',1,null,'BAS')");
-	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,10,1,22,'T~O',1,null,'BAS')");
+	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'time_start','vtiger_activity',1,'2','time_start','Time Start',1,0,0,100,9,23,1,'T~O',1,null,'BAS')");
+	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,10,22,1,'T~O',1,null,'BAS')");
  	$this->db->query("insert into vtiger_field values (10,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,11,21,2,'T~O',1,null,'BAS')");
 
 //Block21 -- End
@@ -912,6 +912,25 @@
  //user Details End
 
 
+//The Entity Name for the modules are maintained in this table
+$this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid')");
+$this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid')");
+$this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid')");
+$this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid')");
+$this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid')");
+$this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid')");
+$this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid')");
+$this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid')");
+$this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid')");
+$this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','last_name,first_name','id')");
+$this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid')");
+$this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid')");
+$this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid')");
+$this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid')");
+$this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid')");
+$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid')");
+$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid')");
+$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id')");
 
                 // Insert End
 		

Modified: vtigercrm/trunk/modules/Users/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DetailView.php (original)
+++ vtigercrm/trunk/modules/Users/DetailView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/CommonUtils.php');
 require_once('include/utils/UserInfoUtil.php');
@@ -37,7 +37,7 @@
 global $app_strings;
 global $mod_strings;
 
-$focus = new User();
+$focus = new Users();
 
 if(!empty($_REQUEST['record'])) {
 	$focus->retrieve_entity_info($_REQUEST['record'],'Users');

Modified: vtigercrm/trunk/modules/Users/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Users/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 	      
 require_once('include/logging.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -24,7 +24,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$userObj = new User();
+		$userObj = new Users();
 		$userObj->retrieve_entity_info($crmid,"Users");
 		$userObj->column_fields[$fieldname] = $fieldvalue;
 		$userObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Users/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/EditView.php (original)
+++ vtigercrm/trunk/modules/Users/EditView.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('modules/Users/Forms.php');
 require_once('include/database/PearDatabase.php');
@@ -36,7 +36,7 @@
 
 
 $smarty=new vtigerCRM_Smarty;
-$focus = new User();
+$focus = new Users();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
 	$smarty->assign("ID",$_REQUEST['record']);

Modified: vtigercrm/trunk/modules/Users/ListLoginHistory.php
==============================================================================
--- vtigercrm/trunk/modules/Users/ListLoginHistory.php (original)
+++ vtigercrm/trunk/modules/Users/ListLoginHistory.php Tue Oct 31 03:40:43 2006
@@ -12,7 +12,7 @@
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
 require_once('modules/Users/LoginHistory.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
@@ -42,7 +42,7 @@
 
 $category = getParenttab();
 
-$oUser = new User($id);
+$oUser = new Users($id);
 
 
 $user_list = getUserslist();

Modified: vtigercrm/trunk/modules/Users/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/ListView.php (original)
+++ vtigercrm/trunk/modules/Users/ListView.php Tue Oct 31 03:40:43 2006
@@ -24,7 +24,7 @@
 global $current_language;
 $mod_strings = return_module_language($current_language,'Users');
 $category = getParentTab();
-$focus = new User();
+$focus = new Users();
 $smarty = new vtigerCRM_Smarty;
 $no_of_users=UserCount();
 //Retreiving the start value from request

Modified: vtigercrm/trunk/modules/Users/Logout.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Logout.php (original)
+++ vtigercrm/trunk/modules/Users/Logout.php Tue Oct 31 03:40:43 2006
@@ -20,7 +20,7 @@
 require_once('include/logging.php');
 require_once('database/DatabaseConnection.php');
 require_once('modules/Users/LoginHistory.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('config.php');
 require_once('include/db_backup/backup.php');
 require_once('include/db_backup/ftp.php');

Modified: vtigercrm/trunk/modules/Users/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Save.php (original)
+++ vtigercrm/trunk/modules/Users/Save.php Tue Oct 31 03:40:43 2006
@@ -20,7 +20,7 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('include/logging.php');
 require_once('include/utils/UserInfoUtil.php');
 $log =& LoggerManager::getLogger('index');
@@ -46,7 +46,7 @@
 if (isset($_POST['record']) && !is_admin($current_user) && $_POST['record'] != $current_user->id) echo ("Unauthorized access to user administration.");
 elseif (!isset($_POST['record']) && !is_admin($current_user)) echo ("Unauthorized access to user administration.");
 
-$focus = new User();
+$focus = new Users();
 if(isset($_REQUEST["record"]) && $_REQUEST["record"] != '')
 {
     $focus->mode='edit';

Modified: vtigercrm/trunk/modules/Users/ShowAuditTrail.php
==============================================================================
--- vtigercrm/trunk/modules/Users/ShowAuditTrail.php (original)
+++ vtigercrm/trunk/modules/Users/ShowAuditTrail.php Tue Oct 31 03:40:43 2006
@@ -12,7 +12,7 @@
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
 require_once('modules/Users/AuditTrail.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');

Modified: vtigercrm/trunk/modules/Users/ShowHistory.php
==============================================================================
--- vtigercrm/trunk/modules/Users/ShowHistory.php (original)
+++ vtigercrm/trunk/modules/Users/ShowHistory.php Tue Oct 31 03:40:43 2006
@@ -12,11 +12,11 @@
 require_once('Smarty_setup.php');
 require_once('data/Tracker.php');
 require_once('modules/Users/LoginHistory.php');
-require_once('modules/Users/User.php');
+require_once('modules/Users/Users.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
-#require_once('modules/Users/User.php');
+#require_once('modules/Users/Users.php');
 require_once('include/utils/utils.php');
 
 global $app_strings;

Modified: vtigercrm/trunk/modules/Users/about_us.php
==============================================================================
--- vtigercrm/trunk/modules/Users/about_us.php (original)
+++ vtigercrm/trunk/modules/Users/about_us.php Tue Oct 31 03:40:43 2006
@@ -22,7 +22,7 @@
 }
 else
 {
-	    $patch_string = "--None--";
+	    $patch_string = $vtiger_current_version;
 }
 global $app_strings;
 global $app_list_strings;
@@ -83,18 +83,20 @@
 						<marquee behavior="scroll" direction="up" width="100%" scrollamount="1" scrolldelay="50"  height="100" onMouseOut="javascript:start();" onMouseOver="javascript:stop();">
 								<table width="100%" border="0" cellpadding="0" cellspacing="0" class="rollOver">
 								<tr><th><?php echo $mod_strings['LBL_TEAM'];?></th></tr>
-										<tr><td>Ahmed</td></tr>
+										<tr><td>Anusha</td></tr>
+										<tr><td>Bharath</td></tr>
+										<tr><td>Bharathi</td></tr>
 										<tr><td>Don</td></tr>
-										<tr><td>Ela</td></tr>
 										<tr><td>Gopal</td></tr>
 										<tr><td>Jeri</td></tr>
 										<tr><td>Mani</td></tr>
 										<tr><td>Mickie</td></tr>
 										<tr><td>Minnie</td></tr>
+										<tr><td>Nithya</td></tr>
 										<tr><td>Philip</td></tr>
 										<tr><td>Radiant</td></tr>
 										<tr><td>Richie</td></tr>
-										<tr><td>SRaj</td></tr>
+										<tr><td>Vashni</td></tr>
 										<tr><td>&nbsp;</td></tr>
 										<tr><th><?php echo $mod_strings['LBL_CREDITS'];?></th></tr>
 										<tr><td>Aissa Belaid</td></tr>

Modified: vtigercrm/trunk/modules/Users/massChangeStatus.php
==============================================================================
--- vtigercrm/trunk/modules/Users/massChangeStatus.php (original)
+++ vtigercrm/trunk/modules/Users/massChangeStatus.php Tue Oct 31 03:40:43 2006
@@ -15,12 +15,12 @@
 
 
 require_once('include/ComboUtil.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 global $app_list_strings;
 global $app_strings;
 global $current_user;
 
-$focus = new Lead();
+$focus = new Leads();
 $idlist = $_POST['idlist'];
 //echo $idlist;
 

Modified: vtigercrm/trunk/modules/Users/populatetemplate.php
==============================================================================
--- vtigercrm/trunk/modules/Users/populatetemplate.php (original)
+++ vtigercrm/trunk/modules/Users/populatetemplate.php Tue Oct 31 03:40:43 2006
@@ -10,9 +10,9 @@
  ********************************************************************************/
 //query the specific vtiger_table and then get the data and write the data here 
 require_once('include/database/PearDatabase.php');
-include_once('modules/Contacts/Contact.php');
-include_once('modules/Leads/Lead.php');
-include_once('modules/Users/User.php');
+include_once('modules/Contacts/Contacts.php');
+include_once('modules/Leads/Leads.php');
+include_once('modules/Users/Users.php');
 global $log;
 
 //download the template file and store it in some specific location
@@ -60,11 +60,11 @@
 //get the module
 if($module == 'leads')
 {
-  $focus = new Lead();
+  $focus = new Leads();
 }
 else
 {
-  $focus = new Contact();
+  $focus = new Contacts();
 }
 
 $focus->retrieve_entity_info($recordid,$module);

Modified: vtigercrm/trunk/modules/Users/profilePrivileges.php
==============================================================================
--- vtigercrm/trunk/modules/Users/profilePrivileges.php (original)
+++ vtigercrm/trunk/modules/Users/profilePrivileges.php Tue Oct 31 03:40:43 2006
@@ -59,16 +59,24 @@
 else
 {
 	$profileName=getProfileName($profileId);
+
 }
 
 $smarty->assign("PROFILE_NAME", $profileName);
 
 if(isset($_REQUEST['profile_description']) && $_REQUEST['profile_description'] != '' && $_REQUEST['mode'] == 'create')
+	
 	$smarty->assign("PROFILE_DESCRIPTION",$_REQUEST['profile_description']);
+else
+{
+	$profileDescription = getProfileDescription($profileId);
+}
+
+$smarty->assign("Profile_Name", $profileName);
+$smarty->assign("Profile_Description", $profileDescription);
+
 if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != '')
 	$smarty->assign("MODE",$_REQUEST['mode']);
-
-
 
 
 //Initially setting the secondary selected vtiger_tab

Modified: vtigercrm/trunk/modules/Users/updateLeadDBStatus.php
==============================================================================
--- vtigercrm/trunk/modules/Users/updateLeadDBStatus.php (original)
+++ vtigercrm/trunk/modules/Users/updateLeadDBStatus.php Tue Oct 31 03:40:43 2006
@@ -19,6 +19,47 @@
 $viewid = $_REQUEST['viewname'];
 $return_module = $_REQUEST['return_module'];
 $return_action = $_REQUEST['return_action'];
+$module_array = array (
+                          'Leads' => 'updateLeadGroupRelation',
+                          'Accounts' => 'updateAccountGroupRelation',
+                          'Contacts' => 'updateContactGroupRelation',
+                          'Potentials' => 'updatePotentialGroupRelation',
+                          'Quotes' => 'updateQuoteGroupRelation',
+                          'SalesOrder' => 'updateSoGroupRelation',
+                          'Invoice' => 'updateInvoiceGroupRelation',
+                          'PurchaseOrder' => 'updatePoGroupRelation',
+                          'HelpDesk' => 'updateTicketGroupRelation',
+                          'Campaigns' => 'updateCampaignGroupRelation',
+                          'Calendar' => 'updateActivityGroupRelation',
+                       );
+
+$deletegroup_array = array (
+                          'Leads'=>'vtiger_leadgrouprelation',
+                          'Accounts'=>'vtiger_accountgrouprelation',
+                          'Contacts'=>'vtiger_contactgrouprelation',
+                          'Potentials'=>'vtiger_potentialgrouprelation',
+                          'Quotes'=>'vtiger_quotegrouprelation',
+                          'SalesOrder'=>'vtiger_sogrouprelation',
+                          'Invoice'=>'vtiger_invoicegrouprelation',
+                          'PurchaseOrder'=>'vtiger_pogrouprelation',
+                          'HelpDesk'=>'vtiger_ticketgrouprelation',
+                          'Campaigns'=>'vtiger_campaigngrouprelation',
+                          'Calendar'=>'vtiger_activitygrouprelation',
+                            );
+$tableId_array= array (
+                       'Leads'=>'leadid',
+                          'Accounts'=>'accountid',
+                          'Contacts'=>'contactid',
+                          'Potentials'=>'potentialid',
+                          'Quotes'=>'quoteid',
+                          'SalesOrder'=>'salesorderid',
+                          'Invoice'=>'invoiceid',
+                          'PurchaseOrder'=>'purchaseorderid',
+                          'HelpDesk'=>'ticketid',
+                          'Campaigns'=>'campaignid',
+                          'Calendar'=>'activityid',       
+                      );
+
 global $current_user;
 global $adb;
 $storearray = explode(";",trim($idlist,';'));
@@ -26,15 +67,31 @@
 $ids_list = array();
 
 $date_var = date('YmdHis');
-if(isset($_REQUEST['user_id']) && $_REQUEST['user_id']!='')
+
+if((isset($_REQUEST['user_id']) && $_REQUEST['user_id']!='') || ($_REQUEST['group_id'] != ''))
 {
 	foreach($storearray as $id)
 	{
 		if(isPermitted($return_module,'EditView',$id) == 'yes')
 		{
-			if($id != '') {
+			if($_REQUEST['user_id'] != '' && $id != '')
+			{
+				//First we have to delete the group relationship
+				$delete_query = "delete from ". $deletegroup_array[$return_module] ." where " . $tableId_array[$return_module] . "='".$id."'";
+				$result = $adb->query($delete_query); 
+
+				//Now we have to update the smownerid
 				$sql = "update vtiger_crmentity set modifiedby=".$current_user->id.",smownerid='" .$idval ."', modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid='" .$id."'";
 				$result = $adb->query($sql);
+			}
+			else if($_REQUEST['group_id'] != '' && $id != '')
+			{
+				//CHANGE HERE -- Here we have to use the getGroupName function. But that function is not correct one because they have used this function to get the assigned group name for the entity - Mickie
+				$groupname = $adb->query_result($adb->query("select groupname from vtiger_groups where groupid=".$_REQUEST['group_id']),0,'groupname');
+				//This is to update the entity - group relation
+				$module_array[$return_module]($id,$groupname); 
+				//Now we have to set the smownerid as 0 
+				$adb->query("update vtiger_crmentity set smownerid=0 where crmid=$id");
 			}
 		}
 		else

Modified: vtigercrm/trunk/modules/Vendors/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Vendors/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
  ********************************************************************************/
 
 require_once('Smarty_setup.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 //Redirecting Header for single page layout
 require_once('user_privileges/default_module_view.php');
 global $singlepane_view;
@@ -21,7 +21,7 @@
 else
 {
 global $currentModule;
-$focus = new Vendor();
+$focus = new Vendors();
 
 $currentmodule = $_REQUEST['module'];
 $RECORD = $_REQUEST['record'];

Modified: vtigercrm/trunk/modules/Vendors/Delete.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/Delete.php (original)
+++ vtigercrm/trunk/modules/Vendors/Delete.php Tue Oct 31 03:40:43 2006
@@ -18,13 +18,13 @@
  * defined return URL.
  ********************************************************************************/
 
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 global $mod_strings;
 
 require_once('include/logging.php');
 $log = LoggerManager::getLogger('product_delete');
 
-$focus = new Vendor();
+$focus = new Vendors();
 
 if(!isset($_REQUEST['record']))
 	die($mod_strings['ERR_DELETE_RECORD']);

Modified: vtigercrm/trunk/modules/Vendors/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/DetailView.php (original)
+++ vtigercrm/trunk/modules/Vendors/DetailView.php Tue Oct 31 03:40:43 2006
@@ -10,11 +10,11 @@
  ********************************************************************************/
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('include/utils/utils.php');
 require_once('user_privileges/default_module_view.php');
 
-$focus = new Vendor();
+$focus = new Vendors();
 
 if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) 
 {

Modified: vtigercrm/trunk/modules/Vendors/DetailViewAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/DetailViewAjax.php (original)
+++ vtigercrm/trunk/modules/Vendors/DetailViewAjax.php Tue Oct 31 03:40:43 2006
@@ -10,7 +10,7 @@
   ********************************************************************************/
 
 require_once('include/logging.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('include/database/PearDatabase.php');
 global $adb;
 
@@ -25,7 +25,7 @@
 	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	if($crmid != "")
 	{
-		$modObj = new Vendor();
+		$modObj = new Vendors();
 		$modObj->retrieve_entity_info($crmid,"Vendors");
 		$modObj->column_fields[$fieldname] = $fieldvalue;
 		$modObj->id = $crmid;

Modified: vtigercrm/trunk/modules/Vendors/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/EditView.php (original)
+++ vtigercrm/trunk/modules/Vendors/EditView.php Tue Oct 31 03:40:43 2006
@@ -11,12 +11,12 @@
 require_once('Smarty_setup.php');
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('include/FormValidationUtil.php');
 
 global $app_strings,$mod_strings,$theme,$currentModule;
 
-$focus = new Vendor();
+$focus = new Vendors();
 $smarty = new vtigerCRM_Smarty();
 
 if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') 

Modified: vtigercrm/trunk/modules/Vendors/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/ListView.php (original)
+++ vtigercrm/trunk/modules/Vendors/ListView.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/database/Postgres8.php');
 require_once('Smarty_setup.php');
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('include/ListView/ListView.php');
 require_once('include/utils/utils.php');
 require_once('modules/CustomView/CustomView.php');
@@ -32,7 +32,7 @@
 $category = getParentTab();
 $smarty->assign("CATEGORY",$category);
 
-$focus = new Vendor();
+$focus = new Vendors();
 $other_text = Array();
 
 if(!$_SESSION['lvs'][$currentModule])

Modified: vtigercrm/trunk/modules/Vendors/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/Save.php (original)
+++ vtigercrm/trunk/modules/Vendors/Save.php Tue Oct 31 03:40:43 2006
@@ -21,11 +21,11 @@
  * Contributor(s): ______________________________________..
  ********************************************************************************/
 
-require_once('modules/Vendors/Vendor.php');
+require_once('modules/Vendors/Vendors.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
 
-$focus = new Vendor();
+$focus = new Vendors();
 setObjectValuesFromRequest(&$focus);
 
 $focus->save("Vendors");

Modified: vtigercrm/trunk/modules/Webmails/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Webmails/CallRelatedList.php Tue Oct 31 03:40:43 2006
@@ -11,7 +11,7 @@
 
 global $current_user;
 require_once('Smarty_setup.php');
-require_once('modules/Leads/Lead.php');
+require_once('modules/Leads/Leads.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('data/Tracker.php');

Modified: vtigercrm/trunk/modules/Webmails/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/Save.php (original)
+++ vtigercrm/trunk/modules/Webmails/Save.php Tue Oct 31 03:40:43 2006
@@ -9,7 +9,7 @@
   *
   ********************************************************************************/
 
-require_once('modules/Emails/Email.php');
+require_once('modules/Emails/Emails.php');
 require_once('modules/Webmails/Webmail.php');
 require_once('include/logging.php');
 require_once('include/database/PearDatabase.php');
@@ -20,7 +20,7 @@
 global $current_user;
 
 $local_log =& LoggerManager::getLogger('index');
-$focus = new Email();
+$focus = new Emails();
 
 $to_address = explode(";",$_REQUEST['to_list']);
 $cc_address = explode(";",$_REQUEST['cc_list']);
@@ -61,8 +61,8 @@
 		add_attachment_to_contact($email->relationship["id"],$email);
 }else {
 	//if relationship is not available create a contact and relate the email to the contact
-	require_once('modules/Contacts/Contact.php');
-	$contact_focus = new Contact();	
+	require_once('modules/Contacts/Contacts.php');
+	$contact_focus = new Contacts();	
 	$contact_focus->column_fields['lastname'] =$email->fromname; 
 	$contact_focus->column_fields['email'] = $email->from;
 	$contact_focus->save("Contacts");

Modified: vtigercrm/trunk/schema/DatabaseSchema.xml
==============================================================================
--- vtigercrm/trunk/schema/DatabaseSchema.xml (original)
+++ vtigercrm/trunk/schema/DatabaseSchema.xml Tue Oct 31 03:40:43 2006
@@ -6082,6 +6082,29 @@
 		<data>
 		</data>
 	</table>
+	<table name="vtiger_entityname">
+		<field name="tabid" type="I" size="19">
+			<key />
+			<default value="0" />
+		</field>
+		<field name="modulename" type="C" size="50">
+			<notnull />
+		</field>
+		<field name="tablename" type="C" size="100">
+			<notnull />
+		</field>
+		<field name="fieldname" type="C" size="150">
+			<notnull />
+		</field>
+		<field name="entityidfield" type="C" size="150">
+			<notnull />
+		</field>
+		<index name="entityname_tabid_idx">
+			<col>tabid</col>
+		</index>
+		<opt platform="mysql">Type=InnoDB</opt>
+	</table>
+
 
 	
 </schema>

Modified: vtigercrm/trunk/soap/firefoxtoolbar.php
==============================================================================
--- vtigercrm/trunk/soap/firefoxtoolbar.php (original)
+++ vtigercrm/trunk/soap/firefoxtoolbar.php Tue Oct 31 03:40:43 2006
@@ -175,8 +175,8 @@
 function CheckLeadPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -193,8 +193,8 @@
 function CheckContactPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -211,8 +211,8 @@
 function CheckAccountPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -229,8 +229,8 @@
 function CheckTicketPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -247,8 +247,8 @@
 function CheckVendorPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -265,8 +265,8 @@
 function CheckProductPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -283,8 +283,8 @@
 function CheckNotePermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -301,8 +301,8 @@
 function CheckSitePermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -319,8 +319,8 @@
 function CheckRssPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -340,8 +340,8 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -365,11 +365,11 @@
 function LogintoVtigerCRM($user_name,$password)
 {
 	global $log;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	
 	$return_access = "FALSE";
 	
-	$objuser = new User();
+	$objuser = new Users();
 	
 	if($password != "")
 	{
@@ -397,8 +397,8 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -436,15 +436,15 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	$adb->println("Create New Note from Web Form - Starts");
-	require_once("modules/Notes/Note.php");
-
-	$focus = new Note();
+	require_once("modules/Notes/Notes.php");
+
+	$focus = new Notes();
 	if(isPermitted("Notes","EditView") == "yes")
 	{
 		$focus->column_fields['notes_title'] = $subject;
@@ -473,17 +473,17 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	$adb->println("Create New Product from Web Form - Starts");
 	
-  require_once("modules/Products/Product.php");
+  require_once("modules/Products/Products.php");
 	if(isPermitted("Products","EditView") == "yes")
 	{
-		$focus = new Product();
+		$focus = new Products();
 		$focus->column_fields['productname'] = $productname;
 		$focus->column_fields['productcode'] = $code;
 		$focus->column_fields['website'] = $website;
@@ -508,16 +508,16 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	$adb->println("Create New Vendor from Web Form - Starts");
-	require_once("modules/Vendors/Vendor.php");
+	require_once("modules/Vendors/Vendors.php");
 	if(isPermitted("Vendors","EditView" ) == "yes")
 	{
-		$focus = new Vendor();
+		$focus = new Vendors();
 		$focus->column_fields['vendorname'] = $vendorname;
 		$focus->column_fields['email'] = $email;
 		$focus->column_fields['phone'] = $phone;
@@ -547,8 +547,8 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -591,15 +591,15 @@
 function create_account($username,$accountname,$email,$phone,$primary_address_street,$primary_address_city,$primary_address_state,$primary_address_postalcode,$primary_address_country)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id,'Users');
-	require_once("modules/Accounts/Account.php");
+	require_once("modules/Accounts/Accounts.php");
 	if(isPermitted("Accounts","EditView") == "yes")
 	{
-		$account=new Account();
+		$account=new Accounts();
 		$account->column_fields['accountname']=$accountname;
 		$account->column_fields['email1']=$email;
 		$account->column_fields['phone']=$phone;
@@ -642,15 +642,15 @@
 	global $log;
 	global $adb;
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	$adb->println("Create New Lead from Web Form - Starts");
-	require_once("modules/Leads/Lead.php");
-
-	$focus = new Lead();
+	require_once("modules/Leads/Leads.php");
+
+	$focus = new Leads();
 	if(isPermitted("Leads","EditView") == "yes")
 	{
 		$focus->column_fields['lastname'] = $lastname;
@@ -689,16 +689,16 @@
 {
 	global $adb,$log;
 	global $current_user;
-	require_once('modules/Users/User.php');
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,'Users');
 
-	require_once('modules/Contacts/Contact.php');
+	require_once('modules/Contacts/Contacts.php');
   if(isPermitted("Contacts","EditView") == "yes")
   {
-   $contact = new Contact();
+   $contact = new Contacts();
    $contact->column_fields[firstname]= $first_name;
    $contact->column_fields[lastname]= $last_name;
    //$contact->column_fields[account_id]=retrieve_account_id($account_name,$user_id);// NULL value is not supported NEED TO FIX

Modified: vtigercrm/trunk/soap/thunderbirdplugin.php
==============================================================================
--- vtigercrm/trunk/soap/thunderbirdplugin.php (original)
+++ vtigercrm/trunk/soap/thunderbirdplugin.php Tue Oct 31 03:40:43 2006
@@ -13,7 +13,7 @@
 require_once('include/logging.php');
 require_once('include/nusoap/nusoap.php');
 require_once('include/database/PearDatabase.php');
-require_once('modules/Contacts/Contact.php');
+require_once('modules/Contacts/Contacts.php');
 
 $log = &LoggerManager::getLogger('thunderbirdplugin');
 
@@ -173,9 +173,9 @@
 
 function SearchContactsByEmail($username,$emailaddress)
 {
-     require_once('modules/Contacts/Contact.php');
-
-     $seed_contact = new Contact();
+     require_once('modules/Contacts/Contacts.php');
+
+     $seed_contact = new Contacts();
      $output_list = Array();
 
      $response = $seed_contact->get_searchbyemailid($username,$emailaddress);
@@ -201,13 +201,13 @@
 function track_email($user_name, $contact_ids, $date_sent, $email_subject, $email_body)
 {
 	global $adb;
-	require_once('modules/Users/User.php');
-	require_once('modules/Emails/Email.php');
-
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Emails/Emails.php');
+
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 
-	$email = new Email();
+	$email = new Emails();
 	//$log->debug($msgdtls['contactid']);
 	$emailbody = str_replace("'", "''", $email_body);
 	$emailsubject = str_replace("'", "''",$email_subject);
@@ -241,9 +241,9 @@
 {
 	global $adb;
 	global $log;
-	require_once('modules/Contacts/Contact.php');
-
-	$seed_contact = new Contact();
+	require_once('modules/Contacts/Contacts.php');
+
+	$seed_contact = new Contacts();
 	$output_list = Array();
 
 	$query = $seed_contact->get_contactsforol($username);
@@ -332,8 +332,8 @@
 	$rows_count =  $db->getRowCount($result);
 	if($rows_count==0)
 	{
-		require_once('modules/Accounts/Account.php');
-		$account = new Account();
+		require_once('modules/Accounts/Accounts.php');
+		$account = new Accounts();
 		$account->column_fields[accountname] = $account_name;
 		$account->column_fields[assigned_user_id]=$user_id;
 		//$account->saveentity("Accounts");
@@ -360,10 +360,10 @@
 {
 	global $adb;
 	global $current_user;
-	require_once('modules/Users/User.php');
-	require_once('modules/Contacts/Contact.php');
-
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Contacts/Contacts.php');
+
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -384,7 +384,7 @@
       $permitted_lists[] = $adb->query_result($result1,$i,'fieldname');
   }
 
-	$contact = new Contact();
+	$contact = new Contacts();
 	$contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $first_name : "";
 	$contact->column_fields[lastname]=in_array('lastname',$permitted_lists) ? $last_name : "";
 	$contact->column_fields[birthday]=in_array('birthday',$permitted_lists) ? getDisplayDate("0000-00-00") : "";
@@ -418,10 +418,10 @@
 {
 	global $adb;
 	global $current_user;
-	require_once('modules/Users/User.php');
-	require_once('modules/Leads/Lead.php');
-
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Leads/Leads.php');
+
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -442,7 +442,7 @@
       $permitted_lists[] = $adb->query_result($result1,$i,'fieldname');
   }
 
-	$Lead = new Lead();
+	$Lead = new Leads();
 	$Lead->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $first_name : "";
 	$Lead->column_fields[lastname]=in_array('lastname',$permitted_lists) ? $last_name : "";
 	$Lead->column_fields[birthday]=in_array('birthday',$permitted_lists) ? getDisplayDate("0000-00-00") : "";
@@ -478,8 +478,8 @@
 {
   global $adb,$log;
   $return_access = 'failure';
-  require_once('modules/Users/User.php');
-	$objuser = new User();
+  require_once('modules/Users/Users.php');
+	$objuser = new Users();
   if($password != "" && $user_name != '')
 	{
 		$objuser->column_fields['user_name'] = $user_name;
@@ -511,8 +511,8 @@
 function CheckContactPerm($user_name)
 {
   global $current_user;
-	require_once('modules/Users/User.php');
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -528,8 +528,8 @@
 function CheckContactViewPerm($user_name)
 {
   global $current_user,$log;
-	require_once('modules/Users/User.php');
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");

Modified: vtigercrm/trunk/soap/vtigerolservice.php
==============================================================================
--- vtigercrm/trunk/soap/vtigerolservice.php (original)
+++ vtigercrm/trunk/soap/vtigerolservice.php Tue Oct 31 03:40:43 2006
@@ -280,9 +280,9 @@
 
 function SearchContactsByEmail($username,$emailaddress)
 {
-     require_once('modules/Contacts/Contact.php');
+     require_once('modules/Contacts/Contacts.php');
      
-     $seed_contact = new Contact();
+     $seed_contact = new Contacts();
      $output_list = Array();
      
      $response = $seed_contact->get_searchbyemailid($username,$emailaddress);
@@ -308,17 +308,17 @@
 function AddMessageToContact($username,$contactid,$msgdtls)
 {
 	global $adb;
-	require_once('modules/Users/User.php');
-	require_once('modules/Emails/Email.php');
-	
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Emails/Emails.php');
+	
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	
 	foreach($msgdtls as $msgdtl)
 	{
     if(isset($msgdtl))
     {    
-        $email = new Email();
+        $email = new Emails();
         //$log->debug($msgdtls['contactid']);
         $email_body = str_replace("'", "''", $msgdtl['body']);
         $email_subject = str_replace("'", "''",$msgdtl['subject']);
@@ -356,11 +356,11 @@
 function LoginToVtiger($userid,$password)
 {
 	global $adb;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	
 	$return_access = "FALSE";
 	
-	$objuser = new User();
+	$objuser = new Users();
 	
 	if($password != "")
 	{
@@ -385,8 +385,8 @@
 function CheckEmailPermission($username)
 {
 	global $current_user,$log;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -403,8 +403,8 @@
 function CheckContactPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -421,8 +421,8 @@
 function CheckActivityPermission($username)
 {
 	global $current_user;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($username);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -439,12 +439,12 @@
 function AddEmailAttachment($emailid,$filedata,$filename,$filesize,$filetype,$username)
 {
 	global $adb;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('include/utils/utils.php');
 
 	$date_var = date('YmdHis');
 
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 
 	$crmid = $adb->getUniqueID("vtiger_crmentity");
@@ -483,9 +483,9 @@
 function GetContacts($username)
 {
 	global $adb;
-	require_once('modules/Contacts/Contact.php');
-
-	$seed_contact = new Contact();
+	require_once('modules/Contacts/Contacts.php');
+
+	$seed_contact = new Contacts();
 	$output_list = Array();
 
 	$query = $seed_contact->get_contactsforol($username);
@@ -564,15 +564,15 @@
 {
 	global $adb;
 	global $current_user;
-	require_once('modules/Users/User.php');
-	require_once('modules/Contacts/Contact.php');
-	
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Contacts/Contacts.php');
+	
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
 	
-	$contact = new Contact();
+	$contact = new Contacts();
 	
 	require('user_privileges/user_privileges_'.$current_user->id.'.php');
 	require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
@@ -646,15 +646,15 @@
 {
 	global $adb;
 	global $current_user;
-	require_once('modules/Users/User.php');
-	require_once('modules/Contacts/Contact.php');
-	
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Contacts/Contacts.php');
+	
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
 	
-	$contact = new Contact();
+	$contact = new Contacts();
 	require('user_privileges/user_privileges_'.$current_user->id.'.php');
 	require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
 	
@@ -727,15 +727,15 @@
 function DeleteContacts($username,$crmid)
 {
 	global $current_user;
-	require_once('modules/Users/User.php');
-	require_once('modules/Contacts/Contact.php');
-
-	$seed_user = new User();
+	require_once('modules/Users/Users.php');
+	require_once('modules/Contacts/Contacts.php');
+
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
 
-	$contact = new Contact();
+	$contact = new Contacts();
 	$contact->id = $crmid;
 	$contact->mark_deleted($contact->id);
 
@@ -760,8 +760,8 @@
 	$rows_count =  $db->getRowCount($result);
 	if($rows_count==0)
 	{
-		require_once('modules/Accounts/Account.php');
-		$account = new Account();
+		require_once('modules/Accounts/Accounts.php');
+		$account = new Accounts();
 		$account->column_fields[accountname] = $account_name;
 		$account->column_fields[assigned_user_id]=$user_id;
 		//$account->saveentity("Accounts");
@@ -856,10 +856,10 @@
 function AddTasks($username,$taskdtls)
 {
 	global $current_user,$adb;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -937,10 +937,10 @@
 function UpdateTasks($username,$taskdtls)
 {
 	global $current_user,$adb;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -1022,10 +1022,10 @@
 function DeleteTasks($username,$crmid)
 {
 	global $current_user;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	   
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -1091,10 +1091,10 @@
 function AddClndr($username,$clndrdtls)
 {
 	global $current_user,$adb;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -1159,10 +1159,10 @@
 {
 	global $current_user;
 	global $adb,$log;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");
@@ -1228,10 +1228,10 @@
 function DeleteClndr($username,$crmid)
 {
 	global $current_user;
-	require_once('modules/Users/User.php');
+	require_once('modules/Users/Users.php');
 	require_once('modules/Calendar/Activity.php');
 	   
-	$seed_user = new User();
+	$seed_user = new Users();
 	$user_id = $seed_user->retrieve_user_id($username);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id,"Users");

Modified: vtigercrm/trunk/soap/webforms.php
==============================================================================
--- vtigercrm/trunk/soap/webforms.php (original)
+++ vtigercrm/trunk/soap/webforms.php Tue Oct 31 03:40:43 2006
@@ -82,8 +82,8 @@
 		$assigned_user_id = $adb->query_result($adb->query("select id from vtiger_users where user_name='admin'"),0,'id');
 	}
 
-	require_once("modules/Leads/Lead.php");
-	$focus = new Lead();
+	require_once("modules/Leads/Leads.php");
+	$focus = new Leads();
 	$focus->column_fields['lastname'] = $lastname;
 	$focus->column_fields['email'] = $email;
 	$focus->column_fields['phone'] = $phone;
@@ -126,8 +126,8 @@
 		$assigned_user_id = $adb->query_result($adb->query("select id from vtiger_users where user_name='admin'"),0,'id');
 	}
 
-	require_once('modules/Contacts/Contact.php');
-	$focus = new Contact();
+	require_once('modules/Contacts/Contacts.php');
+	$focus = new Contacts();
 
 	$focus->column_fields['firstname'] = $first_name;
 	$focus->column_fields['lastname'] = $last_name;

Modified: vtigercrm/trunk/soap/wordplugin.php
==============================================================================
--- vtigercrm/trunk/soap/wordplugin.php (original)
+++ vtigercrm/trunk/soap/wordplugin.php Tue Oct 31 03:40:43 2006
@@ -215,8 +215,8 @@
 function get_tickets_columns($user_name, $password)
 {
 	global $current_user,$log;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
@@ -237,15 +237,15 @@
 function get_contacts_columns($user_name, $password)
 {
 	global $current_user,$log;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user = $seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	if(isPermitted("Contacts","index") == "yes")
 	{
-		require_once('modules/Contacts/Contact.php');
-		$contact = new Contact();
+		require_once('modules/Contacts/Contacts.php');
+		$contact = new Contacts();
 		$log->debug($contact->getColumnNames());
 		return $contact->getColumnNames();	   
 	}
@@ -261,15 +261,15 @@
 function get_accounts_columns($user_name, $password)
 {
 	global $current_user,$log;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 	if(isPermitted("Accounts","index") == "yes")
 	{
-		require_once('modules/Accounts/Account.php');
-		$account = new Account();
+		require_once('modules/Accounts/Accounts.php');
+		$account = new Accounts();
 		$log->debug($account->getColumnNames_Acnt());
 		return $account->getColumnNames_Acnt();
 	}
@@ -285,16 +285,16 @@
 function get_leads_columns($user_name, $password)
 {	
 	global $current_user,$log;
-	require_once("modules/Users/User.php");
-	$seed_user=new User();
+	require_once("modules/Users/Users.php");
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
 
 	if(isPermitted("Leads","index") == "yes")
 	{
-		require_once('modules/Leads/Lead.php');
-		$lead = new Lead();
+		require_once('modules/Leads/Leads.php');
+		$lead = new Leads();
 		$log->debug($lead->getColumnNames_Lead());
 		return $lead->getColumnNames_Lead();
 	}
@@ -309,12 +309,12 @@
 function get_user_columns($user_name, $password)
 {
 	global $current_user;
-	require_once('modules/Users/User.php');
-	$seed_user=new User();
+	require_once('modules/Users/Users.php');
+	$seed_user=new Users();
 	$user_id=$seed_user->retrieve_user_id($user_name);
 	$current_user=$seed_user;
 	$current_user->retrieve_entity_info($user_id, 'Users');
-	$user = new User();
+	$user = new Users();
 	return $user->getColumnNames_User();
 	
 }
@@ -323,8 +323,8 @@
 function create_session($user_name, $password)
 { 
   	global $adb,$log;
-	require_once('modules/Users/User.php');
-	$objuser = new User();
+	require_once('modules/Users/Users.php');
+	$objuser = new Users();
 	if($password != "" && $user_name != '')
 	{
 		$objuser->column_fields['user_name'] = $user_name;

Modified: vtigercrm/trunk/vtigerversion.php
==============================================================================
--- vtigercrm/trunk/vtigerversion.php (original)
+++ vtigercrm/trunk/vtigerversion.php Tue Oct 31 03:40:43 2006
@@ -8,7 +8,7 @@
  * All Rights Reserved.
  *
  ********************************************************************************/
-$patch_version = '1';
+$patch_version = '';
 $modified_database = '';
-$vtiger_current_version = '5.0.0';
+$vtiger_current_version = '5.0.2';
 ?>





More information about the vtigercrm-commits mailing list