Robustify profile image controls ever so slightly

Summary: show project profile image on pertinent edit page. also add a "Use Default Image" checkbox for both project and user profiles. Also added a function for projects to get the profile picture to prevent some copy + paste action.

Test Plan: set my user profile and project profile image. clicked "Use Default Image" and got the default image back.

Reviewers: epriestley, floatinglomas

Reviewed By: floatinglomas

CC: aran, Korvin

Maniphest Tasks: T1307

Differential Revision: https://secure.phabricator.com/D2852
This commit is contained in:
Bob Trahan
2012-06-26 08:14:15 -07:00
parent b3900a399c
commit ee6c6943b3
7 changed files with 101 additions and 16 deletions

View File

@@ -40,17 +40,7 @@ final class PhabricatorProjectProfileController
$profile = new PhabricatorProjectProfile();
}
$src_phid = $profile->getProfileImagePHID();
if (!$src_phid) {
$src_phid = $user->getProfileImagePHID();
}
$file = id(new PhabricatorFile())->loadOneWhere('phid = %s',
$src_phid);
if ($file) {
$picture = $file->getBestURI();
} else {
$picture = PhabricatorUser::getDefaultProfileImageURI();
}
$picture = $profile->loadProfileImageURI();
$members = mpull($project->loadAffiliations(), null, 'getUserPHID');