* code for task#1779.

This commit is contained in:
xia0ta0
2014-02-27 16:13:30 +08:00
parent 166e9a255e
commit 2fa7e4a257
6 changed files with 23 additions and 10 deletions

1
db/update5.2.1.sql Normal file
View File

@@ -0,0 +1 @@
ALTER TABLE `zt_project` DROP `goal`;

View File

@@ -27,7 +27,6 @@ $lang->project->status = 'Status';
$lang->project->statge = 'Stage';
$lang->project->pri = 'Priority';
$lang->project->desc = 'Desc';
$lang->project->goal = 'Goal';
$lang->project->openedBy = 'Opened by';
$lang->project->openedDate = 'Opened date';
$lang->project->closedBy = 'Closed by';

View File

@@ -27,7 +27,6 @@ $lang->project->status = '项目状态';
$lang->project->statge = '所处阶段';
$lang->project->pri = '优先级';
$lang->project->desc = '项目描述';
$lang->project->goal = '项目目标';
$lang->project->openedBy = '由谁创建';
$lang->project->openedDate = '创建日期';
$lang->project->closedBy = '由谁关闭';

View File

@@ -79,10 +79,6 @@ $(document).ready(function()
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
<td class='a-left chosenBox' id='productsBox'><?php echo html::select("products[]", $allProducts, $products, "class='select-1' data-placeholder='{$lang->project->linkProduct}' multiple");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->project->goal;?></th>
<td><?php echo html::textarea('goal', '', "rows='6' class='area-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->project->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows='6' class='area-1'");?></td>

View File

@@ -69,10 +69,6 @@
<th class='rowhead'><?php echo $lang->project->manageProducts;?></th>
<td class='a-left chosenBox' id='productsBox'><?php echo html::select("products[]", $allProducts, $linkedProducts, "class='select-1' data-placeholder='{$lang->project->linkProduct}' multiple");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->project->goal;?></th>
<td><?php echo html::textarea('goal', $project->goal, "rows='6' class='area-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->project->desc;?></th>
<td><?php echo html::textarea('desc', $project->desc, "rows='6' class='area-1'");?></td>

View File

@@ -98,6 +98,9 @@ class upgradeModel extends model
case '5_0':
case '5_1':
case '5_2':
case '5_2_1':
$this->mergeProjectGoalAndDesc();
$this->execSQL($this->getUpgradeFile('5.2.1'));
default: if(!$this->isError()) $this->setting->updateVersion($this->config->version);
}
@@ -754,6 +757,25 @@ class upgradeModel extends model
return true;
}
/**
* Merge the goal and desc of project.
*
* @access public
* @return void
*/
public function mergeProjectGoalAndDesc()
{
$projects = $this->dao->select('id, goal, `desc`')->from(TABLE_PROJECT)->fetchAll('id');
foreach($projects as $id => $project)
{
$this->dao->update(TABLE_PROJECT)
->set('`desc`')->eq($project->goal . '<br />' . $project->desc)
->where('id')->eq($id)
->exec();
}
return true;
}
/**
* Judge any error occers.
*