@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.

Events should offer Spaces as the view policy options

Summary: Ref T8687, Events should offer Spaces as the view policy options

Test Plan: Create event, choose default Space, save, edit, choose different Space, save, new policy should be reflected on Event.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T8687

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

+24 -1
+2
resources/sql/autopatches/20150626.spaces.1.calendar.sql
··· 1 + ALTER TABLE {$NAMESPACE}_calendar.calendar_event 2 + ADD spacePHID VARBINARY(64);
+1
src/__phutil_library_map__.php
··· 5124 5124 'PhabricatorDestructibleInterface', 5125 5125 'PhabricatorMentionableInterface', 5126 5126 'PhabricatorFlaggableInterface', 5127 + 'PhabricatorSpacesInterface', 5127 5128 ), 5128 5129 'PhabricatorCalendarEventCancelController' => 'PhabricatorCalendarController', 5129 5130 'PhabricatorCalendarEventCommentController' => 'PhabricatorCalendarController',
+7
src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
··· 158 158 $icon = $event->getIcon(); 159 159 $edit_policy = $event->getEditPolicy(); 160 160 $view_policy = $event->getViewPolicy(); 161 + $space = $event->getSpacePHID(); 161 162 162 163 if ($request->isFormPost()) { 163 164 $xactions = array(); ··· 178 179 $subscribers = $request->getArr('subscribers'); 179 180 $edit_policy = $request->getStr('editPolicy'); 180 181 $view_policy = $request->getStr('viewPolicy'); 182 + $space = $request->getStr('spacePHID'); 181 183 $is_recurring = $request->getStr('isRecurring') ? 1 : 0; 182 184 $frequency = $request->getStr('frequency'); 183 185 $is_all_day = $request->getStr('isAllDay'); ··· 262 264 $xactions[] = id(new PhabricatorCalendarEventTransaction()) 263 265 ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) 264 266 ->setNewValue($request->getStr('editPolicy')); 267 + 268 + $xactions[] = id(new PhabricatorCalendarEventTransaction()) 269 + ->setTransactionType(PhabricatorTransactions::TYPE_SPACE) 270 + ->setNewValue($space); 265 271 266 272 $editor = id(new PhabricatorCalendarEventEditor()) 267 273 ->setActor($viewer) ··· 471 477 ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 472 478 ->setPolicyObject($event) 473 479 ->setPolicies($current_policies) 480 + ->setSpacePHID($space) 474 481 ->setName('viewPolicy'); 475 482 $edit_policies = id(new AphrontFormPolicyControl()) 476 483 ->setUser($viewer)
+2
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
··· 288 288 } 289 289 290 290 $item = id(new PHUIObjectItemView()) 291 + ->setUser($viewer) 292 + ->setObject($event) 291 293 ->setHeader($viewer->renderHandle($event->getPHID())->render()) 292 294 ->addAttribute($event_date_info) 293 295 ->addAttribute($attendees)
+12 -1
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 9 9 PhabricatorTokenReceiverInterface, 10 10 PhabricatorDestructibleInterface, 11 11 PhabricatorMentionableInterface, 12 - PhabricatorFlaggableInterface { 12 + PhabricatorFlaggableInterface, 13 + PhabricatorSpacesInterface { 13 14 14 15 protected $name; 15 16 protected $userPHID; ··· 31 32 32 33 protected $viewPolicy; 33 34 protected $editPolicy; 35 + 36 + protected $spacePHID; 34 37 35 38 const DEFAULT_ICON = 'fa-calendar'; 36 39 ··· 71 74 ->setIcon(self::DEFAULT_ICON) 72 75 ->setViewPolicy($view_policy) 73 76 ->setEditPolicy($actor->getPHID()) 77 + ->setSpacePHID($actor->getDefaultSpacePHID()) 74 78 ->attachInvitees(array()) 75 79 ->applyViewerTimezone($actor); 76 80 } ··· 550 554 $this->openTransaction(); 551 555 $this->delete(); 552 556 $this->saveTransaction(); 557 + } 558 + 559 + /* -( PhabricatorSpacesInterface )----------------------------------------- */ 560 + 561 + 562 + public function getSpacePHID() { 563 + return $this->spacePHID; 553 564 } 554 565 }