From 80c03beea77b371cd1919986264412475e1fc6fb Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 16 Jun 2022 11:16:17 +0000 Subject: [PATCH] * Fix bug#23821. --- module/execution/control.php | 32 +++++++++++++++++++++--- module/execution/view/batchedit.html.php | 32 ++++++++++++++++++++---- module/programplan/view/create.html.php | 6 ++++- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 839c553183..16bcba9dba 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1576,6 +1576,9 @@ class execution extends control return print(js::confirm($this->lang->execution->importEditPlanStory, inlink('edit', "executionID=$executionID&action=edit&extra=&newPlans=$newPlans&confirm=yes"), inlink('view', "executionID=$executionID"))); } + /* Set menu. */ + $this->execution->setMenu($executionID); + if(!empty($_POST)) { $oldPlans = $this->dao->select('plan')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->andWhere('plan')->ne(0)->fetchPairs('plan'); @@ -1638,9 +1641,6 @@ class execution extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "executionID=$executionID"))); } - /* Set menu. */ - $this->execution->setMenu($executionID); - $executions = array('' => '') + $this->executions; $managers = $this->execution->getDefaultManagers($executionID); @@ -3902,4 +3902,30 @@ class execution extends control echo true; } + + /** + * AJAX: Gets the start date of the project to which the execution belongs. + * + * @param int $executionID + * @access public + * @return string + */ + public function ajaxGetProjectStartDate($executionID = 0) + { + if($this->config->systemMode == 'new') + { + $execution = $this->dao->select('id,project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); + $project = $this->dao->select('begin,end')->from(TABLE_PROJECT)->where('id')->eq($execution->project)->fetch(); + if(empty($project)) + { + echo ''; + return false; + } + + $date = array(); + $date['begin'] = $project->begin; + $date['end'] = $project->end; + echo json_encode($date); + } + } } diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php index c8e68c6f56..8032b11308 100755 --- a/module/execution/view/batchedit.html.php +++ b/module/execution/view/batchedit.html.php @@ -144,8 +144,6 @@ js::set('emptyEnd', $lang->programplan->emptyEnd); js::set('planFinishSmall', $lang->programplan->error->planFinishSmall); js::set('errorBegin', $lang->execution->errorLetterProject); js::set('errorEnd', $lang->execution->errorGreaterProject); -js::set('projectBeginDate', $project->begin); -js::set('projectEndDate', $project->end); ?> diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index c947131b82..ef0d548054 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -285,7 +285,11 @@ $('#planForm').submit(function() } }); - if(!submitForm) return false; + if(!submitForm) + { + setTimeout(function(){$('#submit').removeAttr('disabled')}, 500); + return false; + } });