本文整理汇总了PHP中getCurrentUserProfileList函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentUserProfileList函数的具体用法?PHP getCurrentUserProfileList怎么用?PHP getCurrentUserProfileList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentUserProfileList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getBlocksForQuickEdit
/**
* This function returns the ec_blocks and its related information for given module.
* Input Parameter are $module - module name, $disp_view = display view (edit,detail or create),$mode - edit, $col_fields - * column ec_fields/
* This function returns an array
*/
function getBlocksForQuickEdit($module, $disp_view, $mode, $col_fields = '', $display_type_check)
{
global $log;
$log->debug("Entering getBlocksForQuickEdit() method ...");
global $adb, $current_user;
global $mod_strings;
$tabid = getTabid($module);
$block_detail = array();
$getBlockinfo = "";
$prev_header = "";
$query = "select blockid,blocklabel,show_title from ec_blocks where tabid={$tabid} and {$disp_view}=0 and visible = 0 order by sequence";
$result = $adb->query($query);
$noofrows = $adb->num_rows($result);
$blockid_list = '(';
for ($i = 0; $i < $noofrows; $i++) {
$blockid = $adb->query_result($result, $i, "blockid");
if ($i != 0) {
$blockid_list .= ', ';
}
$blockid_list .= $blockid;
$block_label[$blockid] = $adb->query_result($result, $i, "blocklabel");
}
$blockid_list .= ')';
//retreive the ec_profileList from database
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($is_admin == true) {
$sql = "SELECT ec_field.* FROM ec_field INNER JOIN ec_def_org_field ON ec_def_org_field.fieldid=ec_field.fieldid AND ec_def_org_field.visible=0 WHERE ec_field.tabid=" . $tabid . " AND ec_field.block IN " . $blockid_list . " AND " . $display_type_check . " ORDER BY block,sequence";
} else {
$profileList = getCurrentUserProfileList();
$sql = "SELECT ec_field.*,ec_profile2field.readonly as profile_readonly FROM ec_field INNER JOIN ec_profile2field ON ec_profile2field.fieldid=ec_field.fieldid INNER JOIN ec_def_org_field ON ec_def_org_field.fieldid=ec_field.fieldid WHERE ec_field.tabid=" . $tabid . " AND ec_field.block IN " . $blockid_list . " AND " . $display_type_check . " AND ec_def_org_field.visible=0 AND ec_profile2field.visible=0 AND ec_profile2field.profileid IN " . $profileList . " ORDER BY block,sequence";
}
$result = $adb->query($sql);
$getBlockInfo = getBlockInformation($module, $result, $col_fields, $tabid, $block_label, $mode);
$index_count = 1;
$max_index = 0;
if (!isset($getBlockInfo)) {
$getBlockInfo = array();
}
foreach ($getBlockInfo as $label => $contents) {
$no_rows = count($contents);
$index_count = $max_index + 1;
foreach ($contents as $block_row => $elements) {
$max_index = $no_rows + $index_count;
for ($i = 0; $i < count($elements); $i++) {
if (isset($getBlockInfo[$label][$block_row][$i]) && sizeof($getBlockInfo[$label][$block_row][$i]) != 0) {
if ($i == 0) {
$getBlockInfo[$label][$block_row][$i][] = array($index_count);
} else {
$getBlockInfo[$label][$block_row][$i][] = array($max_index);
}
}
}
$index_count++;
}
}
$log->debug("Exiting getBlocksForQuickEdit method ...");
return $getBlockInfo;
}
开发者ID:honj51,项目名称:taobaocrm,代码行数:63,代码来源:QuickEdit.php
示例2: getPermittedFieldsQuery
/** function used to get the query which will list the permitted fields
* @param string $module - module name
* @param string $disp_view - view name, this may be create_view, edit_view or detail_view
* @return string $sql - query to get the list of fields which are permitted to the current user
*/
function getPermittedFieldsQuery($module, $disp_view)
{
global $adb, $log;
$log->debug("Entering into the function getPermittedFieldsQuery({$module}, {$disp_view})");
global $current_user;
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
//To get the permitted blocks
$blockid_list = getPermittedBlocks($module, $disp_view);
$tabid = getTabid($module);
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users") {
$sql = "SELECT vtiger_field.columnname, vtiger_field.fieldlabel, vtiger_field.tablename FROM vtiger_field WHERE vtiger_field.tabid=" . $tabid . " AND vtiger_field.block IN {$blockid_list} AND vtiger_field.displaytype IN (1,2,4) and vtiger_field.presence in (0,2) ORDER BY block,sequence";
} else {
$profileList = getCurrentUserProfileList();
$sql = "SELECT vtiger_field.columnname, vtiger_field.fieldlabel, vtiger_field.tablename FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=" . $tabid . " AND vtiger_field.block IN " . $blockid_list . " AND vtiger_field.displaytype IN (1,2,4) AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN (" . implode(",", $profileList) . ") and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid ORDER BY block,sequence";
}
$log->debug("Exit from the function getPermittedFieldsQuery({$module}, {$disp_view}). Return value = {$sql}");
return $sql;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:23,代码来源:ExportUtils.php
示例3: getaccesfield
private function getaccesfield($module, $primodule, $secmodule)
{
$adb = PearDatabase::getInstance();
$access_fields = array();
$profileList = getCurrentUserProfileList();
$query = "select vtiger_field.fieldname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where";
$params = array();
if ($module == "Calendar") {
$query .= " vtiger_field.tabid in (9,16) and vtiger_field.displaytype in (1,2,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
if (count($profileList) > 0) {
$query .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
array_push($params, $profileList);
}
$query .= " group by vtiger_field.fieldid order by block,sequence";
} else {
array_push($params, $primodule, $secmodule);
$query .= " vtiger_field.tabid in (select tabid from vtiger_tab where vtiger_tab.name in (?,?)) and vtiger_field.displaytype in (1,2,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
if (count($profileList) > 0) {
$query .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
array_push($params, $profileList);
}
$query .= " group by vtiger_field.fieldid order by block,sequence";
}
$result = $adb->pquery($query, $params);
while ($collistrow = $adb->fetch_array($result)) {
$access_fields[] = $collistrow["fieldname"];
}
return $access_fields;
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:29,代码来源:EditRelatedBlock.php
示例4: get_calendarsforol
/**
* Function to get calendar query for outlookplugin
* @param string $username - User name
* @return string $query - sql query
*/
function get_calendarsforol($user_name)
{
global $log, $adb, $current_user;
$log->debug("Entering get_calendarsforol(" . $user_name . ") method ...");
require_once "modules/Users/Users.php";
$seed_user = new Users();
$user_id = $seed_user->retrieve_user_id($user_name);
$current_user = $seed_user;
$current_user->retrieve_entity_info($user_id, 'Users');
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.presence in (0,2)";
$params1 = array();
} else {
$profileList = getCurrentUserProfileList();
$sql1 = "select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
$params1 = array();
if (count($profileList) > 0) {
$sql1 .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
array_push($params1, $profileList);
}
}
$result1 = $adb->pquery($sql1, $params1);
for ($i = 0; $i < $adb->num_rows($result1); $i++) {
$permitted_lists[] = $adb->query_result($result1, $i, 'tablename');
$permitted_lists[] = $adb->query_result($result1, $i, 'columnname');
if ($adb->query_result($result1, $i, 'columnname') == "date_start") {
$permitted_lists[] = 'vtiger_activity';
$permitted_lists[] = 'time_start';
}
if ($adb->query_result($result1, $i, 'columnname') == "due_date") {
$permitted_lists[] = 'vtiger_activity';
$permitted_lists[] = 'time_end';
}
}
$permitted_lists = array_chunk($permitted_lists, 2);
$column_table_lists = array();
for ($i = 0; $i < count($permitted_lists); $i++) {
$column_table_lists[] = implode(".", $permitted_lists[$i]);
}
$query = "select vtiger_activity.activityid as clndrid, " . implode(',', $column_table_lists) . " from vtiger_activity\n\t\t\tinner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid\n\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid\n\t\t\tleft join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid\n\t\t\tleft join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid\n\t\t\tleft join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid\n\t\t\twhere vtiger_users.user_name='" . $user_name . "' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'";
$log->debug("Exiting get_calendarsforol method ...");
return $query;
}
开发者ID:kikojover,项目名称:corebos,代码行数:50,代码来源:Activity.php
示例5: insertIntoEntityTable
/** Function to insert values in the specifed table for the specified module
* @param $table_name -- table name:: Type varchar
* @param $module -- module:: Type varchar
*/
function insertIntoEntityTable($table_name, $module, $fileid = '')
{
global $log;
global $current_user, $app_strings;
$log->info("function insertIntoEntityTable " . $module . ' vtiger_table name ' . $table_name);
global $adb;
$insertion_mode = $this->mode;
//Checkin whether an entry is already is present in the vtiger_table to update
if ($insertion_mode == 'edit') {
$tablekey = $this->tab_name_index[$table_name];
// Make selection on the primary key of the module table to check.
$check_query = "select {$tablekey} from {$table_name} where {$tablekey}=?";
$check_result = $adb->pquery($check_query, array($this->id));
$num_rows = $adb->num_rows($check_result);
if ($num_rows <= 0) {
$insertion_mode = '';
}
}
$tabid = getTabid($module);
if ($module == 'Calendar' && $this->column_fields["activitytype"] != null && $this->column_fields["activitytype"] != 'Task') {
$tabid = getTabid('Events');
}
if ($insertion_mode == 'edit') {
$update = array();
$update_params = array();
checkFileAccessForInclusion('user_privileges/user_privileges_' . $current_user->id . '.php');
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$sql = "select * from vtiger_field where tabid in (" . generateQuestionMarks($tabid) . ") and tablename=? and displaytype in (1,3) and presence in (0,2) group by columnname";
$params = array($tabid, $table_name);
} else {
$profileList = getCurrentUserProfileList();
if (count($profileList) > 0) {
$sql = "SELECT *\n\t\t\t \t\t\tFROM vtiger_field\n\t\t\t \t\t\tINNER JOIN vtiger_profile2field\n\t\t\t \t\t\tON vtiger_profile2field.fieldid = vtiger_field.fieldid\n\t\t\t \t\t\tINNER JOIN vtiger_def_org_field\n\t\t\t \t\t\tON vtiger_def_org_field.fieldid = vtiger_field.fieldid\n\t\t\t \t\t\tWHERE vtiger_field.tabid = ?\n\t\t\t \t\t\tAND vtiger_profile2field.visible = 0 AND vtiger_profile2field.readonly = 0\n\t\t\t \t\t\tAND vtiger_profile2field.profileid IN (" . generateQuestionMarks($profileList) . ")\n\t\t\t \t\t\tAND vtiger_def_org_field.visible = 0 and vtiger_field.tablename=? and vtiger_field.displaytype in (1,3) and vtiger_field.presence in (0,2) group by columnname";
$params = array($tabid, $profileList, $table_name);
} else {
$sql = "SELECT *\n\t\t\t \t\t\tFROM vtiger_field\n\t\t\t \t\t\tINNER JOIN vtiger_profile2field\n\t\t\t \t\t\tON vtiger_profile2field.fieldid = vtiger_field.fieldid\n\t\t\t \t\t\tINNER JOIN vtiger_def_org_field\n\t\t\t \t\t\tON vtiger_def_org_field.fieldid = vtiger_field.fieldid\n\t\t\t \t\t\tWHERE vtiger_field.tabid = ?\n\t\t\t \t\t\tAND vtiger_profile2field.visible = 0 AND vtiger_profile2field.readonly = 0\n\t\t\t \t\t\tAND vtiger_def_org_field.visible = 0 and vtiger_field.tablename=? and vtiger_field.displaytype in (1,3) and vtiger_field.presence in (0,2) group by columnname";
$params = array($tabid, $table_name);
}
}
} else {
$table_index_column = $this->tab_name_index[$table_name];
if ($table_index_column == 'id' && $table_name == 'vtiger_users') {
$currentuser_id = $adb->getUniqueID("vtiger_users");
$this->id = $currentuser_id;
}
$column = array($table_index_column);
$value = array($this->id);
$sql = "select * from vtiger_field where tabid=? and tablename=? and displaytype in (1,3,4) and vtiger_field.presence in (0,2)";
$params = array($tabid, $table_name);
}
// Attempt to re-use the quer-result to avoid reading for every save operation
// TODO Need careful analysis on impact ... MEMORY requirement might be more
static $_privatecache = array();
$cachekey = "{$insertion_mode}-" . implode(',', $params);
if (!isset($_privatecache[$cachekey])) {
$result = $adb->pquery($sql, $params);
$noofrows = $adb->num_rows($result);
if (CRMEntity::isBulkSaveMode()) {
$cacheresult = array();
for ($i = 0; $i < $noofrows; ++$i) {
$cacheresult[] = $adb->fetch_array($result);
}
$_privatecache[$cachekey] = $cacheresult;
}
} else {
// Useful when doing bulk save
$result = $_privatecache[$cachekey];
$noofrows = count($result);
}
for ($i = 0; $i < $noofrows; $i++) {
$fieldname = $this->resolve_query_result_value($result, $i, "fieldname");
$columname = $this->resolve_query_result_value($result, $i, "columnname");
$uitype = $this->resolve_query_result_value($result, $i, "uitype");
$generatedtype = $this->resolve_query_result_value($result, $i, "generatedtype");
$typeofdata = $this->resolve_query_result_value($result, $i, "typeofdata");
$typeofdata_array = explode("~", $typeofdata);
$datatype = $typeofdata_array[0];
$ajaxSave = false;
if ($_REQUEST['file'] == 'DetailViewAjax' && $_REQUEST['ajxaction'] == 'DETAILVIEW' && isset($_REQUEST["fldName"]) && $_REQUEST["fldName"] != $fieldname || $_REQUEST['action'] == 'MassEditSave' && !isset($_REQUEST[$fieldname . "_mass_edit_check"])) {
$ajaxSave = true;
}
if ($uitype == 4 && $insertion_mode != 'edit') {
$fldvalue = '';
// Bulk Save Mode: Avoid generation of module sequence number, take care later.
// SalesPlatform.ru begin: Added separate numbering for self organizations
if (!CRMEntity::isBulkSaveMode()) {
$modules = array('Invoice', 'Act', 'Consignment');
if (in_array($module, $modules) && isset($this->column_fields['spcompany'])) {
$fldvalue = $this->setModuleSeqNumber("increment", $module, '', '', $this->column_fields['spcompany']);
} else {
$fldvalue = $this->setModuleSeqNumber("increment", $module);
}
//$fldvalue = $this->setModuleSeqNumber("increment", $module);
}
// SalesPlatform.ru end
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:CRMEntity.php
示例6: getFieldVisibilityPermission
/** Function to check permission to access a vtiger_field for a given user
* @param $fld_module -- Module :: Type String
* @param $userid -- User Id :: Type integer
* @param $fieldname -- Field Name :: Type varchar
* @returns $rolename -- Role Name :: Type varchar
*
*/
function getFieldVisibilityPermission($fld_module, $userid, $fieldname, $accessmode = 'readonly')
{
$log = vglobal('log');
$log->debug("Entering getFieldVisibilityPermission(" . $fld_module . "," . $userid . "," . $fieldname . ") method ...");
$adb = PearDatabase::getInstance();
$current_user = vglobal('current_user');
// Check if field is in-active
$fieldActive = isFieldActive($fld_module, $fieldname);
if ($fieldActive == false) {
return '1';
}
require 'user_privileges/user_privileges_' . $userid . '.php';
/* Asha: Fix for ticket #4508. Users with View all and Edit all permission will also have visibility permission for all fields */
if ($is_admin || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$log->debug("Exiting getFieldVisibilityPermission method ...");
return '0';
} else {
//get vtiger_profile list using userid
$profilelist = getCurrentUserProfileList();
//get tabid
$tabid = getTabid($fld_module);
if (count($profilelist) > 0) {
if ($accessmode == 'readonly') {
$query = "SELECT vtiger_profile2field.visible FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=? AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid in (" . generateQuestionMarks($profilelist) . ") AND vtiger_field.fieldname= ? and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid";
} else {
$query = "SELECT vtiger_profile2field.visible FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=? AND vtiger_profile2field.visible=0 AND vtiger_profile2field.readonly=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid in (" . generateQuestionMarks($profilelist) . ") AND vtiger_field.fieldname= ? and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid";
}
$params = array($tabid, $profilelist, $fieldname);
} else {
if ($accessmode == 'readonly') {
$query = "SELECT vtiger_profile2field.visible FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=? AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_field.fieldname= ? and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid";
} else {
$query = "SELECT vtiger_profile2field.visible FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid=? AND vtiger_profile2field.visible=0 AND vtiger_profile2field.readonly=0 AND vtiger_def_org_field.visible=0 AND vtiger_field.fieldname= ? and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid";
}
$params = array($tabid, $fieldname);
}
//Postgres 8 fixes
if ($adb->isPostgres()) {
$query = fixPostgresQuery($query, $log, 0);
}
$result = $adb->pquery($query, $params);
$log->debug("Exiting getFieldVisibilityPermission method ...");
// Returns value as a string
if ($adb->num_rows($result) == 0) {
return '1';
}
return $adb->query_result($result, "0", "visible") . "";
}
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:56,代码来源:UserInfoUtil.php
示例7: getSearchListViewEntries
function getSearchListViewEntries($focus, $module, $list_result, $navigation_array, $form = '')
{
global $log;
$log->debug("Entering getSearchListViewEntries(" . get_class($focus) . "," . $module . "," . $list_result . "," . $navigation_array . ") method ...");
global $adb, $app_strings, $theme, $current_user, $list_max_entries_per_page;
$noofrows = $adb->num_rows($list_result);
$list_header = '';
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$list_block = array();
//getting the vtiger_fieldtable entries from database
$tabid = getTabid($module);
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
//Added to reduce the no. of queries logging for non-admin user -- by Minnie-start
$field_list = array();
$j = 0;
foreach ($focus->search_fields as $name => $tableinfo) {
$fieldname = $focus->search_fields_name[$name];
array_push($field_list, $fieldname);
$j++;
}
$field = array();
if ($is_admin == false && $module != 'Users') {
if ($module == 'Emails') {
$query = "SELECT fieldname FROM vtiger_field WHERE tabid = ? and vtiger_field.presence in (0,2)";
$params = array($tabid);
} else {
$profileList = getCurrentUserProfileList();
$query = "SELECT DISTINCT vtiger_field.fieldname\n\t\t\t\tFROM vtiger_field\n\t\t\t\tINNER JOIN vtiger_profile2field\n\t\t\t\t\tON vtiger_profile2field.fieldid = vtiger_field.fieldid\n\t\t\t\tINNER JOIN vtiger_def_org_field\n\t\t\t\t\tON vtiger_def_org_field.fieldid = vtiger_field.fieldid\n\t\t\t\tWHERE vtiger_field.tabid = ?\n\t\t\t\tAND vtiger_profile2field.visible = 0\n\t\t\t\tAND vtiger_def_org_field.visible = 0\n\t\t\t\tAND vtiger_profile2field.profileid IN (" . generateQuestionMarks($profileList) . ")\n\t\t\t\tAND vtiger_field.fieldname IN (" . generateQuestionMarks($field_list) . ") and vtiger_field.presence in (0,2)";
$params = array($tabid, $profileList, $field_list);
}
$result = $adb->pquery($query, $params);
for ($k = 0; $k < $adb->num_rows($result); $k++) {
$field[] = $adb->query_result($result, $k, "fieldname");
}
}
//constructing the uitype and columnname array
$ui_col_array = array();
$query = "SELECT uitype, columnname, fieldname\n\t\tFROM vtiger_field\n\t\tWHERE tabid=?\n\t\tAND fieldname IN (" . generateQuestionMarks($field_list) . ") and vtiger_field.presence in (0,2)";
$result = $adb->pquery($query, array($tabid, $field_list));
$num_rows = $adb->num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
$tempArr = array();
$uitype = $adb->query_result($result, $i, 'uitype');
$columnname = $adb->query_result($result, $i, 'columnname');
$field_name = $adb->query_result($result, $i, 'fieldname');
$tempArr[$uitype] = $columnname;
$ui_col_array[$field_name] = $tempArr;
}
//end
if ($navigation_array['end_val'] > 0) {
for ($i = 1; $i <= $noofrows; $i++) {
//Getting the entityid
if ($module != 'Users') {
$entity_id = $adb->query_result($list_result, $i - 1, "crmid");
} else {
$entity_id = $adb->query_result($list_result, $i - 1, "id");
}
$list_header = array();
foreach ($focus->search_fields as $name => $tableinfo) {
$fieldname = $focus->search_fields_name[$name];
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || in_array($fieldname, $field) || $module == 'Users') {
if ($fieldname == '') {
$table_name = '';
$column_name = '';
foreach ($tableinfo as $tablename => $colname) {
$table_name = $tablename;
$column_name = $colname;
}
$value = $adb->query_result($list_result, $i - 1, $colname);
} else {
if (($module == 'Calls' || $module == 'Tasks' || $module == 'Meetings' || $module == 'Emails') && ($name == 'Related to' || $name == 'Contact Name' || $name == 'Vendor Name')) {
if ($name == 'Related to') {
$value = getRelatedTo($module, $list_result, $i - 1);
}
if ($name == 'Contact Name') {
$contact_id = $adb->query_result($list_result, $i - 1, "contactid");
$contact_name = getFullNameFromQResult($list_result, $i - 1, "Contacts");
$value = "";
if ($contact_name != "" && $contact_id != 'NULL') {
$value = "<a href='index.php?module=Contacts&action=DetailView&record=" . $contact_id . "'>" . $contact_name . "</a>";
}
}
} elseif (($module == 'Faq' || $module == 'Documents') && $name == 'Related to') {
$value = getRelatedToEntity($module, $list_result, $i - 1);
} elseif ($name == 'Account Name' && ($module == 'Potentials' || $module == 'SalesOrder' || $module == 'Quotes')) {
$account_id = $adb->query_result($list_result, $i - 1, "accountid");
$account_name = getAccountName($account_id);
$value = textlength_check($account_name);
} elseif ($name == 'Quote Name' && $module == 'SalesOrder') {
$quote_id = $adb->query_result($list_result, $i - 1, "quoteid");
$quotename = getQuoteName($quote_id);
$value = textlength_check($quotename);
} elseif ($name == 'Account Name' && $module == 'Contacts') {
$account_id = $adb->query_result($list_result, $i - 1, "accountid");
$account_name = getAccountName($account_id);
$value = textlength_check($account_name);
} elseif (isset($focus->popup_fields) && in_array($fieldname, $focus->popup_fields)) {
global $default_charset;
$forfield = htmlspecialchars($_REQUEST['forfield'], ENT_QUOTES, $default_charset);
//.........这里部分代码省略.........
开发者ID:latechdirect,项目名称:vtiger,代码行数:101,代码来源:ListViewUtils.php
示例8: getColumnNames_Lead
/** Function to get the Columnnames of the Leads Record
* Used By vtigerCRM Word Plugin
* Returns the Merge Fields for Word Plugin
*/
function getColumnNames_Lead()
{
$log = vglobal('log');
$current_user = vglobal('current_user');
$log->debug("Entering getColumnNames_Lead() method ...");
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$sql1 = "select fieldlabel from vtiger_field where tabid=7 and vtiger_field.presence in (0,2)";
$params1 = array();
} else {
$profileList = getCurrentUserProfileList();
$sql1 = "select vtiger_field.fieldid,fieldlabel from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,3,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
$params1 = array();
if (count($profileList) > 0) {
$sql1 .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ") group by fieldid";
array_push($params1, $profileList);
}
}
$result = $this->db->pquery($sql1, $params1);
$numRows = $this->db->num_rows($result);
for ($i = 0; $i < $numRows; $i++) {
$custom_fields[$i] = $this->db->query_result($result, $i, "fieldlabel");
$custom_fields[$i] = preg_replace("/\\s+/", "", $custom_fields[$i]);
$custom_fields[$i] = strtoupper($custom_fields[$i]);
}
$mergeflds = $custom_fields;
$log->debug("Exiting getColumnNames_Lead method ...");
return $mergeflds;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:33,代码来源:Leads.php
示例9: getUnifiedWhere
/**
* Function to get the where condition for a module based on the field table entries
* @param string $listquery -- ListView query for the module
* @param string $module -- module name
* @param string $search_val -- entered search string value
* @return string $where -- where condition for the module based on field table entries
*/
function getUnifiedWhere($listquery, $module, $search_val)
{
global $adb, $current_user;
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
$search_val = $adb->sql_escape_string($search_val);
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$query = "SELECT columnname, tablename FROM vtiger_field WHERE tabid = ? and vtiger_field.presence in (0,2)";
$qparams = array(getTabid($module));
} else {
$profileList = getCurrentUserProfileList();
$query = "SELECT columnname, tablename FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid = vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid = vtiger_field.fieldid WHERE vtiger_field.tabid = ? AND vtiger_profile2field.visible = 0 AND vtiger_profile2field.profileid IN (" . generateQuestionMarks($profileList) . ") AND vtiger_def_org_field.visible = 0 and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid";
$qparams = array(getTabid($module), $profileList);
}
$result = $adb->pquery($query, $qparams);
$noofrows = $adb->num_rows($result);
$where = '';
for ($i = 0; $i < $noofrows; $i++) {
$columnname = $adb->query_result($result, $i, 'columnname');
$tablename = $adb->query_result($result, $i, 'tablename');
// Search / Lookup customization
if ($module == 'Contacts' && $columnname == 'accountid') {
$columnname = "accountname";
$tablename = "vtiger_account";
}
// END
//Before form the where condition, check whether the table for the field has been added in the listview query
if (strstr($listquery, $tablename)) {
if ($where != '') {
$where .= " OR ";
}
$where .= $tablename . "." . $columnname . " LIKE '" . formatForSqlLike($search_val) . "'";
}
}
return $where;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:42,代码来源:SearchUtils.php
示例10: plugin_process_list_query
function plugin_process_list_query($query)
{
global $log, $adb, $current_user;
$log->debug("Entering process_list_query1(" . $query . ") method ...");
$permitted_field_lists = array();
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$sql1 = "select columnname from vtiger_field where tabid=7 and block <> 75 and vtiger_field.presence in (0,2)";
$params1 = array();
} else {
$profileList = getCurrentUserProfileList();
$sql1 = "select columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=7 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
$params1 = array();
if (count($profileList) > 0) {
$sql1 .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
array_push($params1, $profileList);
}
}
$result1 = $this->db->pquery($sql1, $params1);
for ($i = 0; $i < $adb->num_rows($result1); $i++) {
$permitted_field_lists[] = $adb->query_result($result1, $i, 'columnname');
}
$result =& $this->db->query($query, true, "Error retrieving {$this->object_name} list: ");
$list = array();
$rows_found = $this->db->getRowCount($result);
if ($rows_found != 0) {
for ($index = 0, $row = $this->db->fetchByAssoc($result, $index); $row && $index < $rows_found; $index++, $row = $this->db->fetchByAssoc($result, $index)) {
$lead = array();
$lead[lastname] = in_array("lastname", $permitted_field_lists) ? $row[lastname] : "";
$lead[firstname] = in_array("firstname", $permitted_field_lists) ? $row[firstname] : "";
$lead[email] = in_array("email", $permitted_field_lists) ? $row[email] : "";
$lead[leadid] = $row[leadid];
$lead[company] = in_array("company", $permitted_field_lists) ? $row[company] : "";
$list[] = $lead;
}
}
$response = array();
$response['list'] = $list;
$response['row_count'] = $rows_found;
$response['next_offset'] = $next_offset;
$response['previous_offset'] = $previous_offset;
$log->debug("Exiting process_list_query1 method ...");
return $response;
}
开发者ID:kduqi,项目名称:corebos,代码行数:44,代码来源:Leads.php
示例11: getAllModulesWithDateTimeFields
function getAllModulesWithDateTimeFields()
{
global $adb, $log, $current_user;
if (is_admin($current_user)) {
$sqlmods = 'SELECT distinct cbfld.tabid,vtiger_tab.name
FROM vtiger_field as cbfld
INNER JOIN vtiger_tab on cbfld.tabid = vtiger_tab.tabid
WHERE vtiger_tab.presence=0 and vtiger_tab.isentitytype=1 and uitype=5';
$params = array();
} else {
$sqlmods = '';
$profileList = getCurrentUserProfileList();
$sql = "select * from vtiger_profile2globalpermissions where globalactionid=1 and profileid in (" . generateQuestionMarks($profileList) . ");";
$result = $adb->pquery($sql, array($profileList));
if ($result and $adb->num_rows($result) > 0) {
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$permission = $adb->query_result($result, $i, 'globalactionpermission');
if ($permission != 1 || $permission != '1') {
// can see everything
$sqlmods = 'SELECT distinct cbfld.tabid,vtiger_tab.name
FROM vtiger_field as cbfld
INNER JOIN vtiger_tab on cbfld.tabid = vtiger_tab.tabid
WHERE vtiger_tab.presence=0 and vtiger_tab.isentitytype=1 and uitype=14 and
exists (select 1 from vtiger_field where vtiger_field.tabid = cbfld.tabid and uitype=5)';
break;
}
}
$params = array();
}
if ($sqlmods == '') {
$sqlmods = 'SELECT distinct cbfld.tabid,vtiger_tab.name
FROM vtiger_field as cbfld
INNER JOIN vtiger_tab on cbfld.tabid = vtiger_tab.tabid
INNER JOIN vtiger_profile2tab on vtiger_profile2tab.tabid = vtiger_tab.tabid
WHERE vtiger_tab.presence=0 and vtiger_tab.isentitytype=1 and uitype=14
and vtiger_profile2tab.profileid in (' . generateQuestionMarks($profileList) . ') and vtiger_profile2tab.permissions=0 and
exists (select 1 from vtiger_field where vtiger_field.tabid = cbfld.tabid and uitype=5)';
$params = array($profileList);
}
}
$rsmwd = $adb->pquery($sqlmods, $params);
$modswithdt = array();
while ($mod = $adb->fetch_array($rsmwd)) {
$modswithdt[$mod['tabid']] = $mod['name'];
}
uasort($modswithdt, function ($a, $b) {
return strtolower(getTranslatedString($a, $a)) < strtolower(getTranslatedString($b, $b)) ? -1 : 1;
});
return $modswithdt;
}
开发者ID:kikojover,项目名称:corebos,代码行数:50,代码来源:CalendarUtils.php
示例12: CheckFieldPermission
function CheckFieldPermission($fieldname, $module)
{
global $current_user, $adb;
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
if ($fieldname == '' || $module == '') {
return "false";
}
if ($module == 'Calendar') {
$tab_id = array(9, 16);
} else {
$tab_id = getTabid($module);
}
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) {
$profileList = getCurrentUserProfileList();
$sql1 = "SELECT fieldname FROM vtiger_field INNER JOIN vtiger_profile2field ON vtiger_profile2field.fieldid=vtiger_field.fieldid INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid=vtiger_field.fieldid WHERE vtiger_field.tabid in(" . generateQuestionMarks($tab_id) . ") AND fieldname=? AND vtiger_field.displaytype IN (1,2,3,4) AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN (" . generateQuestionMarks($profileList) . ") and vtiger_field.presence in (0,2) GROUP BY vtiger_field.fieldid ORDER BY block,sequence";
$result1 = $adb->pquery($sql1, array($tab_id, $fieldname, $profileList));
$permission = $adb->num_rows($result1) > 0 ? "true" : "false";
} else {
$permission = "true";
}
return $permission;
}
开发者ID:latechdirect,项目名称:vtiger,代码行数:22,代码来源:RelatedListView.php
示例13: getStdCriteriaByModule
function getStdCriteriaByModule($module)
{
$adb = PearDatabase::getInstance();
$tabid = getTabid($module);
$blockids = $params = $profileList = array();
$user_privileges_path = 'user_privileges/user_privileges_' . $this->current_user->id . '.php';
if (file_exists($user_privileges_path)) {
require $user_privileges_path;
}
$module_info = $this->getCustomViewModuleInfo($module);
if (!isset($this->module_list) || empty($this->module_list)) {
$this->initListOfModules();
}
foreach ($this->module_list[$module] as $key => $blockid) {
$blockids[] = $blockid;
}
if (is_array($blockids)) {
$blocks_params = implode(",", $blockids);
} else {
$blocks_params = $blockids;
}
if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
$sql = "select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid ";
$sql .= " where vtiger_field.tabid={$tabid} and vtiger_field.block in ({$blocks_params})\n and vtiger_field.uitype in (5,6,23,70)";
$sql .= " and vtiger_field.presence in (0,2) order by vtiger_field.sequence";
} else {
$profileList = getCurrentUserProfileList();
$sql = "select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ";
$sql .= " where vtiger_field.tabid={$tabid} and vtiger_field.block in ({$blocks_params}) and vtiger_field.uitype in (5,6,23,70)";
$sql .= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
if (count($profileList) > 0) {
$sql .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
array_push($params, $profileList);
}
$sql .= " order by vtiger_field.sequence";
}
$result = $adb->pquery($sql, $profileList);
while ($criteriatyperow = $adb->fetch_array($result)) {
$fieldtablename = $criteriatyperow["tablename"];
$fieldcolname = $criteriatyperow["columnname"];
$fieldlabel = $criteriatyperow["fieldlabel"];
$fieldname = $criteriatyperow["fieldname"];
$fieldlabel1 = $fieldlabel;
$typeofdata = explode("~", $criteriatyperow["typeofdata"]);
$typeofdata = $typeofdata[0];
// $optionvalue = $fieldtablename . ":" . $fieldcolname . ":" . $module . "_" . $fieldlabel1 . ":" . $fieldname . ":" . $typeofdata;
$optionvalue = $fieldtablename . ":" . $fieldcolname . ":" . $module . "_" . $fieldlabel1 . ":" . $fieldname . ":" . $typeofdata;
$stdcriteria_list[$optionvalue] = $fieldlabel;
}
return $stdcriteria_list;
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:51,代码来源:ITS4YouReports.php
示例14: get_calendarsforol
/**
* Function to get calendar query for outlookplugin
* @param string $username - User name
* @return string $query - sql query
*/
function get_calendarsforol($user_name)
{
global $log, $adb, $current_user;
$log-&g
|
请发表评论