本文整理汇总了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;
}
示例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();
}