Conpherence - make adding participants be a little dialogue.

Summary: and now you can add more than one at a time! Also adds the 'add participants' and 'new calendar event' options to mobile view. Fixes T3251. Ref T3253.

Test Plan: loaded up these "adders" on both desktop and device-ish views and it went well!

Reviewers: epriestley, chad

Reviewed By: chad

CC: chad, aran, Korvin

Maniphest Tasks: T3251, T3253

Differential Revision: https://secure.phabricator.com/D6075
This commit is contained in:
Bob Trahan
2013-05-29 17:21:07 -07:00
parent 4cbac3fa06
commit 38e6961cbd
8 changed files with 125 additions and 102 deletions

View File

@@ -54,13 +54,12 @@ final class ConpherenceUpdateController
break;
case ConpherenceUpdateActions::ADD_PERSON:
$xactions = array();
$person_tokenizer = $request->getArr('add_person');
$person_phid = reset($person_tokenizer);
if ($person_phid) {
$person_phids = $request->getArr('add_person');
if (!empty($person_phids)) {
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
ConpherenceTransactionType::TYPE_PARTICIPANTS)
->setNewValue(array('+' => array($person_phid)));
->setNewValue(array('+' => $person_phids));
}
break;
case ConpherenceUpdateActions::REMOVE_PERSON:
@@ -153,6 +152,9 @@ final class ConpherenceUpdateController
}
switch ($action) {
case ConpherenceUpdateActions::ADD_PERSON:
$dialogue = $this->renderAddPersonDialogue($conpherence);
break;
case ConpherenceUpdateActions::REMOVE_PERSON:
$dialogue = $this->renderRemovePersonDialogue($conpherence);
break;
@@ -172,6 +174,27 @@ final class ConpherenceUpdateController
}
private function renderAddPersonDialogue(
ConpherenceThread $conpherence) {
$request = $this->getRequest();
$user = $request->getUser();
$add_person = $request->getStr('add_person');
$body = id(new AphrontFormTokenizerControl())
->setPlaceholder(pht('Add participants...'))
->setName('add_person')
->setUser($user)
->setDatasource('/typeahead/common/users/')
->setLimit(1);
require_celerity_resource('conpherence-update-css');
return id(new AphrontDialogView())
->setTitle(pht('Update Conpherence Participants'))
->addHiddenInput('action', 'add_person')
->appendChild($body);
}
private function renderRemovePersonDialogue(
ConpherenceThread $conpherence) {