本文整理汇总了PHP中getGroupInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getGroupInfo函数的具体用法?PHP getGroupInfo怎么用?PHP getGroupInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getGroupInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGroupUIInfo
function getGroupUIInfo($groupid)
{
static $arrGroupInfo = array();
if (!isset($arrGroupInfo[$groupid])) {
$arrInfo = getGroupInfo($groupid);
$arrRecDefault = array();
$arrRecExist = array();
$arrRecNotExist = array();
/**
* build array with existing roles
*/
if ($arrInfo["role"]["exist"]) {
foreach ($arrInfo["role"]["exist"] as $id => $rolename) {
$arrRecDefault[] = array("id" => $id, "name" => $rolename, "type" => "role", "email" => "Role:" . $rolename);
$arrRecExist[] = array("id" => $id, "name" => $rolename, "type" => "role", "email" => "Role:" . $rolename);
}
}
/**
* build array with not existing roles
*/
if ($arrInfo["role"]["notexist"]) {
foreach ($arrInfo["role"]["notexist"] as $id => $rolename) {
$arrRecDefault[] = array("id" => $id, "name" => $rolename, "type" => "role", "email" => "Role:" . $rolename);
$arrRecNotExist[] = array("id" => $id, "name" => $rolename, "type" => "role", "email" => "Role:" . $rolename);
}
}
/**
* build array with existing users
*/
if ($arrInfo["user"]["exist"]) {
foreach ($arrInfo["user"]["exist"] as $id => $user_name) {
$arrRecDefault[] = array("id" => $id, "name" => $user_name, "type" => "user", "email" => "User:" . $user_name);
$arrRecExist[] = array("id" => $id, "name" => $user_name, "type" => "user", "email" => "User:" . $user_name);
}
}
/**
* build array with not existing users
*/
if ($arrInfo["user"]["notexist"]) {
foreach ($arrInfo["user"]["notexist"] as $id => $user_name) {
$arrRecDefault[] = array("id" => $id, "name" => $user_name, "type" => "user", "email" => "User:" . $user_name);
$arrRecNotExist[] = array("id" => $id, "name" => $user_name, "type" => "user", "email" => "User:" . $user_name);
}
}
$arr = array();
$arr["default"] = $arrRecDefault;
$arr["exist"] = $arrRecExist;
$arr["notexist"] = $arrRecNotExist;
$arrGroupInfo[$groupid] = $arr;
}
return $arrGroupInfo[$groupid];
}
示例2: deleteUserListFromGroup
function deleteUserListFromGroup($db, $groupID, $userArray)
{
if (sizeof($userArray) == 0) {
return;
}
require_once "groupFunctions.php";
require_once "../util.php";
//$deleteArray = array(); //just use userArray
$deleteString = "";
$restUpdateArray = array();
$restUpdateString = "";
//get group hours
$groupInfo = getGroupInfo($db, $groupID);
foreach ($userArray as $uID) {
// create delete string and array
$deleteString .= "uID = ? OR ";
maybeUpdateUserHours($db, $uID, $groupInfo);
// create updateBookingRest string and array
if (shouldUpdateBookingRest($db, $uID, $groupInfo, false)) {
$restUpdateString .= "uID = ? OR ";
array_push($restUpdateArray, $uID);
}
}
//remove extra characters
$deleteString = chop($deleteString, " OR ");
$restUpdateString = chop($restUpdateString, " OR ");
// execute delete
$deleteQuery = "DELETE FROM Permission WHERE groupID= ? AND {$deleteString}";
$deleteArray = $userArray;
array_unshift($deleteArray, $groupID);
runQuery($db, $deleteQuery, $deleteArray);
// execute updateBookingRest
if (sizeof($restUpdateArray) > 0) {
$restUpdateQuery = "UPDATE User SET hasBookingDurationRestriction = 'Yes' WHERE {$restUpdateString}";
runQuery($db, $restUpdateQuery, $restUpdateArray);
}
}
示例3: member_auth
if ($logged['member'] = member_auth(0, false)) {
$memberID = (int) $_COOKIE['memberID'];
} else {
$memberID = 0;
$logged['admin'] = member_auth(1, false);
}
$groupID = (int) $_REQUEST['ID'];
if (!$groupID) {
Header("Location: {$site['url']}groups_home.php");
exit;
}
$bcd = getParam('breadCrampDivider');
$_page['header_text'] = _t("_Group members");
$_page['header'] = _t("_Group members");
$_ni = $_page['name_index'];
if ($arrGroup = getGroupInfo($groupID)) {
$arrGroup['Name_html'] = htmlspecialchars_adv($arrGroup['Name']);
if ((int) $arrGroup['hidden_group'] and !isGroupMember($memberID, $groupID) and !$logged['admin']) {
$_page_cont[$_ni]['page_main_code'] = _t("_You cannot view group members while not a group member");
} else {
if ($arrGroup['status'] == 'Active' or $arrGroup['creatorID'] == $memberID or $logged['admin']) {
$_page['header'] = _t("_Group members");
PageCompMainCode();
} else {
$_page['name_index'] = 0;
$_page['header'] = _t("_Group is suspended");
$_page['header_text'] = _t("_Group is suspended");
$_page_cont[0]['page_main_code'] = _t("_Sorry, group is suspended");
}
}
} else {
示例4: session_start
session_start();
include_once 'incl/functions.php';
include_once 'incl/creds.php';
$link = mysqli_connect($sql_host, $sql_user, $sql_pass, $sql_db);
$group = mysqli_real_escape_string($link, strtolower($_GET['id']));
if (mysqli_num_rows(mysqli_query($link, "SELECT `id` FROM `groups` WHERE `id`='{$group}'")) <= 0) {
header("Location:index.php");
}
if (!isset($_SESSION['login'])) {
$user = null;
include getLangFile(get_loc());
} else {
$user = getUserInfo($link, $_SESSION['login']);
include getLangFile($user['lang']);
}
$group = getGroupInfo($link, $group);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Quatro - <?php
echo $group['name'];
?>
</title>
<script type="text/javascript" src="resx/js.js"></script>
<link rel="stylesheet" href="resx/css.css">
<link rel="stylesheet" href="resx/small_topbar.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<body onload="previous = document.getElementById('posts');">
示例5: uploadGroupPicture
uploadGroupPicture($request_obj);
}
}
$flip_button = "<button class='rotate-button' type='button'>↩</button>";
$picture_form = '
<input type="hidden" name="MAX_FILE_SIZE" value="300000" >
<input name="userpic" type="file" accept=".jpg , .png , .gif" >
<input type="submit" id="submit-pic" value="Send picture" >
';
} else {
// for when some one does not have priviledge
$flip_button = "";
$picture_form = "";
}
// querry for the group info
$row = getGroupInfo($request_obj);
if ($row['group_pic']) {
$img_src = $row['group_pic'];
} else {
$img_src = "images/groupPics/defaultGroup.png";
}
//querry for the members of the group
$return = createGroupGrid($request_obj, $row['group_officer']);
$group_member = $return['group_member'];
$officer_name = $return['officer_name'];
$officer_pic = $return['officer_pic'];
//fallowing the html for the display of individule group
?>
<div class="rotateable front-pannel <?php
if ($request_obj->back) {
echo "flipped";
示例6: sendOpenCallMail
function sendOpenCallMail($call_info, $action)
{
global $db;
$person_cache = array();
$call = $db->GetRow("SELECT * FROM call_log WHERE call_id = ?", array($call_info['call_id']));
$call_info['call_date'] = $call['call_date'] . ' ' . $call['call_time'];
$headers = array();
$headers['content-type'] = 'text/html';
$caller = PSU::nvl($call_info['caller_wp_id'], $call_info['caller_pidm'], $call_info['call_log_username']);
$caller_data = $GLOBALS['user']->getCallerData($caller);
$logger = $person_cache[$call_info['call_log_username']] = PSUPerson::get($call_info['call_log_username']);
$groupInfo = getGroupInfo($call_info['its_group_assigned_to']);
$call_log_employee = checkEmployee($call_info['call_log_username']);
$assigned_employee = checkEmployee($call_info['tlc_assigned_to']);
$to = array();
// always send to the submitter if the submitter is an employee
if ($call_log_employee) {
if ($logger->system_account_exists) {
$to[] = $logger->wp_email;
}
//end
} else {
$end_user_to = $logger->wp_email;
}
//end else
if ($action == "its_staff") {
$call_info['call_id'] = $call_info['new_call_id'] . $call_info['call_id'];
$call_info['comments'] = $call_info['problem_details'] . $call_info['comments'];
if ($call_info['tlc_assigned_to'] != "unassigned") {
if ($assigned_employee) {
$to[] = PSUPerson::get($call_info['tlc_assigned_to'])->wp_email;
} elseif ($call_info['tlc_assigned_to'] == 'caller' && $call_info['call_id']) {
$sql = "SELECT caller_username \n\t\t\t\t\t\t\t\t\tFROM call_log \n\t\t\t\t\t\t\t\t WHERE call_log.call_id = ?";
$end_user_to = $db->GetOne($sql, array($call_info['call_id']));
if ($end_user_to) {
$end_user = PSUPerson::get($end_user_to);
if ($end_user) {
$end_user_to = $end_user->wp_email;
}
}
//end if
} else {
$end_user = PSUPerson::get($call_info['tlc_assigned_to']);
$end_user_to = $end_user->wp_email;
}
//end if
}
//end if
if ($call_info['its_assigned_group'] != 0) {
$sql = "SELECT email_to \n\t\t\t\t\t\t\t\tFROM itsgroups\n\t\t\t\t\t\t\t\t , call_log \n\t\t\t\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t\t WHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\t\t AND itsgroups.itsgroupid = ?\n\t\t\t AND call_log.call_id = ?";
$email_to = $db->GetOne($sql, array($call_info['its_assigned_group'], $call_info['call_id']));
if ($email_to == 'all') {
$sql = "SELECT user_name\n\t\t\t\t\t\t\t\t\tFROM itsgroups\n\t\t\t\t\t\t\t\t\t , its_employee_groups\n\t\t\t\t\t\t\t\t\t , call_log_employee\n\t\t\t\t\t\t\t\t\tWHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.call_log_user_id = its_employee_groups.employee_id \n\t\t\t\t\t\t\t\t\t\tAND its_employee_groups.group_id = ?\n\t\t\t\t\t\t\t\t\t\tAND itsgroups.itsgroupid = its_employee_groups.group_id \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.status = 'active' \n\t\t\t\t AND its_employee_groups.option_id = '2'";
$email_list = $db->GetCol($sql, array($call_info['its_assigned_group']));
} else {
$email_list = explode(',', $email_to);
}
//end else
foreach ((array) $email_list as $identifier) {
$user = PSUPerson::get($identifier);
$to[] = $user->wp_email;
}
//end foreach
}
//end if
if ($call_info['its_group_assigned_to'] != 0) {
$subject = '[Call Log] [' . $groupInfo[1] . '] ' . $caller_data['name_full'];
} else {
$subject = '[Call Log] ' . $caller_data['name_full'];
}
$subject .= ' (#' . $call_info['call_id'] . ')';
if ($call_info['call_status'] == 'closed') {
$subject .= ' [CLOSED]';
// always send close to the owner, if they are allowed to see the
// full history
$caller_identifier = $db->GetOne("SELECT calllog_username FROM call_log WHERE call_log.call_id = '{$call_info['call_id']}'");
$caller_user = PSUPerson::get($caller_identifier);
if ($GLOBALS['end_user_email']) {
$closing_user = PSUPerson::get($_SESSION['wp_id']);
if ($caller_user->wp_email == $closing_user->wp_email) {
$end_user_to = $closing_user->wp_email;
}
//end if
} elseif (checkEmployee($caller_to)) {
$to[] = $caller_user->wp_email;
}
//end else
}
$sql = "SELECT * \n\t\t\t\t\t\t\tFROM call_log\n\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t WHERE call_log.call_id = ?\n\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id\n\t\t\t\t\t\t ORDER BY date_assigned DESC\n\t\t , time_assigned DESC";
$call_info_query = $db->Execute($sql, array($call_info['call_id']));
foreach ($call_info_query as $call_info2) {
$group_name = getGroupInfo($call_info2['its_assigned_group']);
if ($group_name[0] == '') {
$group_name = 'Unassigned';
} else {
$group_name = $group_name[0];
}
$call_info2['group_name'] = $group_name;
$call_info2['update_date'] = $call_info2['date_assigned'] . ' ' . $call_info2['time_assigned'];
if ($call_info2['tlc_assigned_to'] && $call_info2['tlc_assigned_to'] != 'unassigned') {
//.........这里部分代码省略.........
示例7: getID
\t\t\t\t<profile_onclick />
\t\t\t\t<join_date>{$join_date}</join_date>
{$aRay}
\t\t\t</user_info>
EOF;
break;
/**
* get user permissions
*/
/**
* get user permissions
*/
case 'user_perm':
$forum_id = (int) $_GET['forum_id'];
$user_id = getID($user);
$arrGroup = getGroupInfo($forum_id);
$isGroupMember = isGroupMember($user_id, $forum_id) ? 1 : 0;
$isGroupCreator = $arrGroup['creatorID'] == $user_id ? 1 : 0;
$isAdmin = $who == 'admin' ? 1 : 0;
$read_public = 1;
$post_public = ($isGroupMember or $isAdmin) ? 1 : 0;
$edit_public = ($isGroupCreator or $isAdmin) ? 1 : 0;
$del_public = ($isGroupCreator or $isAdmin) ? 1 : 0;
$read_private = ($isGroupMember or $isAdmin) ? 1 : 0;
$post_private = ($isGroupMember or $isAdmin) ? 1 : 0;
$edit_private = ($isGroupCreator or $isAdmin) ? 1 : 0;
$del_private = ($isGroupCreator or $isAdmin) ? 1 : 0;
$edit_own = ($isGroupMember or $isAdmin) ? 1 : 0;
$del_own = ($isGroupMember or $isAdmin) ? 1 : 0;
$search = 0;
$sticky = ($isGroupMember or $isAdmin) ? 1 : 0;
示例8: vtigerCRM_Smarty
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
********************************************************************************/
require_once 'include/utils/utils.php';
global $adb;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$Err_msg;
$parentGroupArray = array();
if (isset($_REQUEST['groupId']) && $_REQUEST['groupId'] != '') {
$mode = 'edit';
$groupId = vtlib_purify($_REQUEST['groupId']);
$groupInfo = getGroupInfo($groupId);
require_once 'include/utils/GetParentGroups.php';
$parGroups = new GetParentGroups();
$parGroups->parent_groups[] = $groupId;
$parGroups->getAllParentGroups($groupId);
$parentGroupArray = $parGroups->parent_groups;
} else {
$mode = 'create';
if (isset($_REQUEST['error']) && $_REQUEST['error'] == 'true') {
$Err_msg = "<center><font color='red'><b>" . $mod_strings['LBL_GROUP_NAME_ERROR'] . "</b></font></center>";
$groupInfo[] = vtlib_purify($_REQUEST['groupname']);
$groupInfo[] = vtlib_purify($_REQUEST['desc']);
}
}
//Constructing the Role Array
$roleDetails = getAllRoleDetails();
示例9: members
public function members()
{
$gid = (int) $_GET['id'];
//redirect if isnt group
if (!$gid || !getGroupInfo($gid)) {
$this->redirect('', '', 'home');
}
//get group info
$groupInfo = getGroupInfo($gid);
$this->assign('groupInfo', $groupInfo);
//get members
$groupMember = getGroupMember($gid);
/*
* check access
*/
if (empty($groupMember)) {
if (empty($this->userId)) {
$this->redirect('', '', 'index');
} else {
$this->redirect('', '', 'home');
}
} else {
if (empty($this->userId)) {
$this->redirect('', '', 'index');
} else {
$isMember = false;
foreach ($groupMember as $key) {
if ($this->userId == $key['uid']) {
$isMember = true;
break;
}
}
if (!$isMember && $groupInfo['privacy'] != 'OPEN') {
$this->redirect('', '', 'home');
}
}
}
/*
* edit group member list
*/
$i = 0;
$j = 1;
foreach ($groupMember as &$key) {
$key = $key + array('key' => $i);
$key = $key + array('id' => $j);
$j++;
if ($i == 9) {
$i = 0;
} else {
$i++;
}
}
$this->assign('groupMember', $groupMember);
//get member count
$memberCount = count($groupMember);
$this->assign('memberCount', $memberCount);
/*
* get header
*/
$name = '<a href="' . url('', '', 'group', '', array('id' => $gid)) . '">' . $groupInfo['name'] . '</a>';
$pageHeader = sprintf(L('_members_header'), $name);
$pageSubheader = sprintf(L('_members_subheader'), $name, $memberCount);
$this->assign('pageHeader', $pageHeader);
$this->assign('pageSubheader', $pageSubheader);
$this->display();
}
示例10: _churchdb_delPersonGroupRelation
/**
* delete group membership
*
* @param int $p_id
* @param int $g_id
*
* @return string
*/
function _churchdb_delPersonGroupRelation($p_id, $g_id)
{
global $user;
$gp_id = _churchdb_getGemeindepersonIdFromPersonId($p_id);
$info_rel = getPersonGroupRelation($gp_id, $g_id);
db_insert('cdb_gemeindeperson_gruppe_archive')->fields(array('gemeindeperson_id' => $gp_id, 'gruppe_id' => $g_id, 'status_no' => $info_rel->status_no, 'letzteaenderung' => $info_rel->letzteaenderung, 'aenderunguser' => $info_rel->aenderunguser))->execute();
// add info about archiving
$dt = new DateTime();
db_insert('cdb_gemeindeperson_gruppe_archive')->fields(array('gemeindeperson_id' => $gp_id, 'gruppe_id' => $g_id, 'status_no' => -99, 'letzteaenderung' => $dt->format('Y-m-d H:i:s'), 'aenderunguser' => $user->cmsuserid))->execute();
$info = getGroupInfo($g_id);
if (readConf('churchdb_sendgroupmails', true) && $info->mail_an_leiter_yn == 1) {
informLeaderAboutDeletedGroupMember($g_id, $gp_id);
}
db_query("DELETE FROM {cdb_gemeindeperson_gruppe} WHERE gemeindeperson_id={$gp_id} AND gruppe_id={$g_id}");
cdb_log("Entferne: " . $info->gruppentyp . " " . $info->gruppe . " (P" . $p_id . ":G" . $g_id . " Leiter:" . $info_rel->status_no . ")", 2, $p_id, CDB_LOG_PERSON, 1);
return "ok";
}
示例11: getExpandedProfile
function getExpandedProfile($userName)
{
$profile = getProfile($userName);
if (!$profile) {
return null;
}
// Expand all the groups to just include the names
foreach ($profile['groups'] as $key => $groupId) {
$profile['groups'][$key] = array();
$profile['groups'][$key]['info'] = getGroupInfo($groupId);
}
// Expand all the tasks
foreach ($profile['tasks'] as $key => $task) {
$profile['tasks'][$key]['contig_meta'] = getContigMeta($task['contig_id']);
}
// Expand all the history
foreach ($profile['history'] as $key => $annotation) {
$profile['history'][$key]['annotation_info'] = getAnnotation($annotation['anno_id']);
$profile['history'][$key]['contig_info'] = getContigMeta($profile['history'][$key]['annotation_info']['contig_id']);
}
// Expand all the partials
foreach ($profile['incomplete_annotations'] as $key => $annotationId) {
$profile['incomplete_annotations'][$key] = array();
$profile['incomplete_annotations'][$key]['annotation_id'] = $annotationId;
$profile['incomplete_annotations'][$key]['annotation_info'] = getAnnotation($annotationId);
$profile['incomplete_annotations'][$key]['contig_info'] = getContigMeta($profile['incomplete_annotations'][$key]['annotation_info']['contig_id']);
}
return $profile;
}
示例12: str_replace
//Emoticons
$post = str_replace(">:D", "<img alt=\"missing\" src=\"resx/evil.png\" />", $post);
$post = str_replace(":)", "<img alt=\"missing\" src=\"resx/happy.png\" />", $post);
$post = str_replace(":D", "<img alt=\"missing\" src=\"resx/laugh.png\" />", $post);
$post = str_replace(":P", "<img alt=\"missing\" src=\"resx/tongue.png\" />", $post);
$post = str_replace(":(", "<img alt=\"missing\" src=\"resx/sad.png\" />", $post);
$post = str_replace(":O", "<img alt=\"missing\" src=\"resx/surprise.png\" />", $post);
$post = str_replace(";)", "<img alt=\"missing\" src=\"resx/wink.png\" />", $post);
$post = str_replace("<3", "<img alt=\"missing\" src=\"resx/heart.png\" />", $post);
//Groups
$group = 0;
if ($_POST['group'] != 0) {
if (getGroupInfo($link, mysqli_escape_string($link, $_POST['group']))['author'] == $_SESSION['login']) {
$group = htmlspecialchars(mysqli_escape_string($link, $_POST['group']));
}
if (strpos(getGroupInfo($link, mysqli_escape_string($link, $_POST['group']))['users'], $_SESSION['login']) != false) {
$group = htmlspecialchars(mysqli_escape_string($link, $_POST['group']));
}
}
//Comments
$comment = 0;
if ($_POST['response'] != 0) {
$comment = htmlspecialchars(mysqli_escape_string($link, $_POST['response']));
}
$priv = 0;
if (isset($_POST['priv'])) {
$priv = 1;
}
$quer = mysqli_query($link, "INSERT INTO posts (author,touser,`group`,comment,post) VALUES ('" . $_SESSION['login'] . "','" . strtolower($touser) . "','" . $group . "','" . $comment . "','{$post}')");
//Mentions
$postid = mysqli_insert_id($link);
示例13: while
// $insertNewSetting = "INSERT INTO memberTemplatesSettings (templateID,name,value) SELECT DISTINCT templateID,'photoradar_allow_calls',1 FROM `memberTemplatesSettings`";
// $renameSetting = "update memberTemplatesSettings set name = 'photoradar_show_manage' where name = 'photoradar_show_password'";
if ($job == "showAllowedTags") {
$sql = "SELECT value FROM memberTemplatesSettings WHERE templateID = '{$templateID}' AND name='photoradar_allowed_tags'";
if ($rs = $db_CS->query($sql)) {
while ($row = $rs->fetch_object()) {
if (strstr($row->value, ",")) {
//echo $row->value;
$regions = explode(",", $row->value);
foreach ($regions as $nRegionID) {
//echo $tagID;
$groupName = getGroupInfo($db_CS, $nRegionID);
$settings[] = array("id" => $nRegionID, "text" => $groupName->name);
}
} else {
$groupName = getGroupInfo($db_CS, $row->value);
if (!$groupName) {
$groupName = $row->value;
} else {
$groupName = $groupName->name;
}
$settings[] = array("id" => $row->value, "text" => $groupName);
}
}
echo json_encode($settings);
//echo "123";
//echo ' ';
}
exit;
}
if ($job == "updateAllowedTags") {
示例14: getOpenCalls
function getOpenCalls($options = array())
{
/* Options include the following:
which:
all - all open calls
mygroup - all open calls in groups that option['calllog_username'] is in
unassigned - calls that are currently not assigned to a user or group
caller - open calls for $option['caller_user_name']
today - calls opened today
my_opened - calls that I opened
my - calls assigned to me, or opted into seeing via high priority groups setting
who:
should contain the the username of the person you are searching on (could be caller or calllog_user)
what:
a comma separated list of fields to fetch, defaults to * if not provided
sort_by:
call_date - when the call was created
call_updated - when the call was last updated
*/
$options['what'] = $options['what'] ?: '*';
$query = "SELECT {$options['what']} \n\t\t\t\tFROM call_log, \n\t\t\t\t\t call_history \n\t\t\t\tWHERE call_log.call_id = call_history.call_id \n\t\t\t\t\tAND call_history.call_status='open'";
switch ($options['which']) {
case '':
case 'none':
case 'all':
$query = "SELECT {$options['what']} \n\t\t\t\t\t\tFROM call_log \n\t\t\t\t\t\t\tLEFT JOIN call_history ON call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\tLEFT JOIN itsgroups ON its_assigned_group = itsgroups.itsgroupid \n\t\t\t\t\t\tWHERE call_history.call_status = 'open' \n\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\thide_in_all_calls != '1' \n\t\t\t\t\t\t\t\tOR hide_in_all_calls IS NULL\n\t\t\t\t\t\t\t\t)";
break;
case 'mygroup':
$query = "SELECT {$options['what']} \n\t\t\t\t\t\tFROM call_log, call_history \n\t\t\t\t\t\tWHERE call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\tAND call_history.its_assigned_group='{$options['who']}' \n\t\t\t\t\t\t\tAND call_history.call_status='open'";
break;
case 'unassigned':
$query .= " AND tlc_assigned_to='unassigned' AND (its_assigned_group='0' || its_assigned_group='unassigned' || its_assigned_group='')";
break;
case 'caller':
$person = new PSUPerson($options['who']);
$query .= " AND (call_log.wp_id = '{$person->wp_id}' OR call_log.pidm = {$person->pidm} OR call_log.caller_username='{$options['who']}')";
break;
case 'today':
$query .= " AND call_log.call_date=NOW()";
break;
case 'my_opened':
$query .= " AND call_log.calllog_username='{$options['who']}' AND call_history.call_status='open'";
break;
case 'my':
$query .= " AND ( call_history.tlc_assigned_to='{$options['who']}'";
$high_priority_groups = implode(',', User::getHighPriorityGroups(false, $options['who']));
if ($high_priority_groups) {
$query .= " OR ( call_history.its_assigned_group IN ({$high_priority_groups}) AND call_history.call_priority = 'high' )";
}
$query .= " )";
break;
default:
$query .= " AND call_history.tlc_assigned_to='{$options['who']}'";
break;
}
// end switch
$query .= " AND call_history.current='1'";
if (!$options['sort_by'] || $options['sort_by'] == 'call_date') {
$options['sort_by'] = 'call_date, call_time';
} elseif ($options['sort_by'] == 'call_updated') {
$options['sort_by'] = 'date_assigned, time_assigned';
}
$query .= " ORDER BY {$options['sort_by']} ASC";
$calls = PSU::db('calllog')->GetAll($query);
foreach ($calls as &$call) {
// needed for the template, but a bit redundant
$call['call_title'] = $call['title'];
// determine an assigned_to that combines person and queue/group
$groupArray = getGroupInfo($call['its_assigned_group']);
if ($call['its_assigned_group'] != 0 || $groupArray[1] != '') {
if ($call['tlc_assigned_to'] != 'unassigned') {
$call['assigned_to']['group'] = $groupArray[1];
$call['assigned_to'][] = $call['tlc_assigned_to'];
} else {
$call['assigned_to']['group'] = $groupArray[1];
}
} elseif ($call['tlc_assigned_to'] != '') {
$call['assigned_to'][] = $call['tlc_assigned_to'];
} else {
$call['assigned_to'][] = 'None';
}
$call['building_name'] = getBuildingName($call['location_building_id']);
if ($call['date_assigned']) {
$assign_datetime = $call['date_assigned'] . ' ' . $call['time_assigned'];
$call['activity_datetime'] = time() - strtotime($assign_datetime);
$call['date_assigned'] = date('M j, Y', strtotime($assign_datetime));
$call['time_assigned'] = date('g:i a', strtotime($assign_datetime));
}
//end if
$call['call_activity_diff'] = \PSU::date_diff(time(), strtotime($assign_datetime), 'simple');
$call['call_summary'] = substr($call['comments'], 0, 100) . (strlen($call['comments']) > 100 ? '...' : '');
$call['show_comments'] = str_replace("\"", """, addslashes(substr(strip_tags(str_replace(array("\n", "\t", "\r"), '', $call['comments'])), 0, 30)));
$call_datetime = $call['call_date'] . ' ' . $call['call_time'];
$call['call_open_time'] = time() - strtotime($call_datetime);
$call['call_date'] = date('M j, Y', strtotime($call_datetime));
$call['call_time'] = date('g:i a', strtotime($call_datetime));
if ($call['feelings_face']) {
$call['feelings_face'] = '<br/><img src="/webapp/feedback/templates/images/feedback-' . $call['feelings_face'] . '.png" class="feedback-face" title="' . $call['feelings'] . '"/>';
}
//end if
//.........这里部分代码省略.........
示例15: getAllGroups
public static function getAllGroups()
{
static $groups = array();
if ($groups) {
return $groups;
}
$_groups = getGroupInfo();
foreach ($_groups as $gid => $one) {
$groups[$one['gptype']][$one['gid']] = $one['gid'];
}
return $groups;
}