| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-23 10:03:09 +10:00
										 |  |  | final class PhabricatorProjectApplication extends PhabricatorApplication { | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   public function getName() { | 
					
						
							| 
									
										
										
										
											2013-02-13 09:22:14 -08:00
										 |  |  |     return pht('Projects'); | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   public function getShortDescription() { | 
					
						
							| 
									
										
										
											
												(Redesign) Clean up older "Tile" code
Summary:
This does some backend cleanup of the tile stuff, and some general cleanup of other application things:
  - Users who haven't customized preferences get a small, specific set of pinned applications: Differential, Maniphest, Diffusion, Audit, Phriction, Projects (and, for administrators, Auth, Config and People).
  - Old tile size methods are replaced with `isPinnnedByDefault()`.
  - Shortened some short descriptions.
  - `shouldAppearInLaunchView()` replaced by less ambiguous `isLaunchable()`.
  - Added a marker for third-party / extension applications.
Test Plan: Faked away my preferences and viewed the home page, saw a smaller set of default pins.
Reviewers: chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D9358
											
										 
											2014-06-03 15:47:27 -07:00
										 |  |  |     return pht('Get Organized'); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   public function isPinnedByDefault(PhabricatorUser $viewer) { | 
					
						
							|  |  |  |     return true; | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   public function getBaseURI() { | 
					
						
							|  |  |  |     return '/project/'; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-24 23:41:43 -08:00
										 |  |  |   public function getFontIcon() { | 
					
						
							|  |  |  |     return 'fa-briefcase'; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-03 15:16:26 -07:00
										 |  |  |   public function getFlavorText() { | 
					
						
							|  |  |  |     return pht('Group stuff into big piles.'); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-18 02:46:39 -07:00
										 |  |  |   public function getRemarkupRules() { | 
					
						
							|  |  |  |     return array( | 
					
						
							|  |  |  |       new ProjectRemarkupRule(), | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:19:40 -07:00
										 |  |  |   public function getEventListeners() { | 
					
						
							|  |  |  |     return array( | 
					
						
							|  |  |  |       new PhabricatorProjectUIEventListener(), | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |   public function getRoutes() { | 
					
						
							|  |  |  |     return array( | 
					
						
							|  |  |  |       '/project/' => array( | 
					
						
							| 
									
										
										
										
											2013-07-22 08:34:35 -07:00
										 |  |  |         '(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorProjectListController', | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |         'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController', | 
					
						
							| 
									
										
										
										
											2014-02-16 20:17:52 -08:00
										 |  |  |         'details/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectEditDetailsController', | 
					
						
							| 
									
										
										
										
											2014-07-23 10:03:09 +10:00
										 |  |  |         'archive/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectArchiveController', | 
					
						
							| 
									
										
										
										
											2012-10-05 16:06:16 -07:00
										 |  |  |         'members/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectMembersEditController', | 
					
						
							| 
									
										
										
										
											2014-03-19 19:30:27 -07:00
										 |  |  |         'members/(?P<id>[1-9]\d*)/remove/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectMembersRemoveController', | 
					
						
							| 
									
										
										
										
											2015-01-12 10:04:01 -08:00
										 |  |  |         'profile/(?P<id>[1-9]\d*)/' | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |           => 'PhabricatorProjectProfileController', | 
					
						
							| 
									
										
										
										
											2015-01-12 10:04:01 -08:00
										 |  |  |         'feed/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectFeedController', | 
					
						
							|  |  |  |         'view/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectViewController', | 
					
						
							| 
									
										
										
										
											2014-07-23 10:03:09 +10:00
										 |  |  |         'picture/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectEditPictureController', | 
					
						
							| 
									
										
										
										
											2014-10-10 16:57:05 -07:00
										 |  |  |         'create/' => 'PhabricatorProjectEditDetailsController', | 
					
						
							| 
									
										
										
										
											2015-12-27 04:47:08 -08:00
										 |  |  |         'subprojects/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectSubprojectsController', | 
					
						
							|  |  |  |         'milestones/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectMilestonesController', | 
					
						
							| 
									
										
										
										
											2014-05-20 11:42:05 -07:00
										 |  |  |         'board/(?P<id>[1-9]\d*)/'. | 
					
						
							|  |  |  |           '(?P<filter>filter/)?'. | 
					
						
							| 
									
										
										
										
											2014-07-23 10:03:09 +10:00
										 |  |  |           '(?:query/(?P<queryKey>[^/]+)/)?' | 
					
						
							|  |  |  |           => 'PhabricatorProjectBoardViewController', | 
					
						
							| 
									
										
										
										
											2014-01-13 12:24:36 -08:00
										 |  |  |         'move/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectMoveController', | 
					
						
							| 
									
										
										
										
											2014-07-11 19:27:07 -07:00
										 |  |  |         'board/(?P<projectID>[1-9]\d*)/' => array( | 
					
						
							|  |  |  |           'edit/(?:(?P<id>\d+)/)?' | 
					
						
							| 
									
										
											  
											
												Allow columns to have a point limit
Summary:
Fixes T5885. This implements optional soft point limits for workboard columns, per traditional Kanban.
  - Allow columns to have a point limit set.
  - When a column has a point limit, show it in the header.
  - If a column has too many points in it, show the column and point count in red.
@chad, this could probably use some design tweaks. In particular:
  - I changed the color of "hidden" columns to avoid confusion with "overfull" columns. We might be able to find a better color.
  - UI hints for overfull columns might need adjustment.
(After T4427, we'll let you sum some custom field instead of total number of tasks, which is why this is called "points" rather than "number of tasks".)
Test Plan:
{F190914}
Note that:
  - "Pre-planning" has a limit, so it shows "4/12".
  - "Planning" has a limit and is overfull, so it shows "5 / 4".
  - Other columns do not have limits.
  - "Post-planning" is a hidden column. This might be too muted now.
Transactions:
{F190915}
Error messages / edit screen:
{F190916}
Reviewers: btrahan, chad
Reviewed By: btrahan
Subscribers: chad, epriestley
Maniphest Tasks: T5885
Differential Revision: https://secure.phabricator.com/D10276
											
										 
											2014-08-15 11:16:08 -07:00
										 |  |  |             => 'PhabricatorProjectColumnEditController', | 
					
						
							| 
									
										
										
										
											2014-09-04 12:47:32 -07:00
										 |  |  |           'hide/(?:(?P<id>\d+)/)?' | 
					
						
							|  |  |  |             => 'PhabricatorProjectColumnHideController', | 
					
						
							| 
									
										
										
										
											2014-07-11 19:27:07 -07:00
										 |  |  |           'column/(?:(?P<id>\d+)/)?' | 
					
						
							|  |  |  |             => 'PhabricatorProjectColumnDetailController', | 
					
						
							| 
									
										
										
										
											2014-08-05 13:40:41 -07:00
										 |  |  |           'import/' | 
					
						
							|  |  |  |             => 'PhabricatorProjectBoardImportController', | 
					
						
							| 
									
										
										
										
											2014-07-11 19:27:07 -07:00
										 |  |  |           'reorder/' | 
					
						
							|  |  |  |             => 'PhabricatorProjectBoardReorderController', | 
					
						
							|  |  |  |         ), | 
					
						
							| 
									
										
										
										
											2012-10-05 16:06:16 -07:00
										 |  |  |         'update/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/' | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |           => 'PhabricatorProjectUpdateController', | 
					
						
							| 
									
										
										
										
											2013-10-22 13:49:37 -07:00
										 |  |  |         'history/(?P<id>[1-9]\d*)/' => 'PhabricatorProjectHistoryController', | 
					
						
							| 
									
										
										
										
											2014-05-19 12:40:57 -07:00
										 |  |  |         '(?P<action>watch|unwatch)/(?P<id>[1-9]\d*)/' | 
					
						
							|  |  |  |           => 'PhabricatorProjectWatchController', | 
					
						
							| 
									
										
										
										
											2014-05-22 15:16:16 -07:00
										 |  |  |       ), | 
					
						
							|  |  |  |       '/tag/' => array( | 
					
						
							| 
									
										
										
										
											2015-01-12 10:04:01 -08:00
										 |  |  |         '(?P<slug>[^/]+)/' => 'PhabricatorProjectViewController', | 
					
						
							| 
									
										
										
										
											2014-06-13 14:09:21 -07:00
										 |  |  |         '(?P<slug>[^/]+)/board/' => 'PhabricatorProjectBoardViewController', | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-22 12:49:16 -08:00
										 |  |  |   public function getQuickCreateItems(PhabricatorUser $viewer) { | 
					
						
							|  |  |  |     $can_create = PhabricatorPolicyFilter::hasCapability( | 
					
						
							|  |  |  |       $viewer, | 
					
						
							|  |  |  |       $this, | 
					
						
							|  |  |  |       ProjectCreateProjectsCapability::CAPABILITY); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     $items = array(); | 
					
						
							|  |  |  |     if ($can_create) { | 
					
						
							|  |  |  |       $item = id(new PHUIListItemView()) | 
					
						
							|  |  |  |         ->setName(pht('Project')) | 
					
						
							|  |  |  |         ->setIcon('fa-briefcase') | 
					
						
							|  |  |  |         ->setHref($this->getBaseURI().'create/'); | 
					
						
							|  |  |  |       $items[] = $item; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return $items; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-10 04:29:07 -07:00
										 |  |  |   protected function getCustomCapabilities() { | 
					
						
							|  |  |  |     return array( | 
					
						
							| 
									
										
										
										
											2014-07-25 08:20:39 +10:00
										 |  |  |       ProjectCreateProjectsCapability::CAPABILITY => array(), | 
					
						
							| 
									
										
										
										
											2014-09-18 11:00:50 -07:00
										 |  |  |       ProjectCanLockProjectsCapability::CAPABILITY => array( | 
					
						
							|  |  |  |         'default' => PhabricatorPolicies::POLICY_ADMIN, | 
					
						
							|  |  |  |       ), | 
					
						
							| 
									
										
										
										
											2014-11-21 11:22:17 -08:00
										 |  |  |       ProjectDefaultViewCapability::CAPABILITY => array( | 
					
						
							| 
									
										
										
										
											2015-06-11 13:25:30 -07:00
										 |  |  |         'caption' => pht('Default view policy for newly created projects.'), | 
					
						
							|  |  |  |         'template' => PhabricatorProjectProjectPHIDType::TYPECONST, | 
					
						
							| 
									
										
										
										
											2015-06-22 11:46:59 -07:00
										 |  |  |         'capability' => PhabricatorPolicyCapability::CAN_VIEW, | 
					
						
							| 
									
										
										
										
											2014-11-21 11:22:17 -08:00
										 |  |  |       ), | 
					
						
							|  |  |  |       ProjectDefaultEditCapability::CAPABILITY => array( | 
					
						
							| 
									
										
										
										
											2015-06-11 13:25:30 -07:00
										 |  |  |         'caption' => pht('Default edit policy for newly created projects.'), | 
					
						
							|  |  |  |         'template' => PhabricatorProjectProjectPHIDType::TYPECONST, | 
					
						
							| 
									
										
										
										
											2015-06-22 11:46:59 -07:00
										 |  |  |         'capability' => PhabricatorPolicyCapability::CAN_EDIT, | 
					
						
							| 
									
										
										
										
											2014-11-21 11:22:17 -08:00
										 |  |  |       ), | 
					
						
							|  |  |  |       ProjectDefaultJoinCapability::CAPABILITY => array( | 
					
						
							| 
									
										
										
										
											2015-06-11 13:25:30 -07:00
										 |  |  |         'caption' => pht('Default join policy for newly created projects.'), | 
					
						
							|  |  |  |         'template' => PhabricatorProjectProjectPHIDType::TYPECONST, | 
					
						
							| 
									
										
										
										
											2015-06-22 11:46:59 -07:00
										 |  |  |         'capability' => PhabricatorPolicyCapability::CAN_JOIN, | 
					
						
							| 
									
										
										
										
											2014-11-21 11:22:17 -08:00
										 |  |  |       ), | 
					
						
							| 
									
										
										
										
											2013-10-10 04:29:07 -07:00
										 |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
											  
											
												Implement a scope selector for the global search
Summary:
See M1433. Fixes T7266. Fixes T4475. Ref T7314.
Future work/notes/etc:
  - Write the User Guide (see TODO).
  - This might needs some design tweaks -- I think it's functionally almost-equivalent to the mock, but the UI isn't quite the same.
  - (Mobile design is a touch off-looking I think?)
  - When you use a custom query, the duplicate "magnifying glass" icons are a little weird. Maybe change one or the other.
  - Maybe worth adding an "Open Documents in Current Application" option? Planning to wait for feedback on that.
  - Need a Quicksand integration to change the current application at some point.
  - Searching in "Current Application" from, e.g., the 404 page just searches all documents. Current plan is to just document this behavior, since the icon is a pretty good callout and it seems plausible that this is intuitive enough that users won't have a hard time with it.
Test Plan:
New dropdown:
{F379150}
Device-ish:
{F379151}
Normal search (current application, from maniphest, selects tasks):
{F379153}
Application search from non-application:
{F379154}
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: johnny-bit, epriestley
Maniphest Tasks: T7266, T7314, T4475
Differential Revision: https://secure.phabricator.com/D12509
											
										 
											2015-04-22 14:31:36 -07:00
										 |  |  |   public function getApplicationSearchDocumentTypes() { | 
					
						
							|  |  |  |     return array( | 
					
						
							|  |  |  |       PhabricatorProjectProjectPHIDType::TYPECONST, | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-07 11:54:49 -07:00
										 |  |  | } |