Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14748413
D15231.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
D15231.diff
View Options
diff --git a/src/applications/project/controller/PhabricatorProjectColumnHideController.php b/src/applications/project/controller/PhabricatorProjectColumnHideController.php
--- a/src/applications/project/controller/PhabricatorProjectColumnHideController.php
+++ b/src/applications/project/controller/PhabricatorProjectColumnHideController.php
@@ -52,42 +52,80 @@
->addCancelButton($view_uri, pht('Okay'));
}
+ $proxy = $column->getProxy();
+
if ($request->isFormPost()) {
- if ($column->isHidden()) {
- $new_status = PhabricatorProjectColumn::STATUS_ACTIVE;
+ if ($proxy) {
+ if ($proxy->isArchived()) {
+ $new_status = PhabricatorProjectStatus::STATUS_ACTIVE;
+ } else {
+ $new_status = PhabricatorProjectStatus::STATUS_ARCHIVED;
+ }
+
+ $xactions = array();
+
+ $xactions[] = id(new PhabricatorProjectTransaction())
+ ->setTransactionType(PhabricatorProjectTransaction::TYPE_STATUS)
+ ->setNewValue($new_status);
+
+ id(new PhabricatorProjectTransactionEditor())
+ ->setActor($viewer)
+ ->setContentSourceFromRequest($request)
+ ->setContinueOnNoEffect(true)
+ ->setContinueOnMissingFields(true)
+ ->applyTransactions($proxy, $xactions);
} else {
- $new_status = PhabricatorProjectColumn::STATUS_HIDDEN;
+ if ($column->isHidden()) {
+ $new_status = PhabricatorProjectColumn::STATUS_ACTIVE;
+ } else {
+ $new_status = PhabricatorProjectColumn::STATUS_HIDDEN;
+ }
+
+ $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS;
+ $xactions = array(
+ id(new PhabricatorProjectColumnTransaction())
+ ->setTransactionType($type_status)
+ ->setNewValue($new_status),
+ );
+
+ $editor = id(new PhabricatorProjectColumnTransactionEditor())
+ ->setActor($viewer)
+ ->setContinueOnNoEffect(true)
+ ->setContentSourceFromRequest($request)
+ ->applyTransactions($column, $xactions);
}
- $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS;
- $xactions = array(
- id(new PhabricatorProjectColumnTransaction())
- ->setTransactionType($type_status)
- ->setNewValue($new_status),
- );
-
- $editor = id(new PhabricatorProjectColumnTransactionEditor())
- ->setActor($viewer)
- ->setContinueOnNoEffect(true)
- ->setContentSourceFromRequest($request)
- ->applyTransactions($column, $xactions);
-
return id(new AphrontRedirectResponse())->setURI($view_uri);
}
- if ($column->isHidden()) {
- $title = pht('Show Column');
- } else {
- $title = pht('Hide Column');
- }
-
- if ($column->isHidden()) {
- $body = pht(
- 'Are you sure you want to show this column?');
+ if ($proxy) {
+ if ($column->isHidden()) {
+ $title = pht('Activate and Show Column');
+ $body = pht(
+ 'This column is hidden because it represents an archived '.
+ 'subproject. Do you want to activate the subproject so the '.
+ 'column is visible again?');
+ $button = pht('Activate Subproject');
+ } else {
+ $title = pht('Archive and Hide Column');
+ $body = pht(
+ 'This column is visible because it represents an active '.
+ 'subproject. Do you want to hide the column by archiving the '.
+ 'subproject?');
+ $button = pht('Archive Subproject');
+ }
} else {
- $body = pht(
- 'Are you sure you want to hide this column? It will no longer '.
- 'appear on the workboard.');
+ if ($column->isHidden()) {
+ $title = pht('Show Column');
+ $body = pht('Are you sure you want to show this column?');
+ $button = pht('Show Column');
+ } else {
+ $title = pht('Hide Column');
+ $body = pht(
+ 'Are you sure you want to hide this column? It will no longer '.
+ 'appear on the workboard.');
+ $button = pht('Hide Column');
+ }
}
$dialog = $this->newDialog()
@@ -96,7 +134,7 @@
->appendChild($body)
->setDisableWorkflowOnCancel(true)
->addCancelButton($view_uri)
- ->addSubmitButton($title);
+ ->addSubmitButton($button);
foreach ($request->getPassthroughRequestData() as $key => $value) {
$dialog->addHiddenInput($key, $value);
diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php
--- a/src/applications/project/storage/PhabricatorProjectColumn.php
+++ b/src/applications/project/storage/PhabricatorProjectColumn.php
@@ -86,6 +86,11 @@
}
public function isHidden() {
+ $proxy = $this->getProxy();
+ if ($proxy) {
+ return $proxy->isArchived();
+ }
+
return ($this->getStatus() == self::STATUS_HIDDEN);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 10:36 AM (5 h, 26 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7030776
Default Alt Text
D15231.diff (4 KB)
Attached To
Mode
D15231: Hide milestone columns when milestone is archived
Attached
Detach File
Event Timeline
Log In to Comment