* [task#130253,doing,0.5h] add unclosedTaskTip when editing status to closed.
This commit is contained in:
@@ -17,11 +17,29 @@ jsVar('executionAttr', $execution->attribute);
|
||||
jsVar('window.lastProjectID', $execution->project);
|
||||
jsVar('weekend', $config->execution->weekend);
|
||||
|
||||
$confirmTip = !empty($unclosedTasks) ? sprintf($this->lang->execution->confirmCloseExecution, implode($this->lang->comma, $unclosedTasks)) : '';
|
||||
$beforeSubmit = jsRaw("() =>
|
||||
{
|
||||
if($('[name=status]').val() != 'closed') return true;
|
||||
zui.Modal.confirm('{$confirmTip}').then((res) =>
|
||||
{
|
||||
if(res)
|
||||
{
|
||||
const formData = new FormData($('#zin_execution_edit_{$execution->id}_formGridPanel form')[0]);
|
||||
const confirmURL = $('#zin_execution_edit_{$execution->id}_formGridPanel form').attr('action');
|
||||
$.ajaxSubmit({url: confirmURL, data: formData});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}");
|
||||
|
||||
formGridPanel
|
||||
(
|
||||
on::change('[name=begin]', 'computeWorkDays(NaN)'),
|
||||
on::change('[name=end]', 'computeWorkDays(NaN)'),
|
||||
on::change('[name=project]', 'changeProject()'),
|
||||
set::formID('zin_execution_edit_' . $execution->id . '_formGridPanel'),
|
||||
!empty($unclosedTasks) ? set::ajax(array('beforeSubmit' => $beforeSubmit)) : null,
|
||||
set::fullModeOrders('project', !empty($config->setCode) ? 'lifetime,attribute,name,code,status' : 'lifetime,attribute,name,status', 'planDate,days,productsBox,PO,QD,PM,RD,teamMembers,desc,acl'),
|
||||
set::title($lang->execution->edit),
|
||||
set::modeSwitcher(false),
|
||||
|
||||
Reference in New Issue
Block a user