[Vtigercrm-commits] [vtiger-commits] r7179 - in /vtigercrm/trunk/modules/HelpDesk: Convert.php HelpDesk.php ListTickets.php Merge.php Save.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Jun 16 06:16:39 EDT 2006


Author: don
Date: Fri Jun 16 04:16:33 2006
New Revision: 7179

Log:
Fixed issues in vtiger_ prefixing in table names

Modified:
    vtigercrm/trunk/modules/HelpDesk/Convert.php
    vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
    vtigercrm/trunk/modules/HelpDesk/ListTickets.php
    vtigercrm/trunk/modules/HelpDesk/Merge.php
    vtigercrm/trunk/modules/HelpDesk/Save.php

Modified: vtigercrm/trunk/modules/HelpDesk/Convert.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/Convert.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/Convert.php Fri Jun 16 04:16:33 2006
@@ -71,7 +71,7 @@
 $change='';
 if($_REQUEST['change_owner'])
 {
-	$change .= '<input type="hidden" name="change_owner" value="true"/><td width="20%" valign="top" class="dataLabel">'.$mod_strings['LBL_ASSIGNED_TO'].'<select vtiger_tabindex="5" name="assigned_user_id" {ASSIGNED_USER_OPTIONS}</select> </td>';
+	$change .= '<input type="hidden" name="change_owner" value="true"/><td width="20%" valign="top" class="dataLabel">'.$mod_strings['LBL_ASSIGNED_TO'].'<select tabindex="5" name="assigned_user_id" {ASSIGNED_USER_OPTIONS}</select> </td>';
 	$xtpl->assign("ASSIGNED_USER_OPTIONS",getComboValues("user_name","users","user_name","1",'--None--'));
 }
 if($_REQUEST['change_status'])

Modified: vtigercrm/trunk/modules/HelpDesk/HelpDesk.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/HelpDesk.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/HelpDesk.php Fri Jun 16 04:16:33 2006
@@ -124,7 +124,7 @@
 
 		$returnset = '&return_module=HelpDesk&return_action=DetailView&return_id='.$id;
 
-		$query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=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_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or vtiger_activitytype='Call' or vtiger_activitytype='Meeting')";
+		$query = "SELECT vtiger_activity.*, vtiger_crmentity.crmid, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=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_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting')";
 		$log->debug("Exiting get_activities method ...");
 		
 		return GetRelatedList('HelpDesk','Activities',$focus,$query,$button,$returnset);
@@ -169,7 +169,7 @@
 		$log->debug("Entering get_attachments(".$id.") method ...");
 		$query = "select vtiger_notes.title,'Notes      '  ActivityType, vtiger_notes.filename,
 		vtiger_attachments.type  FileType,crm2.modifiedtime lastmodified,
-		vtiger_seattachmentsrel.attachmentsid vtiger_attachmentsid, vtiger_notes.notesid crmid,
+		vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid,
 			crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name
 		from vtiger_notes
 			inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid
@@ -184,7 +184,7 @@
 
 		$query .= "select vtiger_attachments.description title ,'Attachments'  ActivityType,
 		vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified,
-		vtiger_attachments.attachmentsid vtiger_attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid,
+		vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid,
 			crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name
 		from vtiger_attachments
 			inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid
@@ -344,7 +344,7 @@
 	{
 		global $log;
 		$log->debug("Entering getColumnNames_Hd() method ...");
-		$sql1 = "select vtiger_fieldlabel from vtiger_field where vtiger_tabid=13 and block <> 6 ";
+		$sql1 = "select fieldlabel from vtiger_field where tabid=13 and block <> 6 ";
 		$result = $this->db->query($sql1);
 		$numRows = $this->db->num_rows($result);
 		for($i=0; $i < $numRows;$i++)

Modified: vtigercrm/trunk/modules/HelpDesk/ListTickets.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/ListTickets.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/ListTickets.php Fri Jun 16 04:16:33 2006
@@ -108,7 +108,7 @@
 	}
 	if($parent_module == 'Accounts')
 	{
-		$sql = "select vtiger_accountname from vtiger_account where vtiger_accountid=".$parent_id;
+		$sql = "select accountname from vtiger_account where accountid=".$parent_id;
 		$parentname = $adb->query_result($adb->query($sql),0,'accountname');
 	        $parent_name = '<a href="index.php?action=DetailView&module='.$parent_module.'&record='.$parent_id.'">'.$parentname.'</a>';
 	}

