Page MenuHomePhabricator

D10417.diff
No OneTemporary

D10417.diff

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
@@ -1940,13 +1940,13 @@
'PhabricatorProjectApplication' => 'applications/project/application/PhabricatorProjectApplication.php',
'PhabricatorProjectArchiveController' => 'applications/project/controller/PhabricatorProjectArchiveController.php',
'PhabricatorProjectBoardController' => 'applications/project/controller/PhabricatorProjectBoardController.php',
- 'PhabricatorProjectBoardDeleteController' => 'applications/project/controller/PhabricatorProjectBoardDeleteController.php',
'PhabricatorProjectBoardImportController' => 'applications/project/controller/PhabricatorProjectBoardImportController.php',
'PhabricatorProjectBoardReorderController' => 'applications/project/controller/PhabricatorProjectBoardReorderController.php',
'PhabricatorProjectBoardViewController' => 'applications/project/controller/PhabricatorProjectBoardViewController.php',
'PhabricatorProjectColumn' => 'applications/project/storage/PhabricatorProjectColumn.php',
'PhabricatorProjectColumnDetailController' => 'applications/project/controller/PhabricatorProjectColumnDetailController.php',
'PhabricatorProjectColumnEditController' => 'applications/project/controller/PhabricatorProjectColumnEditController.php',
+ 'PhabricatorProjectColumnHideController' => 'applications/project/controller/PhabricatorProjectColumnHideController.php',
'PhabricatorProjectColumnPHIDType' => 'applications/project/phid/PhabricatorProjectColumnPHIDType.php',
'PhabricatorProjectColumnPosition' => 'applications/project/storage/PhabricatorProjectColumnPosition.php',
'PhabricatorProjectColumnPositionQuery' => 'applications/project/query/PhabricatorProjectColumnPositionQuery.php',
@@ -4800,7 +4800,6 @@
'PhabricatorProjectApplication' => 'PhabricatorApplication',
'PhabricatorProjectArchiveController' => 'PhabricatorProjectController',
'PhabricatorProjectBoardController' => 'PhabricatorProjectController',
- 'PhabricatorProjectBoardDeleteController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardImportController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardReorderController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController',
@@ -4811,6 +4810,7 @@
),
'PhabricatorProjectColumnDetailController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectColumnEditController' => 'PhabricatorProjectBoardController',
+ 'PhabricatorProjectColumnHideController' => 'PhabricatorProjectBoardController',
'PhabricatorProjectColumnPHIDType' => 'PhabricatorPHIDType',
'PhabricatorProjectColumnPosition' => array(
'PhabricatorProjectDAO',
diff --git a/src/applications/project/application/PhabricatorProjectApplication.php b/src/applications/project/application/PhabricatorProjectApplication.php
--- a/src/applications/project/application/PhabricatorProjectApplication.php
+++ b/src/applications/project/application/PhabricatorProjectApplication.php
@@ -67,8 +67,8 @@
'board/(?P<projectID>[1-9]\d*)/' => array(
'edit/(?:(?P<id>\d+)/)?'
=> 'PhabricatorProjectColumnEditController',
- 'delete/(?:(?P<id>\d+)/)?'
- => 'PhabricatorProjectBoardDeleteController',
+ 'hide/(?:(?P<id>\d+)/)?'
+ => 'PhabricatorProjectColumnHideController',
'column/(?:(?P<id>\d+)/)?'
=> 'PhabricatorProjectColumnDetailController',
'import/'
diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php
+++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
@@ -562,6 +562,27 @@
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit);
+ $can_hide = ($can_edit && !$column->isDefaultColumn());
+ $hide_uri = 'board/'.$this->id.'/hide/'.$column->getID().'/';
+ $hide_uri = $this->getApplicationURI($hide_uri);
+ $hide_uri = $this->getURIWithState($hide_uri);
+
+ if (!$column->isHidden()) {
+ $column_items[] = id(new PhabricatorActionView())
+ ->setName(pht('Hide Column'))
+ ->setIcon('fa-eye-slash')
+ ->setHref($hide_uri)
+ ->setDisabled(!$can_hide)
+ ->setWorkflow(true);
+ } else {
+ $column_items[] = id(new PhabricatorActionView())
+ ->setName(pht('Show Column'))
+ ->setIcon('fa-eye')
+ ->setHref($hide_uri)
+ ->setDisabled(!$can_hide)
+ ->setWorkflow(true);
+ }
+
$column_menu = id(new PhabricatorActionListView())
->setUser($viewer);
foreach ($column_items as $item) {
diff --git a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php
--- a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php
+++ b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php
@@ -119,26 +119,6 @@
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
- $can_hide = ($can_edit && !$column->isDefaultColumn());
-
- if (!$column->isHidden()) {
- $actions->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Hide Column'))
- ->setIcon('fa-eye-slash')
- ->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/'))
- ->setDisabled(!$can_hide)
- ->setWorkflow(true));
- } else {
- $actions->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Show Column'))
- ->setIcon('fa-eye')
- ->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/'))
- ->setDisabled(!$can_hide)
- ->setWorkflow(true));
- }
-
return $actions;
}
diff --git a/src/applications/project/controller/PhabricatorProjectBoardDeleteController.php b/src/applications/project/controller/PhabricatorProjectColumnHideController.php
rename from src/applications/project/controller/PhabricatorProjectBoardDeleteController.php
rename to src/applications/project/controller/PhabricatorProjectColumnHideController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardDeleteController.php
+++ b/src/applications/project/controller/PhabricatorProjectColumnHideController.php
@@ -1,6 +1,6 @@
<?php
-final class PhabricatorProjectBoardDeleteController
+final class PhabricatorProjectColumnHideController
extends PhabricatorProjectBoardController {
private $id;
@@ -42,8 +42,12 @@
}
$column_phid = $column->getPHID();
- $view_uri = $this->getApplicationURI(
- '/board/'.$this->projectID.'/column/'.$this->id.'/');
+
+ $view_uri = $this->getApplicationURI('/board/'.$this->projectID.'/');
+ $view_uri = new PhutilURI($view_uri);
+ foreach ($request->getPassthroughRequestData() as $key => $value) {
+ $view_uri->setQueryParam($key, $value);
+ }
if ($column->isDefaultColumn()) {
return $this->newDialog()
@@ -97,6 +101,10 @@
->addCancelButton($view_uri)
->addSubmitButton($title);
+ foreach ($request->getPassthroughRequestData() as $key => $value) {
+ $dialog->addHiddenInput($key, $value);
+ }
+
return $dialog;
}
}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 11, 1:56 PM (2 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6754443
Default Alt Text
D10417.diff (7 KB)

Event Timeline