* code for task#1779.
This commit is contained in:
1
db/update5.2.1.sql
Normal file
1
db/update5.2.1.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `zt_project` DROP `goal`;
|
||||
@@ -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';
|
||||
|
||||
@@ -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 = '由谁关闭';
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user