+ add the required fields of build module.

This commit is contained in:
wangchunsheng
2010-03-25 06:54:47 +00:00
parent 0714e2476d
commit 663486d51e
4 changed files with 21 additions and 23 deletions
+3
View File
@@ -0,0 +1,3 @@
<?php
$config->build->create->requiredFields = 'product,name,builder,date';
$config->build->edit->requiredFields = 'product,name,builder,date';
+2 -2
View File
@@ -85,7 +85,7 @@ class buildModel extends model
->specialChars('desc')
->add('project', (int)$projectID)
->get();
$this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck('name,date,builder', 'notempty')->exec();
$this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
@@ -96,7 +96,7 @@ class buildModel extends model
->stripTags('name')
->specialChars('desc')
->get();
$this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck('name,date,builder', 'notempty')->where('id')->eq((int)$buildID)->exec();
$this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->edit->requiredFields, 'notempty')->where('id')->eq((int)$buildID)->exec();
}
/* 删除build。*/
+7 -10
View File
@@ -30,11 +30,11 @@
<caption><?php echo $lang->build->create;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->build->product;?></th>
<td><?php echo html::select('product', $products);?></td>
<td><?php echo html::select('product', $products, '', "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->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->build->builder;?></th>
@@ -42,24 +42,21 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->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>
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
<td><input type='text' name='scmPath' class='text-1' /></td>
<td><?php echo html::input('scmPath', '', "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->filePath;?></th>
<td><input type='text' name='filePath' class='text-1' /></td>
<td><?php echo html::input('filePath', '', "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->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'><?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>
+9 -11
View File
@@ -1,6 +1,6 @@
<?php
/**
* The create view of build module of ZenTaoMS.
* The edit view of build 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
@@ -30,35 +30,33 @@
<caption><?php echo $lang->build->edit;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->build->product;?></th>
<td><?php echo html::select('product', $products, $build->product);?></td>
<td><?php echo html::select('product', $products, $build->product, "class='select-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->name;?></th>
<td><input type='text' name='name' class='text-3' value='<?php echo $build->name;?>' /></td>
<td><?php echo html::input('name', $build->name, "class='text-3'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->builder;?></th>
<td><?php echo html::select('builder', $users, $build->builder, 'class="select-3"');?></td>
<td><?php echo html::select('builder', $users, $app->user->account, 'class="select-3"');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->date;?></th>
<td><input type='text' name='date' class='text-3 date' value='<?php echo $build->date;?>' /></td>
<td><?php echo html::input('date', $build->date, "class='text-3 date'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->scmPath;?></th>
<td><input type='text' name='scmPath' class='text-1' value='<?php echo $build->scmPath;?>' /></td>
<td><?php echo html::input('scmPath', $build->scmPath, "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->filePath;?></th>
<td><input type='text' name='filePath' class='text-1' value='<?php echo $build->filePath;?>' /></td>
<td><?php echo html::input('filePath', $build->filePath, "class='text-1'");?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->build->desc;?></th>
<td><textarea name='desc' rows='5' class='area-1'><?php echo $build->desc;?></textarea></td>
<td><?php echo html::textarea('desc', $build->desc, "rows='5' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() .html::hidden('project', $build->project);?></td>
</tr>
<tr><td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() .html::hidden('project', $build->project);?></td></tr>
</table>
</form>
</div>