當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorProject::setHasWorkboard方法代碼示例

本文整理匯總了PHP中PhabricatorProject::setHasWorkboard方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorProject::setHasWorkboard方法的具體用法?PHP PhabricatorProject::setHasWorkboard怎麽用?PHP PhabricatorProject::setHasWorkboard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhabricatorProject的用法示例。


在下文中一共展示了PhabricatorProject::setHasWorkboard方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildInitializeContent

 private function buildInitializeContent(PhabricatorProject $project)
 {
     $request = $this->getRequest();
     $viewer = $this->getViewer();
     $type = $request->getStr('initialize-type');
     $id = $project->getID();
     $profile_uri = $this->getApplicationURI("profile/{$id}/");
     $board_uri = $this->getApplicationURI("board/{$id}/");
     $import_uri = $this->getApplicationURI("board/{$id}/import/");
     $set_default = $request->getBool('default');
     if ($set_default) {
         $this->getProfilePanelEngine()->adjustDefault(PhabricatorProject::PANEL_WORKBOARD);
     }
     if ($request->isFormPost()) {
         if ($type == 'backlog-only') {
             $column = PhabricatorProjectColumn::initializeNewColumn($viewer)->setSequence(0)->setProperty('isDefault', true)->setProjectPHID($project->getPHID())->save();
             $project->setHasWorkboard(1)->save();
             return id(new AphrontRedirectResponse())->setURI($board_uri);
         } else {
             return id(new AphrontRedirectResponse())->setURI($import_uri);
         }
     }
     $new_selector = id(new AphrontFormRadioButtonControl())->setLabel(pht('Columns'))->setName('initialize-type')->setValue('backlog-only')->addButton('backlog-only', pht('New Empty Board'), pht('Create a new board with just a backlog column.'))->addButton('import', pht('Import Columns'), pht('Import board columns from another project.'));
     $default_checkbox = id(new AphrontFormCheckboxControl())->setLabel(pht('Make Default'))->addCheckbox('default', 1, pht('Make the workboard the default view for this project.'), true);
     $form = id(new AphrontFormView())->setUser($viewer)->appendRemarkupInstructions(pht('The workboard for this project has not been created yet.'))->appendControl($new_selector)->appendControl($default_checkbox)->appendControl(id(new AphrontFormSubmitControl())->addCancelButton($profile_uri)->setValue(pht('Create Workboard')));
     $box = id(new PHUIObjectBoxView())->setHeaderText(pht('Create Workboard'))->setForm($form);
     return $box;
 }
開發者ID:billtt,項目名稱:phabricator,代碼行數:28,代碼來源:PhabricatorProjectBoardViewController.php

示例2: addColumn

 private function addColumn(PhabricatorUser $viewer, PhabricatorProject $project, $sequence)
 {
     $project->setHasWorkboard(1)->save();
     return PhabricatorProjectColumn::initializeNewColumn($viewer)->setSequence(0)->setProperty('isDefault', $sequence == 0)->setProjectPHID($project->getPHID())->save();
 }
開發者ID:Houzz,項目名稱:phabricator,代碼行數:5,代碼來源:PhabricatorProjectCoreTestCase.php


注:本文中的PhabricatorProject::setHasWorkboard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。