summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/TaskBulkController.php2
-rw-r--r--app/Controller/TaskCreationController.php20
2 files changed, 13 insertions, 9 deletions
diff --git a/app/Controller/TaskBulkController.php b/app/Controller/TaskBulkController.php
index 51447f32..4345a68f 100644
--- a/app/Controller/TaskBulkController.php
+++ b/app/Controller/TaskBulkController.php
@@ -32,7 +32,7 @@ class TaskBulkController extends BaseController
'project' => $project,
'values' => $values,
'errors' => $errors,
- 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, $project['is_private']),
+ 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, $project['is_private'] == 1),
'colors_list' => $this->colorModel->getList(),
'categories_list' => $this->categoryModel->getList($project['id']),
)));
diff --git a/app/Controller/TaskCreationController.php b/app/Controller/TaskCreationController.php
index cafd7e06..faf2d250 100644
--- a/app/Controller/TaskCreationController.php
+++ b/app/Controller/TaskCreationController.php
@@ -23,8 +23,8 @@ class TaskCreationController extends BaseController
public function show(array $values = array(), array $errors = array())
{
$project = $this->getProject();
- $swimlanes_list = $this->swimlaneModel->getList($project['id'], false, true);
- $values += $this->prepareValues($swimlanes_list);
+ $swimlanesList = $this->swimlaneModel->getList($project['id'], false, true);
+ $values += $this->prepareValues($project['is_private'], $swimlanesList);
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
$values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values));
@@ -34,9 +34,9 @@ class TaskCreationController extends BaseController
'errors' => $errors,
'values' => $values + array('project_id' => $project['id']),
'columns_list' => $this->columnModel->getList($project['id']),
- 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, $project['is_private']),
+ 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, $project['is_private'] == 1),
'categories_list' => $this->categoryModel->getList($project['id']),
- 'swimlanes_list' => $swimlanes_list,
+ 'swimlanes_list' => $swimlanesList,
)));
}
@@ -113,18 +113,22 @@ class TaskCreationController extends BaseController
* Prepare form values
*
* @access protected
- * @param array $swimlanes_list
+ * @param bool $isPrivateProject
+ * @param array $swimlanesList
* @return array
*/
- protected function prepareValues(array $swimlanes_list)
+ protected function prepareValues($isPrivateProject, array $swimlanesList)
{
$values = array(
- 'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanes_list)),
+ 'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanesList)),
'column_id' => $this->request->getIntegerParam('column_id'),
'color_id' => $this->colorModel->getDefaultColor(),
- 'owner_id' => $this->userSession->getId(),
);
+ if ($isPrivateProject) {
+ $values['owner_id'] = $this->userSession->getId();
+ }
+
return $values;
}