diff --git a/module/custom/view/code.html.php b/module/custom/view/code.html.php index d3ea25a840..64fa25546e 100644 --- a/module/custom/view/code.html.php +++ b/module/custom/view/code.html.php @@ -39,10 +39,4 @@ - diff --git a/module/execution/model.php b/module/execution/model.php index c1cd90d2fc..6731dc0ddd 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -660,13 +660,12 @@ class executionModel extends model foreach($data->executionIDList as $executionID) { $executionName = $data->names[$executionID]; - $executionCode = $data->codes[$executionID]; + if(isset($data->codes)) $executionCode = $data->codes[$executionID]; $executionID = (int)$executionID; $executions[$executionID] = new stdClass(); $executions[$executionID]->id = $executionID; $executions[$executionID]->name = $executionName; - $executions[$executionID]->code = $executionCode; $executions[$executionID]->PM = $data->PMs[$executionID]; $executions[$executionID]->PO = $data->POs[$executionID]; $executions[$executionID]->QD = $data->QDs[$executionID]; @@ -680,13 +679,15 @@ class executionModel extends model $executions[$executionID]->days = $data->dayses[$executionID]; $executions[$executionID]->lastEditedBy = $this->app->user->account; $executions[$executionID]->lastEditedDate = helper::now(); + + if(isset($data->codes)) $executions[$executionID]->code = $executionCode; if(isset($data->projects)) $executions[$executionID]->project = zget($data->projects, $executionID, 0); if(isset($data->attributes)) $executions[$executionID]->attribute = zget($data->attributes, $executionID, ''); if($executions[$executionID]->status == 'closed') $executions[$executionID]->closedDate = helper::now(); if($executions[$executionID]->status == 'suspended') $executions[$executionID]->suspendedDate = helper::today(); /* Check unique code for edited executions. */ - if($projectModel == 'scrum' and empty($executionCode) and (!isset($this->config->setCode) or $this->config->setCode == 1)) + if($projectModel == 'scrum' and isset($executionCode) and empty($executionCode)) { dao::$errors['code'][] = 'execution#' . $executionID . sprintf($this->lang->error->notempty, $this->lang->project->code); return false; diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php index aa395cbe56..e9a76ecae3 100755 --- a/module/execution/view/batchedit.html.php +++ b/module/execution/view/batchedit.html.php @@ -34,14 +34,13 @@ if(strpos(",{$config->execution->customBatchEditFields},", ",{$field},") !== false) $visibleFields[$field] = ''; } } - $minWidth = (count($visibleFields) > 5) ? 'w-150px' : ''; - $name = $from == 'execution' ? 'execName' : 'name'; - $code = $from == 'execution' ? 'execCode' : 'code'; - $PM = $from == 'execution' ? 'execPM' : 'PM'; - $type = $from == 'execution' ? 'execType' : 'type'; - $desc = $from == 'execution' ? 'execDesc' : 'desc'; - $status = $from == 'execution' ? 'execStatus' : 'status'; - $hiddenCode = (isset($config->setCode) and $config->setCode == 0) ? 'hidden' : ''; + $minWidth = (count($visibleFields) > 5) ? 'w-150px' : ''; + $name = $from == 'execution' ? 'execName' : 'name'; + $code = $from == 'execution' ? 'execCode' : 'code'; + $PM = $from == 'execution' ? 'execPM' : 'PM'; + $type = $from == 'execution' ? 'execType' : 'type'; + $desc = $from == 'execution' ? 'execDesc' : 'desc'; + $status = $from == 'execution' ? 'execStatus' : 'status'; ?>