1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Merge branch 'master' into redesign-2015

This commit is contained in:
epriestley 2015-06-17 10:44:42 -07:00
commit 7ddaadffab
5 changed files with 21 additions and 19 deletions

View file

@ -127,14 +127,14 @@ final class PhabricatorCalendarEventSearchEngine
}
$invited_phids = $saved->getParameter('invitedPHIDs');
$invited_phids = $user_datasource->evaluateTokens($invited_phids);
if ($invited_phids) {
$invited_phids = $user_datasource->evaluateTokens($invited_phids);
$query->withInvitedPHIDs($invited_phids);
}
$creator_phids = $saved->getParameter('creatorPHIDs');
$creator_phids = $user_datasource->evaluateTokens($creator_phids);
if ($creator_phids) {
$creator_phids = $user_datasource->evaluateTokens($creator_phids);
$query->withCreatorPHIDs($creator_phids);
}

View file

@ -5,8 +5,6 @@
*/
abstract class CelerityResources extends Phobject {
private $map;
abstract public function getName();
abstract public function getResourceData($name);

View file

@ -2,11 +2,6 @@
final class PhabricatorPHID extends Phobject {
protected $phid;
protected $phidType;
protected $ownerPHID;
protected $parentPHID;
public static function generateNewPHID($type, $subtype = null) {
if (!$type) {
throw new Exception(pht('Can not generate PHID with no type.'));

View file

@ -5,6 +5,7 @@ final class PhabricatorSpacesNamespaceQuery
const KEY_ALL = 'spaces.all';
const KEY_DEFAULT = 'spaces.default';
const KEY_VIEWER = 'spaces.viewer';
private $ids;
private $phids;
@ -141,17 +142,25 @@ final class PhabricatorSpacesNamespaceQuery
}
public static function getViewerSpaces(PhabricatorUser $viewer) {
$spaces = self::getAllSpaces();
$cache = PhabricatorCaches::getRequestCache();
$cache_key = self::KEY_VIEWER.'('.$viewer->getPHID().')';
$result = array();
foreach ($spaces as $key => $space) {
$can_see = PhabricatorPolicyFilter::hasCapability(
$viewer,
$space,
PhabricatorPolicyCapability::CAN_VIEW);
if ($can_see) {
$result[$key] = $space;
$result = $cache->getKey($cache_key);
if ($result === null) {
$spaces = self::getAllSpaces();
$result = array();
foreach ($spaces as $key => $space) {
$can_see = PhabricatorPolicyFilter::hasCapability(
$viewer,
$space,
PhabricatorPolicyCapability::CAN_VIEW);
if ($can_see) {
$result[$key] = $space;
}
}
$cache->setKey($cache_key, $result);
}
return $result;

View file

@ -1058,7 +1058,7 @@ abstract class PhabricatorApplicationTransactionEditor
$mailed = array();
foreach ($messages as $mail) {
foreach ($mail->buildRecipientList() as $phid) {
$mailed[$phid] = true;
$mailed[$phid] = $phid;
}
}