diff --git a/module/kanban/control.php b/module/kanban/control.php index fc85d2718f..e88948a6ca 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1302,7 +1302,8 @@ class kanban extends control $this->loadModel('action')->create('kanbancard', $cardID, 'importedBuild', '', $buildID); } - return print(js::locate($this->createLink('kanban', 'view', "kanbanID=$kanbanID"), 'parent.parent')); + $callback = $this->kanban->getKanbanCallback($kanbanID, $regionID); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => $callback)); } $this->loadModel('build'); diff --git a/module/kanban/js/importbuild.ui.js b/module/kanban/js/importbuild.ui.js new file mode 100644 index 0000000000..094f3568de --- /dev/null +++ b/module/kanban/js/importbuild.ui.js @@ -0,0 +1,15 @@ +$(document).off('click', '.batch-btn').on('click', '.batch-btn', function() +{ + const dtable = zui.DTable.query($(this).target); + const checkedList = dtable.$.getChecks(); + if(!checkedList.length) return; + + const url = $(this).data('url'); + const form = new FormData(); + form.append('targetLane', $('[name=lane]').val()) + checkedList.forEach((id) => form.append('builds[]', id)); + + $.ajaxSubmit({url, data:form}); + return false; +}); + diff --git a/module/kanban/ui/importbuild.html.php b/module/kanban/ui/importbuild.html.php index a4abe2dafc..ac67cddd49 100644 --- a/module/kanban/ui/importbuild.html.php +++ b/module/kanban/ui/importbuild.html.php @@ -1,2 +1,49 @@ + * @package kanban + * @link https://www.zentao.net + */ +namespace zin; +jsVar('kanbanID', $kanbanID); +jsVar('regionID', $regionID); +jsVar('groupID', $groupID); +jsVar('columnID', $columnID); +jsVar('methodName', $this->app->rawMethod); + +featureBar +( + inputGroup + ( + span(set::className('input-group-addon'), $lang->kanban->selectedProduct), + picker(set::name('project'), set::items($projects), set::value($selectedProjectID), set::style(array('width' => '200px')), set('data-on', 'change'), set('data-call', 'changeProject'), set::required(true)), + span(set::className('input-group-addon'), $lang->kanban->selectedLane), + picker(set::name('lane'), set::items($lanePairs), set::style(array('width' => '200px')), set::required(true)), + ) +); + +$config->build->dtable->fieldList['execution']['name'] = 'executionName'; +unset($config->build->dtable->fieldList['branch']); +unset($config->build->dtable->fieldList['path']); +unset($config->build->dtable->fieldList['actions']); + +formBase +( + set::id('linkForm'), + set::actions(''), + set::className('mt-2'), + dtable + ( + set::fixedLeftWidth('0.33'), + set::checkable(true), + set::userMap($users), + set::cols(array_values($config->build->dtable->fieldList)), + set::data(array_values($builds2Imported)), + set::footToolbar(array('items' => array(array('text' => $lang->kanban->importCard, 'btnType' => 'primary', 'className' => 'size-sm batch-btn', 'data-url' => inlink('importBuild', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), + set::footPager(usePager()) + ) +); diff --git a/module/kanban/ui/importexecution.html.php b/module/kanban/ui/importexecution.html.php index daa772a334..c0602a02e3 100644 --- a/module/kanban/ui/importexecution.html.php +++ b/module/kanban/ui/importexecution.html.php @@ -1,6 +1,6 @@ @@ -59,7 +59,7 @@ formBase set::userMap($users), set::cols(array_values($config->execution->dtable->fieldList)), set::data(array_values($executions2Imported)), - set::footToolbar(array('items' => array(array('text' => $lang->kanban->importCard, 'btnType' => 'primary', 'className' => 'size-sm importcardBtn batch-btn', 'data-url' => inlink('importExecution', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), + set::footToolbar(array('items' => array(array('text' => $lang->kanban->importAB, 'btnType' => 'primary', 'className' => 'size-sm batch-btn', 'data-url' => inlink('importExecution', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), set::footPager(usePager()) ) ); diff --git a/module/kanban/ui/importplan.html.php b/module/kanban/ui/importplan.html.php index c1619696ee..7520bc78f6 100644 --- a/module/kanban/ui/importplan.html.php +++ b/module/kanban/ui/importplan.html.php @@ -43,7 +43,7 @@ formBase set::checkable(true), set::cols(array_values($config->productplan->dtable->fieldList)), set::data(array_values($plans2Imported)), - set::footToolbar(array('items' => array(array('text' => $lang->kanban->importCard, 'btnType' => 'primary', 'className' => 'size-sm importcardBtn batch-btn', 'data-url' => inlink('importplan', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), + set::footToolbar(array('items' => array(array('text' => $lang->kanban->importAB, 'btnType' => 'primary', 'className' => 'size-sm batch-btn', 'data-url' => inlink('importplan', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), set::footPager(usePager()) ) ); diff --git a/module/kanban/ui/importrelease.html.php b/module/kanban/ui/importrelease.html.php index ab34958f7e..3d6d389282 100644 --- a/module/kanban/ui/importrelease.html.php +++ b/module/kanban/ui/importrelease.html.php @@ -57,7 +57,7 @@ formBase set::checkable(true), set::cols(array_values($config->release->dtable->fieldList)), set::data(array_values($releases2Imported)), - set::footToolbar(array('items' => array(array('text' => $lang->kanban->importCard, 'btnType' => 'primary', 'className' => 'size-sm importcardBtn batch-btn', 'data-url' => inlink('importrelease', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), + set::footToolbar(array('items' => array(array('text' => $lang->kanban->importAB, 'btnType' => 'primary', 'className' => 'size-sm batch-btn', 'data-url' => inlink('importrelease', "kanbanID=$kanbanID®ionID=$regionID&groupID=$groupID&columnID=$columnID"))))), set::footPager(usePager()) ) );