Last active
August 29, 2015 14:08
-
-
Save betobaz/d6c2657124cee73f56e1 to your computer and use it in GitHub Desktop.
SugarCRM::Data Visibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
class OwnedByTeamField extends SugarVisibility{ | |
protected $bean; | |
public function __construct($bean) | |
{ | |
$this->bean = $bean; | |
$this->module_dir = $this->bean->module_dir; | |
} | |
public function addVisibilityWhere(&$query, $options = null){ | |
$GLOBALS['log']->fatal("OwnedByTeamField::addVisibilityWhere query:" . print_r($query, true)); | |
$query .= " AND account_type = 'Prospecto' "; | |
} | |
public function addSseVisibilityFilter($engine, $filter) | |
{ | |
$GLOBALS['log']->fatal("OwnedByTeamField::addSseVisibilityFilter: filter" . print_r($filter, true)); | |
return $filter; | |
} | |
// Utilizar para aplicar clausulas para la vista de lista | |
public function addVisibilityWhereQuery(SugarQuery $query) | |
{ | |
$query->where() | |
->equals('account_type', 'Prospecto'); | |
$GLOBALS['log']->fatal("OwnedByTeamField::addVisibilityWhereQuery: query" . print_r($query->compileSql(), true)); | |
return $query; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dictionary['Account']['visibility'] = array( | |
"OwnedByTeamField" => true, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment