* Fix import story to story lib error. bug #48877.
This commit is contained in:
@@ -124,3 +124,14 @@ window.setStatistics = function(element, checkedIdList, pageSummary)
|
||||
|
||||
return {html: checkedSummary.replace('%total%', total).replace('%estimate%', estimate).replace('%rate%', rate).replace('%SRTotal%', SRTotal)};
|
||||
};
|
||||
|
||||
window.importToLib = function()
|
||||
{
|
||||
const dtable = zui.DTable.query($('#stories'));
|
||||
const checkedList = dtable.$.getChecks();
|
||||
if(!checkedList.length) return;
|
||||
|
||||
let storyIdList = '';
|
||||
checkedList.forEach((id) => storyIdList += id + ',');
|
||||
$('#storyIdList').val(storyIdList);
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ $fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project,
|
||||
/* AssignedTo button. */
|
||||
array('caret' => 'up', 'text' => $lang->story->assignedTo, 'className' => ($canBatchAssignTo ? 'secondary batchAssignToBtn' : 'hidden'), 'items' => $assignItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)),
|
||||
/* Batch import to lib button .*/
|
||||
!$canBatchImportToLib ? null : array('text' => $lang->story->importToLib, 'className' => 'btn secondary batchImportToLibBtn', 'id' => 'importToLib', 'data-toggle' => 'modal', 'url' => '#batchImportToLib')
|
||||
!$canBatchImportToLib ? null : array('text' => $lang->story->importToLib, 'className' => 'btn secondary batchImportToLibBtn', 'id' => 'importToLib', 'data-toggle' => 'modal', 'url' => '#batchImportToLib', 'data-on' => 'click', 'data-call' => 'importToLib')
|
||||
);
|
||||
|
||||
return array
|
||||
@@ -394,4 +394,39 @@ modal
|
||||
)
|
||||
);
|
||||
|
||||
if(isset($libs))
|
||||
{
|
||||
modal
|
||||
(
|
||||
setID('batchImportToLib'),
|
||||
set::title($lang->story->importToLib),
|
||||
form
|
||||
(
|
||||
set::action($this->createLink('story', 'batchImportToLib')),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->story->lib),
|
||||
picker
|
||||
(
|
||||
set::name('lib'),
|
||||
set::items($libs),
|
||||
set::required(true)
|
||||
),
|
||||
input(set::className('hidden'), set::name('storyIdList'), set::id('storyIdList'))
|
||||
),
|
||||
(!hasPriv('assetlib', 'approveStory') && !hasPriv('assetlib', 'batchApproveStory')) ? formGroup
|
||||
(
|
||||
set::label($lang->story->approver),
|
||||
picker
|
||||
(
|
||||
set::name('assignedTo'),
|
||||
set::items($approvers)
|
||||
)
|
||||
) : null,
|
||||
set::submitBtnText($lang->import),
|
||||
set::actions(array('submit'))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user