* Refactor activate plan.
This commit is contained in:
@@ -113,6 +113,7 @@ $config->productplan->dtable->fieldList['actions']['actionsMap']['close']['data-
|
||||
|
||||
$config->productplan->dtable->fieldList['actions']['actionsMap']['activate']['icon'] = 'active';
|
||||
$config->productplan->dtable->fieldList['actions']['actionsMap']['activate']['hint'] = $this->lang->productplan->activateAB;
|
||||
$config->productplan->dtable->fieldList['actions']['actionsMap']['activate']['url'] = 'javascript:activateProductPlan("{planID}")';
|
||||
|
||||
$config->productplan->dtable->fieldList['actions']['actionsMap']['plus']['icon'] = 'plus';
|
||||
|
||||
|
||||
@@ -498,18 +498,8 @@ class productplan extends control
|
||||
public function start(int $planID)
|
||||
{
|
||||
$this->productplan->updateStatus($planID, 'doing', 'started');
|
||||
if(dao::isError())
|
||||
{
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = '';
|
||||
$response['load'] = array('back' => true);
|
||||
}
|
||||
return $this->send($response);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'load' => true, 'closeModal' => true));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -568,19 +558,12 @@ class productplan extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($planID, $confirm = 'no')
|
||||
public function activate(int $planID)
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
return print(js::confirm($this->lang->productplan->confirmActivate, $this->createLink('productplan', 'activate', "planID=$planID&confirm=yes"), 'parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->productplan->updateStatus($planID, 'doing', 'activated');
|
||||
$this->productplan->updateStatus($planID, 'doing', 'activated');
|
||||
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
return print(js::reload('parent'));
|
||||
}
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'load' => true, 'closeModal' => true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,6 +71,14 @@ window.finishProductPlan = function(planID)
|
||||
});
|
||||
}
|
||||
|
||||
window.activateProductPlan = function(planID)
|
||||
{
|
||||
zui.Modal.confirm({message: confirmActivate, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) =>
|
||||
{
|
||||
if(res) $.ajaxSubmit({url: $.createLink('productplan', 'activate', 'planID=' + planID)});
|
||||
});
|
||||
}
|
||||
|
||||
window.deleteProductPlan = function(planID)
|
||||
{
|
||||
zui.Modal.confirm({message: confirmDelete, icon:'icon-info-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) =>
|
||||
|
||||
@@ -298,6 +298,7 @@ jsVar('totalChild', $totalChild);
|
||||
jsVar('totalIndependent', $totalIndependent);
|
||||
jsVar('confirmStart', $this->lang->productplan->confirmStart);
|
||||
jsVar('confirmFinish', $this->lang->productplan->confirmFinish);
|
||||
jsVar('confirmActivate', $this->lang->productplan->confirmActivate);
|
||||
jsVar('confirmDelete', $this->lang->productplan->confirmDelete);
|
||||
|
||||
render();
|
||||
|
||||
Reference in New Issue
Block a user