Differential D15063 Diff 36382 src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/subscriptions/events/PhabricatorSubscriptionsUIEventListener.php
Show All 28 Lines | if (!$object || !$object->getPHID()) { | ||||
return; | return; | ||||
} | } | ||||
if (!($object instanceof PhabricatorSubscribableInterface)) { | if (!($object instanceof PhabricatorSubscribableInterface)) { | ||||
// This object isn't subscribable. | // This object isn't subscribable. | ||||
return; | return; | ||||
} | } | ||||
if (!$object->shouldAllowSubscription($user_phid)) { | |||||
// This object doesn't allow the viewer to subscribe. | |||||
return; | |||||
} | |||||
if ($user_phid && $object->isAutomaticallySubscribed($user_phid)) { | if ($user_phid && $object->isAutomaticallySubscribed($user_phid)) { | ||||
$sub_action = id(new PhabricatorActionView()) | $sub_action = id(new PhabricatorActionView()) | ||||
->setWorkflow(true) | ->setWorkflow(true) | ||||
->setDisabled(true) | ->setDisabled(true) | ||||
->setRenderAsForm(true) | ->setRenderAsForm(true) | ||||
->setHref('/subscriptions/add/'.$object->getPHID().'/') | ->setHref('/subscriptions/add/'.$object->getPHID().'/') | ||||
->setName(pht('Automatically Subscribed')) | ->setName(pht('Automatically Subscribed')) | ||||
->setIcon('fa-check-circle lightgreytext'); | ->setIcon('fa-check-circle lightgreytext'); | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |