Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -8,11 +8,22 @@
|
||||
*/
|
||||
class tasksEntry extends entry
|
||||
{
|
||||
public function get($executionID)
|
||||
public function get($executionID = 0)
|
||||
{
|
||||
$control = $this->loadController('execution', 'task');
|
||||
$control->task($executionID, $this->param('status', 'all'), 0, $this->param('order', ''), $this->param('total', 0), $this->param('limit', 100), $this->param('page', 1));
|
||||
$data = $this->getData();
|
||||
if(!$executionID)
|
||||
{
|
||||
/* Get my tasks defaultly. */
|
||||
$control = $this->loadController('my', 'task');
|
||||
$control->task($this->param('type', 'assignedTo'), $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 20), $this->param('page', 1));
|
||||
$data = $this->getData();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get tasks by execution. */
|
||||
$control = $this->loadController('execution', 'task');
|
||||
$control->task($executionID, $this->param('status', 'all'), 0, $this->param('order', ''), $this->param('total', 0), $this->param('limit', 100), $this->param('page', 1));
|
||||
$data = $this->getData();
|
||||
}
|
||||
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ $routes['/executions'] = 'executions';
|
||||
$routes['/executions/:id'] = 'execution';
|
||||
|
||||
$routes['/executions/:execution/tasks'] = 'tasks';
|
||||
$routes['/tasks'] = 'tasks';
|
||||
$routes['/tasks/:id'] = 'task';
|
||||
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
|
||||
$routes['/tasks/:id/start'] = 'taskStart';
|
||||
|
||||
@@ -202,9 +202,11 @@ class search extends control
|
||||
$type = (empty($type) or $type[0] == 'all') ? 'all' : $type;
|
||||
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
|
||||
$begin = time();
|
||||
$result = $this->search->getList($words, $pager, $type);
|
||||
$begin = time();
|
||||
$results = $this->search->getList($words, $type);
|
||||
$recTotal = count($results);
|
||||
$pager = new pager($recTotal, $this->config->search->recPerPage, $pageID);
|
||||
$results = array_chunk($results, $pager->recPerPage);
|
||||
|
||||
/* Set session. */
|
||||
$uri = inlink('index', "recTotal=$pager->recTotal&pageID=$pager->pageID");
|
||||
@@ -237,7 +239,7 @@ class search extends control
|
||||
|
||||
if(strpos($this->server->http_referer, 'search') === false) $this->session->set('referer', $this->server->http_referer);
|
||||
|
||||
$this->view->results = $result;
|
||||
$this->view->results = empty($results) ? $results : $results[$pageID - 1];
|
||||
$this->view->consumed = time() - $begin;
|
||||
$this->view->title = $this->lang->search->index;
|
||||
$this->view->type = $type;
|
||||
|
||||
@@ -499,12 +499,11 @@ class searchModel extends model
|
||||
* get search results of keywords.
|
||||
*
|
||||
* @param string $keywords
|
||||
* @param object $pager
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($keywords, $pager, $type)
|
||||
public function getList($keywords, $type)
|
||||
{
|
||||
$spliter = $this->app->loadClass('spliter');
|
||||
$words = explode(' ', self::unify($keywords, ' '));
|
||||
@@ -557,7 +556,6 @@ class searchModel extends model
|
||||
->andWhere('objectType')->in($allowedObject)
|
||||
->andWhere('addedDate')->le(helper::now())
|
||||
->orderBy('score_desc, editedDate_desc')
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
foreach($results as $record)
|
||||
@@ -643,7 +641,7 @@ class searchModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
return $this->checkPriv($results, $pager);
|
||||
return $this->checkPriv($results);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -775,11 +773,10 @@ class searchModel extends model
|
||||
* Check product and project priv.
|
||||
*
|
||||
* @param array $results
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function checkPriv($results, $pager = null)
|
||||
public function checkPriv($results)
|
||||
{
|
||||
if($this->app->user->admin) return $results;
|
||||
|
||||
@@ -931,7 +928,6 @@ class searchModel extends model
|
||||
}
|
||||
}
|
||||
}
|
||||
if($total != count($results)) $pager->recTotal = $pager->recTotal - ($total - count($results));
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
@@ -221,6 +221,7 @@ $lang->task->error->deadlineSmall = '"Deadline" must be greater than "StartD
|
||||
$lang->task->error->alreadyStarted = 'You cannot start this task, because it is started.';
|
||||
$lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
|
||||
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
|
||||
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
|
||||
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
|
||||
|
||||
/* Report. */
|
||||
|
||||
@@ -224,6 +224,7 @@ $lang->task->error->deadlineSmall = '"Deadline" must be greater than "StartD
|
||||
$lang->task->error->alreadyStarted = 'You cannot start this task, because it is started.';
|
||||
$lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
|
||||
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
|
||||
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
|
||||
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
|
||||
|
||||
/* Report. */
|
||||
|
||||
@@ -221,6 +221,7 @@ $lang->task->error->deadlineSmall = '"Date Limite" doit être supérieur à
|
||||
$lang->task->error->alreadyStarted = 'You cannot start this task, because it is started.';
|
||||
$lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
|
||||
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
|
||||
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
|
||||
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
|
||||
|
||||
/* Report. */
|
||||
|
||||
@@ -221,6 +221,7 @@ $lang->task->error->deadlineSmall = '"Hạn chót" phải lớn hơn "Ngày
|
||||
$lang->task->error->alreadyStarted = 'You cannot start this task, because it is started.';
|
||||
$lang->task->error->realStartedEmpty = '"Real Started" should not be empty.';
|
||||
$lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
|
||||
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
|
||||
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
|
||||
|
||||
/* Report. */
|
||||
|
||||
@@ -224,6 +224,7 @@ $lang->task->error->deadlineSmall = '"截止日期"必须大于"预计开始
|
||||
$lang->task->error->alreadyStarted = '此任务已被启动,不能重复启动!';
|
||||
$lang->task->error->realStartedEmpty = '实际开始不能为空';
|
||||
$lang->task->error->finishedDateEmpty = '实际完成不能为空';
|
||||
$lang->task->error->finishedDateSmall = '实际完成不能小于实际开始';
|
||||
$lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。';
|
||||
|
||||
/* Report. */
|
||||
|
||||
@@ -1650,6 +1650,12 @@ class taskModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->post->realStarted > $this->post->finishedDate)
|
||||
{
|
||||
dao::$errors[] = $this->lang->task->error->finishedDateSmall;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Record consumed and left. */
|
||||
if(empty($oldTask->team))
|
||||
{
|
||||
|
||||
@@ -32,3 +32,5 @@ div.divider {vertical-align: middle;}
|
||||
#lineList .checkbox-primary {display: inline-block;}
|
||||
.main-row .side-col .check-allLine > label {font-weight: 700}
|
||||
.sprintGroup {margin-left: 6px;}
|
||||
.programParams td > label:first-child {margin-right: 10px;}
|
||||
.programParams td > label:last-child {margin-left: 0px;}
|
||||
|
||||
Reference in New Issue
Block a user