+ add the required fields of release.

This commit is contained in:
wangchunsheng
2010-03-25 03:49:26 +00:00
parent a44c51f509
commit 8f568710c6
4 changed files with 14 additions and 18 deletions

View File

@@ -0,0 +1,3 @@
<?php
$config->release->create->requiredFields = 'name,build,date';
$config->release->edit->requiredFields = 'name,build,date';

View File

@@ -57,7 +57,7 @@ class releaseModel extends model
->specialChars('desc')
->add('product', (int)$productID)
->get();
$this->dao->insert(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck('name,date,build', 'notempty')->exec();
$this->dao->insert(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
@@ -68,7 +68,7 @@ class releaseModel extends model
->stripTags('name')
->specialChars('desc')
->get();
$this->dao->update(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck('name,date,build', 'notempty')->where('id')->eq((int)$releaseID)->exec();
$this->dao->update(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->edit->requiredFields, 'notempty')->where('id')->eq((int)$releaseID)->exec();
}
/* 删除release。*/

View File

@@ -30,7 +30,7 @@
<caption><?php echo $lang->release->create;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->release->name;?></th>
<td><input type='text' name='name' class='text-3' /></td>
<td><?php echo html::input('name', '', "class='text-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->build;?></th>
@@ -38,17 +38,14 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->date;?></th>
<td><input type='text' name='date' class='text-3 date' value='<?php echo helper::today();?>' /></td>
<td><?php echo html::input('date', helper::today(), "class='text-3 date'");?></td>
</tr>
</tr>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->desc;?></th>
<td><textarea name='desc' rows='8' class='area-1'></textarea></td>
<td><?php echo html::textarea('desc', '', "rows='10' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td></tr>
</table>
</form>
</div>

View File

@@ -30,23 +30,19 @@
<caption><?php echo $lang->release->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->release->name;?></th>
<td><input type='text' name='name' class='text-3' value='<?php echo $release->name;?>' /></td>
<td><?php echo html::input('name', $release->name, "class='text-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->build;?></th>
<td>
<?php
echo html::select('build', $builds, $release->build, 'class="select-3"');
?>
</td>
<td><?php echo html::select('build', $builds, $release->build, 'class="select-3"'); ?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->date;?></th>
<td><input type='text' name='date' class='text-3 date' value='<?php echo $release->date;?>' /></td>
<td><?php echo html::input('date', $release->date, "class='text-3 date'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->release->desc;?></th>
<td><textarea name='desc' rows='5' class='area-1'><?php echo $release->desc;?></textarea></td>
<td><?php echo html::textarea('desc', $release->desc, "rows='10' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() . html::hidden('product', $release->product);?></td>