本文整理汇总了PHP中astercrm::getGroupMemberListByID方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getGroupMemberListByID方法的具体用法?PHP astercrm::getGroupMemberListByID怎么用?PHP astercrm::getGroupMemberListByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getGroupMemberListByID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
global $locate;
$objResponse = new xajaxResponse();
$peers = array();
if ($_SESSION['curuser']['usertype'] == 'admin') {
// set all group first
$group = astercrm::getAll('astercrm_accountgroup');
$objResponse->addScript("addOption('groupid',0,'" . $locate->Translate("All") . "');");
while ($group->fetchInto($row)) {
$objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
}
} else {
// set one group
$objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . "" . "');");
// set all account
$account = astercrm::getGroupMemberListByID($_SESSION['curuser']['groupid']);
$objResponse->addScript("addOption('accountid','" . "0" . "','" . "All" . "');");
while ($account->fetchInto($row)) {
$objResponse->addScript("addOption('accountid','" . $row['id'] . "','" . $row['username'] . "');");
}
}
$objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language']));
$objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
return $objResponse;
}
示例2: update
/**
* update account record
* @param f array account record
* @return objResponse object xajax response object
*/
function update($f)
{
global $locate, $db;
$objResponse = new xajaxResponse();
$f['extension'] = strtolower($f['extension']);
$f['agent'] = strtolower($f['agent']);
$f['channel'] = strtolower($f['channel']);
if (trim($f['username']) == '' || trim($f['password']) == '' || trim($f['extension']) == '' || trim($f['usertype']) == '' || trim($f['firstname']) == '' || trim($f['lastname']) == '') {
$objResponse->addAlert($locate->Translate("obligatory_fields"));
return $objResponse->getXML();
}
if (trim($f['usertype']) != 'admin' && trim($f['groupid']) == '') {
$objResponse->addAlert($locate->Translate("please add group first"));
return $objResponse->getXML();
}
$username = $f['username'];
$userid = astercrm::checkValues("astercrm_account", "username", $username);
if ($userid != '' && $userid != $f['id']) {
$objResponse->addAlert($locate->Translate("username_repeat"));
return $objResponse->getXML();
}
if ($f['extensions'] == $locate->translate('extensions_input_tip')) {
$f['extensions'] = '';
}
if ($f['extensions'] != "") {
$f['extensions'] = astercrm::dbcToSbc($f['extensions']);
$myExtensions = split(",", $f['extensions']);
if ($f['extensType'] != "username") {
foreach ($myExtensions as $exten) {
$sqlStr .= "OR extension = '{$exten}'";
}
$sqlStr = ltrim($sqlStr, "OR");
$query = "SELECT username From astercrm_account WHERE {$sqlStr}";
astercrm::events($query);
$res =& $db->query($query);
$myExtensions = array();
while ($res->fetchInto($row)) {
$myExtensions[] = $row['username'];
$newextensions .= "," . $row['username'];
}
$f['extensions'] = ltrim($newextensions, ',');
}
// check the assign username if belong to this group
if ($_SESSION['curuser']['usertype'] != 'admin') {
$myusernames = $myExtensions;
$newextensions = "";
$groupList = astercrm::getGroupMemberListByID($_SESSION['curuser']['groupid']);
while ($groupList->fetchInto($groupRow)) {
$memberNames[] = $groupRow['username'];
}
foreach ($myusernames as $myusername) {
if (in_array($myusername, $memberNames)) {
$newextensions .= ",{$myusername}";
}
}
$f['extensions'] = ltrim($newextensions, ',');
}
}
if ($f['usertype'] == 'admin') {
$f['groupid'] = 0;
}
// check over
$respOk = Customer::updateAccountRecord($f);
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("update_rec"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_update"));
}
return $objResponse->getXML();
}
示例3: array
function &readReportAgent($groupid, $accountid, $sdate, $edate)
{
global $db;
$return_arr = array();
if ($_SESSION['curuser']['usertype'] == "admin") {
if (($groupid == '' || $groupid == 0) && ($accountid == '' || $accountid == 0)) {
$query = "SELECT COUNT(*) as recordNum, mycdr.astercrm_groupid,groupname FROM mycdr LEFT JOIN astercrm_accountgroup ON mycdr.astercrm_groupid = astercrm_accountgroup.id WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND mycdr.astercrm_groupid > 0 ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds ,mycdr.astercrm_groupid FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND mycdr.astercrm_groupid > 0 AND billsec > 0";
$query .= " GROUP BY mycdr.astercrm_groupid ";
$query_a .= " GROUP BY mycdr.astercrm_groupid ";
$all_res =& $db->query($query);
$return_arr['type'] = 'grouplist';
while ($all_res->fetchinto($row)) {
$return_arr[$row['astercrm_groupid']]['recordNum'] = $row['recordNum'];
$return_arr[$row['astercrm_groupid']]['groupname'] = $row['groupname'];
$return_arr[$row['astercrm_groupid']]['arecordNum'] = 0;
$return_arr[$row['astercrm_groupid']]['seconds'] = 0;
}
$answer_res =& $db->query($query_a);
while ($answer_res->fetchinto($arow)) {
$return_arr[$arow['astercrm_groupid']]['arecordNum'] = $arow['arecordNum'];
$return_arr[$arow['astercrm_groupid']]['seconds'] = $arow['seconds'];
}
return $return_arr;
}
}
if (($groupid == '' || $groupid == 0) && ($accountid == '' || $accountid == 0) && $_SESSION['curuser']['usertype'] != "admin") {
$groupid = $_SESSION['curuser']['groupid'];
}
if (is_numeric($accountid) && $accountid > 0) {
$return_arr['type'] = 'agentlist';
$query = "SELECT COUNT(*) as recordNum FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND billsec > 0";
$query .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query_a .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query .= " AND accountid=" . $accountid;
$query_a .= " AND accountid=" . $accountid;
$all_count =& $db->getone($query);
$answer_row =& $db->getRow($query_a);
$account = astercrm::getRecordById($accountid, 'astercrm_account');
$return_arr[$accountid]['recordNum'] = $all_count;
$return_arr[$accountid]['username'] = $account['extension'];
$return_arr[$accountid]['name'] = $account['username'];
$return_arr[$accountid]['arecordNum'] = $answer_row['arecordNum'];
$return_arr[$accountid]['seconds'] = $answer_row['seconds'];
} else {
if (is_numeric($groupid)) {
if ($groupid > 0) {
$return_arr['type'] = 'agentlist';
$member = astercrm::getGroupMemberListByID($groupid);
while ($member->fetchinto($row)) {
$extens = '';
$channels = '';
$agents = '';
$query = "SELECT COUNT(*) as recordNum FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND billsec > 0";
$query .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query_a .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query .= " AND accountid=" . $row['id'];
$query_a .= " AND accountid=" . $row['id'];
$all_count =& $db->getone($query);
$answer_row =& $db->getRow($query_a);
$return_arr[$row['id']]['recordNum'] = $all_count;
$return_arr[$row['id']]['username'] = $row['extension'];
$return_arr[$row['id']]['name'] = $row['username'];
$return_arr[$row['id']]['arecordNum'] = $answer_row['arecordNum'];
$return_arr[$row['id']]['seconds'] = $answer_row['seconds'];
}
}
}
}
return $return_arr;
}
示例4: submitForm
//.........这里部分代码省略.........
if (!in_array('auto_increment', $type_arr)) {
if ($row['name'] == "creby" || $row['name'] == "cretime" || $row['name'] == "groupid" || $row['name'] == "campaignid") {
} else {
$tableStructure[] = $row;
}
}
}
//print_r($tableStructure);exit;
$filePath = $config['system']['upload_file_path'] . $fileName;
//数据文件存放路径
$affectRows = 0;
//计数据库影响结果变量
$x = 0;
//计数变量
$date = date('Y-m-d H:i:s');
//当前时间
$groupid = $aFormValues['groupid'];
$campaignid = $aFormValues['campaignid'];
if ($tableName == 'diallist') {
$aFormValues['chkAdd'] = '1';
foreach ($order as $key => $value) {
if ($value == '0') {
$aFormValues['dialListField'] = $key;
break;
}
}
//echo $aFormValues['dialListField'];exit;
if (!is_numeric($aFormValues['dialListField'])) {
$objResponse->addAlert($locate->Translate('must select a cloumn for dialnumer'));
return $objResponse;
}
}
if ($aFormValues['chkAdd'] != '' && $aFormValues['chkAdd'] == '1') {
//是否添加到拨号列表
$dialListField = trim($aFormValues['dialListField']);
//数字,得到将哪列添加到拨号列表
$dialListTime = trim($aFormValues['dialListTime']);
//数字,下拉列表选择将哪列做为dialtime添加到拨号列表
$dialTimeInput = trim($aFormValues['dialtime']);
//手动指定唯一的拨号时间组拨号列表
if ($aFormValues['chkAssign'] != '' && $aFormValues['chkAssign'] == '1') {
//是否添加分区assign
$tmpStr = trim($aFormValues['assign']);
//分区,以','号分隔的字符串
if ($tmpStr != '') {
$arryAssign = explode(',', $tmpStr);
//判断这些分机是否在该组管理范围内
if ($_SESSION['curuser']['usertype'] != 'admin') {
foreach ($arryAssign as $key => $myAssign) {
if (!in_array(trim($myAssign), $_SESSION['curuser']['memberExtens'])) {
//该组不包含该分机
unset($arryAssign[$key]);
}
}
}
//exit;
$assignNum = count($arryAssign);
//得到手动添加分区个数
//print_r($arryAssign);
//print $assignNum;
} else {
if ($_SESSION['curuser']['usertype'] == 'admin') {
$res = astercrm::getGroupMemberListByID($groupid);
while ($row = $res->fetchRow()) {
$arryAssign[] = $row['extension'];
//$array_extension数组,存放extension数据
}
$assignNum = count($arryAssign);
//extension数据的个数
} else {
$arryAssign = $_SESSION['curuser']['memberExtens'];
$assignNum = count($arryAssign);
//extension数据的个数
}
}
} else {
$arryAssign[] = '';
$assignNum = 0;
}
}
$x = 0;
$affectRows = importResource($filePath, $order, $tableName, $tableStructure, $dialListField, $dialListTime, $date, $groupid, $dialTimeInput, $assignNum, $arryAssign, $campaignid);
$tableAffectRows = $affectRows['table'];
$diallistAffectRows = $affectRows['diallist'];
if ($tableAffectRows < 0) {
$tableAffectRows = 0;
}
if ($diallistAffectRows < 0) {
$diallistAffectRows = 0;
}
$resultMsg = $tableName . ' : ' . $tableAffectRows . ' ' . $locate->Translate('records_inserted') . "<br>";
$resultMsg .= 'diallist : ' . $diallistAffectRows . ' ' . $locate->Translate('records_inserted');
//delete upload file
//@ unlink($filePath);
$objResponse->addAlert($locate->Translate('success'));
$objResponse->addScript("document.getElementById('btnImportData').disabled = false;");
$objResponse->addAssign("divResultMsg", "innerHTML", $resultMsg);
$objResponse->addScript("init();");
return $objResponse;
}
示例5: processAccountData
/**
* function to verify user data
*
* @param $aFormValues (array) login form data
$aFormValues['username']
$aFormValues['password']
$aFormValues['locate']
* @return $objResponse
* @session
$_SESSION['curuser']['username']
$_SESSION['curuser']['extension']
$_SESSION['curuser']['extensions']
$_SESSION['curuser']['country']
$_SESSION['curuser']['language']
$_SESSION['curuser']['channel']
$_SESSION['curuser']['accountcode']
*/
function processAccountData($aFormValues)
{
global $db, $locate, $config;
$objResponse = new xajaxResponse();
$bError = false;
$loginError = false;
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $aFormValues['locate']);
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'login');
/* check whether the pear had been installed */
$pear_exists_result = class_exists('PEAR');
if (empty($pear_exists_result)) {
$objResponse->addAlert($locate->Translate("Please install php pear"));
return $objResponse;
}
if (!$bError) {
//$query = "SELECT * FROM account WHERE username='" . $aFormValues['username'] . "'";
//$res = $db->query($query);
$row = astercrm::getRecordByField("username", $aFormValues['username'], "astercrm_account");
if ($row['id'] != '') {
if ($row['password'] == $aFormValues['password']) {
$identity = astercrm::calculateAgentOntime('login', trim($aFormValues['username']));
if ($identity) {
$update = astercrm::updateAgentOnlineTime('login', date('Y-m-d H:i:s'), $row['id']);
}
if ($aFormValues['rememberme'] == "forever") {
// set cookies for three years
setcookie("username", $aFormValues['username'], time() + 94608000);
setcookie("password", $aFormValues['password'], time() + 94608000);
setcookie("language", $aFormValues['locate'], time() + 94608000);
} else {
// destroy cookies
setcookie("username", "", time() - 3600);
setcookie("password", "", time() - 3600);
setcookie("language", "", time() - 3600);
$username = '';
$password = '';
$language = 'en_US';
$checked = false;
}
$_SESSION = array();
$_SESSION['curuser']['username'] = trim($aFormValues['username']);
$_SESSION['curuser']['extension'] = $row['extension'];
$_SESSION['curuser']['usertype'] = $row['usertype'];
$_SESSION['curuser']['usertype_id'] = $row['usertype_id'];
$_SESSION['curuser']['accountid'] = $row['id'];
$_SESSION['curuser']['accountcode'] = $row['accountcode'];
$_SESSION['curuser']['agent'] = $row['agent'];
$_SESSION['curuser']['callerid'] = trim($row['callerid']);
$_SESSION['curuser']['update_online_interval'] = date("Y-m-d H:i:s");
// added by solo 2007-10-90
$_SESSION['curuser']['channel'] = $row['channel'];
$_SESSION['curuser']['extensions'] = array();
$_SESSION['curuser']['groupid'] = $row['groupid'];
$privilege = array();
if ($row['usertype_id'] > 0) {
$privileges = $db->getAll("SELECT * FROM user_privileges WHERE user_type_id='" . $row['usertype_id'] . "'");
foreach ($privileges as $p) {
$privilege[$p['page']][$p['action']] = 1;
}
}
$_SESSION['curuser']['privileges'] = $privilege;
if ($row['extensions'] != '') {
$_SESSION['curuser']['extensions'] = split(',', $row['extensions']);
}
//check extensions if exists in account table
foreach ($_SESSION['curuser']['extensions'] as $key => $value) {
$exten_row = astercrm::getRecordByField("username", $value, "astercrm_account");
if ($exten_row['id'] == '') {
unset($_SESSION['curuser']['extensions'][$key]);
}
}
// if it's a group admin, then add all group extension to it
if ($row['usertype'] == 'groupadmin' || is_array($_SESSION['curuser']['privileges']['systemstatus']) || is_array($_SESSION['curuser']['privileges']['import'])) {
$_SESSION['curuser']['memberExtens'] = array();
$_SESSION['curuser']['memberNames'] = array();
$_SESSION['curuser']['memberAgents'] = array();
$groupList = astercrm::getGroupMemberListByID($row['groupid']);
while ($groupList->fetchInto($groupRow)) {
$_SESSION['curuser']['memberExtens'][] = $groupRow['extension'];
$_SESSION['curuser']['memberNames'][] = $groupRow['username'];
if ($groupRow['agent'] != '') {
$_SESSION['curuser']['memberAgents'][] = $groupRow['agent'];
}
//.........这里部分代码省略.........
示例6: showAccountgroupDetail
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function showAccountgroupDetail($id)
{
global $locate, $db;
$account =& Customer::getRecordByID($id, 'astercrm_accountgroup');
$contactList =& astercrm::getGroupMemberListByID($account['groupid']);
$html = '
<table border="1" width="100%" class="adminlist">
<tr>
<td nowrap align="left" width="45%">' . $locate->Translate("groupname") . '</td>
<td align="left" width="55%">' . $account['groupname'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("incontext") . '</td>
<td align="left">' . $account['incontext'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("outcontext") . '</td>
<td align="left">' . $account['outcontext'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("groupid") . '</td>
<td align="left">' . $account['groupid'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("force monitor") . '</td>
<td align="left">' . $account['monitorforce'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("first ring") . '</td>
<td align="left">' . $locate->Translate($account['firstring']) . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("allowloginqueue") . '</td>
<td align="left">' . $locate->Translate($account['allowloginqueue']) . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("agent interval") . '</td>
<td align="left">' . $account['agentinterval'] . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("clear popup") . '(s)</td>
<td align="left">' . $account['clear_popup'] . '</td>
</tr>';
/*<tr>
<td nowrap align="left">'.$locate->Translate("pdcontext").'</td>
<td align="left">'.$account['pdcontext'].'</td>
</tr>
<tr>
<td nowrap align="left">'.$locate->Translate("pdextensions").'</td>
<td align="left">'.$account['pdextension'].'</td>
</tr>';*/
$html .= '<tr>
<td>
<a href=? onclick="if (xajax.$(\'allMember\').value==\'off\'){xajax.$(\'memberList\').style.display=\'block\';xajax.$(\'allMember\').value=\'on\'}else{xajax.$(\'memberList\').style.display=\'none\';xajax.$(\'allMember\').value=\'off\'} return false;">' . $locate->Translate("display_all_member") . '</a>
<input type="hidden" id="allMember" name="allMember" value="off">
</td>
</tr>
</table>
<table border="0" id="memberList" name="memberList" style="display:none" class="memberlist">
<tr><td colspan="4" width="100%" height="1px" ></td></tr>
';
while ($contactList->fetchInto($row)) {
$html .= '<tr>';
$html .= '
<td align="left">
' . $row['username'] . '
</td>
';
for ($i = 1; $i < 4; $i++) {
if (!$contactList->fetchInto($row)) {
$html .= '<td> </td>';
} else {
$html .= '
<td align="left">
' . $row['username'] . '
</td>
';
}
}
$html .= '</tr>';
}
$html .= '
</table>';
return $html;
}