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


PHP astercrm::insertNewCustomerLead方法代码示例

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


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

示例1: save


//.........这里部分代码省略.........
            }
        } else {
            $respOk = $f['customerid'];
        }
        $customerID = $respOk;
    }
    if (empty($f['contact'])) {
        $contactID = 0;
    } else {
        if ($f['contactid'] == '') {
            if ($config['system']['allow_same_data'] == false) {
                //检查是否有完全匹配的contact记录
                $contact = Customer::checkValues("contact", "contact", $f['contact'], "string", "customerid", $customerID, "int");
            } else {
                $contact = '';
            }
            //有完全匹配的话就取这个contactid
            if ($contact != '') {
                $respOk = $contact;
                $objResponse->addAlert($locate->Translate("found_contact_replaced"));
            } else {
                $respOk = Customer::insertNewContact($f, $customerID);
                // insert a new contact record
                if (!$respOk) {
                    $objResponse->addAlert($locate->Translate("contact_add_error"));
                    return $objResponse;
                }
                $objResponse->addAlert($locate->Translate("a_new_contact_added"));
            }
        } else {
            $respOk = $f['contactid'];
            $res =& Customer::getContactByID($respOk);
            if ($res) {
                $contactCustomerID = $res['customerid'];
                if ($contactCustomerID == 0 && $customerID == 0) {
                } else {
                    $res =& Customer::updateField('contact', 'customerid', $customerID, $f['contactid']);
                    if ($res) {
                        $objResponse->addAlert($locate->Translate("a_contact_binding"));
                    }
                }
            }
        }
        $contactID = $respOk;
    }
    if ($f['surveyoption'] != '' || $f['surveynote'] != '') {
        $respOk = Customer::insertNewSurveyResult($f['surveyid'], $f['surveyoption'], $f['surveynote'], $customerID, $contactID);
        $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("survey_added"));
    }
    $saveNote = '';
    if (!empty($f['note']) || !empty($f['note_code'])) {
        $saveNote = true;
        $respOk = Customer::insertNewNote($f, $customerID, $contactID);
        // add a new Note
        if ($respOk) {
            $html = createGrid(0, ROWSXPAGE);
            $objResponse->addAssign("grid", "innerHTML", $html);
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("a_new_note_added"));
        } else {
            $objResponse->addAlert($locate->Translate("note_add_error"));
            return $objResponse;
        }
    } else {
        $saveNote = false;
    }
    // 查看是否有scheduler call
    if ($f['addedSchedulerDialId'] != '') {
        $res = astercrm::updateAddedSchedulerDial($customerID, $f['addedSchedulerDialId']);
        $objResponse->addAssign("formdAddSechedualaraDiv", "style.visibility", "hidden");
        $objResponse->addAssign("formdAddSechedualaraDiv", "innerHTML", '');
    }
    /*if(empty($f['sDialNum'])) {
    
    	} else{
    		$f['customerid'] = $customerID;
    		$res = astercrm::insertNewSchedulerDial($f);
    		if ($res){
    			$objResponse->addAlert($locate->Translate("Scheduler Call added"));
    		}
    	}*/
    if ($f['customer_leads_check'] == 'on') {
        if ($customerID != '' && $customerID != 0) {
            astercrm::insertNewCustomerLead($customerID, $config['system']['customer_leads'], $saveNote);
        }
    }
    $objResponse->addAssign("formDiv", "style.visibility", "hidden");
    $objResponse->addAssign("formCustomerInfo", "style.visibility", "hidden");
    $objResponse->addAssign("formContactInfo", "style.visibility", "hidden");
    $objResponse->addAssign("formNoteInfo", "style.visibility", "hidden");
    $objResponse->addClear("formDiv", "innerHTML");
    $objResponse->addClear("formCustomerInfo", "innerHTML");
    $objResponse->addClear("formContactInfo", "innerHTML");
    $objResponse->addClear("formNoteInfo", "innerHTML");
    $objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
    if ($chtml != '') {
        $objResponse->addAssign("formCustomerInfo", "style.visibility", "visible");
        $objResponse->addAssign("formCustomerInfo", "innerHTML", $chtml);
    }
    return $objResponse->getXML();
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:astercrm.server.common.php

示例2: customerLeadsAction

function customerLeadsAction($leadType, $f, $searchFormValue)
{
    $objResponse = new xajaxResponse();
    if (is_array($f['ckb'])) {
        foreach ($f['ckb'] as $vaule) {
            $res_contact = astercrm::insertNewCustomerLead($vaule, $leadType, true);
        }
    }
    $searchContent = $searchFormValue['searchContent'];
    //搜索内容 数组
    $searchField = $searchFormValue['searchField'];
    //搜索条件 数组
    $numRows = $searchFormValue['numRows'];
    $limit = $searchFormValue['limit'];
    $html = createGrid($numRows, $limit, $searchField, $searchContent, '', 'grid');
    $objResponse->addAssign('grid', "innerHTML", $html);
    return $objResponse->getXML();
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:18,代码来源:customer.server.php


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