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


PHP astercrm::getAllSpeedDialRecords方法代码示例

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


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

示例1: init

/**
*  init page
*  @return object xajax response object
*/
function init($username = "", $passwd = "", $lang = 'en_US')
{
    global $config, $db;
    //echo $username.$passwd.$lang;exit;
    //if($_SESSION['curuser']['username'] != $username){
    $row = astercrm::getRecordByField("username", $username, "astercrm_account");
    if ($row['id'] != '') {
        if (md5($row['password']) == $passwd) {
            $_SESSION = array();
            $_SESSION['curuser']['username'] = trim($username);
            $_SESSION['curuser']['extension'] = $row['extension'];
            $_SESSION['curuser']['usertype'] = $row['usertype'];
            $_SESSION['curuser']['accountcode'] = $row['accountcode'];
            $_SESSION['curuser']['agent'] = $row['agent'];
            $_SESSION['curuser']['extensions'] = array();
            // added by solo 2007-10-90
            $_SESSION['curuser']['channel'] = $row['channel'];
            $_SESSION['curuser']['groupid'] = $row['groupid'];
            if ($row['extensions'] != '') {
                $_SESSION['curuser']['extensions'] = split(',', $row['extensions']);
            }
        }
    }
    //}
    //echo $lang;exit;
    list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $lang);
    //echo $_SESSION['curuser']['language'];exit;
    $locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'portal');
    //echo $locate->Translate("Search");exit;
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("username", "value", $_SESSION['curuser']['username']);
    $objResponse->addAssign("extension", "value", $_SESSION['curuser']['extension']);
    $objResponse->addAssign("myevents", "innerHTML", $locate->Translate("extension") . $_SESSION['curuser']['extension'] . "-" . $locate->Translate("waiting"));
    $objResponse->addAssign("btnShowPortal", "value", $locate->Translate("portal"));
    $objResponse->addAssign("btnTransfer", "value", $locate->Translate("Transfer"));
    $objResponse->addAssign("btnSearchContact", "value", $locate->Translate("Search"));
    $objResponse->addAssign("spanMonitor", "innerHTML", $locate->Translate("monitor"));
    $objResponse->addAssign("extensionStatus", "value", 'idle');
    $objResponse->addAssign("spanMonitorStatus", "innerHTML", $locate->Translate("idle"));
    $objResponse->addAssign("btnMonitorStatus", "value", "idle");
    $objResponse->addAssign("btnMonitor", "value", $locate->Translate("start_record"));
    $objResponse->addAssign("btnMonitor", "disabled", true);
    $objResponse->addAssign("btnCallCtrl", "value", $locate->Translate("Dial"));
    $objResponse->addAssign("btnTransfer", "disabled", true);
    foreach ($_SESSION['curuser']['extensions'] as $extension) {
        $extension = trim($extension);
        $row = astercrm::getRecordByField('username', $extension, 'astercrm_account');
        $objResponse->addScript("addOption('sltExten','" . $row['extension'] . "','{$extension}');");
    }
    $speeddial =& astercrm::getAllSpeedDialRecords();
    $speednumber['0']['number'] = $_SESSION['curuser']['extension'];
    $speednumber['0']['description'] = $_SESSION['curuser']['username'];
    $n = 1;
    while ($speeddial->fetchInto($row)) {
        // Change here by the name of fields of its database table
        $speednumber[$n]['description'] = $row['description'];
        $speednumber[$n]['number'] = $row['number'];
        $n++;
    }
    $n = count($speednumber);
    for ($i = 0; $i < $n; ++$i) {
        $objResponse->addScript("addOption('iptDestNumber','" . $speednumber[$i]['number'] . "','" . $speednumber[$i]['description'] . "');");
    }
    $panelHTML = '<a href=? onclick="xajax_showRecentCdr(\'\',\'recent\');return false;">' . $locate->Translate("recentCDR") . '</a>&nbsp;&nbsp;';
    if ($_SESSION['curuser']['usertype'] != "agent") {
        $panelHTML .= '<a href=# onclick="this.href=\'managerportal.php\'">' . $locate->Translate("manager") . '</a>&nbsp;&nbsp;';
    }
    if ($config['system']['enable_external_crm'] == false) {
        //use internal crm
        $objResponse->addIncludeScript("js/astercrm.js");
        $objResponse->addIncludeScript("js/ajax.js");
        $objResponse->addIncludeScript("js/ajax-dynamic-list.js");
        $objResponse->addAssign("divSearchContact", "style.visibility", "visible");
    } else {
        $objResponse->addIncludeScript("js/extercrm.js");
        if ($config['system']['open_new_window'] == false) {
            $mycrm = '<iframe id="mycrm" name="mycrm" src="' . $config['system']['external_crm_default_url'] . '" width="100%"  frameBorder=0 scrolling=auto height="100%"></iframe>';
            $objResponse->addAssign("divCrm", "innerHTML", $mycrm);
        } else {
            $javascript = "openwindow('" . $config['system']['external_crm_default_url'] . "')";
            $objResponse->addScript($javascript);
        }
    }
    $monitorstatus = astercrm::getRecordByID($_SESSION['curuser']['groupid'], 'astercrm_accountgroup');
    if ($monitorstatus['monitorforce']) {
        $objResponse->addAssign("chkMonitor", "checked", 'true');
        $objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
        $objResponse->addAssign("btnMonitor", "disabled", 'true');
    }
    $objResponse->addAssign("divSearchContact", "style.visibility", "visible");
    //if enabled monitor by astercctools
    Common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
    if ($asterccConfig['system']['force_record'] == 1) {
        $objResponse->addAssign("chkMonitor", "checked", 'false');
        $objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
        $objResponse->addAssign("btnMonitor", "disabled", 'true');
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:astercrmclient.server.php


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