[Vtigercrm-commits] [vtiger-commits] r7184 - in /vtigercrm/trunk/modules/Contacts: Contact.php Merge.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Jun 16 07:48:43 EDT 2006
Author: don
Date: Fri Jun 16 05:48:39 2006
New Revision: 7184
Log:
Fixed issues in vtiger_ prefixing in table names
Modified:
vtigercrm/trunk/modules/Contacts/Contact.php
vtigercrm/trunk/modules/Contacts/Merge.php
Modified: vtigercrm/trunk/modules/Contacts/Contact.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Contact.php (original)
+++ vtigercrm/trunk/modules/Contacts/Contact.php Fri Jun 16 05:48:39 2006
@@ -184,7 +184,7 @@
{
global $log;
$log->debug("Entering get_contacts(".$user_name.",".$from_index.",".$offset.") method ...");
- $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as vtiger_account_name,vtiger_account.accountid as vtiger_account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset;
+ $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset;
$log->debug("Exiting get_contacts method ...");
return $this->process_list_query1($query);
@@ -356,7 +356,7 @@
$query .= " union all ";
$query .= "select vtiger_attachments.description AS title,'Attachments' AS ActivityType,
vtiger_attachments.name AS filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified,
- vtiger_attachments.attachmentsid AS vtiger_attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid,
+ vtiger_attachments.attachmentsid AS attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid,
crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name
from vtiger_attachments
inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid
@@ -493,7 +493,7 @@
{
$query = $this->constructCustomQueryAddendum('contactscf','Contacts') ."
vtiger_contactdetails.*, vtiger_contactaddress.*,
- vtiger_account.accountname vtiger_account_name,
+ vtiger_account.accountname account_name,
vtiger_users.user_name assigned_user_name
FROM vtiger_contactdetails
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid
@@ -507,7 +507,7 @@
{
$query = "SELECT
vtiger_contactdetails.*, vtiger_contactaddress.*,
- vtiger_account.accountname vtiger_account_name,
+ vtiger_account.accountname account_name,
vtiger_users.user_name assigned_user_name
FROM vtiger_contactdetails
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid
@@ -528,7 +528,7 @@
{
global $log;
$log->debug("Entering getColumnNames() method ...");
- $sql1 = "select vtiger_fieldlabel from vtiger_field where vtiger_tabid=4 and block <> 6 and block <> 75";
+ $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 6 and block <> 75";
$result = $this->db->query($sql1);
$numRows = $this->db->num_rows($result);
for($i=0; $i < $numRows;$i++)
Modified: vtigercrm/trunk/modules/Contacts/Merge.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Merge.php (original)
+++ vtigercrm/trunk/modules/Contacts/Merge.php Fri Jun 16 05:48:39 2006
@@ -151,16 +151,16 @@
inner join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid
inner join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid
inner 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_contactdetails as contactdetailsContacts on contactdetailsContacts.contactid = vtiger_contactdetails.reportsto
+ left join vtiger_account as accountContacts on accountContacts.accountid = contactdetails.accountid
left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid
left join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid
- left join vtiger_crmentity as vtiger_crmentityAccounts on vtiger_crmentityAccounts.crmid=vtiger_account.accountid
+ left join vtiger_crmentity as crmentityAccounts on crmentityAccounts.crmid=vtiger_account.accountid
left join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid
left join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid
left join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid
- left join vtiger_account as vtiger_accountAccounts on vtiger_accountAccounts.accountid = vtiger_account.parentid
- left join vtiger_users as vtiger_usersAccounts on vtiger_usersAccounts.id = vtiger_crmentityAccounts.smownerid
+ left join vtiger_account as accountAccounts on accountAccounts.accountid = vtiger_account.parentid
+ left join vtiger_users as usersAccounts on usersAccounts.id = crmentityAccounts.smownerid
where vtiger_crmentity.deleted=0 and (crmentityAccounts.deleted <> 1) and vtiger_contactdetails.contactid in(".$mass_merge.")";
@@ -197,7 +197,7 @@
$csvdata = implode($mergevalue,"###");
}else
{
- die("No vtiger_fields to do Merge");
+ die("No fields to do Merge");
}
$handle = fopen($wordtemplatedownloadpath."datasrc.csv","wb");
More information about the vtigercrm-commits
mailing list