Merge branch 'sprint/183_liumengyi_fixbug'

This commit is contained in:
孙广明
2022-01-21 13:57:34 +08:00
4 changed files with 102 additions and 17 deletions
+50 -10
View File
@@ -1709,10 +1709,11 @@ class execution extends control
* Start execution.
*
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function start($executionID)
public function start($executionID, $from = 'execution')
{
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1732,7 +1733,14 @@ class execution extends control
$this->loadModel('common')->syncPPEStatus($executionID);
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
if(isonlybody() and $from == 'kanban')
{
return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')"));
}
else
{
return print(js::reload('parent.parent'));
}
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->start;
@@ -1747,10 +1755,11 @@ class execution extends control
* Delay execution.
*
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function putoff($executionID)
public function putoff($executionID, $from = 'execution')
{
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1767,7 +1776,14 @@ class execution extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
if(isonlybody() and $from == 'kanban')
{
return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')"));
}
else
{
return print(js::reload('parent.parent'));
}
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->putoff;
@@ -1782,10 +1798,11 @@ class execution extends control
* Suspend execution.
*
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function suspend($executionID)
public function suspend($executionID, $from = 'execution')
{
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1803,7 +1820,14 @@ class execution extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
if(isonlybody() and $from == 'kanban')
{
return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('suspended')"));
}
else
{
return print(js::reload('parent.parent'));
}
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->suspend;
@@ -1818,10 +1842,11 @@ class execution extends control
* Activate execution.
*
* @param int $executionID
* @param string $frim
* @access public
* @return void
*/
public function activate($executionID)
public function activate($executionID, $from = 'execution')
{
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1839,7 +1864,14 @@ class execution extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
if(isonlybody() and $from == 'kanban')
{
return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')"));
}
else
{
return print(js::reload('parent.parent'));
}
}
$newBegin = date('Y-m-d');
@@ -1861,10 +1893,11 @@ class execution extends control
* Close execution.
*
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function close($executionID)
public function close($executionID, $from = 'execution')
{
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -1882,7 +1915,14 @@ class execution extends control
$this->action->logHistory($actionID, $changes);
}
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
if(isonlybody() and $from == 'kanban')
{
return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('closed')"));
}
else
{
return print(js::reload('parent.parent'));
}
}
$this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->close;
+45
View File
@@ -1,3 +1,46 @@
/**
* When execution status change.
*
* @param stirng executionStatus
* @access public
* @return void
*/
function changeStatus(executionStatus)
{
if(executionStatus == 'wait')
{
$('.startButton').removeClass('hidden');
$('.putoffButton').removeClass('hidden');
$('.suspendButton').removeClass('hidden');
$('.closeButton').removeClass('hidden');
$('.activateButton').addClass('hidden');
}
else if(executionStatus == 'doing')
{
$('.startButton').addClass('hidden');
$('.putoffButton').removeClass('hidden');
$('.suspendButton').removeClass('hidden');
$('.closeButton').removeClass('hidden');
$('.activateButton').addClass('hidden');
}
else if(executionStatus == 'suspended')
{
$('.startButton').addClass('hidden');
$('.putoffButton').addClass('hidden');
$('.suspendButton').addClass('hidden');
$('.closeButton').removeClass('hidden');
$('.activateButton').removeClass('hidden');
}
else if(executionStatus == 'closed')
{
$('.startButton').addClass('hidden');
$('.putoffButton').addClass('hidden');
$('.suspendButton').addClass('hidden');
$('.closeButton').addClass('hidden');
$('.activateButton').removeClass('hidden');
}
}
/**
* Display the kanban in full screen.
*
@@ -1046,6 +1089,8 @@ function initKanban($kanban)
*/
$(function()
{
changeStatus(execution.status);
if($.cookie('isFullScreen') == 1) $.cookie('isFullScreen', 0);
window.kanbanScaleSize = +$.zui.store.get('executionKanbanScaleSize', 1);
+5 -5
View File
@@ -126,11 +126,11 @@ js::set('hasTaskButton', $hasTaskButton);
if(common::hasPriv('kanban', 'setLaneHeight')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$execution->id&from=execution", '', true), '<i class="icon icon-size-height"></i>' . $lang->kanban->laneHeight, '', "class='iframe btn btn-link text-left' data-width=$width") . '</li>';
$kanbanActions = '';
if(common::hasPriv('execution', 'edit')) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'edit', "executionID=$execution->id", '', true), '<i class="icon icon-edit"></i>' . $lang->kanban->edit, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('start', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'start', "executionID=$execution->id", '', true), '<i class="icon icon-play"></i>' . $lang->execution->start, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('putoff', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'putoff', "executionID=$execution->id", '', true), '<i class="icon icon-calendar"></i>' . $lang->execution->putoff, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('suspend', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'suspend', "executionID=$execution->id", '', true), '<i class="icon icon-pause"></i>' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('close', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'close', "executionID=$execution->id", '', true), '<i class="icon icon-off"></i>' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(in_array('activate', $executionActions)) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'activate', "executionID=$execution->id", '', true), '<i class="icon icon-magic"></i>' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'start')) $kanbanActions .= '<li class="startButton hidden">' . html::a(helper::createLink('execution', 'start', "executionID=$execution->id&from=kanban", '', true), '<i class="icon icon-play"></i>' . $lang->execution->start, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'putoff')) $kanbanActions .= '<li class="putoffButton hidden">' . html::a(helper::createLink('execution', 'putoff', "executionID=$execution->id&from=kanban", '', true), '<i class="icon icon-calendar"></i>' . $lang->execution->putoff, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'suspend')) $kanbanActions .= '<li class="suspendButton hidden">' . html::a(helper::createLink('execution', 'suspend', "executionID=$execution->id&from=kanban", '', true), '<i class="icon icon-pause"></i>' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'close')) $kanbanActions .= '<li class="closeButton hidden">' . html::a(helper::createLink('execution', 'close', "executionID=$execution->id&from=kanban", '', true), '<i class="icon icon-off"></i>' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'activate')) $kanbanActions .= '<li class="activateButton hidden">' . html::a(helper::createLink('execution', 'activate', "executionID=$execution->id&from=kanban", '', true), '<i class="icon icon-magic"></i>' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
if(common::hasPriv('execution', 'delete')) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'delete', "executionID=$execution->id"), '<i class="icon icon-trash"></i>' . $lang->delete, 'hiddenwin', "class='btn btn-link text-left'") . '</li>';
if($kanbanActions)
{
+2 -2
View File
@@ -969,7 +969,7 @@ class kanban extends control
{
if(dao::isError()) return $this->sendError(dao::getError());
$regionID = $column->region;
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, 'all', 'id_desc', $regionID);
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)"));
@@ -1050,7 +1050,7 @@ class kanban extends control
{
if(dao::isError()) return $this->sendError(dao::getError());
$regionID = $column->region;
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, 'all', 'id_desc', $regionID);
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
$kanbanData = json_encode($kanbanData);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)"));