Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15425157
D8248.id19628.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
19 KB
Referenced Files
None
Subscribers
None
D8248.id19628.diff
View Options
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
@@ -1844,8 +1844,10 @@
'PhabricatorProjectCustomFieldStringIndex' => 'applications/project/storage/PhabricatorProjectCustomFieldStringIndex.php',
'PhabricatorProjectDAO' => 'applications/project/storage/PhabricatorProjectDAO.php',
'PhabricatorProjectDescriptionField' => 'applications/project/customfield/PhabricatorProjectDescriptionField.php',
+ 'PhabricatorProjectEditDetailsController' => 'applications/project/controller/PhabricatorProjectEditDetailsController.php',
+ 'PhabricatorProjectEditMainController' => 'applications/project/controller/PhabricatorProjectEditMainController.php',
+ 'PhabricatorProjectEditPictureController' => 'applications/project/controller/PhabricatorProjectEditPictureController.php',
'PhabricatorProjectEditorTestCase' => 'applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php',
- 'PhabricatorProjectHistoryController' => 'applications/project/controller/PhabricatorProjectHistoryController.php',
'PhabricatorProjectListController' => 'applications/project/controller/PhabricatorProjectListController.php',
'PhabricatorProjectMembersEditController' => 'applications/project/controller/PhabricatorProjectMembersEditController.php',
'PhabricatorProjectMoveController' => 'applications/project/controller/PhabricatorProjectMoveController.php',
@@ -1853,8 +1855,6 @@
'PhabricatorProjectPHIDTypeColumn' => 'applications/project/phid/PhabricatorProjectPHIDTypeColumn.php',
'PhabricatorProjectPHIDTypeProject' => 'applications/project/phid/PhabricatorProjectPHIDTypeProject.php',
'PhabricatorProjectProfileController' => 'applications/project/controller/PhabricatorProjectProfileController.php',
- 'PhabricatorProjectProfileEditController' => 'applications/project/controller/PhabricatorProjectProfileEditController.php',
- 'PhabricatorProjectProfilePictureController' => 'applications/project/controller/PhabricatorProjectProfilePictureController.php',
'PhabricatorProjectQuery' => 'applications/project/query/PhabricatorProjectQuery.php',
'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php',
'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php',
@@ -4591,8 +4591,10 @@
'PhabricatorProjectCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage',
'PhabricatorProjectDAO' => 'PhabricatorLiskDAO',
'PhabricatorProjectDescriptionField' => 'PhabricatorProjectStandardCustomField',
+ 'PhabricatorProjectEditDetailsController' => 'PhabricatorProjectController',
+ 'PhabricatorProjectEditMainController' => 'PhabricatorProjectController',
+ 'PhabricatorProjectEditPictureController' => 'PhabricatorProjectController',
'PhabricatorProjectEditorTestCase' => 'PhabricatorTestCase',
- 'PhabricatorProjectHistoryController' => 'PhabricatorProjectController',
'PhabricatorProjectListController' =>
array(
0 => 'PhabricatorProjectController',
@@ -4604,8 +4606,6 @@
'PhabricatorProjectPHIDTypeColumn' => 'PhabricatorPHIDType',
'PhabricatorProjectPHIDTypeProject' => 'PhabricatorPHIDType',
'PhabricatorProjectProfileController' => 'PhabricatorProjectController',
- 'PhabricatorProjectProfileEditController' => 'PhabricatorProjectController',
- 'PhabricatorProjectProfilePictureController' => 'PhabricatorProjectController',
'PhabricatorProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
diff --git a/src/applications/project/application/PhabricatorApplicationProject.php b/src/applications/project/application/PhabricatorApplicationProject.php
--- a/src/applications/project/application/PhabricatorApplicationProject.php
+++ b/src/applications/project/application/PhabricatorApplicationProject.php
@@ -37,15 +37,17 @@
'/project/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorProjectListController',
'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController',
- 'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectProfileEditController',
+ 'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectEditMainController',
+ 'details/(?P<id>[1-9]\d*)/'
+ => 'PhabricatorProjectEditDetailsController',
'archive/(?P<id>[1-9]\d*)/' =>
'PhabricatorProjectArchiveController',
'members/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectMembersEditController',
- 'view/(?P<id>[1-9]\d*)/(?:(?P<page>\w+)/)?'
+ 'view/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectProfileController',
'picture/(?P<id>[1-9]\d*)/' =>
- 'PhabricatorProjectProfilePictureController',
+ 'PhabricatorProjectEditPictureController',
'create/' => 'PhabricatorProjectCreateController',
'board/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectBoardController',
'move/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectMoveController',
diff --git a/src/applications/project/controller/PhabricatorProjectArchiveController.php b/src/applications/project/controller/PhabricatorProjectArchiveController.php
--- a/src/applications/project/controller/PhabricatorProjectArchiveController.php
+++ b/src/applications/project/controller/PhabricatorProjectArchiveController.php
@@ -26,7 +26,7 @@
return new Aphront404Response();
}
- $view_uri = $this->getApplicationURI('view/'.$project->getID().'/');
+ $edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
if ($request->isFormPost()) {
if ($project->isArchived()) {
@@ -48,7 +48,7 @@
->setContinueOnMissingFields(true)
->applyTransactions($project, $xactions);
- return id(new AphrontRedirectResponse())->setURI($view_uri);
+ return id(new AphrontRedirectResponse())->setURI($edit_uri);
}
if ($project->isArchived()) {
@@ -65,7 +65,7 @@
->setUser($viewer)
->setTitle($title)
->appendChild($body)
- ->addCancelButton($view_uri)
+ ->addCancelButton($edit_uri)
->addSubmitButton($button);
return id(new AphrontDialogResponse())->setDialog($dialog);
diff --git a/src/applications/project/controller/PhabricatorProjectProfileEditController.php b/src/applications/project/controller/PhabricatorProjectEditDetailsController.php
rename from src/applications/project/controller/PhabricatorProjectProfileEditController.php
rename to src/applications/project/controller/PhabricatorProjectEditDetailsController.php
--- a/src/applications/project/controller/PhabricatorProjectProfileEditController.php
+++ b/src/applications/project/controller/PhabricatorProjectEditDetailsController.php
@@ -1,6 +1,6 @@
<?php
-final class PhabricatorProjectProfileEditController
+final class PhabricatorProjectEditDetailsController
extends PhabricatorProjectController {
private $id;
@@ -34,6 +34,7 @@
->readFieldsFromStorage($project);
$view_uri = $this->getApplicationURI('view/'.$project->getID().'/');
+ $edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
$e_name = true;
$e_edit = null;
@@ -81,7 +82,7 @@
try {
$editor->applyTransactions($project, $xactions);
- return id(new AphrontRedirectResponse())->setURI($view_uri);
+ return id(new AphrontRedirectResponse())->setURI($edit_uri);
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$validation_exception = $ex;
@@ -119,7 +120,6 @@
id(new AphrontFormPolicyControl())
->setUser($viewer)
->setName('can_view')
- ->setCaption(pht('Members can always view a project.'))
->setPolicyObject($project)
->setPolicies($policies)
->setCapability(PhabricatorPolicyCapability::CAN_VIEW))
@@ -142,7 +142,7 @@
->setCapability(PhabricatorPolicyCapability::CAN_JOIN))
->appendChild(
id(new AphrontFormSubmitControl())
- ->addCancelButton($view_uri)
+ ->addCancelButton($edit_uri)
->setValue(pht('Save')));
$form_box = id(new PHUIObjectBoxView())
@@ -152,7 +152,8 @@
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView())
->addTextCrumb($project->getName(), $view_uri)
- ->addTextCrumb(pht('Edit Project'), $this->getApplicationURI());
+ ->addTextCrumb(pht('Edit'), $edit_uri)
+ ->addTextCrumb(pht('Details'));
return $this->buildApplicationPage(
array(
diff --git a/src/applications/project/controller/PhabricatorProjectEditMainController.php b/src/applications/project/controller/PhabricatorProjectEditMainController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/controller/PhabricatorProjectEditMainController.php
@@ -0,0 +1,155 @@
+<?php
+
+final class PhabricatorProjectEditMainController
+ extends PhabricatorProjectController {
+
+ private $id;
+
+ public function willProcessRequest(array $data) {
+ $this->id = idx($data, 'id');
+ }
+
+ public function processRequest() {
+ $request = $this->getRequest();
+ $viewer = $request->getUser();
+
+ $project = id(new PhabricatorProjectQuery())
+ ->setViewer($viewer)
+ ->withIDs(array($this->id))
+ ->needImages(true)
+ ->executeOne();
+ if (!$project) {
+ return new Aphront404Response();
+ }
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('Edit %s', $project->getName()))
+ ->setUser($viewer)
+ ->setPolicyObject($project)
+ ->setImage($project->getProfileImageURI());
+
+ if ($project->getStatus() == PhabricatorProjectStatus::STATUS_ACTIVE) {
+ $header->setStatus('oh-ok', '', pht('Active'));
+ } else {
+ $header->setStatus('policy-noone', '', pht('Archived'));
+ }
+
+ $actions = $this->buildActionListView($project);
+ $properties = $this->buildPropertyListView($project, $actions);
+
+ $crumbs = $this->buildApplicationCrumbs();
+ $crumbs->addTextCrumb(
+ $project->getName(),
+ $this->getApplicationURI('view/'.$project->getID().'/'));
+ $crumbs->addTextCrumb(pht('Edit'));
+
+ $object_box = id(new PHUIObjectBoxView())
+ ->setHeader($header)
+ ->addPropertyList($properties);
+
+ $xactions = id(new PhabricatorProjectTransactionQuery())
+ ->setViewer($viewer)
+ ->withObjectPHIDs(array($project->getPHID()))
+ ->execute();
+
+ $timeline = id(new PhabricatorApplicationTransactionView())
+ ->setUser($viewer)
+ ->setObjectPHID($project->getPHID())
+ ->setTransactions($xactions);
+
+ return $this->buildApplicationPage(
+ array(
+ $crumbs,
+ $object_box,
+ $timeline,
+ ),
+ array(
+ 'title' => $project->getName(),
+ 'device' => true,
+ ));
+ }
+
+ private function buildActionListView(PhabricatorProject $project) {
+ $request = $this->getRequest();
+ $viewer = $request->getUser();
+
+ $id = $project->getID();
+
+ $view = id(new PhabricatorActionListView())
+ ->setUser($viewer)
+ ->setObjectURI($request->getRequestURI());
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $project,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $view->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Edit Details'))
+ ->setIcon('edit')
+ ->setHref($this->getApplicationURI("details/{$id}/"))
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ $view->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Edit Picture'))
+ ->setIcon('image')
+ ->setHref($this->getApplicationURI("picture/{$id}/"))
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ if ($project->isArchived()) {
+ $view->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Unarchive Project'))
+ ->setIcon('enable')
+ ->setHref($this->getApplicationURI("archive/{$id}/"))
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(true));
+ } else {
+ $view->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Archive Project'))
+ ->setIcon('disable')
+ ->setHref($this->getApplicationURI("archive/{$id}/"))
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(true));
+ }
+
+ return $view;
+ }
+
+ private function buildPropertyListView(
+ PhabricatorProject $project,
+ PhabricatorActionListView $actions) {
+ $request = $this->getRequest();
+ $viewer = $request->getUser();
+
+ $view = id(new PHUIPropertyListView())
+ ->setUser($viewer)
+ ->setObject($project)
+ ->setActionList($actions);
+
+ $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
+ $viewer,
+ $project);
+
+ $view->addProperty(
+ pht('Visible To'),
+ $descriptions[PhabricatorPolicyCapability::CAN_VIEW]);
+
+ $view->addProperty(
+ pht('Editable By'),
+ $descriptions[PhabricatorPolicyCapability::CAN_EDIT]);
+
+ $view->addProperty(
+ pht('Joinable By'),
+ $descriptions[PhabricatorPolicyCapability::CAN_JOIN]);
+
+ return $view;
+ }
+
+
+}
diff --git a/src/applications/project/controller/PhabricatorProjectProfilePictureController.php b/src/applications/project/controller/PhabricatorProjectEditPictureController.php
rename from src/applications/project/controller/PhabricatorProjectProfilePictureController.php
rename to src/applications/project/controller/PhabricatorProjectEditPictureController.php
--- a/src/applications/project/controller/PhabricatorProjectProfilePictureController.php
+++ b/src/applications/project/controller/PhabricatorProjectEditPictureController.php
@@ -1,6 +1,6 @@
<?php
-final class PhabricatorProjectProfilePictureController
+final class PhabricatorProjectEditPictureController
extends PhabricatorProjectController {
private $id;
@@ -26,7 +26,8 @@
return new Aphront404Response();
}
- $project_uri = $this->getApplicationURI('view/'.$project->getID().'/');
+ $edit_uri = $this->getApplicationURI('edit/'.$project->getID().'/');
+ $view_uri = $this->getApplicationURI('view/'.$project->getID().'/');
$supported_formats = PhabricatorFile::getTransformableImageFormats();
$e_file = true;
@@ -93,14 +94,15 @@
$editor->applyTransactions($project, $xactions);
- return id(new AphrontRedirectResponse())->setURI($project_uri);
+ return id(new AphrontRedirectResponse())->setURI($edit_uri);
}
}
$title = pht('Edit Project Picture');
$crumbs = $this->buildApplicationCrumbs();
- $crumbs->addTextCrumb($project->getName(), $project_uri);
- $crumbs->addTextCrumb($title);
+ $crumbs->addTextCrumb($project->getName(), $view_uri);
+ $crumbs->addTextCrumb(pht('Edit'), $edit_uri);
+ $crumbs->addTextCrumb(pht('Picture'));
$form = id(new PHUIFormLayoutView())
->setUser($viewer);
@@ -244,7 +246,7 @@
pht('Supported formats: %s', implode(', ', $supported_formats))))
->appendChild(
id(new AphrontFormSubmitControl())
- ->addCancelButton($project_uri)
+ ->addCancelButton($edit_uri)
->setValue(pht('Upload Picture')));
$form_box = id(new PHUIObjectBoxView())
diff --git a/src/applications/project/controller/PhabricatorProjectHistoryController.php b/src/applications/project/controller/PhabricatorProjectHistoryController.php
deleted file mode 100644
--- a/src/applications/project/controller/PhabricatorProjectHistoryController.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-final class PhabricatorProjectHistoryController
- extends PhabricatorProjectController {
-
- private $id;
-
- public function shouldAllowPublic() {
- return true;
- }
-
- public function willProcessRequest(array $data) {
- $this->id = $data['id'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
-
- $id = $this->id;
-
- $project = id(new PhabricatorProjectQuery())
- ->setViewer($viewer)
- ->withIDs(array($id))
- ->executeOne();
- if (!$project) {
- return new Aphront404Response();
- }
-
- $xactions = id(new PhabricatorProjectTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($project->getPHID()))
- ->execute();
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setObjectPHID($project->getPHID())
- ->setTransactions($xactions);
-
- $crumbs = $this->buildApplicationCrumbs()
- ->addTextCrumb(
- $project->getName(),
- $this->getApplicationURI("view/{$id}/"))
- ->addTextCrumb(pht('History'));
-
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $timeline,
- ),
- array(
- 'title' => $project->getName(),
- 'device' => true,
- ));
- }
-
-}
diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php
--- a/src/applications/project/controller/PhabricatorProjectProfileController.php
+++ b/src/applications/project/controller/PhabricatorProjectProfileController.php
@@ -4,7 +4,6 @@
extends PhabricatorProjectController {
private $id;
- private $page;
public function shouldAllowPublic() {
return true;
@@ -12,7 +11,6 @@
public function willProcessRequest(array $data) {
$this->id = idx($data, 'id');
- $this->page = idx($data, 'page');
}
public function processRequest() {
@@ -200,45 +198,16 @@
id(new PhabricatorActionView())
->setName(pht('Edit Project'))
->setIcon('edit')
- ->setHref($this->getApplicationURI("edit/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit));
-
- if ($project->isArchived()) {
- $view->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Unarchive Project'))
- ->setIcon('enable')
- ->setHref($this->getApplicationURI("archive/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(true));
- } else {
- $view->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Archive Project'))
- ->setIcon('disable')
- ->setHref($this->getApplicationURI("archive/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(true));
- }
+ ->setHref($this->getApplicationURI("edit/{$id}/")));
$view->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Members'))
- ->setIcon('edit')
+ ->setIcon('user')
->setHref($this->getApplicationURI("members/{$id}/"))
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
- $view->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Edit Picture'))
- ->setIcon('image')
- ->setHref($this->getApplicationURI("picture/{$id}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit));
-
-
$action = null;
if (!$project->isUserMember($viewer->getPHID())) {
$can_join = PhabricatorPolicyFilter::hasCapability(
@@ -262,12 +231,6 @@
}
$view->addAction($action);
- $view->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('View History'))
- ->setHref($this->getApplicationURI("history/{$id}/"))
- ->setIcon('transcript'));
-
return $view;
}
@@ -285,10 +248,6 @@
->setActionList($actions);
$view->addProperty(
- pht('Created'),
- phabricator_datetime($project->getDateCreated(), $viewer));
-
- $view->addProperty(
pht('Members'),
$project->getMemberPHIDs()
? $this->renderHandlesForPHIDs($project->getMemberPHIDs(), ',')
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 24, 2:47 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7719443
Default Alt Text
D8248.id19628.diff (19 KB)
Attached To
Mode
D8248: Merge some of the project editing options into an edit UI
Attached
Detach File
Event Timeline
Log In to Comment