Path: blob/master/src/applications/guides/module/PhabricatorGuideQuickStartModule.php
12242 views
<?php12final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {34public function getModuleKey() {5return 'quickstart';6}78public function getModuleName() {9return pht('Quick Start');10}1112public function getModulePosition() {13return 30;14}1516public function getIsModuleEnabled() {17return true;18}1920public function renderModuleStatus(AphrontRequest $request) {21$viewer = $request->getViewer();22$instance = PhabricatorEnv::getEnvConfig('cluster.instance');2324$guide_items = new PhabricatorGuideListView();2526$title = pht('Create a Repository');27$repository_check = id(new PhabricatorRepositoryQuery())28->setViewer($viewer)29->execute();30$href = PhabricatorEnv::getURI('/diffusion/');31if ($repository_check) {32$icon = 'fa-check';33$icon_bg = 'bg-green';34$description = pht(35"You've created at least one repository.");36} else {37$icon = 'fa-code';38$icon_bg = 'bg-sky';39$description =40pht('If you are here for code review, let\'s set up your first '.41'repository.');42}4344$item = id(new PhabricatorGuideItemView())45->setTitle($title)46->setHref($href)47->setIcon($icon)48->setIconBackground($icon_bg)49->setDescription($description);50$guide_items->addItem($item);515253$title = pht('Create a Project');54$project_check = id(new PhabricatorProjectQuery())55->setViewer($viewer)56->execute();57$href = PhabricatorEnv::getURI('/project/');58if ($project_check) {59$icon = 'fa-check';60$icon_bg = 'bg-green';61$description = pht(62"You've created at least one project.");63} else {64$icon = 'fa-briefcase';65$icon_bg = 'bg-sky';66$description =67pht('Project tags define everything. Create them for teams, tags, '.68'or actual projects.');69}7071$item = id(new PhabricatorGuideItemView())72->setTitle($title)73->setHref($href)74->setIcon($icon)75->setIconBackground($icon_bg)76->setDescription($description);77$guide_items->addItem($item);787980$title = pht('Create a Task');81$task_check = id(new ManiphestTaskQuery())82->setViewer($viewer)83->execute();84$href = PhabricatorEnv::getURI('/maniphest/');85if ($task_check) {86$icon = 'fa-check';87$icon_bg = 'bg-green';88$description = pht(89"You've created at least one task.");90} else {91$icon = 'fa-anchor';92$icon_bg = 'bg-sky';93$description =94pht('Create some work for the interns in Maniphest.');95}9697$item = id(new PhabricatorGuideItemView())98->setTitle($title)99->setHref($href)100->setIcon($icon)101->setIconBackground($icon_bg)102->setDescription($description);103$guide_items->addItem($item);104105$title = pht('Personalize your Install');106$wordmark = PhabricatorEnv::getEnvConfig('ui.logo');107$href = PhabricatorEnv::getURI('/config/edit/ui.logo/');108if ($wordmark) {109$icon = 'fa-check';110$icon_bg = 'bg-green';111$description = pht(112'It looks amazing, good work. Home Sweet Home.');113} else {114$icon = 'fa-home';115$icon_bg = 'bg-sky';116$description =117pht('Change the name and add your company logo, just to give it a '.118'little extra polish.');119}120121$item = id(new PhabricatorGuideItemView())122->setTitle($title)123->setHref($href)124->setIcon($icon)125->setIconBackground($icon_bg)126->setDescription($description);127$guide_items->addItem($item);128129$title = pht('Explore Applications');130$href = PhabricatorEnv::getURI('/applications/');131$icon = 'fa-globe';132$icon_bg = 'bg-sky';133$description =134pht('See all available applications.');135136$item = id(new PhabricatorGuideItemView())137->setTitle($title)138->setHref($href)139->setIcon($icon)140->setIconBackground($icon_bg)141->setDescription($description);142$guide_items->addItem($item);143144if (!$instance) {145$title = pht('Invite Collaborators');146$people_check = id(new PhabricatorPeopleQuery())147->setViewer($viewer)148->execute();149$people = count($people_check);150$href = PhabricatorEnv::getURI('/people/invite/send/');151if ($people > 1) {152$icon = 'fa-check';153$icon_bg = 'bg-green';154$description = pht(155'Your invitations have been accepted. You will not be alone on '.156'this journey.');157} else {158$icon = 'fa-group';159$icon_bg = 'bg-sky';160$description =161pht('Invite the rest of your team to get started.');162}163164$item = id(new PhabricatorGuideItemView())165->setTitle($title)166->setHref($href)167->setIcon($icon)168->setIconBackground($icon_bg)169->setDescription($description);170$guide_items->addItem($item);171}172173$intro = pht(174'If you\'re new to this software, these optional steps can help you '.175'learn the basics. Feel free to set things up for how you work best '.176'and explore these features at your own pace.');177178$intro = new PHUIRemarkupView($viewer, $intro);179$intro = id(new PHUIDocumentView())180->appendChild($intro);181182return array($intro, $guide_items);183184}185186}187188189