3 final class ConpherenceColumnViewController
extends
4 ConpherenceController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $user = $request->getUser();
9 $latest_conpherences = array();
10 $latest_participant = id(new ConpherenceParticipantQuery())
11 ->withParticipantPHIDs(array($user->getPHID()))
14 if ($latest_participant) {
15 $conpherence_phids = mpull($latest_participant, 'getConpherencePHID');
16 $latest_conpherences = id(new ConpherenceThreadQuery())
18 ->withPHIDs($conpherence_phids)
19 ->needProfileImage(true)
21 $latest_conpherences = mpull($latest_conpherences, null, 'getPHID');
22 $latest_conpherences = array_select_keys(
29 if ($request->getInt('id')) {
30 $conpherence = id(new ConpherenceThreadQuery())
32 ->withIDs(array($request->getInt('id')))
33 ->needProfileImage(true)
34 ->needTransactions(true)
35 ->setTransactionLimit(ConpherenceThreadQuery
::TRANSACTION_LIMIT
)
38 } else if ($latest_participant) {
39 $participant = head($latest_participant);
40 $conpherence = id(new ConpherenceThreadQuery())
42 ->withPHIDs(array($participant->getConpherencePHID()))
43 ->needProfileImage(true)
44 ->needTransactions(true)
45 ->setTransactionLimit(ConpherenceThreadQuery
::TRANSACTION_LIMIT
)
50 $durable_column = id(new ConpherenceDurableColumnView())
55 return new Aphront404Response();
58 $conpherence_id = null;
59 $conpherence_phid = null;
60 $latest_transaction_id = null;
64 $this->setConpherence($conpherence);
66 $participant = $conpherence->getParticipant($user->getPHID());
67 $transactions = $conpherence->getTransactions();
68 $latest_transaction = head($transactions);
69 $write_guard = AphrontWriteGuard
::beginScopedUnguardedWrites();
70 $participant->markUpToDate($conpherence);
73 $draft = PhabricatorDraft
::newFromUserAndKey(
75 $conpherence->getPHID());
79 ->setSelectedConpherence($conpherence)
80 ->setConpherences($latest_conpherences);
81 $conpherence_id = $conpherence->getID();
82 $conpherence_phid = $conpherence->getPHID();
83 $latest_transaction_id = $latest_transaction->getID();
84 $can_edit = PhabricatorPolicyFilter
::hasCapability(
87 PhabricatorPolicyCapability
::CAN_EDIT
);
90 $dropdown_query = id(new AphlictDropdownDataQuery())
92 $dropdown_query->execute();
94 'content' => hsprintf('%s', $durable_column),
95 'threadID' => $conpherence_id,
96 'threadPHID' => $conpherence_phid,
97 'latestTransactionID' => $latest_transaction_id,
98 'canEdit' => $can_edit,
99 'aphlictDropdownData' => array(
100 $dropdown_query->getNotificationData(),
101 $dropdown_query->getConpherenceData(),
105 return id(new AphrontAjaxResponse())->setContent($response);