当前位置: 首页>>代码示例>>PHP>>正文


PHP CustomView::getExportModifiedCvListQuery方法代码示例

本文整理汇总了PHP中CustomView::getExportModifiedCvListQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomView::getExportModifiedCvListQuery方法的具体用法?PHP CustomView::getExportModifiedCvListQuery怎么用?PHP CustomView::getExportModifiedCvListQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomView的用法示例。


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

示例1: export_all

function export_all($type)
{
    global $log, $list_max_entries_per_page;
    $log->debug("Entering export_all(" . $type . ") method ...");
    global $adb;
    $focus = 0;
    $content = '';
    if ($type != "") {
        //changed by dingjianting on 2009-2-15 for supporting new module
        require_once "modules/{$type}/{$type}.php";
        $focus = new $type();
    }
    $log = LoggerManager::getLogger('export_' . $type);
    $where = '';
    /*
    
    if ( isset($_REQUEST['all']) )
    {
    	$where = '';
    }
    else
    {
    	$where = $_SESSION['export_where'];
    }
    */
    if (!isset($_REQUEST['allids']) || $_REQUEST['allids'] == "") {
        $where = "";
    } else {
        $allids = str_replace(";", ",", $_REQUEST['allids']);
        $allids = substr($allids, 0, -1);
        $where = $crmid . " in (" . $allids . ")";
    }
    $search_type = $_REQUEST['search_type'];
    $export_data = $_REQUEST['export_data'];
    $viewname = $_REQUEST['viewname'];
    $entityArr = getEntityTable($type);
    $ec_crmentity = $entityArr["tablename"];
    $entityidfield = $entityArr["entityidfield"];
    $crmid = $ec_crmentity . "." . $entityidfield;
    $order_by = "";
    $query = $focus->create_export_query($order_by, $where);
    if (isset($_SESSION['export_where']) && $_SESSION['export_where'] != '' && $search_type == 'includesearch') {
        $where = $_SESSION['export_where'];
        $query .= ' and  (' . $where . ') ';
    }
    if (($search_type == 'withoutsearch' || $search_type == 'includesearch') && $export_data == 'selecteddata') {
        $idstring = str_replace(";", ",", $_REQUEST['idstring']);
        $idstring = substr($idstring, 0, -1);
        if ($idstring != "") {
            $query .= ' and ' . $crmid . ' in (' . $idstring . ')';
        }
    }
    if ($export_data == 'vieweddata' && $viewname != "" && $viewname != 0) {
        $oCustomView = new CustomView($type);
        if ($type == "SalesOrder" || $type == "PurchaseOrder") {
            $query = $oCustomView->getExportModifiedCvListQuery($viewname, $query, $type, true);
            //getModifiedCvListQuery
        } else {
            $query = $oCustomView->getExportModifiedCvListQuery($viewname, $query, $type, false);
            //getModifiedCvListQuery
        }
    }
    if (isset($_SESSION['nav_start']) && $_SESSION['nav_start'] != '' && $export_data == 'currentpage') {
        $start_rec = $_SESSION['nav_start'];
        $limit_start_rec = $start_rec == 0 ? 0 : $start_rec - 1;
        $query_order_by = $crmid;
        $sorder = "desc";
        $result = $adb->limitQuery2($query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder);
    } else {
        $query .= " order by " . $crmid . " desc";
        $result = $adb->query($query, true, "Error exporting {$type}: " . "<BR>{$query}");
    }
    $numRows = $adb->num_rows($result);
    $fields_array = $adb->getFieldsArray($result);
    global $current_language;
    $spec_mod_strings = return_specified_module_language($current_language, $type);
    foreach ($fields_array as $key => $fieldlabel) {
        if (isset($spec_mod_strings[$fieldlabel])) {
            $fields_array[$key] = $spec_mod_strings[$fieldlabel];
        }
    }
    $header = implode("\",\"", array_values($fields_array));
    $header = "\"" . $header;
    $header .= "\"\r\n";
    $content .= $header;
    $column_list = implode(",", array_values($fields_array));
    while ($val = $adb->fetchByAssoc($result, -1, false)) {
        $new_arr = array();
        foreach ($val as $key => $value) {
            if ($key == "description") {
                $value = br2nl_vt($value);
            }
            array_push($new_arr, preg_replace("/\"/", "\"\"", $value));
        }
        $line = implode("\",\"", $new_arr);
        $line = "\"" . $line;
        $line .= "\"\r\n";
        $content .= $line;
    }
    $log->debug("Exiting export_all method ...");
//.........这里部分代码省略.........
开发者ID:honj51,项目名称:taobaocrm,代码行数:101,代码来源:export.php


注:本文中的CustomView::getExportModifiedCvListQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。