diff --git a/module/bug/config.php b/module/bug/config.php index 0818cbe1c4..7b21db695a 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -43,7 +43,7 @@ $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,ass $config->bug->custom = new stdclass(); $config->bug->custom->createFields = $config->bug->list->customCreateFields; $config->bug->custom->batchCreateFields = 'module,project,steps,type,severity,os,browser'; -$config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,status,resolvedBy,resolution'; +$config->bug->custom->batchEditFields = 'type,severity,pri,assignedTo,deadline,status,resolvedBy,resolution'; $config->bug->editor = new stdclass(); $config->bug->editor->create = array('id' => 'steps', 'tools' => 'bugTools'); diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 7584d014ab..95441cef29 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -201,10 +201,6 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild); - - bug->deadline;?> - deadline, "class='form-control form-date'");?> - bug->resolvedBy;?> resolvedBy, "class='form-control chosen'");?> diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 2d1ebd53de..fffc2edd2e 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -166,6 +166,8 @@ class upgradeModel extends model $this->adjustPriv9_0(); case '9_0': $this->fixProjectProductData(); + case '9_0_1': + $this->addBugDeadlineToCustomFields(); } $this->deletePatch(); @@ -1587,4 +1589,31 @@ class upgradeModel extends model if(strpos($fromVersion, 'pro') === false ? $fromVersion < '8.3' : $fromVersion < 'pro5.4') $needProcess['updateFile'] = true; return $needProcess; } + + public function addBugDeadlineToCustomFields() + { + $createFieldsItems = $this->dao->select('id, value')->from(TABLE_CONFIG) + ->where('module')->eq('bug') + ->andWhere('section')->eq('custom') + ->andWhere('`key`')->eq('createFields') + ->fetchAll(); + $batchEditFieldsItems = $this->dao->select('id, value')->from(TABLE_CONFIG) + ->where('module')->eq('bug') + ->andWhere('section')->eq('custom') + ->andWhere('`key`')->eq('batchEditFields') + ->fetchAll(); + + foreach($createFieldsItems as $createFieldsItem) + { + $value = empty($createFieldsItem->value) ? 'deadline' : $createFieldsItem->value . ",deadline"; + $this->dao->update(TABLE_CONFIG)->set('value')->eq($value)->where('id')->eq($createFieldsItem->id)->exec(); + } + foreach($batchEditFieldsItems as $batchEditFieldsItem) + { + $value = empty($batchEditFieldsItem->value) ? 'deadline' : $batchEditFieldsItem->value . ",deadline"; + $this->dao->update(TABLE_CONFIG)->set('value')->eq($value)->where('id')->eq($batchEditFieldsItem->id)->exec(); + } + + return true; + } }