Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditEngine.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | protected function buildCustomEditFields($object) { | ||||
if ($this->getIsCreate()) { | if ($this->getIsCreate()) { | ||||
$participant_phids = array($viewer->getPHID()); | $participant_phids = array($viewer->getPHID()); | ||||
$initial_phids = array(); | $initial_phids = array(); | ||||
} else { | } else { | ||||
$participant_phids = $object->getParticipantPHIDs(); | $participant_phids = $object->getParticipantPHIDs(); | ||||
$initial_phids = $participant_phids; | $initial_phids = $participant_phids; | ||||
} | } | ||||
// Only show participants on create or conduit, not edit | // Only show participants on create or conduit, not edit. | ||||
$conduit_only = !$this->getIsCreate(); | $show_participants = (bool)$this->getIsCreate(); | ||||
return array( | return array( | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('name') | ->setKey('name') | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setDescription(pht('Room name.')) | ->setDescription(pht('Room name.')) | ||||
->setConduitTypeDescription(pht('New Room name.')) | ->setConduitTypeDescription(pht('New Room name.')) | ||||
->setIsRequired(true) | ->setIsRequired(true) | ||||
Show All 9 Lines | return array( | ||||
->setTransactionType( | ->setTransactionType( | ||||
ConpherenceThreadTopicTransaction::TRANSACTIONTYPE) | ConpherenceThreadTopicTransaction::TRANSACTIONTYPE) | ||||
->setValue($object->getTopic()), | ->setValue($object->getTopic()), | ||||
id(new PhabricatorUsersEditField()) | id(new PhabricatorUsersEditField()) | ||||
->setKey('participants') | ->setKey('participants') | ||||
->setValue($participant_phids) | ->setValue($participant_phids) | ||||
->setInitialValue($initial_phids) | ->setInitialValue($initial_phids) | ||||
->setIsConduitOnly($conduit_only) | ->setIsFormField($show_participants) | ||||
->setAliases(array('users', 'members', 'participants', 'userPHID')) | ->setAliases(array('users', 'members', 'participants', 'userPHID')) | ||||
->setDescription(pht('Room participants.')) | ->setDescription(pht('Room participants.')) | ||||
->setUseEdgeTransactions(true) | ->setUseEdgeTransactions(true) | ||||
->setConduitTypeDescription(pht('New Room participants.')) | ->setConduitTypeDescription(pht('New Room participants.')) | ||||
->setTransactionType( | ->setTransactionType( | ||||
ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE) | ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE) | ||||
->setLabel(pht('Initial Participants')), | ->setLabel(pht('Initial Participants')), | ||||
); | ); | ||||
} | } | ||||
} | } |