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:"******"id" => $id, "name" => $user_name, "type" => "user", "email" => "User:"******"user"]["notexist"]) { foreach ($arrInfo["user"]["notexist"] as $id => $user_name) { $arrRecDefault[] = array("id" => $id, "name" => $user_name, "type" => "user", "email" => "User:"******"id" => $id, "name" => $user_name, "type" => "user", "email" => "User:"******"default"] = $arrRecDefault; $arr["exist"] = $arrRecExist; $arr["notexist"] = $arrRecNotExist; $arrGroupInfo[$groupid] = $arr; } return $arrGroupInfo[$groupid]; }
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); } }
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 {
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');">
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";
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') { if (!$person_cache[$call_info2['tlc_assigned_to']]) { $person_cache[$call_info2['tlc_assigned_to']] = PSUPerson::get($call_info2['tlc_assigned_to']); } //end else $call_info2['assigned_to'] = $call_info2['tlc_assigned_to']; } //end if if ($call_info2['updated_by']) { if (!$person_cache[$call_info2['updated_by']]) { $person_cache[$call_info2['updated_by']] = PSUPerson::get($call_info2['updated_by']); } //end else $call_info2['logger'] = $call_info2['updated_by']; } //end if $history[] = $call_info2; } $caller_id = $caller_data['identifier']; if (!$person_cache[$caller_id]) { $person_cache[$caller_id] = PSUPerson::get($caller_id); } //end else $current = array_slice($history, 0, 1); $current = $current[0]; // email ITS $tpl = new PSUTemplate(); $tpl->assign('caller', $caller_data); $tpl->assign('caller_id', $caller_id); $tpl->assign('pcache', $person_cache); $tpl->assign('call', $call_info); $tpl->assign('current', $current); $tpl->assign('history', array_slice($history, 1)); $text_message = $tpl->fetch('email.ticket.text.tpl'); $html_message = $tpl->fetch('email.ticket.html.tpl'); $to = implode(',', array_unique($to)); if ($to) { $headers['from'] = $logger->formatName('f l') . ' <' . $logger->wp_email . '>'; PSU::mail($to, $subject, array($text_message, $html_message), $headers); } //end if // email user if ($end_user_to) { $headers['from'] = 'Support Tickets <*****@*****.**>'; $tpl->assign('is_caller', true); $tpl->assign('history', array()); $text_message = $tpl->fetch('email.ticket.text.tpl'); $html_message = $tpl->fetch('email.ticket.html.tpl'); PSU::mail($end_user_to, $subject, array($text_message, $html_message), $headers); } //end if } }
\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;
* 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();
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(); }
/** * 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"; }
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; }
//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);
// $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") {
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='******'who']}')"; break; case 'today': $query .= " AND call_log.call_date=NOW()"; break; case 'my_opened': $query .= " AND call_log.calllog_username='******'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 // If the time that the call has been open (call_open_time) is greater than one week (604800 seconds) if ($call['call_open_time'] > 604800) { // Set a call age status variable and mark it as old $call['call_age_status'] = 'old'; } else { // Otherwise, mark it as normal $call['call_age_status'] = 'normal'; } // If the time since the call has been updated (activity_datetime) is greater than one week (604800 seconds) if ($call['activity_datetime'] > 604800) { // Set an activity age status variable and mark it as old $call['activity_age_status'] = 'old'; } else { // Otherwise, mark it as normal $call['activity_age_status'] = 'normal'; } $identifier = PSU::nvl($call['caller_username'], $call['wp_id'], $call['pidm']); //grabs the person data for the call $person = (array) $GLOBALS['user']->getCallerData($identifier); //overrides the username that was saved in the call with the username that was found from PSUPerson //this is to prevent ~500 calls displaying improper information //that were created with wp_ids instead of usernames as the username identifier $call['caller_username'] = $person['username'] ?: $person['identifier']; //merges the person array and single call(row) array $call = array_merge($call, $person); } // end foreach return $calls; }
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; }
/*+******************************************************************************** * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. ********************************************************************************/ require_once 'include/database/PearDatabase.php'; require_once 'include/utils/UserInfoUtil.php'; global $mod_strings; global $app_strings; global $app_list_strings; $groupId = vtlib_purify($_REQUEST['groupId']); $groupInfoArr = getGroupInfo($groupId); $smarty = new vtigerCRM_Smarty(); global $adb; global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $smarty->assign("GROUPINFO", getStdOutput($groupInfoArr, $groupId, $mod_strings)); $smarty->assign("GROUPID", $groupId); $smarty->assign("GROUP_NAME", $groupInfoArr[0]); /** Gives the group info and the group member info array * @param $groupInfoArr -- Group Info Array got by calling getGroupInfo($groupId):: Type array * @param $groupID -- group id::Type integer * @param $mod_strings -- i18n mod strings array::Type array * @returns $returndata:: Type array, Example array format given below Array (
public function __construct($groupid) { $groupInfo = getGroupInfo($groupid); trace($groupInfo); }
require_once "groupFunctions.php"; require_once "../uploadFile.php"; require_once "../util.php"; //Get parameters from frontend $groupID = $_POST['groupID']; // reads in file and returns an array of contents, one for each non-empty line // each element should be the userID of a user to be added to the group $fileLines = processFile(); if (!$fileLines) { //error occured with file upload http_response_code(400); //Bad request die; } // array of group info containing (addHrsType, hours, hasBookingDurationRestriction, startDate, endDate) $groupInfo = getGroupInfo($db, $groupID); $specialHrs = 0; if (strcmp($groupInfo['addHrsType'], "special") == 0) { $specialHrs = $groupInfo['hours']; } $insertString = ""; $curWeekUpdateString = ""; $nextWeekUpdateString = ""; $restUpdateString = ""; //Array to hold users being added (error-free) $usersAddedArray = array(); //Array holding users + info to be added to permission table $insertArray = array(); //Arrays to hold error users $alreadyInGroupArray = array(); $notInMasterArray = array();
function getProjectFiles($id = "") { global $clerk; $projectId = determineProjectId($id); $theFiles = array(); $orderedFiles = array(); $project = $clerk->query_fetchArray($clerk->query_select("projects", "", "WHERE id= '{$projectId}' OR slug= '{$projectId}'")); $flow = explode(",", $project['flow']); $files = $clerk->query_select("project_files", "", "WHERE project_id= '{$projectId}' ORDER BY pos ASC"); while ($file = $clerk->query_fetchArray($files)) { $theFiles[$file['id']] = $file; } foreach ($flow as $part) { if (strstr($part, "textblock")) { $textBlockID = str_replace("textblock", "", $part); foreach ($theFiles as $file => $data) { if ($data['id'] == $textBlockID) { $orderedFiles[$data['id']] = $data; } } } if (strstr($part, "group")) { $group = getGroupInfo($part); foreach ($theFiles as $file => $data) { if ($data['filegroup'] == $group['num']) { $orderedFiles[$data['id']] = $data; } } } } return $orderedFiles; }
/** Function to get the Entity Display Link * @param $entityid -- Entity Id * @params $entityType -- The entity type may be vtiger_groups or vtiger_roles or rs -- Type Varchar * @returns the Entity Display link */ function getEntityDisplayLink($entityType, $entityid) { global $log; $log->debug("Entering getEntityDisplayLink(" . $entityType . "," . $entityid . ") method ..."); if ($entityType == 'groups') { $groupNameArr = getGroupInfo($entityid); $display_out = "<a href='index.php?module=Settings&action=GroupDetailView&returnaction=OrgSharingDetailView&groupId=" . $entityid . "'>Group::" . $groupNameArr[0] . " </a>"; } elseif ($entityType == 'roles') { $roleName = getRoleName($entityid); $display_out = "<a href='index.php?module=Settings&action=RoleDetailView&returnaction=OrgSharingDetailView&roleid=" . $entityid . "'>Role::" . $roleName . "</a>"; } elseif ($entityType == 'rs') { $roleName = getRoleName($entityid); $display_out = "<a href='index.php?module=Settings&action=RoleDetailView&returnaction=OrgSharingDetailView&roleid=" . $entityid . "'>RoleAndSubordinate::" . $roleName . "</a>"; } $log->debug("Exiting getEntityDisplayLink method ..."); return $display_out; }
function getGroupPicture($gid, $size = 'big') { $info = getGroupInfo($gid); switch ($size) { case 'big': $pic = $info['pic_big']; break; case 'small': $pic = $info['pic_small']; break; case 'square': $pic = $info['pic_square']; break; } if ($pic) { $pic = C('SITE_URL') . '/Data/Uploads/' . $pic; } else { switch ($size) { case 'big': $pic = '../Public/Images/group_l.jpg'; break; case 'small': $pic = '../Public/Images/group_m.jpg'; break; case 'square': $pic = '../Public/Images/group_s.jpg'; break; } } return $pic; }