+ add the required fields of story.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
$config->story->create->requiredFields = 'estimate,title';
|
||||
$config->story->edit->requiredFields = 'estimate,title';
|
||||
$config->story->change->requiredFields = 'title';
|
||||
$config->story->close->requiredFields = 'closedReason';
|
||||
$config->story->review->requiredFields = 'assignedTo,reviewedBy,result';
|
||||
@@ -74,7 +74,7 @@ class storyModel extends model
|
||||
->setIF($this->post->needNotReview, 'status', 'active')
|
||||
->remove('files,labels,spec,needNotReview')
|
||||
->get();
|
||||
$this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->batchCheck('title,estimate', 'notempty')->exec();
|
||||
$this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->batchCheck($this->config->story->create->requiredFields, 'notempty')->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$storyID = $this->dao->lastInsertID();
|
||||
@@ -116,7 +116,7 @@ class storyModel extends model
|
||||
$this->dao->update(TABLE_STORY)
|
||||
->data($story)
|
||||
->autoCheck()
|
||||
->check('title', 'notempty')
|
||||
->batchCheck($this->config->story->change->requiredFields, 'notempty')
|
||||
->where('id')->eq((int)$storyID)->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
@@ -165,7 +165,7 @@ class storyModel extends model
|
||||
$this->dao->update(TABLE_STORY)
|
||||
->data($story)
|
||||
->autoCheck()
|
||||
->batchCheck('title,estimate', 'notempty')
|
||||
->batchCheck($this->config->story->edit->requiredFields, 'notempty')
|
||||
->checkIF($story->closedBy, 'closedReason', 'notempty')
|
||||
->checkIF($story->closedReason == 'done', 'stage', 'notempty')
|
||||
->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty')
|
||||
@@ -209,7 +209,7 @@ class storyModel extends model
|
||||
->get();
|
||||
$this->dao->update(TABLE_STORY)->data($story)
|
||||
->autoCheck()
|
||||
->batchCheck('assignedTo, reviewedBy', 'notempty')
|
||||
->batchCheck($this->config->story->review->requiredFields, 'notempty')
|
||||
->checkIF($this->post->result == 'reject', 'closedReason', 'notempty')
|
||||
->checkIF($this->post->result == 'reject' and $this->post->closedReason == 'duplicate', 'duplicateStory', 'notempty')
|
||||
->checkIF($this->post->result == 'reject' and $this->post->closedReason == 'subdivided', 'childStories', 'notempty')
|
||||
@@ -246,7 +246,7 @@ class storyModel extends model
|
||||
->get();
|
||||
$this->dao->update(TABLE_STORY)->data($story)
|
||||
->autoCheck()
|
||||
->check('closedReason', 'notempty')
|
||||
->batchCheck($this->config->story->close->requiredFields, 'notempty')
|
||||
->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty')
|
||||
->checkIF($story->closedReason == 'subdivided', 'childStories', 'notempty')
|
||||
->where('id')->eq($storyID)->exec();
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->story->estimate;?></th>
|
||||
<td><input type='text' name='estimate' id='estimate' class='text-3' /></td>
|
||||
<td><?php echo html::input('estimate', '', "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->story->reviewedBy;?></th>
|
||||
@@ -53,11 +53,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->story->title;?></th>
|
||||
<td><input type='text' name='title' class='text-1' /></td>
|
||||
<td><?php echo html::input('title', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->story->spec;?></th>
|
||||
<td><textarea name='spec' rows='8' class='text-1'></textarea><br /><?php echo $lang->story->specTemplate;?></td>
|
||||
<td><?php echo html::textarea('spec', '', "rows='8' class='text-1'");?><br /><?php echo $lang->story->specTemplate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><nobr><?php echo $lang->story->mailto;?></nobr></th>
|
||||
|
||||
Reference in New Issue
Block a user