@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow the Default/Backlog column to be renamed

Summary: Fixes T5101. There's no technical reason not to allow this, it just took a little extra work so I didn't do it originally.

Test Plan: Renamed "Backlog", un-renamed it. Tried to hide it.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5101

Differential Revision: https://secure.phabricator.com/D9721

+54 -18
+8 -1
src/applications/project/controller/PhabricatorProjectBoardDeleteController.php
··· 42 42 } 43 43 44 44 $column_phid = $column->getPHID(); 45 - 46 45 $view_uri = $this->getApplicationURI( 47 46 '/board/'.$this->projectID.'/column/'.$this->id.'/'); 47 + 48 + if ($column->isDefaultColumn()) { 49 + return $this->newDialog() 50 + ->setTitle(pht('Can Not Hide Default Column')) 51 + ->appendParagraph( 52 + pht('You can not hide the default/backlog column on a board.')) 53 + ->addCancelButton($view_uri, pht('Okay')); 54 + } 48 55 49 56 if ($request->isFormPost()) { 50 57 if ($column->isHidden()) {
+11 -2
src/applications/project/controller/PhabricatorProjectBoardEditController.php
··· 111 111 if ($is_new) { 112 112 $title = pht('Create Column'); 113 113 $submit = pht('Create Column'); 114 + $crumb_text = pht('Create Column'); 114 115 } else { 115 - $title = pht('Edit %s', $column->getName()); 116 + $title = pht('Edit %s', $column->getDisplayName()); 116 117 $submit = pht('Save Column'); 118 + $crumb_text = pht('Edit'); 117 119 } 118 120 119 121 $form->appendChild( ··· 125 127 $crumbs->addTextCrumb( 126 128 pht('Board'), 127 129 $this->getApplicationURI('board/'.$project->getID().'/')); 128 - $crumbs->addTextCrumb($title); 130 + 131 + if (!$is_new) { 132 + $crumbs->addTextCrumb( 133 + $column->getDisplayName(), 134 + $view_uri); 135 + } 136 + 137 + $crumbs->addTextCrumb($crumb_text); 129 138 130 139 $form_box = id(new PHUIObjectBoxView()) 131 140 ->setHeaderText($title)
+1 -3
src/applications/project/controller/PhabricatorProjectBoardViewController.php
··· 175 175 ->setHeader($column->getDisplayName()) 176 176 ->setHeaderColor($column->getHeaderColor()); 177 177 178 - if (!$column->isDefaultColumn()) { 179 - $panel->setEditURI($board_uri.'column/'.$column->getID().'/'); 180 - } 178 + $panel->setEditURI($board_uri.'column/'.$column->getID().'/'); 181 179 182 180 $panel->setHeaderAction(id(new PHUIIconView()) 183 181 ->setIconFont('fa-plus')
+6 -4
src/applications/project/controller/PhabricatorProjectColumnDetailController.php
··· 54 54 ->setObjectPHID($column->getPHID()) 55 55 ->setTransactions($xactions); 56 56 57 - $title = pht('%s', $column->getName()); 57 + $title = pht('%s', $column->getDisplayName()); 58 58 $crumbs = $this->buildApplicationCrumbs(); 59 59 $crumbs->addTextCrumb( 60 60 pht('Board'), ··· 85 85 86 86 $header = id(new PHUIHeaderView()) 87 87 ->setUser($viewer) 88 - ->setHeader($column->getName()) 88 + ->setHeader($column->getDisplayName()) 89 89 ->setPolicyObject($column); 90 90 91 91 if ($column->isHidden()) { ··· 119 119 ->setDisabled(!$can_edit) 120 120 ->setWorkflow(!$can_edit)); 121 121 122 + $can_hide = ($can_edit && !$column->isDefaultColumn()); 123 + 122 124 if (!$column->isHidden()) { 123 125 $actions->addAction( 124 126 id(new PhabricatorActionView()) 125 127 ->setName(pht('Hide Column')) 126 128 ->setIcon('fa-eye-slash') 127 129 ->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/')) 128 - ->setDisabled(!$can_edit) 130 + ->setDisabled(!$can_hide) 129 131 ->setWorkflow(true)); 130 132 } else { 131 133 $actions->addAction( ··· 133 135 ->setName(pht('Show Column')) 134 136 ->setIcon('fa-eye') 135 137 ->setHref($this->getApplicationURI($base_uri.'delete/'.$id.'/')) 136 - ->setDisabled(!$can_edit) 138 + ->setDisabled(!$can_hide) 137 139 ->setWorkflow(true)); 138 140 } 139 141
+4 -1
src/applications/project/editor/PhabricatorProjectColumnTransactionEditor.php
··· 81 81 $object->getName(), 82 82 $xactions); 83 83 84 - if ($missing) { 84 + // The default "Backlog" column is allowed to be unnamed, which 85 + // means we use the default name. 86 + 87 + if ($missing && !$object->isDefaultColumn()) { 85 88 $error = new PhabricatorApplicationTransactionValidationError( 86 89 $type, 87 90 pht('Required'),
+7 -1
src/applications/project/storage/PhabricatorProjectColumn.php
··· 50 50 } 51 51 52 52 public function getDisplayName() { 53 + $name = $this->getName(); 54 + if (strlen($name)) { 55 + return $name; 56 + } 57 + 53 58 if ($this->isDefaultColumn()) { 54 59 return pht('Backlog'); 55 60 } 56 - return $this->getName(); 61 + 62 + return pht('Unnamed Column'); 57 63 } 58 64 59 65 public function getHeaderColor() {
+17 -6
src/applications/project/storage/PhabricatorProjectColumnTransaction.php
··· 21 21 22 22 switch ($this->getTransactionType()) { 23 23 case PhabricatorProjectColumnTransaction::TYPE_NAME: 24 - if (!strlen($old)) { 24 + if ($old === null) { 25 25 return pht( 26 26 '%s created this column.', 27 27 $author_handle); 28 28 } else { 29 - return pht( 30 - '%s renamed this column from "%s" to "%s".', 31 - $author_handle, 32 - $old, 33 - $new); 29 + if (!strlen($old)) { 30 + return pht( 31 + '%s named this column "%s".', 32 + $author_handle, 33 + $new); 34 + } else if (strlen($new)) { 35 + return pht( 36 + '%s renamed this column from "%s" to "%s".', 37 + $author_handle, 38 + $old, 39 + $new); 40 + } else { 41 + return pht( 42 + '%s removed the custom name of this column.', 43 + $author_handle); 44 + } 34 45 } 35 46 case PhabricatorProjectColumnTransaction::TYPE_STATUS: 36 47 switch ($new) {