* finish task #1826.

This commit is contained in:
wyd621
2014-03-11 03:36:49 +00:00
parent 2f06f1b11f
commit 4e73e16d1a
3 changed files with 14 additions and 2 deletions
+11
View File
@@ -77,6 +77,11 @@ class bugModel extends model
$now = helper::now();
$data = fixer::input('post')->get();
$actions = array();
$stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0));
$moduleOwners = array();
while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner;
for($i = 0; $i < $this->config->bug->batchCreate; $i++)
{
if(empty($data->titles[$i])) continue;
@@ -94,6 +99,12 @@ class bugModel extends model
$bug->os = $data->oses[$i];
$bug->browser = $data->browsers[$i];
if(!empty($moduleOwners[$bug->module]))
{
$bug->assignedTo = $moduleOwners[$bug->module];
$bug->assignedDate = $now;
}
$this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec();
$bugID = $this->dao->lastInsertID();