本文整理汇总了PHP中SugarBean::add_team_security_where_clause方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarBean::add_team_security_where_clause方法的具体用法?PHP SugarBean::add_team_security_where_clause怎么用?PHP SugarBean::add_team_security_where_clause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarBean
的用法示例。
在下文中一共展示了SugarBean::add_team_security_where_clause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_message_scope_dom
function get_message_scope_dom($campaign_id, $campaign_name, $db = null, $mod_strings = array())
{
//find prospect list attached to this campaign..
$query = "SELECT prospect_list_id, prospect_lists.name ";
$query .= "FROM prospect_list_campaigns ";
$query .= "INNER join prospect_lists on prospect_lists.id = prospect_list_campaigns.prospect_list_id ";
// We need to confirm that the user is a member of the team of the item.
$bean = new SugarBean();
$bean->disable_row_level_security = false;
$bean->add_team_security_where_clause($query, "prospect_lists");
$query .= "WHERE prospect_lists.deleted = 0 ";
$query .= "AND prospect_list_campaigns.deleted=0 ";
$query .= "AND campaign_id='" . $campaign_id . "'";
$query .= " and prospect_lists.list_type not like 'exempt%'";
if (empty($db)) {
$db = DBManagerFactory::getInstance();
}
if (empty($mod_strings) or !isset($mod_strings['LBL_DEFAULT'])) {
global $current_language;
$mod_strings = return_module_language($current_language, 'Campaigns');
}
//add campaign to the result array.
//$return_array[$campaign_id]= $campaign_name . ' (' . $mod_strings['LBL_DEFAULT'] . ')';
$result = $db->query($query);
while (($row = $db->fetchByAssoc($result)) != null) {
$return_array[$row['prospect_list_id']] = $row['name'];
}
if (empty($return_array)) {
$return_array = array();
} else {
return $return_array;
}
}
示例2: retrieveFoldersForProcessing
/**
* Builds up a metacollection of user/group folders to be passed to processor methods
* @param object User object, defaults to $current_user
* @return array Array of abstract folder objects
*/
function retrieveFoldersForProcessing($user, $subscribed = true)
{
global $sugar_config;
global $current_language, $current_user;
$emails_mod_strings = return_module_language($current_language, "Emails");
$myEmailTypeString = 'inbound';
$myDraftsTypeString = 'draft';
$mySentEmailTypeString = 'sent';
if (empty($user)) {
global $current_user;
$user = $current_user;
}
$rootWhere = '';
$teamSecurityClause = '';
$bean = new SugarBean();
$bean->disable_row_level_security = false;
$bean->add_team_security_where_clause($teamSecurityClause, 'f');
$bean->disable_row_level_security = true;
$rootWhere .= "AND (f.parent_folder IS NULL OR f.parent_folder = '')";
if ($subscribed) {
$q = $this->coreSubscribed . $teamSecurityClause . $this->coreWhereSubscribed . "'{$user->id}' " . $rootWhere . $this->coreOrderBy;
} else {
$q = $this->core . $teamSecurityClause . $this->coreWhere . $rootWhere . $this->coreOrderBy;
}
$r = $this->db->query($q);
$return = array();
$found = array();
while ($a = $this->db->fetchByAssoc($r, false)) {
if (($a['folder_type'] == $myEmailTypeString || $a['folder_type'] == $myDraftsTypeString || $a['folder_type'] == $mySentEmailTypeString) && $a['created_by'] != $current_user->id) {
continue;
}
// if
if (!isset($found[$a['id']])) {
$found[$a['id']] = true;
$return[] = $a;
}
}
return $return;
}