* [task#118853,0.5h,2h] add confirmdemandretract for story view.

This commit is contained in:
tanghucheng
2024-06-06 15:26:49 +08:00
parent fdb7f104d5
commit 2f2d5305f9
+10
View File
@@ -182,6 +182,7 @@ $hasRepo = $this->loadModel('repo')->getListByProduct($story->product, 'Gitla
$actions = $story->deleted ? array() : $this->loadModel('common')->buildOperateMenu($story);
$hasDivider = !empty($actions['mainActions']) && !empty($actions['suffixActions']);
if(!empty($actions)) $actions = array_merge($actions['mainActions'], array(array('type' => 'divider')), $actions['suffixActions']);
foreach($actions as $key => $action)
{
if(!$hasDivider && isset($action['type']) && $action['type'] == 'divider')
@@ -203,6 +204,15 @@ foreach($actions as $key => $action)
}
}
if($this->config->edition == 'ipd' and $story->type == 'story') $story = $this->story->getAffectObject(array(), $story->type, $story);
if($config->edition == 'ipd' && $story->type == 'story' && !empty($story->confirmeObject))
{
$actions = array();
$method = $story->confirmeObject['type'] == 'confirmedretract' ? 'confirmDemandRetract' : 'confirmDemandUnlink';
$url = helper::createLink('story', $method, "objectID=$story->id&object=story&extra={$story->confirmeObject['id']}");
$actions[] = array('name' => $method, 'text' => $lang->story->$method, 'icon' => 'search', 'hint' => $lang->story->$method, 'url' => $url, 'data-toggle' => 'modal');
}
detail
(
set::urlFormatter(array('{id}' => $story->id, '{type}' => $story->type, '{product}' => $story->product, '{branch}' => $story->branch, '{module}' => $story->module, '{execution}' => isset($executionID) ? $executionID : (isset($projectID) ? $projectID : 0))),