Add start and end date for projects
This commit is contained in:
@@ -11,6 +11,7 @@ New features:
|
|||||||
* Add user api access
|
* Add user api access
|
||||||
* Add config parameter to define session duration
|
* Add config parameter to define session duration
|
||||||
* Add config parameter to disable/enable RememberMe authentication
|
* Add config parameter to disable/enable RememberMe authentication
|
||||||
|
* Add start/end date for projects
|
||||||
* Add Portuguese (European) translation
|
* Add Portuguese (European) translation
|
||||||
* Add Norwegian translation
|
* Add Norwegian translation
|
||||||
|
|
||||||
|
|||||||
@@ -509,6 +509,8 @@ class Project extends Base
|
|||||||
new Validators\Required('name', t('The project name is required')),
|
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('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('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\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('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),
|
new Validators\Unique('identifier', t('The identifier must be unique'), $this->db->getConnection(), self::TABLE),
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ use PDO;
|
|||||||
use Core\Security;
|
use Core\Security;
|
||||||
use Model\Link;
|
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)
|
function version_83($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ use PDO;
|
|||||||
use Core\Security;
|
use Core\Security;
|
||||||
use Model\Link;
|
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)
|
function version_63($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,13 @@ use Core\Security;
|
|||||||
use PDO;
|
use PDO;
|
||||||
use Model\Link;
|
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)
|
function version_79($pdo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?>
|
<?= $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>
|
<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'])): ?>
|
<?php if ($this->user->isAdmin() || $this->user->isProjectAdministrationAllowed($project['id'])): ?>
|
||||||
<?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
|
<?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -14,14 +14,16 @@
|
|||||||
<?php if ($paginator->isEmpty()): ?>
|
<?php if ($paginator->isEmpty()): ?>
|
||||||
<p class="alert"><?= t('No project') ?></p>
|
<p class="alert"><?= t('No project') ?></p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<table class="table-stripped">
|
<table class="table-stripped table-small">
|
||||||
<tr>
|
<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-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()): ?>
|
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
|
||||||
<th class="column-15"><?= t('Managers') ?></th>
|
<th class="column-12"><?= t('Managers') ?></th>
|
||||||
<th class="column-15"><?= t('Members') ?></th>
|
<th class="column-12"><?= t('Members') ?></th>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<th><?= t('Columns') ?></th>
|
<th><?= t('Columns') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -48,12 +50,19 @@
|
|||||||
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
|
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->url->link($this->e($project['name']), 'project', 'show', array('project_id' => $project['id'])) ?>
|
|
||||||
<?php if (! empty($project['description'])): ?>
|
<?php if (! empty($project['description'])): ?>
|
||||||
<span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'>
|
<span class="tooltip" title='<?= $this->e($this->text->markdown($project['description'])) ?>'>
|
||||||
<i class="fa fa-info-circle"></i>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?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>
|
</td>
|
||||||
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
|
<?php if ($this->user->isAdmin() || $this->user->isProjectAdmin()): ?>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -62,6 +62,10 @@ th a:hover {
|
|||||||
background: #fefefe;
|
background: #fefefe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-3 {
|
||||||
|
width: 3%;
|
||||||
|
}
|
||||||
|
|
||||||
.column-5 {
|
.column-5 {
|
||||||
width: 5%;
|
width: 5%;
|
||||||
}
|
}
|
||||||
@@ -74,10 +78,18 @@ th a:hover {
|
|||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-12 {
|
||||||
|
width: 12%;
|
||||||
|
}
|
||||||
|
|
||||||
.column-15 {
|
.column-15 {
|
||||||
width: 15%;
|
width: 15%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-18 {
|
||||||
|
width: 18%;
|
||||||
|
}
|
||||||
|
|
||||||
.column-20 {
|
.column-20 {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,18 @@ class ProjectTest extends Base
|
|||||||
$this->assertEmpty($project['token']);
|
$this->assertEmpty($project['token']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCreationWithStartAndDate()
|
||||||
|
{
|
||||||
|
$p = new Project($this->container);
|
||||||
|
|
||||||
|
$this->assertEquals(1, $p->create(array('name' => 'UnitTest', 'start_date' => '2015-01-01', 'end_date' => '2015-12-31')));
|
||||||
|
|
||||||
|
$project = $p->getById(1);
|
||||||
|
$this->assertNotEmpty($project);
|
||||||
|
$this->assertEquals('2015-01-01', $project['start_date']);
|
||||||
|
$this->assertEquals('2015-12-31', $project['end_date']);
|
||||||
|
}
|
||||||
|
|
||||||
public function testCreationWithDefaultCategories()
|
public function testCreationWithDefaultCategories()
|
||||||
{
|
{
|
||||||
$p = new Project($this->container);
|
$p = new Project($this->container);
|
||||||
|
|||||||
Reference in New Issue
Block a user