Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15438816
D13459.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13459.diff
View Options
diff --git a/resources/sql/autopatches/20150626.spaces.1.calendar.sql b/resources/sql/autopatches/20150626.spaces.1.calendar.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20150626.spaces.1.calendar.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_calendar.calendar_event
+ ADD spacePHID VARBINARY(64);
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -5124,6 +5124,7 @@
'PhabricatorDestructibleInterface',
'PhabricatorMentionableInterface',
'PhabricatorFlaggableInterface',
+ 'PhabricatorSpacesInterface',
),
'PhabricatorCalendarEventCancelController' => 'PhabricatorCalendarController',
'PhabricatorCalendarEventCommentController' => 'PhabricatorCalendarController',
diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
@@ -158,6 +158,7 @@
$icon = $event->getIcon();
$edit_policy = $event->getEditPolicy();
$view_policy = $event->getViewPolicy();
+ $space = $event->getSpacePHID();
if ($request->isFormPost()) {
$xactions = array();
@@ -178,6 +179,7 @@
$subscribers = $request->getArr('subscribers');
$edit_policy = $request->getStr('editPolicy');
$view_policy = $request->getStr('viewPolicy');
+ $space = $request->getStr('spacePHID');
$is_recurring = $request->getStr('isRecurring') ? 1 : 0;
$frequency = $request->getStr('frequency');
$is_all_day = $request->getStr('isAllDay');
@@ -263,6 +265,10 @@
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
->setNewValue($request->getStr('editPolicy'));
+ $xactions[] = id(new PhabricatorCalendarEventTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_SPACE)
+ ->setNewValue($space);
+
$editor = id(new PhabricatorCalendarEventEditor())
->setActor($viewer)
->setContentSourceFromRequest($request)
@@ -471,6 +477,7 @@
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicyObject($event)
->setPolicies($current_policies)
+ ->setSpacePHID($space)
->setName('viewPolicy');
$edit_policies = id(new AphrontFormPolicyControl())
->setUser($viewer)
diff --git a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
--- a/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
+++ b/src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
@@ -288,6 +288,8 @@
}
$item = id(new PHUIObjectItemView())
+ ->setUser($viewer)
+ ->setObject($event)
->setHeader($viewer->renderHandle($event->getPHID())->render())
->addAttribute($event_date_info)
->addAttribute($attendees)
diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -9,7 +9,8 @@
PhabricatorTokenReceiverInterface,
PhabricatorDestructibleInterface,
PhabricatorMentionableInterface,
- PhabricatorFlaggableInterface {
+ PhabricatorFlaggableInterface,
+ PhabricatorSpacesInterface {
protected $name;
protected $userPHID;
@@ -32,6 +33,8 @@
protected $viewPolicy;
protected $editPolicy;
+ protected $spacePHID;
+
const DEFAULT_ICON = 'fa-calendar';
private $parentEvent = self::ATTACHABLE;
@@ -71,6 +74,7 @@
->setIcon(self::DEFAULT_ICON)
->setViewPolicy($view_policy)
->setEditPolicy($actor->getPHID())
+ ->setSpacePHID($actor->getDefaultSpacePHID())
->attachInvitees(array())
->applyViewerTimezone($actor);
}
@@ -551,4 +555,11 @@
$this->delete();
$this->saveTransaction();
}
+
+/* -( PhabricatorSpacesInterface )----------------------------------------- */
+
+
+ public function getSpacePHID() {
+ return $this->spacePHID;
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 27, 3:47 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7227907
Default Alt Text
D13459.diff (4 KB)
Attached To
Mode
D13459: Events should offer Spaces as the view policy options
Attached
Detach File
Event Timeline
Log In to Comment