Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -1034,6 +1034,7 @@ class bug extends control
|
||||
$this->view->bug = $bug;
|
||||
$this->view->action = $action;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->clear();
|
||||
$mailContent = $this->parse($this->moduleName, 'sendmail');
|
||||
|
||||
/* Send it. */
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
+14
-14
@@ -57,7 +57,7 @@ class story extends control
|
||||
{
|
||||
$actionID = $this->action->create('story', $storyID, 'Frombug', '', $bugID);
|
||||
}
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
if($this->post->newStory)
|
||||
{
|
||||
$response['message'] = $this->lang->story->successSaved . $this->lang->story->newStory;
|
||||
@@ -184,7 +184,7 @@ class story extends control
|
||||
|
||||
foreach($mails as $mail)
|
||||
{
|
||||
$this->sendMail($mail->storyID, $mail->actionID);
|
||||
$this->sendmail($mail->storyID, $mail->actionID);
|
||||
}
|
||||
die(js::locate($this->createLink('product', 'browse', "productID=$productID"), 'parent'));
|
||||
}
|
||||
@@ -273,7 +273,7 @@ class story extends control
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$actionID = $this->action->create('story', $storyID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
|
||||
}
|
||||
@@ -309,7 +309,7 @@ class story extends control
|
||||
{
|
||||
$actionID = $this->action->create('story', $storyID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
}
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
@@ -401,7 +401,7 @@ class story extends control
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
|
||||
}
|
||||
@@ -434,8 +434,7 @@ class story extends control
|
||||
$this->story->activate($storyID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
|
||||
if(isonlybody()) die(js::closeColorbox('parent.parent'));
|
||||
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
|
||||
@@ -537,7 +536,7 @@ class story extends control
|
||||
if($this->post->closedReason != '' and strpos('done,postponed,subdivided', $this->post->closedReason) !== false) $result = 'pass';
|
||||
$actionID = $this->action->create('story', $storyID, 'Reviewed', $this->post->comment, ucfirst($result));
|
||||
$this->action->logHistory($actionID, array());
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
if($this->post->result == 'reject')
|
||||
{
|
||||
$this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason));
|
||||
@@ -590,7 +589,7 @@ class story extends control
|
||||
$actions = $this->story->batchReview($storyIDList, $result, $reason);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
foreach($actions as $storyID => $actionID) $this->sendMail($storyID, $actionID);
|
||||
foreach($actions as $storyID => $actionID) $this->sendmail($storyID, $actionID);
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
}
|
||||
|
||||
@@ -609,7 +608,7 @@ class story extends control
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason));
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
if(isonlybody()) die(js::closeColorbox('parent.parent'));
|
||||
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
|
||||
}
|
||||
@@ -655,8 +654,8 @@ class story extends control
|
||||
foreach($allChanges as $storyID => $changes)
|
||||
{
|
||||
$actionID = $this->action->create('story', $storyID, 'Closed', htmlspecialchars($this->post->comments[$storyID]), ucfirst($this->post->closedReasons[$storyID]));
|
||||
$this->action->logHistory($actionID);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
}
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
@@ -730,7 +729,7 @@ class story extends control
|
||||
{
|
||||
$actionID = $this->action->create('story', $storyID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
}
|
||||
@@ -751,7 +750,7 @@ class story extends control
|
||||
{
|
||||
$actionID = $this->action->create('story', $storyID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendMail($storyID, $actionID);
|
||||
$this->sendmail($storyID, $actionID);
|
||||
}
|
||||
die(js::locate($this->session->storyList, 'parent'));
|
||||
}
|
||||
@@ -889,6 +888,7 @@ class story extends control
|
||||
$this->view->story = $story;
|
||||
$this->view->action = $action;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->clear();
|
||||
$mailContent = $this->parse($this->moduleName, 'sendmail');
|
||||
|
||||
/* Send it. */
|
||||
|
||||
@@ -148,6 +148,7 @@ class storyModel extends model
|
||||
|
||||
if($bugID > 0)
|
||||
{
|
||||
$bug = new stdclass();
|
||||
$bug->toStory = $storyID;
|
||||
$bug->status = 'closed';
|
||||
$bug->resolution = 'tostory';
|
||||
@@ -595,6 +596,7 @@ class storyModel extends model
|
||||
$oldStory = $this->getById($storyID);
|
||||
if($oldStory->status == 'closed') continue;
|
||||
|
||||
$story = new stdclass();
|
||||
$story->lastEditedBy = $this->app->user->account;
|
||||
$story->lastEditedDate = $now;
|
||||
$story->closedBy = $this->app->user->account;
|
||||
|
||||
@@ -773,6 +773,7 @@ class testtask extends control
|
||||
$this->view->testtask = $testtask;
|
||||
$this->view->action = $action;
|
||||
$this->view->users = $users;
|
||||
$this->clear();
|
||||
|
||||
$mailContent = $this->parse($this->moduleName, 'sendmail');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user