+ add the required fields of productplan.

This commit is contained in:
wangchunsheng
2010-03-25 03:41:38 +00:00
parent 2839e05c8c
commit e05bf9d12f
6 changed files with 12 additions and 40 deletions
+3
View File
@@ -0,0 +1,3 @@
<?php
$config->productplan->create->requiredFields = 'title,begin,end';
$config->productplan->edit->requiredFields = 'title,begin,end';
+2 -6
View File
@@ -48,11 +48,9 @@ class productplanModel extends model
{
$plan = fixer::input('post')
->stripTags('title')
->setDefault('begin', '0000-00-00')
->setDefault('end', '0000-00-00')
->specialChars('desc')
->get();
$this->dao->insert(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck('title,product', 'notempty')->exec();
$this->dao->insert(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
@@ -61,11 +59,9 @@ class productplanModel extends model
{
$plan = fixer::input('post')
->stripTags('title')
->setDefault('begin', '0000-00-00')
->setDefault('end', '0000-00-00')
->specialChars('desc')
->get();
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck('title,product', 'notempty')->where('id')->eq((int)$planID)->exec();
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')->where('id')->eq((int)$planID)->exec();
}
/* 删除计划。*/
+4 -4
View File
@@ -34,19 +34,19 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->title;?></th>
<td><input type='text' name='title' class='text-3' /></td>
<td><?php echo html::input('title', '', "class='text-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->begin;?></th>
<td><input type='text' name='begin' class='text-3 date' /></td>
<td><?php echo html::input('begin', '', "class='text-3 date'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->end;?></th>
<td><input type='text' name='end' class='text-3 date' /></td>
<td><?php echo html::input('end', '', "class='text-3 date'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><textarea name='desc' rows='5' class='area-1'></textarea></td>
<td><?php echo html::textarea('desc', '', "rows='5' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
+1 -1
View File
@@ -46,7 +46,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><textarea name='desc' rows='5' class='area-1'><?php echo $plan->desc;?></textarea></td>
<td><?php echo html::textarea('desc', $plan->desc, "rows='5' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
-29
View File
@@ -1,29 +0,0 @@
<?php
/**
* The index view file of release module of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright 2009-2010 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package release
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/view/header.html.php';?>
<div id='doc3'>
<a href='browse.html'>browse</a>
</div>
<?php include '../../common/view/footer.html.php';?>
@@ -51,9 +51,11 @@
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='5'><?php echo html::submitButton();?></td>
</tr>
</tfoot>
</table>
</form>