summaryrefslogtreecommitdiff
path: root/app/Api
diff options
context:
space:
mode:
authorTobias Balle-Petersen <tobiasbp@gmail.com>2019-05-24 10:54:16 +0200
committerfguillot <fred@kanboard.net>2019-05-27 11:33:51 +0200
commita5d43b2b0b6ab470de9a14197bf66022db070e81 (patch)
tree6df2f0c945b8ef5ab156d1d313c09f7ab23ed8d5 /app/Api
parent4fe5025f5e0e2ee82edae54cd14d6e12a9eb1d09 (diff)
Feature: Set "start date" and "end date" on projects from API
Added parameters "start_date" and "end_date" to functions createProject and updateProject. These parameters could not previously be set from the API. Documentation should be updated to reflect the change (If approved).
Diffstat (limited to 'app/Api')
-rw-r--r--app/Api/Procedure/ProjectProcedure.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Api/Procedure/ProjectProcedure.php b/app/Api/Procedure/ProjectProcedure.php
index c9ac0ae6..b6b9bcbf 100644
--- a/app/Api/Procedure/ProjectProcedure.php
+++ b/app/Api/Procedure/ProjectProcedure.php
@@ -91,19 +91,21 @@ class ProjectProcedure extends BaseProcedure
return $this->helper->projectActivity->getProjectEvents($project_id);
}
- public function createProject($name, $description = null, $owner_id = 0, $identifier = null)
+ public function createProject($name, $description = null, $owner_id = 0, $identifier = null, $start_date = null, $end_date = null)
{
$values = $this->filterValues(array(
'name' => $name,
'description' => $description,
'identifier' => $identifier,
+ 'start_date' => $start_date,
+ 'end_date' => $end_date,
));
list($valid, ) = $this->projectValidator->validateCreation($values);
return $valid ? $this->projectModel->create($values, $owner_id, $this->userSession->isLogged()) : false;
}
- public function updateProject($project_id, $name = null, $description = null, $owner_id = null, $identifier = null)
+ public function updateProject($project_id, $name = null, $description = null, $owner_id = null, $identifier = null, $start_date = null, $end_date = null)
{
ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'updateProject', $project_id);
@@ -113,6 +115,8 @@ class ProjectProcedure extends BaseProcedure
'description' => $description,
'owner_id' => $owner_id,
'identifier' => $identifier,
+ 'start_date' => $start_date,
+ 'end_date' => $end_date
));
list($valid, ) = $this->projectValidator->validateModification($values);