* Finish task #3220.

This commit is contained in:
pengjiangxiu
2017-09-21 09:10:22 +08:00
parent 221a7e1db9
commit a0779473fc
3 changed files with 26 additions and 4 deletions
+21 -1
View File
@@ -111,7 +111,27 @@ class taskModel extends model
$tasks = fixer::input('post')->get();
$batchNum = count(reset($tasks));
$result = $this->loadModel('common')->removeDuplicate('task', $tasks, "project=$projectID");
$storyIDs = array();
$taskNames = array();
foreach($tasks->story as $key => $storyID)
{
if(empty($tasks->name[$key])) continue;
$inNames = in_array($tasks->name[$key], $taskNames);
if(!$inNames || $inNames && !in_array($storyID, $storyIDs))
{
$storyIDs[] = $storyID;
$taskNames[] = $tasks->name[$key];
}
else
{
dao::$errors['message'][] = sprintf($this->lang->duplicate, $this->lang->task->common);
echo js::error(dao::getError());
exit;
}
}
$result = $this->loadModel('common')->removeDuplicate('task', $tasks, "project=$projectID and story " . helper::dbIN($storyIDs));
$tasks = $result['data'];
/* check estimate. */
+4 -2
View File
@@ -858,12 +858,14 @@ class user extends control
die(js::locate(inlink('logout', $referer), 'parent'));
}
$pathPos = strrpos($this->app->getBasePath(), DIRECTORY_SEPARATOR, -2);
/* Remove the real path for security reason. */
$pathPos = strrpos($this->app->getBasePath(), DIRECTORY_SEPARATOR, -2);
$resetFileName = substr($resetFileName, $pathPos+1);
$this->view->title = $this->lang->user->resetPassword;
$this->view->status = 'reset';
$this->view->needCreateFile = $needCreateFile;
$this->view->resetFileName = substr($resetFileName, $pathPos+1);
$this->view->resetFileName = $resetFileName;
$this->display();
}
+1 -1
View File
File diff suppressed because one or more lines are too long