本文整理汇总了PHP中ManiphestTaskPriority类的典型用法代码示例。如果您正苦于以下问题:PHP ManiphestTaskPriority类的具体用法?PHP ManiphestTaskPriority怎么用?PHP ManiphestTaskPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ManiphestTaskPriority类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getItem
public function getItem()
{
$task = $this->getTask();
$owner = $this->getOwner();
$can_edit = $this->getCanEdit();
$viewer = $this->getViewer();
$color_map = ManiphestTaskPriority::getColorMap();
$bar_color = idx($color_map, $task->getPriority(), 'grey');
$card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task->getPHID()))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
if ($owner) {
$card->addHandleIcon($owner, $owner->getName());
}
$cover_file = $this->getCoverImageFile();
if ($cover_file) {
$card->setCoverImage($cover_file->getBestURI());
}
if ($task->isClosed()) {
$icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
$icon = id(new PHUIIconView())->setIcon($icon . ' grey');
$card->addAttribute($icon);
$card->setBarColor('grey');
}
$project_handles = $this->getProjectHandles();
if ($project_handles) {
$tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
$card->addAttribute($tag_list);
}
return $card;
}
开发者ID:truSense,项目名称:phabricator,代码行数:29,代码来源:ProjectBoardTaskCard.php
示例2: initializeNewTask
public static function initializeNewTask(PhabricatorUser $actor)
{
$app = id(new PhabricatorApplicationQuery())->setViewer($actor)->withClasses(array('PhabricatorManiphestApplication'))->executeOne();
$view_policy = $app->getPolicy(ManiphestDefaultViewCapability::CAPABILITY);
$edit_policy = $app->getPolicy(ManiphestDefaultEditCapability::CAPABILITY);
return id(new ManiphestTask())->setStatus(ManiphestTaskStatus::getDefaultStatus())->setPriority(ManiphestTaskPriority::getDefaultPriority())->setAuthorPHID($actor->getPHID())->setViewPolicy($view_policy)->setEditPolicy($edit_policy)->setSpacePHID($actor->getDefaultSpacePHID())->attachProjectPHIDs(array())->attachSubscriberPHIDs(array());
}
开发者ID:fuding,项目名称:phabricator,代码行数:7,代码来源:ManiphestTask.php
示例3: renderActionEffectDescription
protected function renderActionEffectDescription($type, $data)
{
switch ($type) {
case self::DO_PRIORITY:
return pht('Changed task priority to "%s".', ManiphestTaskPriority::getTaskPriorityName($data));
}
}
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:ManiphestTaskPriorityHeraldAction.php
示例4: newTableRow
protected function newTableRow($phid, $object, $trace)
{
$viewer = $this->getViewer();
if ($object) {
$status = $object->getStatus();
$priority = $object->getPriority();
$status_icon = ManiphestTaskStatus::getStatusIcon($status);
$status_name = ManiphestTaskStatus::getTaskStatusName($status);
$priority_color = ManiphestTaskPriority::getTaskPriorityColor($priority);
if ($object->isClosed()) {
$priority_color = 'grey';
}
$status = array(id(new PHUIIconView())->setIcon($status_icon, $priority_color), ' ', $status_name);
$owner_phid = $object->getOwnerPHID();
if ($owner_phid) {
$assigned = $viewer->renderHandle($owner_phid);
} else {
$assigned = phutil_tag('em', array(), pht('None'));
}
$link = phutil_tag('a', array('href' => $object->getURI()), $object->getTitle());
$link = array($object->getMonogram(), ' ', $link);
} else {
$status = null;
$assigned = null;
$link = $viewer->renderHandle($phid);
}
return array($trace, $status, $assigned, $link);
}
开发者ID:rchicoli,项目名称:phabricator,代码行数:28,代码来源:ManiphestTaskGraph.php
示例5: execute
protected function execute(ConduitAPIRequest $request)
{
$task = new ManiphestTask();
$task->setPriority(ManiphestTaskPriority::getDefaultPriority());
$task->setAuthorPHID($request->getUser()->getPHID());
$this->applyRequest($task, $request, $is_new = true);
return $this->buildTaskInfoDictionary($task);
}
开发者ID:rudimk,项目名称:phabricator,代码行数:8,代码来源:ConduitAPI_maniphest_createtask_Method.php
示例6: buildResults
private function buildResults()
{
$results = array();
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
foreach ($priority_map as $value => $name) {
$results[$value] = id(new PhabricatorTypeaheadResult())->setIcon(ManiphestTaskPriority::getTaskPriorityIcon($value))->setPHID($value)->setName($name);
}
return $results;
}
开发者ID:patelhardik,项目名称:phabricator,代码行数:9,代码来源:ManiphestTaskPriorityDatasource.php
示例7: getEditorValue
public function getEditorValue(PhabricatorUser $viewer, $value)
{
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
$value_map = array();
foreach ($value as $priority) {
$value_map[$priority] = idx($priority_map, $priority, $priority);
}
return $value_map;
}
开发者ID:ThomasWo,项目名称:phabricator,代码行数:9,代码来源:ManiphestTaskPriorityHeraldField.php
示例8: execute
protected function execute(ConduitAPIRequest $request)
{
$task_id = $request->getValue('task_id');
$task = id(new ManiphestTask())->load($task_id);
if (!$task) {
throw new ConduitException('ERR_BAD_TASK');
}
$result = array('id' => $task->getID(), 'phid' => $task->getPHID(), 'authorPHID' => $task->getAuthorPHID(), 'ownerPHID' => $task->getAuthorPHID(), 'ccPHIDs' => $task->getCCPHIDs(), 'status' => $task->getStatus(), 'priority' => ManiphestTaskPriority::getTaskPriorityName($task->getPriority()), 'title' => $task->getTitle(), 'description' => $task->getDescription(), 'projectPHIDs' => $task->getProjectPHIDs(), 'uri' => PhabricatorEnv::getProductionURI('/T' . $task->getID()));
return $result;
}
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:10,代码来源:ConduitAPI_maniphest_info_Method.php
示例9: render
public function render()
{
$handles = $this->handles;
require_celerity_resource('maniphest-task-summary-css');
$list = new PHUIObjectItemListView();
if ($this->noDataString) {
$list->setNoDataString($this->noDataString);
} else {
$list->setNoDataString(pht('No tasks.'));
}
$status_map = ManiphestTaskStatus::getTaskStatusMap();
$color_map = ManiphestTaskPriority::getColorMap();
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
if ($this->showBatchControls) {
Javelin::initBehavior('maniphest-list-editor');
}
foreach ($this->tasks as $task) {
$item = id(new PHUIObjectItemView())->setUser($this->getUser())->setObject($task)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setHref('/T' . $task->getID());
if ($task->getOwnerPHID()) {
$owner = $handles[$task->getOwnerPHID()];
$item->addByline(pht('Assigned: %s', $owner->renderLink()));
}
$status = $task->getStatus();
$pri = idx($priority_map, $task->getPriority());
$status_name = idx($status_map, $task->getStatus());
$tooltip = pht('%s, %s', $status_name, $pri);
$icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
$color = idx($color_map, $task->getPriority(), 'grey');
if ($task->isClosed()) {
$item->setDisabled(true);
$color = 'grey';
}
$item->setStatusIcon($icon . ' ' . $color, $tooltip);
$item->addIcon('none', phabricator_datetime($task->getDateModified(), $this->getUser()));
if ($this->showSubpriorityControls) {
$item->setGrippable(true);
}
if ($this->showSubpriorityControls || $this->showBatchControls) {
$item->addSigil('maniphest-task');
}
$project_handles = array_select_keys($handles, array_reverse($task->getProjectPHIDs()));
$item->addAttribute(id(new PHUIHandleTagListView())->setLimit(4)->setNoDataString(pht('No Projects'))->setSlim(true)->setHandles($project_handles));
$item->setMetadata(array('taskID' => $task->getID()));
if ($this->showBatchControls) {
$href = new PhutilURI('/maniphest/task/edit/' . $task->getID() . '/');
if (!$this->showSubpriorityControls) {
$href->setQueryParam('ungrippable', 'true');
}
$item->addAction(id(new PHUIListItemView())->setIcon('fa-pencil')->addSigil('maniphest-edit-task')->setHref($href));
}
$list->addItem($item);
}
return $list;
}
开发者ID:endlessm,项目名称:phabricator,代码行数:54,代码来源:ManiphestTaskListView.php
示例10: render
public function render()
{
if (!$this->user) {
throw new Exception("Call setUser() before rendering!");
}
$task = $this->task;
$handles = $this->handles;
require_celerity_resource('maniphest-task-summary-css');
$classes = array(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW => 'pri-unbreak', ManiphestTaskPriority::PRIORITY_TRIAGE => 'pri-triage', ManiphestTaskPriority::PRIORITY_HIGH => 'pri-high', ManiphestTaskPriority::PRIORITY_NORMAL => 'pri-normal', ManiphestTaskPriority::PRIORITY_LOW => 'pri-low', ManiphestTaskPriority::PRIORITY_WISH => 'pri-wish');
$pri_class = idx($classes, $task->getPriority());
return '<table class="maniphest-task-summary">' . '<tr>' . '<td class="maniphest-task-number ' . $pri_class . '">' . 'T' . $task->getID() . '</td>' . '<td class="maniphest-task-status">' . ($task->getStatus() == ManiphestTaskStatus::STATUS_OPEN ? 'Open' : 'Closed') . '</td>' . '<td class="maniphest-task-owner">' . ($task->getOwnerPHID() ? $handles[$task->getOwnerPHID()]->renderLink() : '<em>None</em>') . '</td>' . '<td class="maniphest-task-name">' . phutil_render_tag('a', array('href' => '/T' . $task->getID()), phutil_escape_html($task->getTitle())) . '</td>' . '<td class="maniphest-task-priority">' . ManiphestTaskPriority::getTaskPriorityName($task->getPriority()) . '</td>' . '<td class="maniphest-task-updated">' . phabricator_datetime($task->getDateModified(), $this->user) . '</td>' . '</tr>' . '</table>';
}
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:12,代码来源:ManiphestTaskSummaryView.php
示例11: loadResults
public function loadResults()
{
$viewer = $this->getViewer();
$raw_query = $this->getRawQuery();
$results = array();
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
foreach ($priority_map as $value => $name) {
// NOTE: $value is not a PHID but is unique. This'll work.
$results[] = id(new PhabricatorTypeaheadResult())->setPHID($value)->setName($name);
}
return $results;
}
开发者ID:denghp,项目名称:phabricator,代码行数:12,代码来源:ManiphestTaskPriorityDatasource.php
示例12: processRequest
public function processRequest()
{
$this->requireApplicationCapability(ManiphestBulkEditCapability::CAPABILITY);
$request = $this->getRequest();
$user = $request->getUser();
$task_ids = $request->getArr('batch');
$tasks = id(new ManiphestTaskQuery())->setViewer($user)->withIDs($task_ids)->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->execute();
$actions = $request->getStr('actions');
if ($actions) {
$actions = json_decode($actions, true);
}
if ($request->isFormPost() && is_array($actions)) {
foreach ($tasks as $task) {
$field_list = PhabricatorCustomField::getObjectFields($task, PhabricatorCustomField::ROLE_EDIT);
$field_list->readFieldsFromStorage($task);
$xactions = $this->buildTransactions($actions, $task);
if ($xactions) {
// TODO: Set content source to "batch edit".
$editor = id(new ManiphestTransactionEditor())->setActor($user)->setContentSourceFromRequest($request)->setContinueOnNoEffect(true)->setContinueOnMissingFields(true)->applyTransactions($task, $xactions);
}
}
$task_ids = implode(',', mpull($tasks, 'getID'));
return id(new AphrontRedirectResponse())->setURI('/maniphest/?ids=' . $task_ids);
}
$handles = ManiphestTaskListView::loadTaskHandles($user, $tasks);
$list = new ManiphestTaskListView();
$list->setTasks($tasks);
$list->setUser($user);
$list->setHandles($handles);
$template = new AphrontTokenizerTemplateView();
$template = $template->render();
$projects_source = new PhabricatorProjectDatasource();
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
$owner_source = new PhabricatorTypeaheadOwnerDatasource();
require_celerity_resource('maniphest-batch-editor');
Javelin::initBehavior('maniphest-batch-editor', array('root' => 'maniphest-batch-edit-form', 'tokenizerTemplate' => $template, 'sources' => array('project' => array('src' => $projects_source->getDatasourceURI(), 'placeholder' => $projects_source->getPlaceholderText()), 'owner' => array('src' => $owner_source->getDatasourceURI(), 'placeholder' => $owner_source->getPlaceholderText(), 'limit' => 1), 'cc' => array('src' => $mailable_source->getDatasourceURI(), 'placeholder' => $mailable_source->getPlaceholderText())), 'input' => 'batch-form-actions', 'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(), 'statusMap' => ManiphestTaskStatus::getTaskStatusMap()));
$form = new AphrontFormView();
$form->setUser($user);
$form->setID('maniphest-batch-edit-form');
foreach ($tasks as $task) {
$form->appendChild(phutil_tag('input', array('type' => 'hidden', 'name' => 'batch[]', 'value' => $task->getID())));
}
$form->appendChild(phutil_tag('input', array('type' => 'hidden', 'name' => 'actions', 'id' => 'batch-form-actions')));
$form->appendChild(phutil_tag('p', array(), pht('These tasks will be edited:')));
$form->appendChild($list);
$form->appendChild(id(new AphrontFormInsetView())->setTitle('Actions')->setRightButton(javelin_tag('a', array('href' => '#', 'class' => 'button green', 'sigil' => 'add-action', 'mustcapture' => true), pht('Add Another Action')))->setContent(javelin_tag('table', array('sigil' => 'maniphest-batch-actions', 'class' => 'maniphest-batch-actions-table'), '')))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Update Tasks'))->addCancelButton('/maniphest/'));
$title = pht('Batch Editor');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
$form_box = id(new PHUIObjectBoxView())->setHeaderText(pht('Batch Edit Tasks'))->setForm($form);
return $this->buildApplicationPage(array($crumbs, $form_box), array('title' => $title, 'device' => false));
}
开发者ID:denghp,项目名称:phabricator,代码行数:52,代码来源:ManiphestBatchEditController.php
示例13: getItem
public function getItem()
{
$task = $this->getTask();
$owner = $this->getOwner();
$can_edit = $this->getCanEdit();
$color_map = ManiphestTaskPriority::getColorMap();
$bar_color = idx($color_map, $task->getPriority(), 'grey');
$card = id(new PHUIObjectItemView())->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task->getPHID()))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
if ($owner) {
$card->addAttribute($owner->renderLink());
}
return $card;
}
开发者ID:denghp,项目名称:phabricator,代码行数:13,代码来源:ProjectBoardTaskCard.php
示例14: buildResults
private function buildResults()
{
$results = array();
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
foreach ($priority_map as $value => $name) {
$result = id(new PhabricatorTypeaheadResult())->setIcon(ManiphestTaskPriority::getTaskPriorityIcon($value))->setPHID($value)->setName($name)->addAttribute(pht('Priority'));
if (ManiphestTaskPriority::isDisabledPriority($value)) {
$result->setClosed(pht('Disabled'));
}
$results[$value] = $result;
}
return $results;
}
开发者ID:rchicoli,项目名称:phabricator,代码行数:13,代码来源:ManiphestTaskPriorityDatasource.php
示例15: renderHovercard
public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $task, $data)
{
$viewer = $this->getViewer();
$hovercard->setTitle($task->getMonogram())->setDetail($task->getTitle());
$owner_phid = $task->getOwnerPHID();
if ($owner_phid) {
$owner = $viewer->renderHandle($owner_phid);
} else {
$owner = phutil_tag('em', array(), pht('None'));
}
$hovercard->addField(pht('Assigned To'), $owner);
$hovercard->addField(pht('Priority'), ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
$hovercard->addTag(ManiphestView::renderTagForTask($task));
}
开发者ID:phpengineer,项目名称:phabricator,代码行数:14,代码来源:ManiphestHovercardEngineExtension.php
示例16: buildTaskInfoDictionaries
protected function buildTaskInfoDictionaries(array $tasks)
{
if (!$tasks) {
return array();
}
$all_aux = id(new ManiphestTaskAuxiliaryStorage())->loadAllWhere('taskPHID in (%Ls)', mpull($tasks, 'getPHID'));
$all_aux = mgroup($all_aux, 'getTaskPHID');
$result = array();
foreach ($tasks as $task) {
$auxiliary = idx($all_aux, $task->getPHID(), array());
$auxiliary = mpull($auxiliary, 'getValue', 'getName');
$result[$task->getPHID()] = array('id' => $task->getID(), 'phid' => $task->getPHID(), 'authorPHID' => $task->getAuthorPHID(), 'ownerPHID' => $task->getOwnerPHID(), 'ccPHIDs' => $task->getCCPHIDs(), 'status' => $task->getStatus(), 'priority' => ManiphestTaskPriority::getTaskPriorityName($task->getPriority()), 'title' => $task->getTitle(), 'description' => $task->getDescription(), 'projectPHIDs' => $task->getProjectPHIDs(), 'uri' => PhabricatorEnv::getProductionURI('/T' . $task->getID()), 'auxiliary' => $auxiliary, 'objectName' => 'T' . $task->getID(), 'dateCreated' => $task->getDateCreated(), 'dateModified' => $task->getDateModified());
}
return $result;
}
开发者ID:hwang36,项目名称:phabricator,代码行数:15,代码来源:ConduitAPI_maniphest_Method.php
示例17: buildWorkbook
/**
* @phutil-external-symbol class PHPExcel
* @phutil-external-symbol class PHPExcel_IOFactory
* @phutil-external-symbol class PHPExcel_Style_NumberFormat
* @phutil-external-symbol class PHPExcel_Cell_DataType
*/
public function buildWorkbook(PHPExcel $workbook, array $tasks, array $handles, PhabricatorUser $user)
{
$sheet = $workbook->setActiveSheetIndex(0);
$sheet->setTitle(pht('Tasks'));
$widths = array(null, 15, null, 10, 15, 15, 60, 30, 20, 100);
foreach ($widths as $col => $width) {
if ($width !== null) {
$sheet->getColumnDimension($this->col($col))->setWidth($width);
}
}
$status_map = ManiphestTaskStatus::getTaskStatusMap();
$pri_map = ManiphestTaskPriority::getTaskPriorityMap();
$date_format = null;
$rows = array();
$rows[] = array(pht('ID'), pht('Owner'), pht('Status'), pht('Priority'), pht('Date Created'), pht('Date Updated'), pht('Deadline'), pht('Title'), pht('Projects'), pht('Description'));
$is_date = array(false, false, false, false, true, true, true, false, false, false);
$header_format = array('font' => array('bold' => true));
foreach ($tasks as $task) {
$task_owner = null;
if ($task->getOwnerPHID()) {
$task_owner = $handles[$task->getOwnerPHID()]->getName();
}
$projects = array();
foreach ($task->getProjectPHIDs() as $phid) {
$projects[] = $handles[$phid]->getName();
}
$projects = implode(', ', $projects);
$custom_fields = PhabricatorCustomField::getObjectFields($task, PhabricatorCustomField::ROLE_VIEW);
$custom_fields->setViewer($user)->readFieldsFromStorage($task);
$fields = $custom_fields->getFields();
$rows[] = array('T' . $task->getID(), $task_owner, idx($status_map, $task->getStatus(), '?'), idx($pri_map, $task->getPriority(), '?'), $this->computeExcelDate($task->getDateCreated()), $this->computeExcelDate($task->getDateModified()), $this->computeExcelDate($fields['std:maniphest:Deadline']->getValueForStorage()), $task->getTitle(), $projects, id(new PhutilUTF8StringTruncator())->setMaximumBytes(512)->truncateString($task->getDescription()));
}
foreach ($rows as $row => $cols) {
foreach ($cols as $col => $spec) {
$cell_name = $this->col($col) . ($row + 1);
$cell = $sheet->setCellValue($cell_name, $spec, $return_cell = true);
if ($row == 0) {
$sheet->getStyle($cell_name)->applyFromArray($header_format);
}
if ($is_date[$col]) {
$code = PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2;
$sheet->getStyle($cell_name)->getNumberFormat()->setFormatCode($code);
} else {
$cell->setDataType(PHPExcel_Cell_DataType::TYPE_STRING);
}
}
}
}
开发者ID:nanamiwang,项目名称:phabricator,代码行数:54,代码来源:ManiphestExcelDefaultFormat.php
示例18: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$task_ids = $request->getArr('batch');
$tasks = id(new ManiphestTask())->loadAllWhere('id IN (%Ld)', $task_ids);
$actions = $request->getStr('actions');
if ($actions) {
$actions = json_decode($actions, true);
}
if ($request->isFormPost() && is_array($actions)) {
foreach ($tasks as $task) {
$xactions = $this->buildTransactions($actions, $task);
if ($xactions) {
$editor = new ManiphestTransactionEditor();
$editor->applyTransactions($task, $xactions);
}
}
$task_ids = implode(',', mpull($tasks, 'getID'));
return id(new AphrontRedirectResponse())->setURI('/maniphest/view/custom/?s=oc&tasks=' . $task_ids);
}
$panel = new AphrontPanelView();
$panel->setHeader('Maniphest Batch Editor');
$handle_phids = mpull($tasks, 'getOwnerPHID');
$handles = id(new PhabricatorObjectHandleData($handle_phids))->loadHandles();
$list = new ManiphestTaskListView();
$list->setTasks($tasks);
$list->setUser($user);
$list->setHandles($handles);
$template = new AphrontTokenizerTemplateView();
$template = $template->render();
require_celerity_resource('maniphest-batch-editor');
Javelin::initBehavior('maniphest-batch-editor', array('root' => 'maniphest-batch-edit-form', 'tokenizerTemplate' => $template, 'sources' => array('project' => array('src' => '/typeahead/common/projects/', 'placeholder' => 'Type a project name...'), 'owner' => array('src' => '/typeahead/common/searchowner/', 'placeholder' => 'Type a user name...', 'limit' => 1)), 'input' => 'batch-form-actions', 'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(), 'statusMap' => ManiphestTaskStatus::getTaskStatusMap()));
$form = new AphrontFormView();
$form->setUser($user);
$form->setID('maniphest-batch-edit-form');
foreach ($tasks as $task) {
$form->appendChild(phutil_render_tag('input', array('type' => 'hidden', 'name' => 'batch[]', 'value' => $task->getID()), null));
}
$form->appendChild(phutil_render_tag('input', array('type' => 'hidden', 'name' => 'actions', 'id' => 'batch-form-actions'), null));
$form->appendChild('<p>These tasks will be edited:</p>');
$form->appendChild($list);
$form->appendChild(id(new AphrontFormInsetView())->setTitle('Actions')->setRightButton(javelin_render_tag('a', array('href' => '#', 'class' => 'button green', 'sigil' => 'add-action', 'mustcapture' => true), 'Add Another Action'))->setContent(javelin_render_tag('table', array('sigil' => 'maniphest-batch-actions', 'class' => 'maniphest-batch-actions-table'), '')))->appendChild(id(new AphrontFormSubmitControl())->setValue('Update Tasks')->addCancelButton('/maniphest/', 'Done'));
$panel->appendChild($form);
return $this->buildStandardPageResponse($panel, array('title' => 'Batch Editor'));
}
开发者ID:relrod,项目名称:phabricator,代码行数:46,代码来源:ManiphestBatchEditController.php
示例19: getItem
public function getItem()
{
$task = $this->getTask();
$owner = $this->getOwner();
$can_edit = $this->getCanEdit();
$viewer = $this->getViewer();
$color_map = ManiphestTaskPriority::getColorMap();
$bar_color = idx($color_map, $task->getPriority(), 'grey');
$card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
if ($owner) {
$card->addHandleIcon($owner, $owner->getName());
}
$cover_file = $this->getCoverImageFile();
if ($cover_file) {
$card->setCoverImage($cover_file->getBestURI());
}
if (ManiphestTaskPoints::getIsEnabled()) {
$points = $task->getPoints();
if ($points !== null) {
$points_tag = id(new PHUITagView())->setType(PHUITagView::TYPE_SHADE)->setShade(PHUITagView::COLOR_GREY)->setSlimShady(true)->setName($points)->addClass('phui-workcard-points');
$card->addAttribute($points_tag);
}
}
if ($task->isClosed()) {
$icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
$icon = id(new PHUIIconView())->setIcon($icon . ' grey');
$card->addAttribute($icon);
$card->setBarColor('grey');
}
$project_handles = $this->getProjectHandles();
// Remove any archived projects from the list.
if ($project_handles) {
foreach ($project_handles as $key => $handle) {
if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
unset($project_handles[$key]);
}
}
}
if ($project_handles) {
$project_handles = array_reverse($project_handles);
$tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
$card->addAttribute($tag_list);
}
$card->addClass('phui-workcard');
return $card;
}
开发者ID:endlessm,项目名称:phabricator,代码行数:46,代码来源:ProjectBoardTaskCard.php
示例20: handleHovercardEvent
private function handleHovercardEvent(PhutilEvent $event)
{
$viewer = $event->getUser();
$hovercard = $event->getValue('hovercard');
$handle = $event->getValue('handle');
$phid = $handle->getPHID();
$task = $event->getValue('object');
if (!$task instanceof ManiphestTask) {
return;
}
$e_project = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
// Fun with "Unbeta Pholio", hua hua
$e_dep_on = ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
$e_dep_by = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST;
$edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(array($phid))->withEdgeTypes(array($e_project, $e_dep_on, $e_dep_by));
$edges = idx($edge_query->execute(), $phid);
$edge_phids = $edge_query->getDestinationPHIDs();
$owner_phid = $task->getOwnerPHID();
$hovercard->setTitle(pht('T%d', $task->getID()))->setDetail($task->getTitle());
if ($owner_phid) {
$owner = $viewer->renderHandle($owner_phid);
} else {
$owner = phutil_tag('em', array(), pht('None'));
}
$hovercard->addField(pht('Assigned To'), $owner);
$hovercard->addField(pht('Priority'), ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
if ($edge_phids) {
$edge_types = array($e_project => pht('Projects'), $e_dep_by => pht('Blocks'), $e_dep_on => pht('Blocked By'));
$max_count = 6;
foreach ($edge_types as $edge_type => $edge_name) {
if ($edges[$edge_type]) {
// TODO: This can be made more sophisticated. We still load all
// edges into memory. Only load the ones we need.
$edge_overflow = array();
if (count($edges[$edge_type]) > $max_count) {
$edges[$edge_type] = array_slice($edges[$edge_type], 0, 6, true);
$edge_overflow = ', ...';
}
$hovercard->addField($edge_name, array($viewer->renderHandleList(array_keys($edges[$edge_type])), $edge_overflow));
}
}
}
$hovercard->addTag(ManiphestView::renderTagForTask($task));
$event->setValue('hovercard', $hovercard);
}
开发者ID:patelhardik,项目名称:phabricator,代码行数:45,代码来源:ManiphestHovercardEventListener.php
注:本文中的ManiphestTaskPriority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论