本文整理汇总了PHP中getPermittedFieldsQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP getPermittedFieldsQuery函数的具体用法?PHP getPermittedFieldsQuery怎么用?PHP getPermittedFieldsQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPermittedFieldsQuery函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create_export_query
/** Function to export the account records in CSV Format
* @param reference variable - order by is passed when the query is executed
* @param reference variable - where condition is passed when the query is executed
* Returns Export Accounts Query.
*/
function create_export_query(&$order_by, &$where)
{
global $log;
global $current_user;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("SalesOrder", "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "SalesOrder");
}
$fields_list = $this->getFieldsListFromQuery($sql, $mod_strings);
//echo($fields_list);
$query = "SELECT {$fields_list} FROM ec_salesorder\n\t\t\t\tLEFT JOIN ec_account\n\t\t\t\t\tON ec_account.accountid = ec_salesorder.accountid\n\t\t\t\tLEFT JOIN ec_users\n\t\t\t\t\tON ec_salesorder.smownerid = ec_users.id\n\t\t\t\tLEFT JOIN ec_inventoryproductrel\n\t\t\t\t\tON ec_salesorder.salesorderid=ec_inventoryproductrel.id";
$where_auto = " ec_salesorder.deleted = 0 ";
if ($where != "") {
$query .= "WHERE ({$where}) AND " . $where_auto;
} else {
$query .= "WHERE " . $where_auto;
}
//we should add security check when the user has Private Access
if (!empty($order_by)) {
$query .= " ORDER BY {$order_by}, ec_inventoryproductrel.sequence_no";
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:34,代码来源:SalesOrder.php
示例2: create_export_query
/** Function to export the notes in CSV Format
* @param reference variable - order by is passed when the query is executed
* @param reference variable - where condition is passed when the query is executed
* Returns Export Contacts Query.
*/
function create_export_query(&$order_by, &$where)
{
global $log;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$module = "Contacts";
$sql = getPermittedFieldsQuery($module, "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "Contacts");
}
$fields_list = $this->getFieldsListFromQuery($sql, $mod_strings);
$query = "SELECT {$fields_list} FROM ec_contacts\n\t\t\t\tLEFT JOIN ec_users\n\t\t\t\t\tON ec_contacts.smownerid = ec_users.id \n\t\t\t\tLEFT JOIN ec_users as ua\n\t\t\t\t\tON ec_contacts.approvedby = ua.id \n\t\t\t\tLEFT JOIN ec_users as ucreator\n\t\t\t\t\tON ec_contacts.smcreatorid = ucreator.id ";
//LEFT JOIN ec_approvestatus ON ec_contacts.approved = ec_approvestatus.statusid ";
$query .= " left join ec_account ON ec_contacts.accountid=ec_account.accountid ";
//$query .= " left join ec_contactdetails ON ec_contacts.contact_id=ec_contactdetails.contactid ";
// var_dump($query);
// exit(); 2013-08-22 by ligangze
$where_auto = " ec_contacts.deleted = 0 ";
if ($where != "") {
$query .= " WHERE ({$where}) AND " . $where_auto;
} else {
$query .= " WHERE " . $where_auto;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:34,代码来源:Contacts.php
示例3: create_export_query
/** Function to export the notes in CSV Format
* @param reference variable - order by is passed when the query is executed
* @param reference variable - where condition is passed when the query is executed
* Returns Export Relsettings Query.
*/
function create_export_query(&$order_by, &$where)
{
global $log;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$module = "Relsettings";
$sql = getPermittedFieldsQuery($module, "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "Relsettings");
}
$fields_list = $this->getFieldsListFromQuery($sql, $mod_strings);
$query = "SELECT {$fields_list} FROM ec_relsettings\n\t\t\t\tLEFT JOIN ec_users\n\t\t\t\t\tON ec_relsettings.smownerid = ec_users.id\n\t\t\t\tLEFT JOIN ec_users as ua\n\t\t\t\t\tON ec_relsettings.approvedby = ua.id\n\t\t\t\tLEFT JOIN ec_users as ucreator\n\t\t\t\t\tON ec_relsettings.smcreatorid = ucreator.id\n\t\t\t\tLEFT JOIN ec_approvestatus ON ec_relsettings.approved = ec_approvestatus.statusid ";
$query .= " left join ec_account ON ec_relsettings.accountid=ec_account.accountid ";
$query .= " left join ec_contactdetails ON ec_relsettings.contact_id=ec_contactdetails.contactid ";
$query .= " left join ec_potential ON ec_relsettings.potentialid=ec_potential.potentialid ";
$query .= " left join ec_salesorder ON ec_relsettings.salesorderid=ec_salesorder.salesorderid ";
$query .= " left join ec_vendor ON ec_vendor.vendorid=ec_relsettings.vendorid ";
$query .= " left join ec_purchaseorder ON ec_purchaseorder.purchaseorderid=ec_relsettings.purchaseorderid ";
$query_rel = "SELECT ec_entityname.* FROM ec_crmentityrel inner join ec_entityname on ec_entityname.modulename=ec_crmentityrel.relmodule WHERE ec_crmentityrel.module='" . $module . "'";
$fldmod_result = $this->db->query($query_rel);
$rownum = $this->db->num_rows($fldmod_result);
for ($i = 0; $i < $rownum; $i++) {
$rel_modulename = $this->db->query_result($fldmod_result, $i, 'modulename');
$rel_tablename = $this->db->query_result($fldmod_result, $i, 'tablename');
$rel_entityname = $this->db->query_result($fldmod_result, $i, 'fieldname');
$rel_entityid = $this->db->query_result($fldmod_result, $i, 'entityidfield');
$query .= " left join " . $rel_tablename . " ON ec_relsettings." . $rel_entityid . "=" . $rel_tablename . "." . $rel_entityid;
}
$where_auto = " ec_relsettings.deleted = 0 ";
if ($where != "") {
$query .= " WHERE ({$where}) AND " . $where_auto;
} else {
$query .= " WHERE " . $where_auto;
}
$tab_id = getTabid($module);
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3 || isset($_REQUEST['viewscope']) || isset($_SESSION[$module . '_viewscope'])) {
$sec_parameter = getListViewSecurityParameter($module, $isSearchAll);
$query .= $sec_parameter;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:50,代码来源:Relsettings.php
示例4: create_export_query
/**
* Create query to export the records.
*/
function create_export_query($where)
{
global $current_user;
$thismodule = $_REQUEST['module'];
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery($thismodule, "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list}, vtiger_users.user_name AS user_name \n\t\t\t\tFROM vtiger_crmentity INNER JOIN {$this->table_name} ON vtiger_crmentity.crmid={$this->table_name}.{$this->table_index}";
if (!empty($this->customFieldTable)) {
$query .= " INNER JOIN " . $this->customFieldTable[0] . " ON " . $this->customFieldTable[0] . '.' . $this->customFieldTable[1] . " = {$this->table_name}.{$this->table_index}";
}
$query .= " LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
$query .= " LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active'";
$linkedModulesQuery = $this->db->pquery("SELECT distinct fieldname, columnname, relmodule FROM vtiger_field" . " INNER JOIN vtiger_fieldmodulerel ON vtiger_fieldmodulerel.fieldid = vtiger_field.fieldid" . " WHERE uitype='10' AND vtiger_fieldmodulerel.module=?", array($thismodule));
$linkedFieldsCount = $this->db->num_rows($linkedModulesQuery);
$rel_mods[$this->table_name] = 1;
for ($i = 0; $i < $linkedFieldsCount; $i++) {
$related_module = $this->db->query_result($linkedModulesQuery, $i, 'relmodule');
$fieldname = $this->db->query_result($linkedModulesQuery, $i, 'fieldname');
$columnname = $this->db->query_result($linkedModulesQuery, $i, 'columnname');
$other = CRMEntity::getInstance($related_module);
vtlib_setup_modulevars($related_module, $other);
if ($rel_mods[$other->table_name]) {
$rel_mods[$other->table_name] = $rel_mods[$other->table_name] + 1;
$alias = $other->table_name . $rel_mods[$other->table_name];
$query_append = "as {$alias}";
} else {
$alias = $other->table_name;
$query_append = '';
$rel_mods[$other->table_name] = 1;
}
$query .= " LEFT JOIN {$other->table_name} {$query_append} ON {$alias}.{$other->table_index} = {$this->table_name}.{$columnname}";
}
$query .= $this->getNonAdminAccessControlQuery($thismodule, $current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != '') {
$query .= " WHERE ({$where}) AND {$where_auto}";
} else {
$query .= " WHERE {$where_auto}";
}
return $query;
}
开发者ID:kduqi,项目名称:corebos,代码行数:46,代码来源:PriceBooks.php
示例5: create_export_query
/** Function to export the lead records in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Leads Query.
*/
function create_export_query($where)
{
global $log, $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Leads", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT {$fields_list},case when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name\n\t\t\t\tFROM " . $this->entity_table . "\n\t\t\t\tINNER JOIN vtiger_leaddetails ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid\n\t\t\t\tLEFT JOIN vtiger_leadsubdetails ON vtiger_leaddetails.leadid = vtiger_leadsubdetails.leadsubscriptionid\n\t\t\t\tLEFT JOIN vtiger_leadaddress ON vtiger_leaddetails.leadid=vtiger_leadaddress.leadaddressid\n\t\t\t\tLEFT JOIN vtiger_leadscf ON vtiger_leadscf.leadid=vtiger_leaddetails.leadid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active'";
$query .= $this->getNonAdminAccessControlQuery('Leads', $current_user);
$where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0";
if ($where != "") {
$query .= " where ({$where}) AND " . $where_auto;
} else {
$query .= " where " . $where_auto;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:kduqi,项目名称:corebos,代码行数:24,代码来源:Leads.php
示例6: create_export_query
/** function used to get the export query for product
* @param reference &$order_by - reference of the order by variable which will be added with the query
* @param reference &$where - reference of the where variable which will be added with the query
* @return string $query - return the query which will give the list of products to export
*/
function create_export_query(&$order_by, &$where)
{
global $log;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Products", "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "Products");
}
$fields_list = getFieldsListFromQuery($sql, $mod_strings);
$query = "SELECT {$fields_list} FROM " . $this->table_name . "\n\t\t\tLEFT JOIN ec_users as ucreator\n\t\t\t\t\tON ec_products.smcreatorid = ucreator.id\n\t\t\tWHERE ec_products.deleted = 0 ";
//ProductRelatedToLead, Account and Potential tables are added to get the Related to field
if ($where != "") {
$query .= " AND ({$where}) ";
}
if (!empty($order_by)) {
$query .= " ORDER BY {$order_by}";
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:29,代码来源:Products.php
示例7: create_export_query
/** function used to get the export query for product
* @param reference $where - reference of the where variable which will be added with the query
* @return string $query - return the query which will give the list of products to export
*/
function create_export_query($where)
{
global $log, $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Products", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list} FROM " . $this->table_name . "\n\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid = vtiger_products.productid\n\t\t\tLEFT JOIN vtiger_productcf\n\t\t\t\tON vtiger_products.productid = vtiger_productcf.productid\n\t\t\tLEFT JOIN vtiger_vendor\n\t\t\t\tON vtiger_vendor.vendorid = vtiger_products.vendor_id";
$query .= " LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
$query .= " LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id AND vtiger_users.status='Active'";
$query .= $this->getNonAdminAccessControlQuery('Products', $current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != '') {
$query .= " WHERE ({$where}) AND {$where_auto}";
} else {
$query .= " WHERE {$where_auto}";
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:kikojover,项目名称:corebos,代码行数:25,代码来源:Products.php
示例8: create_export_query
/** Function to export the account records in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Accounts Query.
*/
function create_export_query($where)
{
$log = vglobal('log');
$current_user = vglobal('current_user');
$log->debug("Entering create_export_query(" . $where . ") method ...");
include("include/utils/ExportUtils.php");
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Accounts", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT $fields_list,case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name
FROM " . $this->entity_table . "
INNER JOIN vtiger_account
ON vtiger_account.accountid = vtiger_crmentity.crmid
LEFT JOIN vtiger_accountaddress
ON vtiger_accountaddress.accountaddressid = vtiger_account.accountid
LEFT JOIN vtiger_accountscf
ON vtiger_accountscf.accountid = vtiger_account.accountid
LEFT JOIN vtiger_groups
ON vtiger_groups.groupid = vtiger_crmentity.smownerid
LEFT JOIN vtiger_users
ON vtiger_users.id = vtiger_crmentity.smownerid and vtiger_users.status = 'Active'
LEFT JOIN vtiger_account vtiger_account2
ON vtiger_account2.accountid = vtiger_account.parentid
"; //vtiger_account2 is added to get the Member of account
$query .= $this->getNonAdminAccessControlQuery('Accounts', $current_user);
$where_auto = " vtiger_crmentity.deleted = 0 ";
if ($where != "")
$query .= " WHERE ($where) AND " . $where_auto;
else
$query .= " WHERE " . $where_auto;
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:43,代码来源:Accounts.php
示例9: create_export_query
/** Function to export the vendors in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Vendors Query.
*/
function create_export_query($where)
{
global $log;
global $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Vendors", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list} FROM " . $this->entity_table . "\n INNER JOIN vtiger_vendor\n ON vtiger_crmentity.crmid = vtiger_vendor.vendorid\n LEFT JOIN vtiger_vendorcf\n ON vtiger_vendorcf.vendorid=vtiger_vendor.vendorid\n LEFT JOIN vtiger_seattachmentsrel\n ON vtiger_vendor.vendorid=vtiger_seattachmentsrel.crmid\n LEFT JOIN vtiger_attachments\n ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid\n LEFT JOIN vtiger_users\n ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active'\n ";
$where_auto = " vtiger_crmentity.deleted = 0 ";
if ($where != "") {
$query .= " WHERE ({$where}) AND " . $where_auto;
} else {
$query .= " WHERE " . $where_auto;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:23,代码来源:Vendors.php
示例10: create_export_query
/** Function to export the account records in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Accounts Query.
*/
function create_export_query($where)
{
global $log;
global $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Accounts", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list},case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name\n\t \t\t\tFROM " . $this->entity_table . "\n\t\t\t\tINNER JOIN vtiger_account\n\t\t\t\t\tON vtiger_account.accountid = vtiger_crmentity.crmid\n\t\t\t\tLEFT JOIN vtiger_accountbillads\n\t\t\t\t\tON vtiger_accountbillads.accountaddressid = vtiger_account.accountid\n\t\t\t\tLEFT JOIN vtiger_accountshipads\n\t\t\t\t\tON vtiger_accountshipads.accountaddressid = vtiger_account.accountid\n\t\t\t\tLEFT JOIN vtiger_accountscf\n\t\t\t\t\tON vtiger_accountscf.accountid = vtiger_account.accountid\n\t LEFT JOIN vtiger_groups\n \t ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users\n\t\t\t\t\tON vtiger_users.id = vtiger_crmentity.smownerid and vtiger_users.status = 'Active'\n\t\t\t\tLEFT JOIN vtiger_account vtiger_account2\n\t\t\t\t\tON vtiger_account2.accountid = vtiger_account.parentid\n\t\t\t\t";
//vtiger_account2 is added to get the Member of account
$query .= $this->getNonAdminAccessControlQuery('Accounts', $current_user);
$where_auto = " vtiger_crmentity.deleted = 0 ";
if ($where != "") {
$query .= " WHERE ({$where}) AND " . $where_auto;
} else {
$query .= " WHERE " . $where_auto;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:25,代码来源:Accounts.php
示例11: create_export_query
/** function used to get the export query for product
* @param reference $where - reference of the where variable which will be added with the query
* @return string $query - return the query which will give the list of products to export
*/
function create_export_query($where)
{
global $log;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Products", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list} FROM " . $this->table_name . "\n\t\t\tINNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid = vtiger_products.productid \n\t\t\tLEFT JOIN vtiger_productcf\n\t\t\t\tON vtiger_products.productid = vtiger_productcf.productid\n\t\t\tINNER JOIN vtiger_users\n\t\t\t\tON vtiger_users.id=vtiger_products.handler \n\n\t\t\tLEFT JOIN vtiger_vendor\n\t\t\t\tON vtiger_vendor.vendorid = vtiger_products.vendor_id\n\t\t\tWHERE vtiger_crmentity.deleted = 0 and vtiger_users.status = 'Active'";
if ($where != "") {
$query .= " AND ({$where}) ";
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:hardikk,项目名称:HNH,代码行数:19,代码来源:Products.php
示例12: create_export_query
/**
* Create query to export the records.
*/
function create_export_query($where)
{
global $current_user;
$thismodule = $_REQUEST['module'];
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery($thismodule, "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list}, vtiger_users.user_name AS user_name \n\t\t\t\t\tFROM vtiger_crmentity INNER JOIN {$this->table_name} ON vtiger_crmentity.crmid={$this->table_name}.{$this->table_index}";
if (!empty($this->customFieldTable)) {
$query .= " INNER JOIN " . $this->customFieldTable[0] . " ON " . $this->customFieldTable[0] . '.' . $this->customFieldTable[1] . " = {$this->table_name}.{$this->table_index}";
}
$query .= " LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
$query .= " LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active'";
$linkedModulesQuery = $this->db->pquery("SELECT distinct fieldname, columnname, relmodule FROM vtiger_field" . " INNER JOIN vtiger_fieldmodulerel ON vtiger_fieldmodulerel.fieldid = vtiger_field.fieldid" . " WHERE uitype='10' AND vtiger_fieldmodulerel.module=?", array($thismodule));
$linkedFieldsCount = $this->db->num_rows($linkedModulesQuery);
for ($i = 0; $i < $linkedFieldsCount; $i++) {
$related_module = $this->db->query_result($linkedModulesQuery, $i, 'relmodule');
$fieldname = $this->db->query_result($linkedModulesQuery, $i, 'fieldname');
$columnname = $this->db->query_result($linkedModulesQuery, $i, 'columnname');
$other = CRMEntity::getInstance($related_module);
vtlib_setup_modulevars($related_module, $other);
$query .= " LEFT JOIN {$other->table_name} ON {$other->table_name}.{$other->table_index} = {$this->table_name}.{$columnname}";
}
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != '') {
$query .= " WHERE ({$where}) AND {$where_auto}";
} else {
$query .= " WHERE {$where_auto}";
}
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
// Security Check for Field Access
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[7] == 3) {
//Added security check to get the permitted records only
$query = $query . " " . getListViewSecurityParameter($thismodule);
}
return $query;
}
开发者ID:hardikk,项目名称:HNH,代码行数:42,代码来源:ModCommentsCore.php
示例13: create_export_query
/**
* Create query to export the records.
*/
function create_export_query($where)
{
global $current_user;
$thismodule = $_REQUEST['module'];
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery($thismodule, "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list}\n\t\t\t\t\tFROM vtiger_crmentity INNER JOIN {$this->table_name} ON vtiger_crmentity.crmid={$this->table_name}.{$this->table_index}";
if (!empty($this->customFieldTable)) {
$query .= " INNER JOIN " . $this->customFieldTable[0] . " ON " . $this->customFieldTable[0] . '.' . $this->customFieldTable[1] . " = {$this->table_name}.{$this->table_index}";
}
$query .= " LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
$query .= " LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id AND vtiger_users.status='Active'";
$query .= $this->getNonAdminAccessControlQuery('Services', $current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != '') {
$query .= " WHERE ({$where}) AND {$where_auto}";
} else {
$query .= " WHERE {$where_auto}";
}
return $query;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:26,代码来源:Services.php
示例14: create_export_query
/** Function to export the notes in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Documents Query.
*/
function create_export_query($where)
{
global $log, $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Documents", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT {$fields_list}, foldername, filename,\n\t\t\t\t\tconcat(path,vtiger_attachments.attachmentsid,'_',filename) as storagename,\n\t\t\t\t\tconcat(account_no,' ',accountname) as account, concat(contact_no,' ',firstname,' ',lastname) as contact\n\t\t\t\tFROM vtiger_notes\n\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_notes.notesid\n\t\t\t\tleft join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_notes.notesid\n\t\t\t\tleft join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid\n\t\t\t\tLEFT JOIN vtiger_attachmentsfolder on vtiger_notes.folderid=vtiger_attachmentsfolder.folderid\n\t\t\t\tLEFT JOIN vtiger_senotesrel ON vtiger_senotesrel.notesid=vtiger_notes.notesid\n\t\t\t\tLEFT JOIN vtiger_account ON vtiger_account.accountid=vtiger_senotesrel.crmid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid=vtiger_senotesrel.crmid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_crmentity.smownerid=vtiger_groups.groupid ";
$query .= getNonAdminAccessControlQuery('Documents', $current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != "") {
$query .= " WHERE ({$where}) AND " . $where_auto;
} else {
$query .= " WHERE " . $where_auto;
}
$query .= ' group by vtiger_notes.notesid';
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:kduqi,项目名称:corebos,代码行数:24,代码来源:Documents.php
示例15: create_export_query
/**
* Create query to export the records.
*/
function create_export_query($where)
{
global $current_user;
include("include/utils/ExportUtils.php");
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery('Services', "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$query = "SELECT $fields_list
FROM vtiger_crmentity INNER JOIN $this->table_name ON vtiger_crmentity.crmid=$this->table_name.$this->table_index";
if(!empty($this->customFieldTable)) {
$query .= " INNER JOIN ".$this->customFieldTable[0]." ON ".$this->customFieldTable[0].'.'.$this->customFieldTable[1] .
" = $this->table_name.$this->table_index";
}
$query .= " LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
$query .= " LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id AND vtiger_users.status='Active'";
$query .= $this->getNonAdminAccessControlQuery('Services',$current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if($where != '') $query .= " WHERE ($where) AND $where_auto";
else $query .= " WHERE $where_auto";
return $query;
}
开发者ID:Wasage,项目名称:werpa,代码行数:32,代码来源:Services.php
示例16: create_export_query
/** Function to export the account records in CSV Format
* @param reference variable - order by is passed when the query is executed
* @param reference variable - where condition is passed when the query is executed
* Returns Export Accounts Query.
*/
function create_export_query(&$order_by, &$where)
{
global $log;
global $current_user;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Accounts", "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "Accounts");
}
$fields_list = getFieldsListFromQuery($sql, $mod_strings);
$query = "SELECT {$fields_list} FROM ec_account\n\t\t\t\tLEFT JOIN ec_users\n\t\t\t\t\tON ec_account.smownerid = ec_users.id\n\t\t\t\tLEFT JOIN ec_users as ucreator\n\t\t\t\t\tON ec_account.smcreatorid = ucreator.id ";
$where_auto = " ec_account.deleted = 0 ";
if ($where != "") {
$query .= "WHERE ({$where}) AND " . $where_auto;
} else {
$query .= "WHERE " . $where_auto;
}
$query .= " and ucreator.id=" . $_SESSION['authenticated_user_id'] . " ";
if (!empty($order_by)) {
$query .= " ORDER BY {$order_by}";
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:33,代码来源:Accounts.php
示例17: create_export_query
/** Function to export the notes in CSV Format
* @param reference variable - order by is passed when the query is executed
* @param reference variable - where condition is passed when the query is executed
* Returns Export Notes Query.
*/
function create_export_query(&$order_by, &$where)
{
global $log;
$log->debug("Entering create_export_query(" . $order_by . "," . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Notes", "detail_view");
global $mod_strings;
global $current_language;
if (empty($mod_strings)) {
$mod_strings = return_module_language($current_language, "Notes");
}
$fields_list = getFieldsListFromQuery($sql, $mod_strings);
$query = "SELECT {$fields_list} FROM ec_notes\n\t\t\t\tLEFT JOIN ec_contactdetails\n\t\t\t\t\tON ec_notes.contact_id=ec_contactdetails.contactid\n\t\t\t\tLEFT JOIN ec_account\n\t\t\t\t\tON ec_notes.accountid=ec_account.accountid\n\t\t\t\tLEFT JOIN ec_users\n\t\t\t\t\tON ec_notes.smownerid = ec_users.id\n\t\t\t\tLEFT JOIN ec_users as ucreator\n\t\t\t\t\tON ec_notes.smcreatorid = ucreator.id\n\t\t\t\tWHERE ec_notes.deleted=0 " . $where;
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:22,代码来源:Notes.php
示例18: create_export_query
/** Function to export the lead records in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export OSSCosts Query.
*/
function create_export_query($where)
{
global $log;
global $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("OSSCosts", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$fields_list .= getInventoryFieldsForExport($this->table_name);
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT {$fields_list} FROM " . $this->entity_table . "\n\t\t\t\tINNER JOIN vtiger_osscosts ON vtiger_osscosts.osscostsid = vtiger_crmentity.crmid\n\t\t\t\tLEFT JOIN vtiger_osscostscf ON vtiger_osscostscf.osscostsid = vtiger_osscosts.osscostsid\n\t\t\t\tLEFT JOIN vtiger_inventoryproductrel ON vtiger_inventoryproductrel.id = vtiger_osscosts.osscostsid\n\t\t\t\tLEFT JOIN vtiger_products ON vtiger_products.productid = vtiger_inventoryproductrel.productid\n\t\t\t\tLEFT JOIN vtiger_service ON vtiger_service.serviceid = vtiger_inventoryproductrel.productid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_osscosts.relategid\n\t\t\t\tLEFT JOIN vtiger_osscosts ON vtiger_osscosts.osscostsid = vtiger_osscosts.relategid\n\t\t\t\tLEFT JOIN vtiger_vendor ON vtiger_vendor.vendorid = vtiger_osscosts.relategid\n\t\t\t\tLEFT JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_osscosts.potentialid\n\t\t\t\tLEFT JOIN vtiger_project ON vtiger_project.projectid = vtiger_osscosts.projectid\n\t\t\t\tLEFT JOIN vtiger_troubletickets ON vtiger_troubletickets.ticketid = vtiger_osscosts.ticketid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_currency_info.id = vtiger_osscosts.currency_id\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid";
$query .= $this->getNonAdminAccessControlQuery('OSSCosts', $current_user);
$where_auto = " vtiger_crmentity.deleted=0";
if ($where != "") {
$query .= " where ({$where}) AND " . $where_auto;
} else {
$query .= " where " . $where_auto;
}
$log->debug("Exiting create_export_query method ...");
return $query;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:26,代码来源:OSSCosts.php
示例19: create_export_query
/** Function to export the notes in CSV Format
* @param reference variable - where condition is passed when the query is executed
* Returns Export Documents Query.
*/
function create_export_query($where)
{
global $log, $current_user;
$log->debug("Entering create_export_query(" . $where . ") method ...");
include "include/utils/ExportUtils.php";
//To get the Permitted fields query and the permitted fields list
$sql = getPermittedFieldsQuery("Documents", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT {$fields_list}, case when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end as user_name" . " FROM vtiger_notes\n\t\t\t\tinner join vtiger_crmentity\n\t\t\t\t
|
请发表评论