[Vtigercrm-commits] [vtiger-commits] r9824 - /vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Nov 13 07:06:47 EST 2006
Author: richie
Date: Mon Nov 13 05:06:33 2006
New Revision: 9824
Log:
Code Changes are done for module addition tool
Modified:
vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Mon Nov 13 05:06:33 2006
@@ -1594,8 +1594,9 @@
require('user_privileges/user_privileges_'.$current_user->id.'.php');
require('user_privileges/sharing_privileges_'.$current_user->id.'.php');
$tab_id = getTabid($module);
- if($module == "HelpDesk")
- {
+ switch($module)
+ {
+ Case "HelpDesk":
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_troubletickets.title, vtiger_troubletickets.status,
vtiger_troubletickets.priority, vtiger_troubletickets.parent_id,
@@ -1627,10 +1628,9 @@
$query .= $sec_parameter;
}
-
- }
- if($module == "Accounts")
- {
+ break;
+
+ Case "Accounts":
//Query modified to sort by assigned to
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_account.accountname, vtiger_account.email1,
@@ -1689,10 +1689,9 @@
WHERE userid=".$current_user->id."
AND tabid=".$tab_id.")))) ";
}
-
- }
- if ($module == "Potentials")
- {
+ break;
+
+ Case "Potentials":
//Query modified to sort by assigned to
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_account.accountname,
@@ -1722,10 +1721,9 @@
$query .= $sec_parameter;
}
-
- }
- if($module == "Leads")
- {
+ break;
+
+ Case "Leads":
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_leaddetails.firstname, vtiger_leaddetails.lastname,
vtiger_leaddetails.company, vtiger_leadaddress.phone,
@@ -1753,9 +1751,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "Products")
- {
+ break;
+ Case "Products":
$query = "SELECT vtiger_crmentity.crmid, vtiger_products.*, vtiger_productcf.*
FROM vtiger_products
INNER JOIN vtiger_crmentity
@@ -1772,9 +1769,8 @@
OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Accounts').")
OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Potentials').")
OR vtiger_products.contactid IN (".getReadEntityIds('Contacts').")) ";
- }
- if($module == "Notes")
- {
+ break;
+ Case "Notes":
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.modifiedtime,
vtiger_notes.title, vtiger_notes.contact_id, vtiger_notes.filename,
vtiger_senotesrel.crmid AS relatedto,
@@ -1799,9 +1795,8 @@
OR vtiger_senotesrel.crmid IN (".getReadEntityIds('PurchaseOrder').")
OR vtiger_senotesrel.crmid IN (".getReadEntityIds('SalesOrder').")
OR vtiger_notes.contact_id IN (".getReadEntityIds('Contacts').")) ";
- }
- if($module == "Contacts")
- {
+ break;
+ Case "Contacts":
//Query modified to sort by assigned to
$query = "SELECT vtiger_contactdetails.firstname, vtiger_contactdetails.lastname,
vtiger_contactdetails.title, vtiger_contactdetails.accountid,
@@ -1831,9 +1826,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "Calendar")
- {
+ break;
+ Case "Calendar":
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.setype,
vtiger_activity.*,
vtiger_contactdetails.lastname, vtiger_contactdetails.firstname,
@@ -1871,9 +1865,8 @@
}
//$query .=" group by vtiger_activity.activityid ";
//included by Jaguar
- }
- if($module == "Emails")
- {
+ break;
+ Case "Emails":
$query = "SELECT DISTINCT vtiger_crmentity.crmid, vtiger_crmentity.smownerid,
vtiger_activity.activityid, vtiger_activity.subject,
vtiger_activity.date_start,
@@ -1906,10 +1899,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
-
- if($module == "Faq")
- {
+ break;
+ Case "Faq":
$query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime,
vtiger_faq.*
FROM vtiger_faq
@@ -1923,27 +1914,23 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
-
- }
-
- if($module == "Vendors")
- {
+ break;
+
+ Case "Vendors":
$query = "SELECT vtiger_crmentity.crmid, vtiger_vendor.*
FROM vtiger_vendor
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid = vtiger_vendor.vendorid
WHERE vtiger_crmentity.deleted = 0";
- }
- if($module == "PriceBooks")
- {
+ break;
+ Case "PriceBooks":
$query = "SELECT vtiger_crmentity.crmid, vtiger_pricebook.*
FROM vtiger_pricebook
INNER JOIN vtiger_crmentity
ON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid
WHERE vtiger_crmentity.deleted = 0";
- }
- if($module == "Quotes")
- {
+ break;
+ Case "Quotes":
//Query modified to sort by assigned to
$query = "SELECT vtiger_crmentity.*,
vtiger_quotes.*,
@@ -1976,9 +1963,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "PurchaseOrder")
- {
+ break;
+ Case "PurchaseOrder":
//Query modified to sort by assigned to
$query = "SELECT vtiger_crmentity.*,
vtiger_purchaseorder.*,
@@ -2008,9 +1994,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "SalesOrder")
- {
+ break;
+ Case "SalesOrder":
//Query modified to sort by assigned to
$query = "SELECT vtiger_crmentity.*,
vtiger_salesorder.*,
@@ -2043,9 +2028,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "Invoice")
- {
+ break;
+ Case "Invoice":
//Query modified to sort by assigned to
//query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376)
$query = "SELECT vtiger_crmentity.*,
@@ -2079,9 +2063,8 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "Campaigns")
- {
+ break;
+ Case "Campaigns":
//Query modified to sort by assigned to
//query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376)
$query = "SELECT vtiger_crmentity.*,
@@ -2103,12 +2086,14 @@
$sec_parameter=getListViewSecurityParameter($module);
$query .= $sec_parameter;
}
- }
- if($module == "Users")
- {
+ break;
+ Case "Users":
$query = "select id,user_name,roleid,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status from vtiger_users inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where deleted=0 ".$where ;
- }
-
+ break;
+ default:
+ $focus = new $module();
+ $query = $focus->getListQuery($module);
+ }
$log->debug("Exiting getListQuery method ...");
return $query;
More information about the vtigercrm-commits
mailing list