@@ -52,42 +52,80 @@ public function handleRequest(AphrontRequest $request) {
5252 ->addCancelButton ($ view_uri , pht ('Okay ' ));
5353 }
5454
55+ $ proxy = $ column ->getProxy ();
56+
5557 if ($ request ->isFormPost ()) {
56- if ($ column ->isHidden ()) {
57- $ new_status = PhabricatorProjectColumn::STATUS_ACTIVE ;
58+ if ($ proxy ) {
59+ if ($ proxy ->isArchived ()) {
60+ $ new_status = PhabricatorProjectStatus::STATUS_ACTIVE ;
61+ } else {
62+ $ new_status = PhabricatorProjectStatus::STATUS_ARCHIVED ;
63+ }
64+
65+ $ xactions = array ();
66+
67+ $ xactions [] = id (new PhabricatorProjectTransaction ())
68+ ->setTransactionType (PhabricatorProjectTransaction::TYPE_STATUS )
69+ ->setNewValue ($ new_status );
70+
71+ id (new PhabricatorProjectTransactionEditor ())
72+ ->setActor ($ viewer )
73+ ->setContentSourceFromRequest ($ request )
74+ ->setContinueOnNoEffect (true )
75+ ->setContinueOnMissingFields (true )
76+ ->applyTransactions ($ proxy , $ xactions );
5877 } else {
59- $ new_status = PhabricatorProjectColumn::STATUS_HIDDEN ;
78+ if ($ column ->isHidden ()) {
79+ $ new_status = PhabricatorProjectColumn::STATUS_ACTIVE ;
80+ } else {
81+ $ new_status = PhabricatorProjectColumn::STATUS_HIDDEN ;
82+ }
83+
84+ $ type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS ;
85+ $ xactions = array (
86+ id (new PhabricatorProjectColumnTransaction ())
87+ ->setTransactionType ($ type_status )
88+ ->setNewValue ($ new_status ),
89+ );
90+
91+ $ editor = id (new PhabricatorProjectColumnTransactionEditor ())
92+ ->setActor ($ viewer )
93+ ->setContinueOnNoEffect (true )
94+ ->setContentSourceFromRequest ($ request )
95+ ->applyTransactions ($ column , $ xactions );
6096 }
6197
62- $ type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS ;
63- $ xactions = array (
64- id (new PhabricatorProjectColumnTransaction ())
65- ->setTransactionType ($ type_status )
66- ->setNewValue ($ new_status ),
67- );
68-
69- $ editor = id (new PhabricatorProjectColumnTransactionEditor ())
70- ->setActor ($ viewer )
71- ->setContinueOnNoEffect (true )
72- ->setContentSourceFromRequest ($ request )
73- ->applyTransactions ($ column , $ xactions );
74-
7598 return id (new AphrontRedirectResponse ())->setURI ($ view_uri );
7699 }
77100
78- if ($ column ->isHidden ()) {
79- $ title = pht ('Show Column ' );
80- } else {
81- $ title = pht ('Hide Column ' );
82- }
83-
84- if ($ column ->isHidden ()) {
85- $ body = pht (
86- 'Are you sure you want to show this column? ' );
101+ if ($ proxy ) {
102+ if ($ column ->isHidden ()) {
103+ $ title = pht ('Activate and Show Column ' );
104+ $ body = pht (
105+ 'This column is hidden because it represents an archived ' .
106+ 'subproject. Do you want to activate the subproject so the ' .
107+ 'column is visible again? ' );
108+ $ button = pht ('Activate Subproject ' );
109+ } else {
110+ $ title = pht ('Archive and Hide Column ' );
111+ $ body = pht (
112+ 'This column is visible because it represents an active ' .
113+ 'subproject. Do you want to hide the column by archiving the ' .
114+ 'subproject? ' );
115+ $ button = pht ('Archive Subproject ' );
116+ }
87117 } else {
88- $ body = pht (
89- 'Are you sure you want to hide this column? It will no longer ' .
90- 'appear on the workboard. ' );
118+ if ($ column ->isHidden ()) {
119+ $ title = pht ('Show Column ' );
120+ $ body = pht ('Are you sure you want to show this column? ' );
121+ $ button = pht ('Show Column ' );
122+ } else {
123+ $ title = pht ('Hide Column ' );
124+ $ body = pht (
125+ 'Are you sure you want to hide this column? It will no longer ' .
126+ 'appear on the workboard. ' );
127+ $ button = pht ('Hide Column ' );
128+ }
91129 }
92130
93131 $ dialog = $ this ->newDialog ()
@@ -96,7 +134,7 @@ public function handleRequest(AphrontRequest $request) {
96134 ->appendChild ($ body )
97135 ->setDisableWorkflowOnCancel (true )
98136 ->addCancelButton ($ view_uri )
99- ->addSubmitButton ($ title );
137+ ->addSubmitButton ($ button );
100138
101139 foreach ($ request ->getPassthroughRequestData () as $ key => $ value ) {
102140 $ dialog ->addHiddenInput ($ key , $ value );
0 commit comments