• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getNonAdminAccessControlQuery函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getNonAdminAccessControlQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP getNonAdminAccessControlQuery函数的具体用法?PHP getNonAdminAccessControlQuery怎么用?PHP getNonAdminAccessControlQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getNonAdminAccessControlQuery函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getTopPotentials

function getTopPotentials($maxval, $calCnt)
{
    $log = LoggerManager::getLogger('top opportunity_list');
    $log->debug("Entering getTopPotentials() method ...");
    require_once "data/Tracker.php";
    require_once 'modules/Potentials/Potentials.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    global $app_strings;
    global $adb;
    global $current_language;
    global $current_user;
    $current_module_strings = return_module_language($current_language, "Potentials");
    $title = array();
    $title[] = 'myTopOpenPotentials.gif';
    $title[] = $current_module_strings['LBL_TOP_OPPORTUNITIES'];
    $title[] = 'home_mypot';
    $where = "AND vtiger_potential.potentialid > 0 AND vtiger_potential.sales_stage not in ('Closed Won','Closed Lost','" . $current_module_strings['Closed Won'] . "','" . $current_module_strings['Closed Lost'] . "') AND vtiger_crmentity.smownerid='" . $current_user->id . "' AND vtiger_potential.amount > 0";
    $header = array();
    $header[] = $current_module_strings['LBL_LIST_OPPORTUNITY_NAME'];
    //$header[]=$current_module_strings['LBL_LIST_ACCOUNT_NAME'];
    $currencyid = fetchCurrency($current_user->id);
    $rate_symbol = getCurrencySymbolandCRate($currencyid);
    $rate = $rate_symbol['rate'];
    $curr_symbol = $rate_symbol['symbol'];
    $header[] = $current_module_strings['LBL_LIST_AMOUNT'] . '(' . $curr_symbol . ')';
    $list_query = "SELECT vtiger_crmentity.crmid, vtiger_potential.potentialname,\n\t\t\tvtiger_potential.amount, potentialid\n\t\t\tFROM vtiger_potential\n\t\t\tIGNORE INDEX(PRIMARY) INNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid = vtiger_potential.potentialid";
    $list_query .= getNonAdminAccessControlQuery('Potentials', $current_user);
    $list_query .= "WHERE vtiger_crmentity.deleted = 0 " . $where;
    $list_query .= " ORDER BY amount DESC";
    $list_query .= " LIMIT " . $adb->sql_escape_string($maxval);
    if ($calCnt == 'calculateCnt') {
        $list_result_rows = $adb->query(mkCountQuery($list_query));
        return $adb->query_result($list_result_rows, 0, 'count');
    }
    $list_result = $adb->query($list_query);
    $open_potentials_list = array();
    $noofrows = $adb->num_rows($list_result);
    $entries = array();
    if ($noofrows) {
        for ($i = 0; $i < $noofrows; $i++) {
            $open_potentials_list[] = array('name' => $adb->query_result($list_result, $i, 'potentialname'), 'id' => $adb->query_result($list_result, $i, 'potentialid'), 'amount' => $adb->query_result($list_result, $i, 'amount'));
            $potentialid = $adb->query_result($list_result, $i, 'potentialid');
            $potentialname = $adb->query_result($list_result, $i, 'potentialname');
            $Top_Potential = strlen($potentialname) > 20 ? substr($potentialname, 0, 20) . '...' : $potentialname;
            $value = array();
            $value[] = '<a href="index.php?action=DetailView&module=Potentials&record=' . $potentialid . '">' . $Top_Potential . '</a>';
            $value[] = CurrencyField::convertToUserFormat($adb->query_result($list_result, $i, 'amount'));
            $entries[$potentialid] = $value;
        }
    }
    $advft_criteria_groups = array('1' => array('groupcondition' => null));
    $advft_criteria = array(array('groupid' => 1, 'columnname' => 'vtiger_potential:sales_stage:sales_stage:Potentials_Sales_Stage:V', 'comparator' => 'k', 'value' => 'closed', 'columncondition' => 'and'), array('groupid' => 1, 'columnname' => 'vtiger_potential:amount:amount:Potentials_Amount:N', 'comparator' => 'g', 'value' => '0', 'columncondition' => 'and'), array('groupid' => 1, 'columnname' => 'vtiger_crmentity:smownerid:assigned_user_id:Leads_Assigned_To:V', 'comparator' => 'e', 'value' => getFullNameFromArray('Users', $current_user->column_fields), 'columncondition' => null));
    $search_qry = '&advft_criteria=' . Zend_Json::encode($advft_criteria) . '&advft_criteria_groups=' . Zend_Json::encode($advft_criteria_groups) . '&searchtype=advance&query=true';
    $values = array('ModuleName' => 'Potentials', 'Title' => $title, 'Header' => $header, 'Entries' => $entries, 'search_qry' => $search_qry);
    if (count($open_potentials_list) == 0 || count($open_potentials_list) > 0) {
        $log->debug("Exiting getTopPotentials method ...");
        return $values;
    }
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:60,代码来源:ListViewTop.php


示例2: getTopPotentials

function getTopPotentials($maxval, $calCnt)
{
    $log = LoggerManager::getLogger('top opportunity_list');
    $log->debug("Entering getTopPotentials() method ...");
    require_once "data/Tracker.php";
    require_once 'modules/Potentials/Potentials.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    global $app_strings;
    global $adb;
    global $current_language;
    global $current_user;
    $current_module_strings = return_module_language($current_language, "Potentials");
    $title = array();
    $title[] = 'myTopOpenPotentials.gif';
    $title[] = $current_module_strings['LBL_TOP_OPPORTUNITIES'];
    $title[] = 'home_mypot';
    $where = "AND vtiger_potential.potentialid > 0 AND vtiger_potential.sales_stage not in ('Closed Won','Closed Lost','" . $current_module_strings['Closed Won'] . "','" . $current_module_strings['Closed Lost'] . "') AND vtiger_crmentity.smownerid='" . $current_user->id . "' AND vtiger_potential.amount > 0";
    $header = array();
    $header[] = $current_module_strings['LBL_LIST_OPPORTUNITY_NAME'];
    //$header[]=$current_module_strings['LBL_LIST_ACCOUNT_NAME'];
    $currencyid = fetchCurrency($current_user->id);
    $rate_symbol = getCurrencySymbolandCRate($currencyid);
    $rate = $rate_symbol['rate'];
    $curr_symbol = $rate_symbol['symbol'];
    $header[] = $current_module_strings['LBL_LIST_AMOUNT'] . '(' . $curr_symbol . ')';
    $list_query = "SELECT vtiger_crmentity.crmid, vtiger_potential.potentialname,\n\t\t\tvtiger_potential.amount, potentialid\n\t\t\tFROM vtiger_potential\n\t\t\tIGNORE INDEX(PRIMARY) INNER JOIN vtiger_crmentity\n\t\t\t\tON vtiger_crmentity.crmid = vtiger_potential.potentialid";
    $list_query .= getNonAdminAccessControlQuery('Potentials', $current_user);
    $list_query .= "WHERE vtiger_crmentity.deleted = 0 " . $where;
    $list_query .= " ORDER BY amount DESC";
    $list_query .= " LIMIT " . $adb->sql_escape_string($maxval);
    if ($calCnt == 'calculateCnt') {
        $list_result_rows = $adb->query(mkCountQuery($list_query));
        return $adb->query_result($list_result_rows, 0, 'count');
    }
    $list_result = $adb->query($list_query);
    $open_potentials_list = array();
    $noofrows = $adb->num_rows($list_result);
    $entries = array();
    if ($noofrows) {
        for ($i = 0; $i < $noofrows; $i++) {
            $open_potentials_list[] = array('name' => $adb->query_result($list_result, $i, 'potentialname'), 'id' => $adb->query_result($list_result, $i, 'potentialid'), 'amount' => $adb->query_result($list_result, $i, 'amount'));
            $potentialid = $adb->query_result($list_result, $i, 'potentialid');
            $potentialname = $adb->query_result($list_result, $i, 'potentialname');
            $Top_Potential = strlen($potentialname) > 20 ? substr($potentialname, 0, 20) . '...' : $potentialname;
            $value = array();
            $value[] = '<a href="index.php?action=DetailView&module=Potentials&record=' . $potentialid . '">' . $Top_Potential . '</a>';
            $value[] = convertFromDollar($adb->query_result($list_result, $i, 'amount'), $rate);
            $entries[$potentialid] = $value;
        }
    }
    $search_qry = "&query=true&Fields0=assigned_user_id&Condition0=e&Srch_value0=" . $current_user->column_fields['user_name'] . "&Fields1=sales_stage&Condition1=k&Srch_value1=closed&searchtype=advance&search_cnt=2&matchtype=all";
    $values = array('ModuleName' => 'Potentials', 'Title' => $title, 'Header' => $header, 'Entries' => $entries, 'search_qry' => $search_qry);
    if ($display_empty_home_blocks && count($open_potentials_list) == 0 || count($open_potentials_list) > 0) {
        $log->debug("Exiting getTopPotentials method ...");
        return $values;
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:58,代码来源:ListViewTop.php


示例3: showEmailsList

 public function showEmailsList($srecord, $smodule, $Config, $type)
 {
     $return = array();
     $adb = PearDatabase::getInstance();
     $widgets = $this->modules_email_actions_widgets;
     $queryParams = array();
     if ($widgets[$smodule]) {
         $ids = array();
         $result = $adb->pquery("SELECT * FROM vtiger_crmentityrel WHERE (vtiger_crmentityrel.crmid = ?) OR ( vtiger_crmentityrel.relcrmid = ? ) ", array($srecord, $srecord), true);
         foreach ($result->GetArray() as $row) {
             if ($row['module'] == 'OSSMailView') {
                 $ids[] = $row['crmid'];
             } elseif ($row['relmodule'] == 'OSSMailView') {
                 $ids[] = $row['relcrmid'];
             }
         }
         if (count($ids) == 0) {
             return array();
         }
         $queryParams[] = $ids;
         if ($type != 'all') {
             $ifwhere = "AND type = ?";
             $queryParams[] = $type;
         }
         $query = "SELECT * FROM vtiger_ossmailview INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_ossmailview.ossmailviewid";
         global $current_user;
         $query .= ' ' . getNonAdminAccessControlQuery('OSSMailView', $current_user);
         $query .= " WHERE ossmailviewid IN (" . generateQuestionMarks($ids) . ") {$ifwhere} ORDER BY ossmailviewid DESC LIMIT " . $Config['widget_limit'];
         $result = $adb->pquery($query, $queryParams, true);
         foreach ($result->GetArray() as $row) {
             $from = $this->findRecordsById($row['from_id']);
             $to = $this->findRecordsById($row['to_id']);
             $return[$row['ossmailviewid']]['date'] = $row['createdtime'];
             $return[$row['ossmailviewid']]['subject'] = '<a href="index.php?module=OSSMailView&view=preview&record=' . $row['ossmailviewid'] . '" target="' . $Config['target'] . '"> ' . $this->limit_text($row['subject']) . '</a>';
             $return[$row['ossmailviewid']]['attachments'] = $row['attachments_exist'];
             $return[$row['ossmailviewid']]['from'] = $from == '' && $from ? $from : $this->limit_text($row['from_email']);
             $return[$row['ossmailviewid']]['to'] = $to == '' && $to ? $to : $this->limit_text($row['to_email']);
             $return[$row['ossmailviewid']]['type'] = $row['type'];
             $return[$row['ossmailviewid']]['body'] = $row['content'];
         }
     }
     return $return;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:43,代码来源:Record.php


示例4: get_searchbyemailid

 /** Function to get the Contacts assigned to a user with a valid email address.
 * @param varchar $username - User Name
 * @param varchar $emailaddress - Email Addr for each contact.
 * Used By vtigerCRM Outlook Plugin
 * Returns the Query
 */
 function get_searchbyemailid($username, $emailaddress)
 {
     global $log, $current_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 'user_privileges/user_privileges_' . $current_user->id . '.php';
     require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
     $log->debug("Entering get_searchbyemailid(" . $username . "," . $emailaddress . ") method ...");
     $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname,\n\t\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.salutation,\n\t\t\t\tvtiger_contactdetails.email,vtiger_contactdetails.title,\n\t\t\t\tvtiger_contactdetails.mobile,vtiger_account.accountname,\n\t\t\t\tvtiger_account.accountid as accountid from vtiger_contactdetails\n\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid";
     $query .= getNonAdminAccessControlQuery('Contacts', $current_user);
     $query .= "where vtiger_crmentity.deleted=0";
     if (trim($emailaddress) != '') {
         $query .= " and ((vtiger_contactdetails.email like '" . formatForSqlLike($emailaddress) . "') or vtiger_contactdetails.lastname REGEXP REPLACE('" . $emailaddress . "',' ','|') or vtiger_contactdetails.firstname REGEXP REPLACE('" . $emailaddress . "',' ','|')) and vtiger_contactdetails.email != ''";
     } else {
         $query .= " and (vtiger_contactdetails.email like '" . formatForSqlLike($emailaddress) . "' and vtiger_contactdetails.email != '')";
     }
     $log->debug("Exiting get_searchbyemailid method ...");
     return $this->plugin_process_list_query($query);
 }
开发者ID:jgjermeni,项目名称:corebos,代码行数:28,代码来源:Contacts.php


示例5: getReportsQuery

 /** function to get report query for the given module
  *  @ param $module : type String
  *  this returns join query for the given module
  */
 function getReportsQuery($module, $type = '')
 {
     $log = vglobal('log');
     $current_user = vglobal('current_user');
     $secondary_module = "'";
     $secondary_module .= str_replace(":", "','", $this->secondarymodule);
     $secondary_module .= "'";
     if ($module == "Leads") {
         $query = "from vtiger_leaddetails\n\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid";
         if ($this->queryPlanner->requireTable('vtiger_leadsubdetails')) {
             $query .= "\tinner join vtiger_leadsubdetails on vtiger_leadsubdetails.leadsubscriptionid=vtiger_leaddetails.leadid";
         }
         if ($this->queryPlanner->requireTable('vtiger_leadaddress')) {
             $query .= "\tinner join vtiger_leadaddress on vtiger_leadaddress.leadaddressid=vtiger_leaddetails.leadid";
         }
         if ($this->queryPlanner->requireTable('vtiger_leadscf')) {
             $query .= " inner join vtiger_leadscf on vtiger_leaddetails.leadid = vtiger_leadscf.leadid";
         }
         if ($this->queryPlanner->requireTable('vtiger_groupsLeads')) {
             $query .= "\tleft join vtiger_groups as vtiger_groupsLeads on vtiger_groupsLeads.groupid = vtiger_crmentity.smownerid";
         }
         if ($this->queryPlanner->requireTable('vtiger_usersLeads')) {
             $query .= " left join vtiger_users as vtiger_usersLeads on vtiger_usersLeads.id = vtiger_crmentity.smownerid";
         }
         $query .= " left 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";
         if ($this->queryPlanner->requireTable('vtiger_lastModifiedByLeads')) {
             $query .= " left join vtiger_users as vtiger_lastModifiedByLeads on vtiger_lastModifiedByLeads.id = vtiger_crmentity.modifiedby";
         }
         if ($this->queryPlanner->requireTable('vtiger_createdbyLeads')) {
             $query .= " left join vtiger_users as vtiger_createdbyLeads on vtiger_createdbyLeads.id = vtiger_crmentity.smcreatorid";
         }
         foreach ($this->queryPlanner->getCustomTables() as $customTable) {
             $query .= " left join " . $customTable['refTable'] . " as " . $customTable['reference'] . " on " . $customTable['reference'] . "." . $customTable['refIndex'] . " = " . $customTable['table'] . "." . $customTable['field'];
         }
         $query .= " " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . " where vtiger_crmentity.deleted=0 and vtiger_leaddetails.converted=0";
     } else {
         if ($module == "Accounts") {
             $query = "from vtiger_account\n\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid";
             if ($this->queryPlanner->requireTable('vtiger_accountaddress')) {
                 $query .= " inner join vtiger_accountaddress on vtiger_account.accountid=vtiger_accountaddress.accountaddressid";
             }
             if ($this->queryPlanner->requireTable('vtiger_accountscf')) {
                 $query .= " inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid";
             }
             if ($this->queryPlanner->requireTable('vtiger_groupsAccounts')) {
                 $query .= " left join vtiger_groups as vtiger_groupsAccounts on vtiger_groupsAccounts.groupid = vtiger_crmentity.smownerid";
             }
             if ($this->queryPlanner->requireTable('vtiger_accountAccounts')) {
                 $query .= "\tleft join vtiger_account as vtiger_accountAccounts on vtiger_accountAccounts.accountid = vtiger_account.parentid";
             }
             if ($this->queryPlanner->requireTable('vtiger_usersAccounts')) {
                 $query .= " left join vtiger_users as vtiger_usersAccounts on vtiger_usersAccounts.id = vtiger_crmentity.smownerid";
             }
             $query .= " left 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";
             if ($this->queryPlanner->requireTable('vtiger_lastModifiedByAccounts')) {
                 $query .= " left join vtiger_users as vtiger_lastModifiedByAccounts on vtiger_lastModifiedByAccounts.id = vtiger_crmentity.modifiedby";
             }
             if ($this->queryPlanner->requireTable('vtiger_createdbyAccounts')) {
                 $query .= " left join vtiger_users as vtiger_createdbyAccounts on vtiger_createdbyAccounts.id = vtiger_crmentity.smcreatorid";
             }
             foreach ($this->queryPlanner->getCustomTables() as $customTable) {
                 $query .= " left join " . $customTable['refTable'] . " as " . $customTable['reference'] . " on " . $customTable['reference'] . "." . $customTable['refIndex'] . " = " . $customTable['table'] . "." . $customTable['field'];
             }
             $query .= " " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . " where vtiger_crmentity.deleted=0 ";
         } else {
             if ($module == "Contacts") {
                 $query = "from vtiger_contactdetails\n\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid";
                 if ($this->queryPlanner->requireTable('vtiger_contactaddress')) {
                     $query .= "\tinner join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_customerdetails')) {
                     $query .= "\tinner join vtiger_customerdetails on vtiger_customerdetails.customerid = vtiger_contactdetails.contactid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_contactsubdetails')) {
                     $query .= "\tinner join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_contactscf')) {
                     $query .= "\tinner join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_groupsContacts')) {
                     $query .= " left join vtiger_groups vtiger_groupsContacts on vtiger_groupsContacts.groupid = vtiger_crmentity.smownerid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_contactdetailsContacts')) {
                     $query .= "\tleft join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_accountContacts')) {
                     $query .= "\tleft join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.parentid";
                 }
                 if ($this->queryPlanner->requireTable('vtiger_usersContacts')) {
                     $query .= " left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentity.smownerid";
                 }
                 $query .= " left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tleft join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid";
                 foreach ($this->queryPlanner->getCustomTables() as $customTable) {
                     $query .= " left join " . $customTable['refTable'] . " as " . $customTable['reference'] . " on " . $customTable['reference'] . "." . $customTable['refIndex'] . " = " . $customTable['table'] . "." . $customTable['field'];
                 }
                 if ($this->queryPlanner->requireTable('vtiger_lastModifiedByContacts')) {
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:ReportRun.php


示例6: 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\ton vtiger_crmentity.crmid=vtiger_notes.notesid\n\t\t\t\tLEFT JOIN `vtiger_trees_templates_data` on vtiger_notes.folderid=`vtiger_trees_templates_data`.tree\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id " . " LEFT 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;
     }
     $log->debug("Exiting create_export_query method ...");
     return $query;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:24,代码来源:Documents.php


示例7: getReportsQuery

 /** function to get report query for the given module    
  *  @ param $module : type String 
  *  this returns join query for the given module
  */
 function getReportsQuery($module)
 {
     global $log, $current_user;
     $secondary_module = "'";
     $secondary_module .= str_replace(":", "','", $this->secondarymodule);
     $secondary_module .= "'";
     if ($module == "Leads") {
         $query = "from vtiger_leaddetails \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid \n                    inner join vtiger_leadsubdetails on vtiger_leadsubdetails.leadsubscriptionid=vtiger_leaddetails.leadid \n                    inner join vtiger_leadaddress on vtiger_leadaddress.leadaddressid=vtiger_leadsubdetails.leadsubscriptionid \n                    inner join vtiger_leadscf on vtiger_leaddetails.leadid = vtiger_leadscf.leadid \n                    left join vtiger_groups as vtiger_groupsLeads on vtiger_groupsLeads.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersLeads on vtiger_usersLeads.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0 and vtiger_leaddetails.converted=0";
     } else {
         if ($module == "Accounts") {
             $query = "from vtiger_account \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid \n                    inner join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid \n                    inner join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid \n                    inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid \n                    left join vtiger_groups as vtiger_groupsAccounts on vtiger_groupsAccounts.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_account as vtiger_accountAccounts on vtiger_accountAccounts.accountid = vtiger_account.parentid\n                    left join vtiger_users as vtiger_usersAccounts on vtiger_usersAccounts.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0 ";
         } else {
             if ($module == "Contacts") {
                 $query = "from vtiger_contactdetails\n                    inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid \n                    inner join vtiger_contactaddress on vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid \n                    inner join vtiger_customerdetails on vtiger_customerdetails.customerid = vtiger_contactdetails.contactid\n                    inner join vtiger_contactsubdetails on vtiger_contactdetails.contactid = vtiger_contactsubdetails.contactsubscriptionid \n                    inner join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid \n                    left join vtiger_groups vtiger_groupsContacts on vtiger_groupsContacts.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto\n                    left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid \n                    left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
             } else {
                 if ($module == "Potentials") {
                     $query = "from vtiger_potential \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid \n                    inner join vtiger_potentialscf on vtiger_potentialscf.potentialid = vtiger_potential.potentialid\n                    left join vtiger_account as vtiger_accountPotentials on vtiger_potential.related_to = vtiger_accountPotentials.accountid\n                    left join vtiger_contactdetails as vtiger_contactdetailsPotentials on vtiger_potential.related_to = vtiger_contactdetailsPotentials.contactid \n                    left join vtiger_campaign as vtiger_campaignPotentials on vtiger_potential.campaignid = vtiger_campaignPotentials.campaignid\n                    left join vtiger_groups vtiger_groupsPotentials on vtiger_groupsPotentials.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersPotentials on vtiger_usersPotentials.id = vtiger_crmentity.smownerid  \n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid  \n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0 ";
                 } else {
                     if ($module == "Products") {
                         $query = "from vtiger_products \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_products.productid \n                    left join vtiger_productcf on vtiger_products.productid = vtiger_productcf.productid \n                    left join vtiger_users as vtiger_usersProducts on vtiger_usersProducts.id = vtiger_products.handler \n                    left join vtiger_vendor as vtiger_vendorRelProducts on vtiger_vendorRelProducts.vendorid = vtiger_products.vendor_id \n                    LEFT JOIN (\n                                    SELECT vtiger_products.productid, \n                                                    (CASE WHEN (vtiger_products.currency_id = 1 ) THEN vtiger_products.unit_price\n                                                            ELSE (vtiger_products.unit_price / vtiger_currency_info.conversion_rate) END\n                                                    ) AS actual_unit_price\n                                    FROM vtiger_products\n                                    LEFT JOIN vtiger_currency_info ON vtiger_products.currency_id = vtiger_currency_info.id\n                                    LEFT JOIN vtiger_productcurrencyrel ON vtiger_products.productid = vtiger_productcurrencyrel.productid\n                                    AND vtiger_productcurrencyrel.currencyid = " . $current_user->currency_id . "\n                    ) AS innerProduct ON innerProduct.productid = vtiger_products.productid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
                     } else {
                         if ($module == "HelpDesk") {
                             $query = "from vtiger_troubletickets \n                    inner join vtiger_crmentity  \n                    on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid \n                    inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid\n                    left join vtiger_crmentity as vtiger_crmentityRelHelpDesk on vtiger_crmentityRelHelpDesk.crmid = vtiger_troubletickets.parent_id\n                    left join vtiger_account as vtiger_accountRelHelpDesk on vtiger_accountRelHelpDesk.accountid=vtiger_crmentityRelHelpDesk.crmid \n                    left join vtiger_contactdetails as vtiger_contactdetailsRelHelpDesk on vtiger_contactdetailsRelHelpDesk.contactid= vtiger_crmentityRelHelpDesk.crmid\n                    left join vtiger_products as vtiger_productsRel on vtiger_productsRel.productid = vtiger_troubletickets.product_id \n                    left join vtiger_groups as vtiger_groupsHelpDesk on vtiger_groupsHelpDesk.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersHelpDesk on vtiger_crmentity.smownerid=vtiger_usersHelpDesk.id \n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id \n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0 ";
                         } else {
                             if ($module == "Calendar") {
                                 $query = "from vtiger_activity \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid\n                    left join vtiger_activitycf on vtiger_activitycf.activityid = vtiger_crmentity.crmid\n                    left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid \n                    left join vtiger_contactdetails as vtiger_contactdetailsCalendar on vtiger_contactdetailsCalendar.contactid= vtiger_cntactivityrel.contactid\n                    left join vtiger_groups as vtiger_groupsCalendar on vtiger_groupsCalendar.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersCalendar on vtiger_usersCalendar.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid\n                    left join vtiger_activity_reminder on vtiger_activity_reminder.activity_id = vtiger_activity.activityid\n                    left join vtiger_recurringevents on vtiger_recurringevents.activityid = vtiger_activity.activityid\n                    left join vtiger_crmentity as vtiger_crmentityRelCalendar on vtiger_crmentityRelCalendar.crmid = vtiger_seactivityrel.crmid\n                    left join vtiger_account as vtiger_accountRelCalendar on vtiger_accountRelCalendar.accountid=vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_leaddetails as vtiger_leaddetailsRelCalendar on vtiger_leaddetailsRelCalendar.leadid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_potential as vtiger_potentialRelCalendar on vtiger_potentialRelCalendar.potentialid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_quotes as vtiger_quotesRelCalendar on vtiger_quotesRelCalendar.quoteid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_purchaseorder as vtiger_purchaseorderRelCalendar on vtiger_purchaseorderRelCalendar.purchaseorderid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_invoice as vtiger_invoiceRelCalendar on vtiger_invoiceRelCalendar.invoiceid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_salesorder as vtiger_salesorderRelCalendar on vtiger_salesorderRelCalendar.salesorderid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_troubletickets as vtiger_troubleticketsRelCalendar on vtiger_troubleticketsRelCalendar.ticketid = vtiger_crmentityRelCalendar.crmid\n                    left join vtiger_campaign as vtiger_campaignRelCalendar on vtiger_campaignRelCalendar.campaignid = vtiger_crmentityRelCalendar.crmid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype != 'Emails')";
                             } else {
                                 if ($module == "Quotes") {
                                     $query = "from vtiger_quotes \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid \n                    inner join vtiger_quotesbillads on vtiger_quotes.quoteid=vtiger_quotesbillads.quotebilladdressid \n                    inner join vtiger_quotesshipads on vtiger_quotes.quoteid=vtiger_quotesshipads.quoteshipaddressid\n                    left join vtiger_inventoryproductrel as vtiger_inventoryproductrelQuotes on vtiger_quotes.quoteid = vtiger_inventoryproductrelQuotes.id\n                    left join vtiger_products as vtiger_productsQuotes on vtiger_productsQuotes.productid = vtiger_inventoryproductrelQuotes.productid  \n                    left join vtiger_service as vtiger_serviceQuotes on vtiger_serviceQuotes.serviceid = vtiger_inventoryproductrelQuotes.productid\n                    left join vtiger_quotescf on vtiger_quotes.quoteid = vtiger_quotescf.quoteid\n                    left join vtiger_groups as vtiger_groupsQuotes on vtiger_groupsQuotes.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersQuotes on vtiger_usersQuotes.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersRel1 on vtiger_usersRel1.id = vtiger_quotes.inventorymanager\n                    left join vtiger_potential as vtiger_potentialRelQuotes on vtiger_potentialRelQuotes.potentialid = vtiger_quotes.potentialid\n                    left join vtiger_contactdetails as vtiger_contactdetailsQuotes on vtiger_contactdetailsQuotes.contactid = vtiger_quotes.contactid\n                    left join vtiger_account as vtiger_accountQuotes on vtiger_accountQuotes.accountid = vtiger_quotes.accountid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
                                 } else {
                                     if ($module == "PurchaseOrder") {
                                         $query = "from vtiger_purchaseorder \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid \n                    inner join vtiger_pobillads on vtiger_purchaseorder.purchaseorderid=vtiger_pobillads.pobilladdressid \n                    inner join vtiger_poshipads on vtiger_purchaseorder.purchaseorderid=vtiger_poshipads.poshipaddressid\n                    left join vtiger_inventoryproductrel as vtiger_inventoryproductrelPurchaseOrder on vtiger_purchaseorder.purchaseorderid = vtiger_inventoryproductrelPurchaseOrder.id\n                    left join vtiger_products as vtiger_productsPurchaseOrder on vtiger_productsPurchaseOrder.productid = vtiger_inventoryproductrelPurchaseOrder.productid  \n                    left join vtiger_service as vtiger_servicePurchaseOrder on vtiger_servicePurchaseOrder.serviceid = vtiger_inventoryproductrelPurchaseOrder.productid\n                    left join vtiger_purchaseordercf on vtiger_purchaseorder.purchaseorderid = vtiger_purchaseordercf.purchaseorderid\n                    left join vtiger_groups as vtiger_groupsPurchaseOrder on vtiger_groupsPurchaseOrder.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersPurchaseOrder on vtiger_usersPurchaseOrder.id = vtiger_crmentity.smownerid \n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid \n                    left join vtiger_vendor as vtiger_vendorRelPurchaseOrder on vtiger_vendorRelPurchaseOrder.vendorid = vtiger_purchaseorder.vendorid \n                    left join vtiger_contactdetails as vtiger_contactdetailsPurchaseOrder on vtiger_contactdetailsPurchaseOrder.contactid = vtiger_purchaseorder.contactid \n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n\t\t\t\twhere vtiger_crmentity.deleted=0";
                                     } else {
                                         if ($module == "Invoice") {
                                             $query = "from vtiger_invoice \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid \n                    inner join vtiger_invoicebillads on vtiger_invoice.invoiceid=vtiger_invoicebillads.invoicebilladdressid \n                    inner join vtiger_invoiceshipads on vtiger_invoice.invoiceid=vtiger_invoiceshipads.invoiceshipaddressid\n                    left join vtiger_inventoryproductrel as vtiger_inventoryproductrelInvoice on vtiger_invoice.invoiceid = vtiger_inventoryproductrelInvoice.id\n                    left join vtiger_products as vtiger_productsInvoice on vtiger_productsInvoice.productid = vtiger_inventoryproductrelInvoice.productid\n                    left join vtiger_service as vtiger_serviceInvoice on vtiger_serviceInvoice.serviceid = vtiger_inventoryproductrelInvoice.productid\n                    left join vtiger_salesorder as vtiger_salesorderInvoice on vtiger_salesorderInvoice.salesorderid=vtiger_invoice.salesorderid\n                    left join vtiger_invoicecf on vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid \n                    left join vtiger_groups as vtiger_groupsInvoice on vtiger_groupsInvoice.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersInvoice on vtiger_usersInvoice.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    left join vtiger_account as vtiger_accountInvoice on vtiger_accountInvoice.accountid = vtiger_invoice.accountid\n                    left join vtiger_contactdetails as vtiger_contactdetailsInvoice on vtiger_contactdetailsInvoice.contactid = vtiger_invoice.contactid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
                                         } else {
                                             if ($module == "SalesOrder") {
                                                 $query = "from vtiger_salesorder \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid \n                    inner join vtiger_sobillads on vtiger_salesorder.salesorderid=vtiger_sobillads.sobilladdressid \n                    inner join vtiger_soshipads on vtiger_salesorder.salesorderid=vtiger_soshipads.soshipaddressid\n                    left join vtiger_inventoryproductrel as vtiger_inventoryproductrelSalesOrder on vtiger_salesorder.salesorderid = vtiger_inventoryproductrelSalesOrder.id\n                    left join vtiger_products as vtiger_productsSalesOrder on vtiger_productsSalesOrder.productid = vtiger_inventoryproductrelSalesOrder.productid  \n                    left join vtiger_service as vtiger_serviceSalesOrder on vtiger_serviceSalesOrder.serviceid = vtiger_inventoryproductrelSalesOrder.productid\n                    left join vtiger_contactdetails as vtiger_contactdetailsSalesOrder on vtiger_contactdetailsSalesOrder.contactid = vtiger_salesorder.contactid\n                    left join vtiger_quotes as vtiger_quotesSalesOrder on vtiger_quotesSalesOrder.quoteid = vtiger_salesorder.quoteid\t\t\t\t\n                    left join vtiger_account as vtiger_accountSalesOrder on vtiger_accountSalesOrder.accountid = vtiger_salesorder.accountid\n                    left join vtiger_potential as vtiger_potentialRelSalesOrder on vtiger_potentialRelSalesOrder.potentialid = vtiger_salesorder.potentialid \n                    left join vtiger_invoice_recurring_info on vtiger_invoice_recurring_info.salesorderid = vtiger_salesorder.salesorderid\n                    left join vtiger_groups as vtiger_groupsSalesOrder on vtiger_groupsSalesOrder.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersSalesOrder on vtiger_usersSalesOrder.id = vtiger_crmentity.smownerid \n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid \n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
                                             } else {
                                                 if ($module == "Campaigns") {
                                                     $query = "from vtiger_campaign\n                    inner join vtiger_campaignscf as vtiger_campaignscf on vtiger_campaignscf.campaignid=vtiger_campaign.campaignid   \n                    inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_campaign.campaignid\n                    left join vtiger_products as vtiger_productsCampaigns on vtiger_productsCampaigns.productid = vtiger_campaign.product_id\n                    left join vtiger_groups as vtiger_groupsCampaigns on vtiger_groupsCampaigns.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users as vtiger_usersCampaigns on vtiger_usersCampaigns.id = vtiger_crmentity.smownerid\n                    left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid\n                    left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid\n                    " . $this->getRelatedModulesQuery($module, $this->secondarymodule) . getNonAdminAccessControlQuery($this->primarymodule, $current_user) . "\n                    where vtiger_crmentity.deleted=0";
                                                 } else {
                                                     if ($module != '') {
                                                         //fixing the bug of missing join to related tables
                                                         $focus = CRMEntity::getInstance($module);
                                                         $query = $this->generateReportsQuery($module);
                                                         if ($module == "Cashflow4You" && $this->secondarymodule == "Invoice") {
                                                             $query .= " left join its4you_cashflow4you_associatedto on  its4you_cashflow4you_associatedto.cashflow4youid = vtiger_crmentity.crmid ";
                                                         }
                                                         $query .= $this->getRelatedModulesQuery($module, $this->secondarymodule);
                                                         if ($module == "Cashflow4You" && $this->secondarymodule == "Invoice") {
                                                             $query = str_replace("left join vtiger_invoice on its4you_cashflow4you.relationid=vtiger_invoice.invoiceid", "left join vtiger_invoice on its4you_cashflow4you.relationid=vtiger_invoice.invoiceid or its4you_cashflow4you_associatedto.cashflow4you_associated_id = vtiger_invoice.invoiceid", $query);
                                                         }
                                                         switch ($this->secondarymodule) {
                                                             //case "HelpDesk":
                                                             //    $query .= " left join vtiger_ticketcomments on vtiger_ticketcomments.ticketid=vtiger_troubletickets.ticketid ";
                                                             //    break;
                                                             case "Faq":
                                                                 $query .= " left join vtiger_products as vtiger_productsfaq on vtiger_productsfaq.productid=vtiger_faq.product_id \n                                    left join vtiger_faqcomments on vtiger_faqcomments.faqid=vtiger_faq.id ";
                                                                 break;
                                                         }
                                                         $query .= getNonAdminAccessControlQuery($this->primarymodule, $current_user) . " WHERE vtiger_crmentity.deleted=0";
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // ITS4YOU MaJu
     if ($module == 'PriceBooks' && $this->secondarymodule == 'Products') {
         $query = str_replace('left join vtiger_crmentity as vtiger_crmentityProducts', 'inner join vtiger_crmentity as vtiger_crmentityProducts', $query);
     } elseif ($module == "Potentials" && $this->secondarymodule == "Contacts") {
         $query = str_replace("left join vtiger_contactdetails as vtiger_contactdetailsPotentials on vtiger_potential.related_to = vtiger_contactdetailsPotentials.contactid", "left join vtiger_contpotentialrel on vtiger_contpotentialrel.potentialid = vtiger_potential.potentialid\n                                  left join vtiger_contactdetails as vtiger_contactdetailsPotentials on vtiger_contpotentialrel.contactid = vtiger_contactdetailsPotentials.contactid ", $query);
         $query = str_replace("on vtiger_potential.related_to=vtiger_contactdetails.contactid", "on vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid", $query);
     }
     // ITS4YOU-END
     $log->info("ReportRun :: Successfully returned getReportsQuery" . $module);
     $sdpos = strpos($query, "vtiger_crmentity" . $this->secondarymodule . ".");
     if ($sdpos !== false) {
         $query .= " AND vtiger_crmentity" . $this->secondarymodule . ".deleted= '0'";
     }
     $query .= " AND vtiger_crmentity.crmid= '" . $this->crmid . "'";
     return $query;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:95,代码来源:RelBlockRun.php


示例8: getReportsQuery

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getNormalParam函数代码示例发布时间:2022-05-15
下一篇:
PHP getNodeIdByNodeName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap