* Refactor projectrelease::batchUnlinkBug and projectrelease::batchUnlinkStory.
This commit is contained in:
@@ -400,16 +400,16 @@ class projectrelease extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目发布批量取消关联需求。
|
||||
* Batch unlink story.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchUnlinkStory($releaseID)
|
||||
public function batchUnlinkStory(int $releaseID)
|
||||
{
|
||||
$this->loadModel('release')->batchUnlinkStory($releaseID);
|
||||
return print(js::locate($this->createLink('projectrelease', 'view', "releaseID=$releaseID&type=story"), 'parent'));
|
||||
echo $this->fetch('release', 'batchUnlinkStory', "releaseID={$releaseID}");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,6 +447,7 @@ class projectrelease extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目发布批量取消关联 bug。
|
||||
* Batch unlink story.
|
||||
*
|
||||
* @param int $releaseID
|
||||
@@ -454,10 +455,9 @@ class projectrelease extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchUnlinkBug($releaseID, $type = 'bug')
|
||||
public function batchUnlinkBug(int $releaseID, string $type = 'bug')
|
||||
{
|
||||
$this->loadModel('release')->batchUnlinkBug($releaseID, $type);
|
||||
return print(js::locate($this->createLink('projectrelease', 'view', "releaseID=$releaseID&type=$type"), 'parent'));
|
||||
echo $this->fetch('release', 'batchUnlinkBug', "releaseID={$releaseID}&type={$type}");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -605,7 +605,7 @@ class release extends control
|
||||
public function batchUnlinkStory(int $releaseID)
|
||||
{
|
||||
$this->release->batchUnlinkStory($releaseID);
|
||||
return $this->sendSuccess(array('load' => $this->createLink('release', 'view', "releaseID=$releaseID&type=story")));
|
||||
return $this->sendSuccess(array('load' => $this->createLink($this->app->rawModule, 'view', "releaseID={$releaseID}&type=story")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -626,7 +626,7 @@ class release extends control
|
||||
if(!empty($_POST['bugs']))
|
||||
{
|
||||
$this->release->linkBug($releaseID, $type);
|
||||
return print(js::locate($this->createLink($this->app->rawModule, 'view', "releaseID=$releaseID&type=$type"), 'parent'));
|
||||
return $this->sendSuccess(array('load' => $this->createLink($this->app->rawModule, 'view', "releaseID={$releaseID}&type={$type}")));
|
||||
}
|
||||
|
||||
$this->session->set('bugList', $this->createLink($this->app->rawModule, 'view', "releaseID=$releaseID&type=$type&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa');
|
||||
@@ -744,7 +744,7 @@ class release extends control
|
||||
public function batchUnlinkBug(int $releaseID, string $type = 'bug')
|
||||
{
|
||||
$this->release->batchUnlinkBug($releaseID, $type);
|
||||
return $this->sendSuccess(array('load' => $this->createLink('release', 'view', "releaseID=$releaseID&type=$type")));
|
||||
return $this->sendSuccess(array('load' => $this->createLink($this->app->rawModule, 'view', "releaseID={$releaseID}&type={$type}")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -585,7 +585,7 @@ class releaseModel extends model
|
||||
*/
|
||||
public function batchUnlinkBug($releaseID, $type = 'bug')
|
||||
{
|
||||
$bugList = $this->post->unlinkBugs;
|
||||
$bugList = $this->post->bugIdList;
|
||||
if(empty($bugList)) return true;
|
||||
|
||||
$release = $this->getByID($releaseID);
|
||||
@@ -596,7 +596,7 @@ class releaseModel extends model
|
||||
$this->dao->update(TABLE_RELEASE)->set($field)->eq($release->$field)->where('id')->eq((int)$releaseID)->exec();
|
||||
|
||||
$this->loadModel('action');
|
||||
foreach($this->post->unlinkBugs as $unlinkBugID) $this->action->create('bug', $unlinkBugID, 'unlinkedfromrelease', '', $releaseID);
|
||||
foreach($this->post->bugIdList as $unlinkBugID) $this->action->create('bug', $unlinkBugID, 'unlinkedfromrelease', '', $releaseID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,8 +38,8 @@ $canBatchUnlinkStory = $canBeChanged && common::hasPriv($buildModule, 'batchUnli
|
||||
$canBatchCloseStory = $canBeChanged && common::hasPriv('story', 'batchClose');
|
||||
|
||||
$storyFootToolbar = array();
|
||||
if($canBatchUnlinkStory) $storyFootToolbar['items'][] = array('class' => 'btn secondary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'story', 'data-url' => createLink($buildModule, 'batchUnlinkStory', "release={$release->id}"));
|
||||
if($canBatchCloseStory) $storyFootToolbar['items'][] = array('class' => 'btn secondary size-sm batch-btn', 'text' => $lang->story->batchClose, 'data-type' => 'story', 'data-url' => createLink('story', 'batchClose', "productID={$release->product}"));
|
||||
if($canBatchUnlinkStory) $storyFootToolbar['items'][] = array('className' => 'btn primary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'story', 'data-url' => createLink($buildModule, 'batchUnlinkStory', "release={$release->id}"));
|
||||
if($canBatchCloseStory) $storyFootToolbar['items'][] = array('className' => 'btn primary size-sm batch-btn', 'text' => $lang->story->batchClose, 'data-type' => 'story', 'data-url' => createLink('story', 'batchClose', "productID={$release->product}"));
|
||||
|
||||
/* Table data and setting for resolved bugs tab. */
|
||||
jsVar('confirmunlinkbug', $lang->release->confirmUnlinkBug);
|
||||
@@ -52,8 +52,8 @@ $canBatchUnlinkBug = $canBeChanged && common::hasPriv($buildModule, 'batchUnlink
|
||||
$canBatchCloseBug = $canBeChanged && common::hasPriv('bug', 'batchClose');
|
||||
|
||||
$bugFootToolbar = array();
|
||||
if($canBatchUnlinkBug) $bugFootToolbar['items'][] = array('class' => 'btn secondary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'bug', 'data-url' => createLink($buildModule, 'batchUnlinkBug', "release={$release->id}"));
|
||||
if($canBatchCloseBug) $bugFootToolbar['items'][] = array('class' => 'btn secondary size-sm batch-btn', 'text' => $lang->bug->batchClose, 'data-type' => 'bug', 'data-url' => createLink('bug', 'batchClose', "productID={$release->product}"));
|
||||
if($canBatchUnlinkBug) $bugFootToolbar['items'][] = array('className' => 'btn primary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'bug', 'data-url' => createLink($buildModule, 'batchUnlinkBug', "release={$release->id}"));
|
||||
if($canBatchCloseBug) $bugFootToolbar['items'][] = array('className' => 'btn primary size-sm batch-btn', 'text' => $lang->bug->batchClose, 'data-type' => 'bug', 'data-url' => createLink('bug', 'batchClose', "productID={$release->product}"));
|
||||
|
||||
/* Table data and setting for left bugs tab. */
|
||||
jsVar('confirmunlinkleftbug', $lang->release->confirmUnlinkBug);
|
||||
@@ -63,7 +63,7 @@ $config->release->dtable->leftBug->fieldList['resolvedBuild']['map'] = $builds;
|
||||
$leftBugTableData = initTableData($leftBugs, $config->release->dtable->leftBug->fieldList, $this->release);
|
||||
|
||||
$leftBugFootToolbar = array();
|
||||
if($canBatchUnlinkBug) $leftBugFootToolbar['items'][] = array('class' => 'btn secondary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'bug', 'data-url' => createLink($buildModule, 'batchUnlinkBug', "release={$release->id}&type=leftBug"));
|
||||
if($canBatchUnlinkBug) $leftBugFootToolbar['items'][] = array('className' => 'btn primary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'data-type' => 'bug', 'data-url' => createLink($buildModule, 'batchUnlinkBug', "release={$release->id}&type=leftBug"));
|
||||
|
||||
/* Process release info data. */
|
||||
$releaseBuild = array();
|
||||
|
||||
Reference in New Issue
Block a user