Page MenuHomePhabricator

D13481.id32619.diff
No OneTemporary

D13481.id32619.diff

diff --git a/src/applications/calendar/application/PhabricatorCalendarApplication.php b/src/applications/calendar/application/PhabricatorCalendarApplication.php
--- a/src/applications/calendar/application/PhabricatorCalendarApplication.php
+++ b/src/applications/calendar/application/PhabricatorCalendarApplication.php
@@ -61,7 +61,7 @@
=> 'PhabricatorCalendarEventCancelController',
'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'
=> 'PhabricatorCalendarEventJoinController',
- 'comment/(?P<id>[1-9]\d*)/'
+ 'comment/(?P<id>[1-9]\d*)/(?:(?P<sequence>\d+)/)?'
=> 'PhabricatorCalendarEventCommentController',
),
),
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventCommentController.php b/src/applications/calendar/controller/PhabricatorCalendarEventCommentController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventCommentController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventCommentController.php
@@ -11,12 +11,14 @@
}
public function handleRequest(AphrontRequest $request) {
- $user = $request->getUser();
-
if (!$request->isFormPost()) {
return new Aphront400Response();
}
+ $user = $request->getUser();
+ $is_preview = $request->isPreviewRequest();
+ $draft = PhabricatorDraft::buildFromRequest($request);
+
$event = id(new PhabricatorCalendarEventQuery())
->setViewer($user)
->withIDs(array($this->id))
@@ -25,8 +27,23 @@
return new Aphront404Response();
}
- $is_preview = $request->isPreviewRequest();
- $draft = PhabricatorDraft::buildFromRequest($request);
+ $index = $request->getURIData('sequence');
+ if ($index && !$is_preview) {
+ $result = $this->getEventAtIndexForGhostPHID(
+ $user,
+ $event->getPHID(),
+ $index);
+
+ if ($result) {
+ $event = $result;
+ } else {
+ $event = $this->createEventFromGhost(
+ $user,
+ $event,
+ $index);
+ $event->applyViewerTimezone($user);
+ }
+ }
$view_uri = '/'.$event->getMonogram();
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
@@ -16,9 +16,10 @@
public function processRequest() {
$request = $this->getRequest();
$viewer = $request->getUser();
-
$sequence = $request->getURIData('sequence');
+ $timeline = null;
+
$event = id(new PhabricatorCalendarEventQuery())
->setViewer($viewer)
->withIDs(array($this->id))
@@ -60,9 +61,11 @@
$crumbs->addTextCrumb($title, '/E'.$event->getID());
}
- $timeline = $this->buildTransactionTimeline(
- $event,
- new PhabricatorCalendarEventTransactionQuery());
+ if (!$event->getIsGhostEvent()) {
+ $timeline = $this->buildTransactionTimeline(
+ $event,
+ new PhabricatorCalendarEventTransactionQuery());
+ }
$header = $this->buildHeaderView($event);
$actions = $this->buildActionView($event);
@@ -84,7 +87,8 @@
->setDraft($draft)
->setHeaderText($add_comment_header)
->setAction(
- $this->getApplicationURI('/event/comment/'.$event->getID().'/'))
+ $this->getApplicationURI(
+ '/event/comment/'.$event->getID().'/'.$sequence.'/'))
->setSubmitButtonName(pht('Add Comment'));
return $this->buildApplicationPage(

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 1:12 AM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6729578
Default Alt Text
D13481.id32619.diff (3 KB)

Event Timeline