summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-08-18 21:39:43 -0400
committerFrederic Guillot <fred@kanboard.net>2015-08-18 21:39:43 -0400
commit6b4786624be70c4c024b829407a7496eec361cbb (patch)
tree51999c360f0f0c965b317ba31419118ef6ace8a3 /app
parentb04cbc419b60df02ca59a9bbf87cd840614b09a4 (diff)
Add start and end date for projects
Diffstat (limited to 'app')
-rw-r--r--app/Model/Project.php2
-rw-r--r--app/Schema/Mysql.php8
-rw-r--r--app/Schema/Postgres.php8
-rw-r--r--app/Schema/Sqlite.php8
-rw-r--r--app/Template/project/edit.php6
-rw-r--r--app/Template/project/index.php21
6 files changed, 44 insertions, 9 deletions
diff --git a/app/Model/Project.php b/app/Model/Project.php
index fedc41ac..161a0cae 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -509,6 +509,8 @@ class Project extends Base
new Validators\Required('name', t('The project name is required')),
new Validators\MaxLength('name', t('The maximum length is %d characters', 50), 50),
new Validators\MaxLength('identifier', t('The maximum length is %d characters', 50), 50),
+ new Validators\MaxLength('start_date', t('The maximum length is %d characters', 10), 10),
+ new Validators\MaxLength('end_date', t('The maximum length is %d characters', 10), 10),
new Validators\AlphaNumeric('identifier', t('This value must be alphanumeric')) ,
new Validators\Unique('name', t('This project must be unique'), $this->db->getConnection(), self::TABLE),
new Validators\Unique('identifier', t('The identifier must be unique'), $this->db->getConnection(), self::TABLE),
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 9bd610bb..0a8ede18 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,7 +6,13 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 83;
+const VERSION = 84;
+
+function version_84($pdo)
+{
+ $pdo->exec("ALTER TABLE projects ADD COLUMN start_date CHAR(10) DEFAULT ''");
+ $pdo->exec("ALTER TABLE projects ADD COLUMN end_date CHAR(10) DEFAULT ''");
+}
function version_83($pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 143167e3..a0c71e0c 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,13 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 63;
+const VERSION = 64;
+
+function version_64($pdo)
+{
+ $pdo->exec("ALTER TABLE projects ADD COLUMN start_date CHAR(10) DEFAULT ''");
+ $pdo->exec("ALTER TABLE projects ADD COLUMN end_date CHAR(10) DEFAULT ''");
+}
function version_63($pdo)
{
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 15268d9a..4fb1819f 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,7 +6,13 @@ use Core\Security;
use PDO;
use Model\Link;
-const VERSION = 79;
+const VERSION = 80;
+
+function version_80($pdo)
+{
+ $pdo->exec("ALTER TABLE projects ADD COLUMN start_date TEXT DEFAULT ''");
+ $pdo->exec("ALTER TABLE projects ADD COLUMN end_date TEXT DEFAULT ''");
+}
function version_79($pdo)
{
diff --git a/app/Template/project/edit.php b/app/Template/project/edit.php
index c8f235c7..3c64a399 100644
--- a/app/Template/project/edit.php
+++ b/app/Template/project/edit.php
@@ -13,6 +13,12 @@
<?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?>
<p class="form-help"><?= t('The project identifier is an optional alphanumeric code used to identify your project.') ?></p>
+ <?= $this->form->label(t('Start date'), 'start_date') ?>
+ <?= $this->form->text('start_date', $values, $errors, array('maxlength="10"'), 'form-date') ?>
+
+ <?= $this->form->label(t('End date'), 'end_date') ?>
+ <?= $this->form->text('end_date', $values, $errors, array('maxlength="10"'), 'form-date') ?>
+
<?php if ($this->user->isAdmin() || $this->user->isProjectAdministrationAllowed($project['id'])): ?>
<?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
<?php endif ?>
diff --git a/app/Template/project/index.php b/app/Template/project/index.php
index b2cfc7e7..f24a8c4a 100644
--- a/app/Template/project/index.php
+++ b/app/Template/project/index.php
@@ -14,14 +14,16 @@
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('No project') ?></p>
<?php else: ?>
- <table class="table-stripped">
+ <table class="table-stripped table-small">
<tr>
- <th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th>
+ <th class="column-3"><?= $paginator->order(t('Id'), 'id') ?></th>
<th class="column-5"><?= $paginator->order(t('Status'), 'is_active') ?></th>
- <th class="column-20"><?= $paginator->order(t('Project'), 'name') ?></th>
+ <th class="column-15"><?= $paginator->order(t('Project'), 'name') ?></th>
+ <th class="column-8"><?= $paginator->order(t('Start date'), 'start_date') ?></th>
+ <th class="column-8"><?= $paginator->order(t('End date'), 'end_date') ?></th>
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
- <th class="column-15"><?= t('Managers') ?></th>
- <th class="column-15"><?= t('Members') ?></th>
+ <th class="column-12"><?= t('Managers') ?></th>
+ <th class="column-12"><?= t('Members') ?></th>
<?php endif ?>
<th><?= t('Columns') ?></th>
</tr>
@@ -48,12 +50,19 @@
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
<?php endif ?>
- <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
<?php if (! empty($project['description'])): ?>
<span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>
+
+ <?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
+ </td>
+ <td>
+ <?= $project['start_date'] ?>
+ </td>
+ <td>
+ <?= $project['end_date'] ?>
</td>
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
<td>