Modified: vtigercrm/trunk/modules/HelpDesk/Merge.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/Merge.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/Merge.php Fri Jun 16 04:16:33 2006
@@ -86,7 +86,7 @@
 
 	if($columnname == "parent_id")
 	{
-		$column_name = "case vtiger_crmentityRelHelpDesk.setype when 'Accounts' then vtiger_accountRelHelpDesk.accountname when 'Contacts' then concat(contactdetailsRelHelpDesk.firstname,' ',contactdetailsRelHelpDesk.lastname) End";
+		$column_name = "case crmentityRelHelpDesk.setype when 'Accounts' then accountRelHelpDesk.accountname when 'Contacts' then concat(contactdetailsRelHelpDesk.firstname,' ',contactdetailsRelHelpDesk.lastname) End";
 	}
 	if($columnname == "product_id")
 	{
@@ -165,27 +165,27 @@
 	$query ="select ".$selectcolumns." from vtiger_troubletickets
 			inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid
 			inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid
-			left join vtiger_crmentity as vtiger_crmentityRelHelpDesk on vtiger_crmentityRelHelpDesk.crmid = vtiger_troubletickets.parent_id
-			left join vtiger_account as vtiger_accountRelHelpDesk on vtiger_accountRelHelpDesk.accountid=crmentityRelHelpDesk.crmid
-			left join vtiger_contactdetails as vtiger_contactdetailsRelHelpDesk on vtiger_contactdetailsRelHelpDesk.contactid= vtiger_crmentityRelHelpDesk.crmid
-			left join vtiger_products as vtiger_productsRel on vtiger_productsRel.productid = vtiger_troubletickets.product_id
+			left join vtiger_crmentity as crmentityRelHelpDesk on crmentityRelHelpDesk.crmid = vtiger_troubletickets.parent_id
+			left join vtiger_account as accountRelHelpDesk on accountRelHelpDesk.accountid=crmentityRelHelpDesk.crmid
+			left join vtiger_contactdetails as contactdetailsRelHelpDesk on contactdetailsRelHelpDesk.contactid= crmentityRelHelpDesk.crmid
+			left join vtiger_products as productsRel on productsRel.productid = vtiger_troubletickets.product_id
 			left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id
 			left join vtiger_account on vtiger_account.accountid = vtiger_troubletickets.parent_id               
-			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_accountbillads.accountaddressid = vtiger_account.accountid
 			left join vtiger_accountshipads on vtiger_accountshipads.accountaddressid = vtiger_account.accountid
 			left join vtiger_accountscf on vtiger_accountbillads.accountaddressid = vtiger_accountscf.accountid 
-			left join vtiger_account as vtiger_accountAccount on vtiger_accountAccount.accountid = vtiger_troubletickets.parent_id
-			left join vtiger_users as vtiger_usersAccounts on vtiger_usersAccounts.id = vtiger_crmentityAccounts.smownerid
+			left join vtiger_account as accountAccount on accountAccount.accountid = vtiger_troubletickets.parent_id
+			left join vtiger_users as usersAccounts on usersAccounts.id = crmentityAccounts.smownerid
 			left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id               
-			left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid 
+			left join vtiger_crmentity as crmentityContacts on 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)||(crmentityAccounts.deleted=0 || vtiger_crmentityAccounts.deleted is null)) 
+			left join vtiger_contactdetails as contactdetailsContacts on contactdetailsContacts.contactid = vtiger_contactdetails.reportsto
+			left join vtiger_account as accountContacts on accountContacts.accountid = vtiger_contactdetails.accountid 
+			left join vtiger_users as usersContacts on usersContacts.id = crmentityContacts.smownerid
+			where vtiger_crmentity.deleted=0 and ((crmentityContacts.deleted=0 || crmentityContacts.deleted is null)||(crmentityAccounts.deleted=0 || crmentityAccounts.deleted is null)) 
 			and vtiger_troubletickets.ticketid in (".$mass_merge.")";
 
 	$result = $adb->query($query);
@@ -221,7 +221,7 @@
 }
 else
 {
-	die("No vtiger_fields to do Merge");
+	die("No fields to do Merge");
 }	
 
 $handle = fopen($wordtemplatedownloadpath."datasrc.csv","wb");

Modified: vtigercrm/trunk/modules/HelpDesk/Save.php
==============================================================================
--- vtigercrm/trunk/modules/HelpDesk/Save.php (original)
+++ vtigercrm/trunk/modules/HelpDesk/Save.php Fri Jun 16 04:16:33 2006
@@ -62,7 +62,7 @@
 	}
 	if($parent_module == 'Accounts')
 	{
-		$result = $adb->query("select * from vtiger_account where vtiger_accountid=".$focus->column_fields['parent_id']);
+		$result = $adb->query("select * from vtiger_account where accountid=".$focus->column_fields['parent_id']);
 		$emailoptout = $adb->query_result($result,0,'emailoptout');
 		$parentname = $adb->query_result($result,0,'accountname');
 	}





More information about the vtigercrm-commits mailing list