mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Set event policies like other event properties
Summary: Closes T8028, Set event policies like other event properties Test Plan: Create and edit events, make sure edit and view policies get populated and saved correctly. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T8028 Differential Revision: https://secure.phabricator.com/D13415
This commit is contained in:
parent
cee1835bb0
commit
b1a843b21a
2 changed files with 11 additions and 8 deletions
|
@ -61,6 +61,8 @@ abstract class PhabricatorCalendarController extends PhabricatorController {
|
|||
->setID(null)
|
||||
->setPHID(null)
|
||||
->removeViewerTimezone($viewer)
|
||||
->setViewPolicy($event->getViewPolicy())
|
||||
->setEditPolicy($event->getEditPolicy())
|
||||
->save();
|
||||
$ghost_invitees = array();
|
||||
foreach ($invitees as $invitee) {
|
||||
|
|
|
@ -156,11 +156,8 @@ final class PhabricatorCalendarEventEditController
|
|||
$is_parent = $event->getIsRecurrenceParent();
|
||||
$frequency = idx($event->getRecurrenceFrequency(), 'rule');
|
||||
$icon = $event->getIcon();
|
||||
|
||||
$current_policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($viewer)
|
||||
->setObject($event)
|
||||
->execute();
|
||||
$edit_policy = $event->getEditPolicy();
|
||||
$view_policy = $event->getViewPolicy();
|
||||
|
||||
if ($request->isFormPost()) {
|
||||
$xactions = array();
|
||||
|
@ -306,9 +303,6 @@ final class PhabricatorCalendarEventEditController
|
|||
PhabricatorCalendarEventTransaction::TYPE_END_DATE);
|
||||
$error_recurrence_end_date = $ex->getShortMessage(
|
||||
PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE);
|
||||
|
||||
$event->setViewPolicy($view_policy);
|
||||
$event->setEditPolicy($edit_policy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,6 +316,11 @@ final class PhabricatorCalendarEventEditController
|
|||
|
||||
$recurring_date_edit_label = null;
|
||||
|
||||
$current_policies = id(new PhabricatorPolicyQuery())
|
||||
->setViewer($viewer)
|
||||
->setObject($event)
|
||||
->execute();
|
||||
|
||||
$name = id(new AphrontFormTextControl())
|
||||
->setLabel(pht('Name'))
|
||||
->setName('name')
|
||||
|
@ -468,12 +467,14 @@ final class PhabricatorCalendarEventEditController
|
|||
|
||||
$view_policies = id(new AphrontFormPolicyControl())
|
||||
->setUser($viewer)
|
||||
->setValue($view_policy)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
||||
->setPolicyObject($event)
|
||||
->setPolicies($current_policies)
|
||||
->setName('viewPolicy');
|
||||
$edit_policies = id(new AphrontFormPolicyControl())
|
||||
->setUser($viewer)
|
||||
->setValue($edit_policy)
|
||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
||||
->setPolicyObject($event)
|
||||
->setPolicies($current_policies)
|
||||
|
|
Loading…
Reference in a new issue