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

PHP getTableNameForField函数代码示例

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

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



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

示例1: getWidget

 public function getWidget()
 {
     $widget = array();
     $model = Vtiger_Module_Model::getInstance($this->Data['relatedmodule']);
     if ($model->isPermitted('DetailView')) {
         $this->Config['url'] = $this->getUrl();
         $this->Config['tpl'] = 'Basic.tpl';
         if ($this->Data['action'] == 1) {
             $createPermission = $model->isPermitted('EditView');
             $this->Config['action'] = $createPermission == true ? 1 : 0;
             $this->Config['actionURL'] = $model->getQuickCreateUrl();
         }
         if (isset($this->Data['filter'])) {
             $filterArray = explode('::', $this->Data['filter']);
             $this->Config['field_name'] = $filterArray[2];
         }
         if (isset($this->Data['checkbox']) && $this->Data['checkbox'] != '-') {
             $this->Config['url'] .= '&whereCondition[' . getTableNameForField(getTabModuleName($this->Data['relatedmodule']), $this->Data['checkbox']) . '.' . $this->Data['checkbox'] . ']=1';
             $on = 'LBL_SWITCH_ON_' . strtoupper($this->Data['checkbox']);
             $translateOn = vtranslate($on, $model->getName());
             if ($on == $translateOn) {
                 $translateOn = vtranslate('LBL_YES', $model->getName());
             }
             $off = 'LBL_SWITCH_OFF_' . strtoupper($this->Data['checkbox']);
             $translateOff = vtranslate($off, $model->getName());
             if ($off == $translateOff) {
                 $translateOff = vtranslate('LBL_NO', $model->getName());
             }
             $this->Config['checkboxLables'] = ['on' => $translateOn, 'off' => $translateOff];
         }
         $widget = $this->Config;
     }
     return $widget;
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:34,代码来源:RelatedModule.php


示例2: rgb

    echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
    echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span clas\n\t\ts='genHeaderSmall'>{$app_strings['LBL_PERMISSION']}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\n\t\t</td>\n\t\t</tr>\n\t\t</tbody></table>\n\t\t</div>";
    echo "</td></tr></table>";
    exit;
}
$listquery = getListQuery($currentModule);
$list_query = $customView->getModifiedCvListQuery($viewid, $listquery, $currentModule);
if ($where != '') {
    $list_query = "{$list_query} AND {$where}";
}
// Sorting
if (!empty($order_by)) {
    if ($order_by == 'smownerid') {
        $list_query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField($currentModule, $order_by);
        $tablename = $tablename != '' ? $tablename . '.' : '';
        $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $list_query = fixPostgresQuery($list_query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($list_query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
    $noofrows = null;
}
$queryMode = isset($_REQUEST['query']) && $_REQUEST['query'] == 'true';
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:31,代码来源:ListView.php


示例3: array

$folders = array();
$emptyfolders = array();
if ($foldercount > 0) {
    for ($i = 0; $i < $foldercount; $i++) {
        $query = '';
        $displayFolder = '';
        $query = $focus->query;
        $list_query = '';
        $list_query = $focus->query;
        $folder_id = $adb->query_result($result, $i, "folderid");
        $query .= " and vtiger_notes.folderid = {$folder_id}";
        if ($folder_id != $request_folderid) {
            $start[$folder_id] = 1;
        }
        if (isset($order_by) && $order_by != '') {
            $tablename = getTableNameForField('Documents', $order_by);
            $tablename = $tablename != '' ? $tablename . "." : '';
            if ($adb->dbType == "pgsql") {
                $query .= ' GROUP BY ' . $tablename . $order_by;
                $list_query .= ' GROUP BY ' . $tablename . $order_by;
                $focus->additional_query .= ' GROUP BY ' . $tablename . $order_by;
            }
            $query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
            $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
            $focus->additional_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
        }
        //Retreiving the no of rows
        $count_result = $adb->query(mkCountQuery($query));
        $num_records = $adb->query_result($count_result, 0, "count");
        if ($num_records > 0) {
            $displayFolder = true;
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php


示例4: getSearchURL

if ($viewid != "0") {
    $queryGenerator->initForCustomViewById($viewid);
} else {
    $queryGenerator->initForDefaultCustomView();
}
if (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') {
    $queryGenerator->addUserSearchConditions($_REQUEST);
    $ustring = getSearchURL($_REQUEST);
    // we have a query
    $url_string .= "&query=true" . $ustring;
    $smarty->assign("SEARCH_URL", $url_string);
}
$list_query = $queryGenerator->getQuery();
$view_script = "<script language='javascript'>\r\nfunction set_selected()\r\n{\r\n\tlen=document.massdelete.viewname.length;\r\n\tfor(i=0;i<len;i++)\r\n\t{\r\n\t\tif(document.massdelete.viewname[i].value == '{$viewid}')\r\n\t\tdocument.massdelete.viewname[i].selected = true;\r\n\t}\r\n}\r\n\tset_selected();\r\n\t</script>";
if (isset($order_by) && $order_by != '') {
    $tablename = getTableNameForField('Faq', $order_by);
    $tablename = $tablename != '' ? $tablename . "." : '';
    if ($adb->dbType == "pgsql") {
        $list_query .= ' GROUP BY ' . $tablename . $order_by;
    }
    $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
//Constructing the list view
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("CATEGORY", $category);
$smarty->assign("SINGLE_MOD", 'Document');
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:ListView.php


示例5: unset

    unset($_SESSION['export_where']);
}
$view_script = "<script language='javascript'>\n\tfunction set_selected()\n\t{\n\t\tlen=document.massdelete.viewname.length;\n\t\tfor(i=0;i<len;i++)\n\t\t{\n\t\t\tif(document.massdelete.viewname[i].value == '{$viewid}')\n\t\t\t\tdocument.massdelete.viewname[i].selected = true;\n\t\t}\n\t}\n\tset_selected();\n\t</script>";
// mailer_export
if (isset($other_text['mailer_exp'])) {
    $view_script .= "<script language='javascript'>\n\tfunction mailer_export()\n\t{\n    document.massdelete.action.value=\"MailerExport\";\n    document.massdelete.step.value=\"ask\";\n    window.locate=\"index.php?module=Accounts&action=MailerExport&from=Accounts&step=ask\";\n\t}\n\t</script>";
}
// end of mailer export
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        if ($adb->dbType == "pgsql") {
            $query .= ' GROUP BY user_name';
        }
        $query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField('Accounts', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($adb->dbType == "pgsql") {
            $query .= ' GROUP BY ' . $tablename . $order_by;
        }
        $query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $query = fixPostgresQuery($query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:31,代码来源:ListView.php


示例6: getListViewNavigation

 public static function getListViewNavigation($currentRecordId)
 {
     global $currentModule, $current_user, $adb, $log, $list_max_entries_per_page;
     Zend_Json::$useBuiltinEncoderDecoder = true;
     $reUseData = false;
     $displayBufferRecordCount = 10;
     $bufferRecordCount = 15;
     if ($currentModule == 'Documents') {
         $sql = "select folderid from vtiger_notes where notesid=?";
         $params = array($currentRecordId);
         $result = $adb->pquery($sql, $params);
         $folderId = $adb->query_result($result, 0, 'folderid');
     }
     $cv = new CustomView();
     $viewId = $cv->getViewId($currentModule);
     if (!empty($_SESSION[$currentModule . '_DetailView_Navigation' . $viewId])) {
         $recordNavigationInfo = Zend_Json::decode($_SESSION[$currentModule . '_DetailView_Navigation' . $viewId]);
         $pageNumber = 0;
         if (count($recordNavigationInfo) == 1) {
             foreach ($recordNavigationInfo as $recordIdList) {
                 if (in_array($currentRecordId, $recordIdList)) {
                     $reUseData = true;
                 }
             }
         } else {
             $recordList = array();
             $recordPageMapping = array();
             foreach ($recordNavigationInfo as $start => $recordIdList) {
                 foreach ($recordIdList as $index => $recordId) {
                     $recordList[] = $recordId;
                     $recordPageMapping[$recordId] = $start;
                     if ($recordId == $currentRecordId) {
                         $searchKey = count($recordList) - 1;
                     }
                 }
             }
             if ($searchKey > $displayBufferRecordCount - 1 && $searchKey < count($recordList) - $displayBufferRecordCount) {
                 $reUseData = true;
             }
         }
     }
     if ($reUseData === false) {
         $recordNavigationInfo = array();
         if (!empty($_REQUEST['start'])) {
             $start = ListViewSession::getRequestStartPage();
         } else {
             $start = ListViewSession::getCurrentPage($currentModule, $viewId);
         }
         $startRecord = ($start - 1) * $list_max_entries_per_page - $bufferRecordCount;
         if ($startRecord < 0) {
             $startRecord = 0;
         }
         $list_query = $_SESSION[$currentModule . '_listquery'];
         $instance = CRMEntity::getInstance($currentModule);
         $instance->getNonAdminAccessControlQuery($currentModule, $current_user);
         vtlib_setup_modulevars($currentModule, $instance);
         if ($currentModule == 'Documents' && !empty($folderId)) {
             $list_query = preg_replace("/[\n\r\\s]+/", " ", $list_query);
             $hasOrderBy = stripos($list_query, 'order by');
             if ($hasOrderBy > 0) {
                 $list_query = substr($list_query, 0, $hasOrderBy - 1) . " AND vtiger_notes.folderid={$folderId} " . substr($list_query, $hasOrderBy);
             } else {
                 $list_query .= " AND vtiger_notes.folderid={$folderId}";
                 $order_by = $instance->getOrderByForFolder($folderId);
                 $sorder = $instance->getSortOrderForFolder($folderId);
                 $tablename = getTableNameForField($currentModule, $order_by);
                 $tablename = $tablename != '' ? $tablename . "." : '';
                 if (!empty($order_by)) {
                     $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
                 }
             }
         }
         if ($start != 1) {
             $recordCount = $list_max_entries_per_page + 2 * $bufferRecordCount;
         } else {
             $recordCount = $list_max_entries_per_page + $bufferRecordCount;
         }
         $list_query .= " LIMIT {$startRecord}, {$recordCount}";
         $resultAllCRMIDlist_query = $adb->pquery($list_query, array());
         $navigationRecordList = array();
         while ($forAllCRMID = $adb->fetch_array($resultAllCRMIDlist_query)) {
             $navigationRecordList[] = $forAllCRMID[$instance->table_index];
         }
         $pageCount = 0;
         $current = $start;
         if ($start == 1) {
             $firstPageRecordCount = $list_max_entries_per_page;
         } else {
             $firstPageRecordCount = $bufferRecordCount;
             $current -= 1;
         }
         $searchKey = array_search($currentRecordId, $navigationRecordList);
         $recordNavigationInfo = array();
         if ($searchKey !== false) {
             foreach ($navigationRecordList as $index => $recordId) {
                 if (!is_array($recordNavigationInfo[$current])) {
                     $recordNavigationInfo[$current] = array();
                 }
                 if ($index == $firstPageRecordCount || $index == $firstPageRecordCount + $pageCount * $list_max_entries_per_page) {
                     $current++;
//.........这里部分代码省略.........
开发者ID:kduqi,项目名称:corebos,代码行数:101,代码来源:ListViewSession.php


示例7: export

/**
 * This function exports all the data for a given module
 * Param $type - module name
 * Return type text
 */
function export($type)
{
    global $log, $list_max_entries_per_page;
    $log->debug("Entering export(" . $type . ") method ...");
    global $adb;
    $focus = 0;
    $content = '';
    if ($type != "") {
        // vtlib customization: Hook to dynamically include required module file.
        // Refer to the logic in setting $currentModule in index.php
        $focus = CRMEntity::getInstance($type);
    }
    $log = LoggerManager::getLogger('export_' . $type);
    $db = PearDatabase::getInstance();
    $oCustomView = new CustomView("{$type}");
    $viewid = $oCustomView->getViewId("{$type}");
    $sorder = $focus->getSortOrder();
    $order_by = $focus->getOrderBy();
    $search_type = $_REQUEST['search_type'];
    $export_data = $_REQUEST['export_data'];
    if (isset($_SESSION['export_where']) && $_SESSION['export_where'] != '' && $search_type == 'includesearch') {
        $where = $_SESSION['export_where'];
    }
    $query = $focus->create_export_query($where);
    if ($search_type != 'includesearch' && $type != 'Calendar') {
        $stdfiltersql = $oCustomView->getCVStdFilterSQL($viewid);
        $advfiltersql = $oCustomView->getCVAdvFilterSQL($viewid);
        if (isset($stdfiltersql) && $stdfiltersql != '') {
            $query .= ' and ' . $stdfiltersql;
        }
        if (isset($advfiltersql) && $advfiltersql != '') {
            $query .= ' and ' . $advfiltersql;
        }
    }
    $params = array();
    if (($search_type == 'withoutsearch' || $search_type == 'includesearch') && $export_data == 'selecteddata') {
        $idstring = explode(";", $_REQUEST['idstring']);
        if ($type == 'Accounts' && count($idstring) > 0) {
            $query .= ' and vtiger_account.accountid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Contacts' && count($idstring) > 0) {
            $query .= ' and vtiger_contactdetails.contactid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Potentials' && count($idstring) > 0) {
            $query .= ' and vtiger_potential.potentialid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Leads' && count($idstring) > 0) {
            $query .= ' and vtiger_leaddetails.leadid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Products' && count($idstring) > 0) {
            $query .= ' and vtiger_products.productid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Documents' && count($idstring) > 0) {
            $query .= ' and vtiger_notes.notesid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'HelpDesk' && count($idstring) > 0) {
            $query .= ' and vtiger_troubletickets.ticketid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } elseif ($type == 'Vendors' && count($idstring) > 0) {
            $query .= ' and vtiger_vendor.vendorid in (' . generateQuestionMarks($idstring) . ')';
            array_push($params, $idstring);
        } else {
            if (count($idstring) > 0) {
                // vtlib customization: Hook to make the export feature available for custom modules.
                $query .= " and {$focus->table_name}.{$focus->table_index} in (" . generateQuestionMarks($idstring) . ')';
                array_push($params, $idstring);
                // END
            }
        }
    }
    if (isset($order_by) && $order_by != '') {
        if ($order_by == 'smownerid') {
            $query .= ' ORDER BY user_name ' . $sorder;
        } elseif ($order_by == 'lastname' && $type == 'Documents') {
            $query .= ' ORDER BY vtiger_contactdetails.lastname  ' . $sorder;
        } elseif ($order_by == 'crmid' && $type == 'HelpDesk') {
            $query .= ' ORDER BY vtiger_troubletickets.ticketid  ' . $sorder;
        } else {
            $tablename = getTableNameForField($type, $order_by);
            $tablename = $tablename != '' ? $tablename . "." : '';
            if ($adb->dbType == "pgsql") {
                $query .= ' GROUP BY ' . $tablename . $order_by;
            }
            $query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
        }
    }
    if ($export_data == 'currentpage') {
        $current_page = ListViewSession::getCurrentPage($type, $viewid);
        $limit_start_rec = ($current_page - 1) * $list_max_entries_per_page;
        if ($limit_start_rec < 0) {
            $limit_start_rec = 0;
        }
        $query .= ' LIMIT ' . $limit_start_rec . ',' . $list_max_entries_per_page;
    }
    $result = $adb->pquery($query, $params, true, "Error exporting {$type}: " . "<BR>{$query}");
//.........这里部分代码省略.........
开发者ID:nvh3010,项目名称:quancrm,代码行数:101,代码来源:export.php


示例8: getNavigationValues

$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $query = fixPostgresQuery($query, $log, 0);
}
// Setting the record count string
//modified by rdhital
$start_rec = $navigation_array['start'];
$end_rec = $navigation_array['end_val'];
//By raju Ends
//limiting the query
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        $query_order_by = 'user_name';
    } else {
        $tablename = getTableNameForField('Notes', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        $query_order_by = $tablename . $order_by;
    }
}
if ($start_rec == 0) {
    $limit_start_rec = 0;
} else {
    $limit_start_rec = $start_rec - 1;
}
$list_result = $adb->limitQuery2($query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
$record_string = $app_strings["LBL_SHOWING"] . " " . $start_rec . " - " . $end_rec . " " . $app_strings["LBL_LIST_OF"] . " " . $noofrows;
//Retreive the List View Table Header
if ($viewid != '') {
    $url_string .= "&viewname=" . $viewid;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:ListView.php


示例9: elseif

        $list_query .= " AND vtiger_potential.sales_stage = '" . $mod_strings['Closed Won'] . "' AND " . $where;
    } elseif (isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true') {
        $list_query .= " AND vtiger_potential.sales_stage not in( '" . $mod_strings['Closed Won'] . "' , '" . $mod_strings['Closed Lost'] . "' )AND " . $where;
    }
    $_SESSION['export_where'] = $where;
} else {
    unset($_SESSION['export_where']);
}
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        if ($adb->dbType == "pgsql") {
            $list_query .= ' GROUP BY user_name';
        }
        $list_query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField('Potentials', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($adb->dbType == "pgsql") {
            $list_query .= ' GROUP BY ' . $tablename . $order_by;
        }
        $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
if ($viewid == 0) {
    echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
    echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'><span clas\n\t\ts='genHeaderSmall'>{$app_strings['LBL_PERMISSION']}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\n\t\t</td>\n\t\t</tr>\n\t\t</tbody></table>\n\t\t</div>";
    echo "</td></tr></table>";
    exit;
}
//Constructing the list view
$smarty->assign("MOD", $mod_strings);
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:ListView.php


示例10: in

    $list_query .= " AND vtiger_seactivityrel.crmid in (select contactid from vtiger_contactdetails) AND vtiger_emaildetails.email_flag !='WEBMAIL'";
}
if ($_REQUEST['folderid'] == '3') {
    $list_query .= " AND vtiger_seactivityrel.crmid in (select accountid from vtiger_account)";
}
if ($_REQUEST['folderid'] == '4') {
    $list_query .= " AND vtiger_seactivityrel.crmid in (select leadid from vtiger_leaddetails)";
}
if ($_REQUEST['folderid'] == '5') {
    $list_query .= " AND vtiger_salesmanactivityrel.smid in (select id from vtiger_users)";
}
if ($_REQUEST['folderid'] == '6') {
    $list_query .= " AND vtiger_emaildetails.email_flag ='WEBMAIL'";
}
if (isset($order_by) && $order_by != '') {
    $tablename = getTableNameForField('Emails', $order_by);
    $tablename = $tablename != '' ? $tablename . "." : '';
    $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
$list_result = $adb->query($list_query);
//Constructing the list view
$smarty->assign("CUSTOMVIEW_OPTION", $customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("SINGLE_MOD", 'Email');
$smarty->assign("BUTTONS", $other_text);
$category = getParentTab();
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php


示例11: getSearchURL

$url_string = '';
if ($_REQUEST['query'] == 'true') {
    $queryGenerator->addUserSearchConditions($_REQUEST);
    $ustring = getSearchURL($_REQUEST);
    $url_string .= "&query=true{$ustring}";
    $smarty->assign('SEARCH_URL', $url_string);
}
$query = $queryGenerator->getQuery();
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        if ($adb->dbType == "pgsql") {
            $query .= ' GROUP BY user_name';
        }
        $query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField('PurchaseOrder', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($adb->dbType == "pgsql") {
            $query .= ' GROUP BY ' . $tablename . $order_by;
        }
        $query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $query = fixPostgresQuery($query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php


示例12: and

    if (isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true') {
        $list_query .= " and (vtiger_troubletickets.status!='Closed' or vtiger_troubletickets.status is null) and " . $where;
    }
    $_SESSION['export_where'] = $where;
} else {
    unset($_SESSION['export_where']);
}
//sort by "assignedto" and default sort by "ticketid"(DESC)
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        if ($adb->dbType == "pgsql") {
            $list_query .= ' GROUP BY vtiger_users.user_name';
        }
        $list_query .= " ORDER BY case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end " . $sorder;
    } else {
        $tablename = getTableNameForField('HelpDesk', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($adb->dbType == "pgsql") {
            $list_query .= ' GROUP BY ' . $tablename . $order_by;
        }
        $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
} else {
    if ($adb->dbType == "pgsql") {
        $list_query .= ' GROUP BY vtiger_troubletickets.ticketid';
    }
    $list_query .= ' ORDER BY vtiger_troubletickets.ticketid DESC';
}
//Constructing the list view
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:ListView.php


示例13: getListQuery

    $smarty->assign("ALL", 'All');
}
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
    $listquery = getListQuery("PriceBooks");
    $list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "PriceBooks");
} else {
    $list_query = getListQuery("PriceBooks");
}
//<<<<<<<<customview>>>>>>>>>
if (isset($where) && $where != '') {
    $list_query .= ' and ' . $where;
}
if (isset($order_by) && $order_by != '') {
    $tablename = getTableNameForField('PriceBooks', $order_by);
    $tablename = $tablename != '' ? $tablename . "." : '';
    if ($adb->dbType == "pgsql") {
        $list_query .= ' GROUP BY ' . $tablename . $order_by;
    }
    $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
}
///Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $list_query = fixPostgresQuery($list_query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($list_query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
    $noofrows = null;
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:31,代码来源:ListView.php


示例14: unset

    $url_string .= "&query=true" . $ustring;
    $log->info("Here is the where clause for the list view: {$where}");
    $smarty->assign("SEARCH_URL", $url_string);
}
$query = $queryGenerator->getQuery();
$where = $queryGenerator->getConditionalWhere();
if (isset($where) && $where != '') {
    $_SESSION['export_where'] = $where;
} else {
    unset($_SESSION['export_where']);
}
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        $query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField('Leads', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($adb->dbType == "pgsql") {
            $query .= ' GROUP BY ' . $tablename . $order_by;
        }
        $query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
    }
}
//Postgres 8 fixes
if ($adb->dbType == "pgsql") {
    $query = fixPostgresQuery($query, $log, 0);
}
if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
    $count_result = $adb->query(mkCountQuery($query));
    $noofrows = $adb->query_result($count_result, 0, "count");
} else {
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php


示例15: date

        $list_query .= " AND " . $where;
    }
}
if (isset($_REQUEST['from_homepage'])) {
    $today = date("Y-m-d", time());
    if ($_REQUEST['from_homepage'] == 'upcoming_activities') {
        $list_query .= " AND (vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus not in ('Held','Not Held')) AND (date_start >= '{$today}' OR vtiger_recurringevents.recurringdate >= '{$today}')";
    } elseif ($_REQUEST['from_homepage'] == 'pending_activities') {
        $list_query .= " AND (vtiger_activity.status is NULL OR vtiger_activity.status not in ('Completed','Deferred')) and (vtiger_activity.eventstatus is NULL OR  vtiger_activity.eventstatus not in ('Held','Not Held')) AND (due_date <= '{$today}' OR vtiger_recurringevents.recurringdate <= '{$today}')";
    }
}
if (isset($order_by) && $order_by != '') {
    if ($order_by == 'smownerid') {
        $list_query .= ' ORDER BY user_name ' . $sorder;
    } else {
        $tablename = getTableNameForField('Calendar', $order_by);
        $tablename = $tablename != '' ? $tablename . "." : '';
        if ($order_by == 'lastname') {
            $list_query .= ' ORDER BY vtiger_contactdetails.lastname ' . $sorder;
        } else {
            $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder;
        }
    }
}
//Constructing the list view
$smarty->assign("CUSTOMVIEW_OPTION", $customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:ListView.php


示例16: GetRelatedListBase

/** Function to get related list entries in detailed array format
 * @param $module -- modulename:: Type string
 * @param $relatedmodule -- relatedmodule:: Type string
 * @param $focus -- focus:: Type object
 * @param $query -- query:: Type string
 * @param $button -- buttons:: Type string
 * @param $returnset -- returnset:: Type string
 * @param $id -- id:: Type string
 * @param $edit_val -- edit value:: Type string
 * @param $del_val -- delete value:: Type string
 * @returns $related_entries -- related entires:: Type string array
 */
function GetRelatedListBase($module, $relatedmodule, $focus, $query, $button, $returnset, $id = '', $edit_val = '', $del_val = '', $skipActions = false)
{
    $log = LoggerManager::getLogger('account_list');
    $log->debug("Entering GetRelatedList(" . $module . "," . $relatedmodule . "," . get_class($focus) . "," . $query . "," . $button . "," . $returnset . "," . $edit_val . "," . $del_val . ") method ...");
    require_once 'Smarty_setup.php';
    require_once "data/Tracker.php";
    require_once 'include/database/PearDatabase.php';
    global $adb, $app_strings, $current_language;
    $current_module_strings = return_module_language($current_language, $module);
    global $list_max_entries_per_page, $urlPrefix, $currentModule, $theme, $theme_path, $theme_path, $mod_strings;
    $smarty = new vtigerCRM_Smarty();
    if (!isset($where)) {
        $where = "";
    }
    $button = '<table cellspacing=0 cellpadding=2><tr><td>' . $button . '</td></tr></table>';
    // Added to have Purchase Order as form Title
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $smarty->assign("MOD", $mod_strings);
    $smarty->assign("APP", $app_strings);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE", $relatedmodule);
    // We do not have RelatedListView in Detail View mode of Calendar module. So need to skip it.
    if ($module != 'Calendar') {
        $focus->initSortByField($relatedmodule);
    }
    //Retreive the list from Database
    //Appending the security parameter Security fix by Don
    if ($relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors' && $relatedmodule != 'Users') {
        global $current_user;
        $secQuery = getNonAdminAccessControlQuery($relatedmodule, $current_user);
        if (strlen($secQuery) > 1) {
            $query = appendFromClauseToQuery($query, $secQuery);
        }
    }
    if ($relatedmodule == 'Leads') {
        $query .= " AND vtiger_leaddetails.converted = 0";
    }
    if (isset($where) && $where != '') {
        $query .= ' and ' . $where;
    }
    if (!$_SESSION['rlvs'][$module][$relatedmodule]) {
        $modObj = new ListViewSession();
        $modObj->sortby = $focus->default_order_by;
        $modObj->sorder = $focus->default_sort_order;
        $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj);
    }
    if (!empty($_REQUEST['order_by'])) {
        if (method_exists($focus, getSortOrder)) {
            $sorder = $focus->getSortOrder();
        }
        if (method_exists($focus, getOrderBy)) {
            $order_by = $focus->getOrderBy();
        }
        if (isset($order_by) && $order_by != '') {
            $_SESSION['rlvs'][$module][$relatedmodule]['sorder'] = $sorder;
            $_SESSION['rlvs'][$module][$relatedmodule]['sortby'] = $order_by;
        }
    } elseif ($_SESSION['rlvs'][$module][$relatedmodule]) {
        $sorder = $_SESSION['rlvs'][$module][$relatedmodule]['sorder'];
        $order_by = $_SESSION['rlvs'][$module][$relatedmodule]['sortby'];
    } else {
        $order_by = $focus->default_order_by;
        $sorder = $focus->default_sort_order;
    }
    //Added by Don for AssignedTo ordering issue in Related Lists
    $query_order_by = $order_by;
    if ($order_by == 'smownerid') {
        $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
        $query_order_by = "case when (vtiger_users.user_name not like '') then {$userNameSql} else vtiger_groups.groupname end ";
    } elseif ($order_by != 'crmid' && !empty($order_by)) {
        $tabname = getTableNameForField($relatedmodule, $order_by);
        if ($tabname !== '' and $tabname != NULL) {
            $query_order_by = $tabname . "." . $query_order_by;
        }
    }
    if (!empty($query_order_by)) {
        $query .= ' ORDER BY ' . $query_order_by . ' ' . $sorder;
    }
    if ($relatedmodule == 'Calendar') {
        $mod_listquery = "activity_listquery";
    } else {
        $mod_listquery = strtolower($relatedmodule) . "_listquery";
    }
    $_SESSION[$mod_listquery] = $query;
    $url_qry = "&order_by=" . $order_by . "&sorder=" . $sorder;
    $computeCount = isset($_REQUEST['withCount']) ? $_REQUEST['withCount'] : '';
//.........这里部分代码省略.........
开发者ID:kikojover,项目名称:corebos,代码行数:101,代码来源:RelatedListView.php


示例17: GetRelatedList

/** Function to get related list entries in detailed array format
 * @param $module -- modulename:: Type string
 * @param $relatedmodule -- relatedmodule:: Type string
 * @param $focus -- focus:: Type object
 * @param $query -- query:: Type string
 * @param $button -- buttons:: Type string
 * @param $returnset -- returnset:: Type string
 * @param $id -- id:: Type string
 * @param $edit_val -- edit value:: Type string
 * @param $del_val -- delete value:: Type string
 * @returns $related_entries -- related entires:: Type string array
 *
 */
function GetRelatedList($module, $relatedmodule, $focus, $query, $button, $returnset, $id = '', $edit_val = '', $del_val = '')
{
    $log = LoggerManager::getLogger('account_list');
    $log->debug("Entering GetRelatedList(" . $module . "," . $relatedmodule . "," . get_class($focus) . "," . $query . "," . $button . "," . $returnset . "," . $edit_val . "," . $del_val . ") method ...");
    require_once 'Smarty_setup.php';
    require_once "data/Tracker.php";
    require_once 'include/database/PearDatabase.php';
    global $adb;
    global $app_strings;
    global $current_language;
    $current_module_strings = return_module_language($current_language, $module);
    global $list_max_entries_per_page;
    global $urlPrefix;
    global $currentModule;
    global $theme;
    global $theme_path;
    global $theme_path;
    global $mod_strings;
    // focus_list is the means of passing data to a ListView.
    global $focus_list;
    $smarty = new vtigerCRM_Smarty();
    if (!isset($where)) {
        $where = "";
    }
    $button = '<table cellspacing=0 cellpadding=2><tr><td>' . $button . '</td></tr></table>';
    // Added to have Purchase Order as form Title
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $smarty->assign("MOD", $mod_strings);
    $smarty->assign("APP", $app_strings);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE", $relatedmodule);
    // We do not have RelatedListView in Detail View mode of Calendar module. So need to skip it.
    if ($module != 'Calendar') {
        $focus->initSortByField($relatedmodule);
    }
    //Retreive the list from Database
    //Appending the security parameter
    if ($relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors') {
        global $current_user;
        require 'user_privileges/user_privileges_' . $current_user->id . '.php';
        require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
        $tab_id = getTabid($relatedmodule);
        if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) {
            $sec_parameter = getListViewSecurityParameter($relatedmodule);
            $query .= ' ' . $sec_parameter;
        }
    }
    if ($relatedmodule == 'Leads') {
        $query .= " AND vtiger_leaddetails.converted = 0";
    }
    if (isset($where) && $where != '') {
        $query .= ' and ' . $where;
    }
    if (!$_SESSION['rlvs'][$module][$relatedmodule]) {
        $modObj = new ListViewSession();
        $modObj->sortby = $focus->default_order_by;
        $modObj->sorder = $focus->default_sort_order;
        $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj);
    }
    if (isset($_REQUEST['relmodule']) && $_REQUEST['relmodule'] == $relatedmodule) {
        if (method_exists($focus, getSortOrder)) {
  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getTableNameForForeignKeyField函数代码示例发布时间:2022-05-15
下一篇:
PHP getTableList函数代码示例发布时间: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