@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.

Move profile-related "settings" and "account" panel information to "edit profile"

Summary: Ref T1703. Put this stuff on Profile -> Edit Profile instead of spread across Settings -> Account and Settings -> Profile. Makes it custom-field driven.

Test Plan: {F49333} {F49334}

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1703

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

+29 -61
+20 -12
src/applications/people/controller/PhabricatorPeopleProfileController.php
··· 104 104 } 105 105 } 106 106 107 - $nav->appendChild($header); 108 - $nav->appendChild($content); 107 + $actions = id(new PhabricatorActionListView()) 108 + ->setUser($viewer); 109 109 110 - if ($user->getPHID() == $viewer->getPHID()) { 111 - $nav->addFilter( 112 - null, 113 - pht('Edit Profile...'), 114 - '/settings/panel/profile/'); 115 - } 110 + $can_edit = ($user->getPHID() == $viewer->getPHID()); 111 + 112 + $actions->addAction( 113 + id(new PhabricatorActionView()) 114 + ->setIcon('edit') 115 + ->setName(pht('Edit Profile')) 116 + ->setHref($this->getApplicationURI('editprofile/'.$user->getID().'/')) 117 + ->setDisabled(!$can_edit) 118 + ->setWorkflow(!$can_edit)); 116 119 117 120 if ($viewer->getIsAdmin()) { 118 - $nav->addFilter( 119 - null, 120 - pht('Administrate User...'), 121 - '/people/edit/'.$user->getID().'/'); 121 + $actions->addAction( 122 + id(new PhabricatorActionView()) 123 + ->setIcon('blame') 124 + ->setName(pht('Administrate User')) 125 + ->setHref($this->getApplicationURI('edit/'.$user->getID().'/'))); 122 126 } 127 + 128 + $nav->appendChild($header); 129 + $nav->appendChild($actions); 130 + $nav->appendChild($content); 123 131 124 132 return $this->buildApplicationPage( 125 133 $nav,
+9 -1
src/applications/people/customfield/PhabricatorUserRealNameField.php
··· 26 26 } 27 27 28 28 public function getNewValueForApplicationTransactions() { 29 + if (!$this->isEditable()) { 30 + return $this->getObject()->getRealName(); 31 + } 29 32 return $this->value; 30 33 } 31 34 ··· 42 45 return id(new AphrontFormTextControl()) 43 46 ->setName($this->getFieldKey()) 44 47 ->setValue($this->value) 45 - ->setLabel($this->getFieldName()); 48 + ->setLabel($this->getFieldName()) 49 + ->setDisabled(!$this->isEditable()); 50 + } 51 + 52 + private function isEditable() { 53 + return PhabricatorEnv::getEnvConfig('account.editable'); 46 54 } 47 55 48 56 }
-19
src/applications/settings/panel/PhabricatorSettingsPanelAccount.php
··· 17 17 18 18 public function processRequest(AphrontRequest $request) { 19 19 $user = $request->getUser(); 20 - $editable = PhabricatorEnv::getEnvConfig('account.editable'); 21 - 22 - $e_realname = $editable ? true : null; 23 20 $errors = array(); 24 21 if ($request->isFormPost()) { 25 - 26 - if ($editable) { 27 - $user->setRealName($request->getStr('realname')); 28 - if (!strlen($user->getRealName())) { 29 - $errors[] = pht('Real name must be nonempty.'); 30 - $e_realname = pht('Required'); 31 - } 32 - } 33 - 34 22 $new_timezone = $request->getStr('timezone'); 35 23 if (in_array($new_timezone, DateTimeZone::listIdentifiers(), true)) { 36 24 $user->setTimezoneIdentifier($new_timezone); ··· 72 60 id(new AphrontFormStaticControl()) 73 61 ->setLabel(pht('Username')) 74 62 ->setValue($user->getUsername())) 75 - ->appendChild( 76 - id(new AphrontFormTextControl()) 77 - ->setLabel(pht('Real Name')) 78 - ->setName('realname') 79 - ->setError($e_realname) 80 - ->setValue($user->getRealName()) 81 - ->setDisabled(!$editable)) 82 63 ->appendChild( 83 64 id(new AphrontFormSelectControl()) 84 65 ->setLabel(pht('Timezone'))
-29
src/applications/settings/panel/PhabricatorSettingsPanelProfile.php
··· 25 25 $e_image = null; 26 26 $errors = array(); 27 27 if ($request->isFormPost()) { 28 - $profile->setTitle($request->getStr('title')); 29 - $profile->setBlurb($request->getStr('blurb')); 30 - 31 28 $sex = $request->getStr('sex'); 32 29 $sexes = array(PhutilPerson::SEX_MALE, PhutilPerson::SEX_FEMALE); 33 30 if (in_array($sex, $sexes)) { ··· 149 146 ->setUser($request->getUser()) 150 147 ->setEncType('multipart/form-data') 151 148 ->appendChild( 152 - id(new AphrontFormTextControl()) 153 - ->setLabel(pht('Title')) 154 - ->setName('title') 155 - ->setValue($profile->getTitle()) 156 - ->setCaption(pht('Serious business title.'))) 157 - ->appendChild( 158 149 id(new AphrontFormSelectControl()) 159 150 ->setOptions($sexes) 160 151 ->setLabel(pht('Sex')) ··· 166 157 ->setLabel(pht('Translation')) 167 158 ->setName('translation') 168 159 ->setValue($user->getTranslation())) 169 - ->appendChild( 170 - id(new AphrontFormMarkupControl()) 171 - ->setLabel(pht('Profile URI')) 172 - ->setValue( 173 - phutil_tag( 174 - 'a', 175 - array( 176 - 'href' => $profile_uri, 177 - ), 178 - $profile_uri))) 179 - ->appendChild(hsprintf( 180 - '<p class="aphront-form-instructions">%s</p>', 181 - pht('Write something about yourself! Make sure to include important ' . 182 - 'information like your favorite Pokemon and which Starcraft race ' . 183 - 'you play.'))) 184 - ->appendChild( 185 - id(new AphrontFormTextAreaControl()) 186 - ->setLabel(pht('Blurb')) 187 - ->setName('blurb') 188 - ->setValue($profile->getBlurb())) 189 160 ->appendChild( 190 161 id(new AphrontFormMarkupControl()) 191 162 ->setLabel(pht('Profile Image'))