mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
improve calendar status editing
Summary: make it so a given user can click to edit status from calendar view. also fix bug so when editing status existing "type" is selected Test Plan: edited status from calendar view and observed "sporadic" status sticky Reviewers: epriestley, chad Reviewed By: chad CC: aran, Korvin Maniphest Tasks: T2060, T2061 Differential Revision: https://secure.phabricator.com/D3957
This commit is contained in:
parent
7bdd0e7a3d
commit
3c11bf320f
4 changed files with 23 additions and 3 deletions
|
@ -46,6 +46,7 @@ final class PhabricatorCalendarBrowseController
|
|||
$event->setDescription(
|
||||
$status->getTerseSummary($user).$details
|
||||
);
|
||||
$event->setEventID($status->getID());
|
||||
$month_view->addEvent($event);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ final class PhabricatorCalendarEditStatusController
|
|||
$status_select = id(new AphrontFormSelectControl())
|
||||
->setLabel(pht('Status'))
|
||||
->setName('status')
|
||||
->setValue($status->getStatus())
|
||||
->setOptions($status->getStatusOptions());
|
||||
|
||||
$description = id(new AphrontFormTextAreaControl())
|
||||
|
|
|
@ -7,6 +7,15 @@ final class AphrontCalendarEventView extends AphrontView {
|
|||
private $epochStart;
|
||||
private $epochEnd;
|
||||
private $description;
|
||||
private $eventID;
|
||||
|
||||
public function setEventID($event_id) {
|
||||
$this->eventID = $event_id;
|
||||
return $this;
|
||||
}
|
||||
public function getEventID() {
|
||||
return $this->eventID;
|
||||
}
|
||||
|
||||
public function setUserPHID($user_phid) {
|
||||
$this->userPHID = $user_phid;
|
||||
|
|
|
@ -289,15 +289,24 @@ final class AphrontCalendarMonthView extends AphrontView {
|
|||
$info .= "\n\n".$event->getDescription();
|
||||
}
|
||||
|
||||
if ($user->getPHID() == $event->getUserPHID()) {
|
||||
$tag = 'a';
|
||||
$href = '/calendar/status/edit/'.$event->getEventID().'/';
|
||||
} else {
|
||||
$tag = 'div';
|
||||
$href = null;
|
||||
}
|
||||
|
||||
$text_div = javelin_render_tag(
|
||||
'div',
|
||||
$tag,
|
||||
array(
|
||||
'sigil' => 'has-tooltip',
|
||||
'meta' => array(
|
||||
'tip' => $info."\n\n".implode("\n", $when),
|
||||
'size' => 240,
|
||||
'tip' => $info."\n\n".implode("\n", $when),
|
||||
'size' => 240,
|
||||
),
|
||||
'class' => 'aphront-calendar-event-text',
|
||||
'href' => $href,
|
||||
),
|
||||
phutil_escape_html(phutil_utf8_shorten($event->getName(), 32)));
|
||||
|
||||
|
|
Loading…
Reference in a new issue