Add per-project and per-swimlane task limits
This change allows projects and swimlanes to be configured with task limits that apply to their whole scope (i.e. all active tasks in a project or swimlane, respectively), as opposed to the usual per-column task limits.
This commit is contained in:
@@ -127,7 +127,7 @@ abstract class BaseController extends Base
|
||||
protected function getProject($project_id = 0)
|
||||
{
|
||||
$project_id = $this->request->getIntegerParam('project_id', $project_id);
|
||||
$project = $this->projectModel->getByIdWithOwner($project_id);
|
||||
$project = $this->projectModel->getByIdWithOwnerAndTaskCount($project_id);
|
||||
|
||||
if (empty($project)) {
|
||||
throw new PageNotFoundException();
|
||||
|
||||
@@ -97,7 +97,8 @@ class ProjectCreationController extends BaseController
|
||||
'name' => $values['name'],
|
||||
'is_private' => $values['is_private'],
|
||||
'identifier' => $values['identifier'],
|
||||
'per_swimlane_task_limits' => $values['per_swimlane_task_limits'],
|
||||
'per_swimlane_task_limits' => array_key_exists('per_swimlane_task_limits', $values) ? $values['per_swimlane_task_limits'] : 0,
|
||||
'task_limit' => $values['task_limit'],
|
||||
);
|
||||
|
||||
return $this->projectModel->create($project, $this->userSession->getId(), true);
|
||||
|
||||
@@ -63,7 +63,7 @@ class SwimlaneController extends BaseController
|
||||
list($valid, $errors) = $this->swimlaneValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
if ($this->swimlaneModel->create($project['id'], $values['name'], $values['description']) !== false) {
|
||||
if ($this->swimlaneModel->create($project['id'], $values['name'], $values['description'], $values['task_limit']) !== false) {
|
||||
$this->flash->success(t('Your swimlane have been created successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])), true);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user