@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add `calendar.event.search` and `calendar.event.edit`

Summary: Ref T7944. The search method is a bit bare-bones for now, but these substantially work.

Test Plan: Edited events via API; queried events via API.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7944

Differential Revision: https://secure.phabricator.com/D16288

+89 -17
+7 -2
src/__phutil_library_map__.php
··· 2019 2019 'PhabricatorCalendarApplication' => 'applications/calendar/application/PhabricatorCalendarApplication.php', 2020 2020 'PhabricatorCalendarController' => 'applications/calendar/controller/PhabricatorCalendarController.php', 2021 2021 'PhabricatorCalendarDAO' => 'applications/calendar/storage/PhabricatorCalendarDAO.php', 2022 - 'PhabricatorCalendarEditEngine' => 'applications/calendar/editor/PhabricatorCalendarEditEngine.php', 2023 2022 'PhabricatorCalendarEvent' => 'applications/calendar/storage/PhabricatorCalendarEvent.php', 2024 2023 'PhabricatorCalendarEventAcceptTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventAcceptTransaction.php', 2025 2024 'PhabricatorCalendarEventAllDayTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventAllDayTransaction.php', ··· 2029 2028 'PhabricatorCalendarEventDeclineTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventDeclineTransaction.php', 2030 2029 'PhabricatorCalendarEventDescriptionTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php', 2031 2030 'PhabricatorCalendarEventDragController' => 'applications/calendar/controller/PhabricatorCalendarEventDragController.php', 2031 + 'PhabricatorCalendarEventEditConduitAPIMethod' => 'applications/calendar/conduit/PhabricatorCalendarEventEditConduitAPIMethod.php', 2032 2032 'PhabricatorCalendarEventEditController' => 'applications/calendar/controller/PhabricatorCalendarEventEditController.php', 2033 + 'PhabricatorCalendarEventEditEngine' => 'applications/calendar/editor/PhabricatorCalendarEventEditEngine.php', 2033 2034 'PhabricatorCalendarEventEditor' => 'applications/calendar/editor/PhabricatorCalendarEventEditor.php', 2034 2035 'PhabricatorCalendarEventEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventEmailCommand.php', 2035 2036 'PhabricatorCalendarEventEndDateTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php', ··· 2048 2049 'PhabricatorCalendarEventRSVPEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventRSVPEmailCommand.php', 2049 2050 'PhabricatorCalendarEventRecurringTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventRecurringTransaction.php', 2050 2051 'PhabricatorCalendarEventReplyTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventReplyTransaction.php', 2052 + 'PhabricatorCalendarEventSearchConduitAPIMethod' => 'applications/calendar/conduit/PhabricatorCalendarEventSearchConduitAPIMethod.php', 2051 2053 'PhabricatorCalendarEventSearchEngine' => 'applications/calendar/query/PhabricatorCalendarEventSearchEngine.php', 2052 2054 'PhabricatorCalendarEventStartDateTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventStartDateTransaction.php', 2053 2055 'PhabricatorCalendarEventTransaction' => 'applications/calendar/storage/PhabricatorCalendarEventTransaction.php', ··· 6630 6632 'PhabricatorCalendarApplication' => 'PhabricatorApplication', 6631 6633 'PhabricatorCalendarController' => 'PhabricatorController', 6632 6634 'PhabricatorCalendarDAO' => 'PhabricatorLiskDAO', 6633 - 'PhabricatorCalendarEditEngine' => 'PhabricatorEditEngine', 6634 6635 'PhabricatorCalendarEvent' => array( 6635 6636 'PhabricatorCalendarDAO', 6636 6637 'PhabricatorPolicyInterface', ··· 6644 6645 'PhabricatorFlaggableInterface', 6645 6646 'PhabricatorSpacesInterface', 6646 6647 'PhabricatorFulltextInterface', 6648 + 'PhabricatorConduitResultInterface', 6647 6649 ), 6648 6650 'PhabricatorCalendarEventAcceptTransaction' => 'PhabricatorCalendarEventReplyTransaction', 6649 6651 'PhabricatorCalendarEventAllDayTransaction' => 'PhabricatorCalendarEventTransactionType', ··· 6653 6655 'PhabricatorCalendarEventDeclineTransaction' => 'PhabricatorCalendarEventReplyTransaction', 6654 6656 'PhabricatorCalendarEventDescriptionTransaction' => 'PhabricatorCalendarEventTransactionType', 6655 6657 'PhabricatorCalendarEventDragController' => 'PhabricatorCalendarController', 6658 + 'PhabricatorCalendarEventEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 6656 6659 'PhabricatorCalendarEventEditController' => 'PhabricatorCalendarController', 6660 + 'PhabricatorCalendarEventEditEngine' => 'PhabricatorEditEngine', 6657 6661 'PhabricatorCalendarEventEditor' => 'PhabricatorApplicationTransactionEditor', 6658 6662 'PhabricatorCalendarEventEmailCommand' => 'MetaMTAEmailTransactionCommand', 6659 6663 'PhabricatorCalendarEventEndDateTransaction' => 'PhabricatorCalendarEventDateTransaction', ··· 6675 6679 'PhabricatorCalendarEventRSVPEmailCommand' => 'PhabricatorCalendarEventEmailCommand', 6676 6680 'PhabricatorCalendarEventRecurringTransaction' => 'PhabricatorCalendarEventTransactionType', 6677 6681 'PhabricatorCalendarEventReplyTransaction' => 'PhabricatorCalendarEventTransactionType', 6682 + 'PhabricatorCalendarEventSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 6678 6683 'PhabricatorCalendarEventSearchEngine' => 'PhabricatorApplicationSearchEngine', 6679 6684 'PhabricatorCalendarEventStartDateTransaction' => 'PhabricatorCalendarEventDateTransaction', 6680 6685 'PhabricatorCalendarEventTransaction' => 'PhabricatorModularTransaction',
+19
src/applications/calendar/conduit/PhabricatorCalendarEventEditConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class PhabricatorCalendarEventEditConduitAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'calendar.event.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new PhabricatorCalendarEventEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new event or edit an existing one.'); 17 + } 18 + 19 + }
+18
src/applications/calendar/conduit/PhabricatorCalendarEventSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class PhabricatorCalendarEventSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'calendar.event.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new PhabricatorCalendarEventSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about events.'); 16 + } 17 + 18 + }
+1 -1
src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
··· 4 4 extends PhabricatorCalendarController { 5 5 6 6 public function handleRequest(AphrontRequest $request) { 7 - return id(new PhabricatorCalendarEditEngine()) 7 + return id(new PhabricatorCalendarEventEditEngine()) 8 8 ->setController($this) 9 9 ->buildResponse(); 10 10 }
+1 -1
src/applications/calendar/controller/PhabricatorCalendarEventListController.php
··· 27 27 protected function buildApplicationCrumbs() { 28 28 $crumbs = parent::buildApplicationCrumbs(); 29 29 30 - id(new PhabricatorCalendarEditEngine()) 30 + id(new PhabricatorCalendarEventEditEngine()) 31 31 ->setViewer($this->getViewer()) 32 32 ->addActionToCrumbs($crumbs); 33 33
+1 -1
src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
··· 38 38 $details = $this->buildPropertySection($event); 39 39 $description = $this->buildDescriptionView($event); 40 40 41 - $comment_view = id(new PhabricatorCalendarEditEngine()) 41 + $comment_view = id(new PhabricatorCalendarEventEditEngine()) 42 42 ->setViewer($viewer) 43 43 ->buildEditEngineCommentView($event); 44 44
+1 -1
src/applications/calendar/editor/PhabricatorCalendarEditEngine.php src/applications/calendar/editor/PhabricatorCalendarEventEditEngine.php
··· 1 1 <?php 2 2 3 - final class PhabricatorCalendarEditEngine 3 + final class PhabricatorCalendarEventEditEngine 4 4 extends PhabricatorEditEngine { 5 5 6 6 const ENGINECONST = 'calendar.event';
+41 -11
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 1 1 <?php 2 2 3 3 final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO 4 - implements PhabricatorPolicyInterface, 5 - PhabricatorProjectInterface, 6 - PhabricatorMarkupInterface, 7 - PhabricatorApplicationTransactionInterface, 8 - PhabricatorSubscribableInterface, 9 - PhabricatorTokenReceiverInterface, 10 - PhabricatorDestructibleInterface, 11 - PhabricatorMentionableInterface, 12 - PhabricatorFlaggableInterface, 13 - PhabricatorSpacesInterface, 14 - PhabricatorFulltextInterface { 4 + implements 5 + PhabricatorPolicyInterface, 6 + PhabricatorProjectInterface, 7 + PhabricatorMarkupInterface, 8 + PhabricatorApplicationTransactionInterface, 9 + PhabricatorSubscribableInterface, 10 + PhabricatorTokenReceiverInterface, 11 + PhabricatorDestructibleInterface, 12 + PhabricatorMentionableInterface, 13 + PhabricatorFlaggableInterface, 14 + PhabricatorSpacesInterface, 15 + PhabricatorFulltextInterface, 16 + PhabricatorConduitResultInterface { 15 17 16 18 protected $name; 17 19 protected $userPHID; ··· 630 632 631 633 public function newFulltextEngine() { 632 634 return new PhabricatorCalendarEventFulltextEngine(); 635 + } 636 + 637 + 638 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 639 + 640 + 641 + public function getFieldSpecificationsForConduit() { 642 + return array( 643 + id(new PhabricatorConduitSearchFieldSpecification()) 644 + ->setKey('name') 645 + ->setType('string') 646 + ->setDescription(pht('The name of the event.')), 647 + id(new PhabricatorConduitSearchFieldSpecification()) 648 + ->setKey('description') 649 + ->setType('string') 650 + ->setDescription(pht('The event description.')), 651 + ); 652 + } 653 + 654 + public function getFieldValuesForConduit() { 655 + return array( 656 + 'name' => $this->getName(), 657 + 'description' => $this->getDescription(), 658 + ); 659 + } 660 + 661 + public function getConduitSearchAttachments() { 662 + return array(); 633 663 } 634 664 635 665 }