#1144 Add description field to swimlane.

This commit is contained in:
Fabiano Pereira
2015-09-03 16:27:28 -03:00
parent de91d5820b
commit 339c990577
18 changed files with 158 additions and 84 deletions

View File

@@ -40,14 +40,18 @@ class Swimlane extends \Core\Base
return $this->swimlane->getDefault($project_id); return $this->swimlane->getDefault($project_id);
} }
public function addSwimlane($project_id, $name) public function addSwimlane($project_id, $name, $description = '')
{ {
return $this->swimlane->create($project_id, $name); return $this->swimlane->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description));
} }
public function updateSwimlane($swimlane_id, $name) public function updateSwimlane($swimlane_id, $name, $description = null)
{ {
return $this->swimlane->rename($swimlane_id, $name); $values = array('id' => $swimlane_id, 'name' => $name);
if (!is_null($description)) {
$values['description'] = $description;
}
return $this->swimlane->update($values);
} }
public function removeSwimlane($project_id, $swimlane_id) public function removeSwimlane($project_id, $swimlane_id)

View File

@@ -58,16 +58,14 @@ class Swimlane extends Base
*/ */
public function save() public function save()
{ {
$project = $this->getProject();
$values = $this->request->getValues(); $values = $this->request->getValues();
list($valid, $errors) = $this->swimlane->validateCreation($values); list($valid, $errors) = $this->swimlane->validateCreation($values);
if ($valid) { if ($valid) {
if ($this->swimlane->create($project['id'], $values['name'])) { if ($this->swimlane->create($values)) {
$this->session->flash(t('Your swimlane have been created successfully.')); $this->session->flash(t('Your swimlane have been created successfully.'));
$this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id']))); $this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $values['project_id'])));
} }
else { else {
$this->session->flashError(t('Unable to create your swimlane.')); $this->session->flashError(t('Unable to create your swimlane.'));
@@ -134,8 +132,7 @@ class Swimlane extends Base
list($valid, $errors) = $this->swimlane->validateModification($values); list($valid, $errors) = $this->swimlane->validateModification($values);
if ($valid) { if ($valid) {
if ($this->swimlane->update($values)) {
if ($this->swimlane->rename($values['id'], $values['name'])) {
$this->session->flash(t('Swimlane updated successfully.')); $this->session->flash(t('Swimlane updated successfully.'));
$this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id']))); $this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id'])));
} }
@@ -253,4 +250,15 @@ class Swimlane extends Base
$this->swimlane->moveDown($project['id'], $swimlane_id); $this->swimlane->moveDown($project['id'], $swimlane_id);
$this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id']))); $this->response->redirect($this->helper->url->to('swimlane', 'index', array('project_id' => $project['id'])));
} }
/**
* Display swimlane description
*
* @access public
*/
public function description()
{
$swimlane = $this->swimlane->getById($this->request->getIntegerParam('swimlane_id'));
$this->response->html($this->template->render('board/tooltip_description', array('task' => $swimlane)));
}
} }

View File

@@ -160,7 +160,7 @@ class Swimlane extends Base
public function getSwimlanes($project_id) public function getSwimlanes($project_id)
{ {
$swimlanes = $this->db->table(self::TABLE) $swimlanes = $this->db->table(self::TABLE)
->columns('id', 'name') ->columns('id', 'name', 'description')
->eq('project_id', $project_id) ->eq('project_id', $project_id)
->eq('is_active', self::ACTIVE) ->eq('is_active', self::ACTIVE)
->orderBy('position', 'asc') ->orderBy('position', 'asc')
@@ -216,32 +216,30 @@ class Swimlane extends Base
* Add a new swimlane * Add a new swimlane
* *
* @access public * @access public
* @param integer $project_id * @param array $values Form values
* @param string $name
* @return integer|boolean * @return integer|boolean
*/ */
public function create($project_id, $name) public function create($values)
{ {
return $this->persist(self::TABLE, array( if (! $this->project->exists($values['project_id'])) {
'project_id' => $project_id, return 0;
'name' => $name, }
'position' => $this->getLastPosition($project_id), $values['position'] = $this->getLastPosition($values['project_id']);
)); return $this->persist(self::TABLE, $values);
} }
/** /**
* Rename a swimlane * Update a swimlane
* *
* @access public * @access public
* @param integer $swimlane_id Swimlane id * @param array $values Form values
* @param string $name Swimlane name
* @return bool * @return bool
*/ */
public function rename($swimlane_id, $name) public function update(array $values)
{ {
return $this->db->table(self::TABLE) return $this->db->table(self::TABLE)
->eq('id', $swimlane_id) ->eq('id', $values['id'])
->update(array('name' => $name)); ->update($values);
} }
/** /**

View File

@@ -6,7 +6,12 @@ use PDO;
use Core\Security; use Core\Security;
use Model\Link; use Model\Link;
const VERSION = 85; const VERSION = 86;
function version_86($pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
function version_85($pdo) function version_85($pdo)
{ {

View File

@@ -6,7 +6,12 @@ use PDO;
use Core\Security; use Core\Security;
use Model\Link; use Model\Link;
const VERSION = 65; const VERSION = 66;
function version_66($pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
function version_65($pdo) function version_65($pdo)
{ {

View File

@@ -6,7 +6,12 @@ use Core\Security;
use PDO; use PDO;
use Model\Link; use Model\Link;
const VERSION = 81; const VERSION = 82;
function version_82($pdo)
{
$pdo->exec("ALTER TABLE swimlanes ADD COLUMN description TEXT");
}
function version_81($pdo) function version_81($pdo)
{ {

View File

@@ -65,6 +65,14 @@
<div title="<?= t('Task count') ?>" class="board-column-header-task-count"> <div title="<?= t('Task count') ?>" class="board-column-header-task-count">
(<span><?= $swimlane['nb_tasks'] ?></span>) (<span><?= $swimlane['nb_tasks'] ?></span>)
<?php if (! empty($swimlane['description'])): ?>
<span title="<?= t('Description') ?>" class="tooltip"
data-href="<?= $this->url->href('swimlane', 'description', array('swimlane_id' => $swimlane['id'], 'project_id' => $swimlane['project_id'])) ?>">
<i class="fa fa-file-text-o"></i>
</span>
<?php endif ?>
</div> </div>
</th> </th>
<?php endif ?> <?php endif ?>

View File

@@ -12,6 +12,27 @@
<?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
<?= $this->form->label(t('Description'), 'description') ?>
<div class="form-tabs">
<div class="write-area">
<?= $this->form->textarea('description', $values, $errors) ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
</div>
<ul class="form-tabs-nav">
<li class="form-tab form-tab-selected">
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
</li>
<li class="form-tab">
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
</li>
</ul>
</div>
<div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div>
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= t('or') ?>

View File

@@ -16,6 +16,26 @@
<?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
<?= $this->form->label(t('Description'), 'description') ?>
<div class="form-tabs">
<div class="write-area">
<?= $this->form->textarea('description', $values, $errors) ?>
</div>
<div class="preview-area">
<div class="markdown"></div>
</div>
<ul class="form-tabs-nav">
<li class="form-tab form-tab-selected">
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
</li>
<li class="form-tab">
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
</li>
</ul>
</div>
<div class="form-help"><?= $this->url->doc(t('Write your text in Markdown'), 'syntax-guide') ?></div>
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div> </div>

View File

@@ -25,7 +25,7 @@
</li> </li>
<?php endif ?> <?php endif ?>
<li> <li>
<?= $this->url->link(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?> <?= $this->url->link(t('Edit'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li> </li>
<li> <li>
<?php if ($swimlane['is_active']): ?> <?php if ($swimlane['is_active']): ?>

View File

@@ -70,7 +70,7 @@ class BoardTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1'))); $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $s->create(1, 'test 1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 3))); $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 3)));
$this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));

View File

@@ -215,9 +215,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1'))); $this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes // create initial swimlanes
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(3, $s->create(1, 'S3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1); $default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default'; $default_swimlane1['default_swimlane'] = 'New Default';
@@ -277,9 +277,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1'))); $this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes // create initial swimlanes
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(3, $s->create(1, 'S3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1); $default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default'; $default_swimlane1['default_swimlane'] = 'New Default';
@@ -323,9 +323,9 @@ class ProjectDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1'))); $this->assertEquals(1, $p->create(array('name' => 'P1')));
// create initial swimlanes // create initial swimlanes
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(3, $s->create(1, 'S3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1); $default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default'; $default_swimlane1['default_swimlane'] = 'New Default';

View File

@@ -16,7 +16,7 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlanes = $s->getSwimlanes(1); $swimlanes = $s->getSwimlanes(1);
$this->assertNotEmpty($swimlanes); $this->assertNotEmpty($swimlanes);
@@ -37,8 +37,8 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(2, $s->create(1, 'Swimlane #2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$swimlanes = $s->getList(1); $swimlanes = $s->getList(1);
$expected = array('Default swimlane', 'Swimlane #1', 'Swimlane #2'); $expected = array('Default swimlane', 'Swimlane #1', 'Swimlane #2');
@@ -46,26 +46,26 @@ class SwimlaneTest extends Base
$this->assertEquals($expected, $swimlanes); $this->assertEquals($expected, $swimlanes);
} }
public function testRename() public function testUpdate()
{ {
$p = new Project($this->container); $p = new Project($this->container);
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
$this->assertEquals('Swimlane #1', $swimlane['name']); $this->assertEquals('Swimlane #1', $swimlane['name']);
$this->assertTrue($s->rename(1, 'foobar')); $this->assertTrue($s->update(array('id' => 1, 'name' => 'foobar')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
$this->assertEquals('foobar', $swimlane['name']); $this->assertEquals('foobar', $swimlane['name']);
} }
public function testRenameDefaultSwimlane() public function testUpdateDefaultSwimlane()
{ {
$p = new Project($this->container); $p = new Project($this->container);
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
@@ -92,7 +92,7 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
@@ -110,7 +110,7 @@ class SwimlaneTest extends Base
$this->assertEquals(1, $s->getLastPosition(1)); $this->assertEquals(1, $s->getLastPosition(1));
// Create a new swimlane // Create a new swimlane
$this->assertEquals(2, $s->create(1, 'Swimlane #2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$swimlane = $s->getById(2); $swimlane = $s->getById(2);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
@@ -134,7 +134,7 @@ class SwimlaneTest extends Base
$tf = new TaskFinder($this->container); $tf = new TaskFinder($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'swimlane_id' => 1)));
$task = $tf->getbyId(1); $task = $tf->getbyId(1);
@@ -156,9 +156,9 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(2, $s->create(1, 'Swimlane #2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$this->assertEquals(3, $s->create(1, 'Swimlane #3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
@@ -216,10 +216,10 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(2, $s->create(1, 'Swimlane #2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$this->assertEquals(3, $s->create(1, 'Swimlane #3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
$this->assertEquals(1, $swimlane['is_active']); $this->assertEquals(1, $swimlane['is_active']);
@@ -299,10 +299,10 @@ class SwimlaneTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'UnitTest'))); $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
$this->assertEquals(1, $s->create(1, 'Swimlane #1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertEquals(2, $s->create(1, 'Swimlane #2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Swimlane #2')));
$this->assertEquals(3, $s->create(1, 'Swimlane #3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'Swimlane #3')));
$swimlane = $s->getById(1); $swimlane = $s->getById(1);
$this->assertNotEmpty($swimlane); $this->assertNotEmpty($swimlane);
$this->assertEquals(1, $swimlane['is_active']); $this->assertEquals(1, $swimlane['is_active']);
@@ -383,10 +383,10 @@ class SwimlaneTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'P1'))); $this->assertEquals(1, $p->create(array('name' => 'P1')));
$this->assertEquals(2, $p->create(array('name' => 'P2'))); $this->assertEquals(2, $p->create(array('name' => 'P2')));
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(3, $s->create(1, 'S3')); $this->assertEquals(3, $s->create(array('project_id' => 1, 'name' => 'S3')));
$default_swimlane1 = $s->getDefault(1); $default_swimlane1 = $s->getDefault(1);
$default_swimlane1['default_swimlane'] = 'New Default'; $default_swimlane1['default_swimlane'] = 'New Default';

View File

@@ -225,8 +225,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(2, $p->create(array('name' => 'test2')));
$this->assertNotFalse($s->create(1, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
// We create a task // We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -258,9 +258,9 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(2, $p->create(array('name' => 'test2')));
$this->assertNotFalse($s->create(1, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #2')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
// We create a task // We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -291,9 +291,9 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(2, $p->create(array('name' => 'test2')));
$this->assertNotFalse($s->create(1, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #2')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
// We create a task // We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -574,8 +574,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(2, $p->create(array('name' => 'test2')));
$this->assertNotFalse($s->create(1, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #1')));
// We create a task // We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));
@@ -607,8 +607,8 @@ class TaskDuplicationTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $p->create(array('name' => 'test1')));
$this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(2, $p->create(array('name' => 'test2')));
$this->assertNotFalse($s->create(1, 'Swimlane #1')); $this->assertNotFalse($s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
$this->assertNotFalse($s->create(2, 'Swimlane #2')); $this->assertNotFalse($s->create(array('project_id' => 2, 'name' => 'Swimlane #2')));
// We create a task // We create a task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2, 'swimlane_id' => 1)));

View File

@@ -22,8 +22,8 @@ class TaskExportTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'Export Project'))); $this->assertEquals(1, $p->create(array('name' => 'Export Project')));
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertNotFalse($c->create(array('name' => 'Category #1', 'project_id' => 1))); $this->assertNotFalse($c->create(array('name' => 'Category #1', 'project_id' => 1)));
$this->assertNotFalse($c->create(array('name' => 'Category #2', 'project_id' => 1))); $this->assertNotFalse($c->create(array('name' => 'Category #2', 'project_id' => 1)));

View File

@@ -335,8 +335,8 @@ class TaskFilterTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'My project A'))); $this->assertEquals(1, $p->create(array('name' => 'My project A')));
$this->assertEquals(1, $s->create(1, 'Version 1.1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Version 1.1')));
$this->assertEquals(2, $s->create(1, 'Version 1.2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'Version 1.2')));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task1', 'swimlane_id' => 1))); $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task1', 'swimlane_id' => 1)));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task2', 'swimlane_id' => 2))); $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task2', 'swimlane_id' => 2)));
$this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task3', 'swimlane_id' => 0))); $this->assertNotFalse($tc->create(array('project_id' => 1, 'title' => 'task3', 'swimlane_id' => 0)));

View File

@@ -54,8 +54,8 @@ class TaskMovedDateSubscriberTest extends Base
$now = time(); $now = time();
$this->assertEquals(1, $p->create(array('name' => 'Project #1'))); $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $s->create(1, 'S1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'S1')));
$this->assertEquals(2, $s->create(1, 'S2')); $this->assertEquals(2, $s->create(array('project_id' => 1, 'name' => 'S2')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));
$task = $tf->getById(1); $task = $tf->getById(1);

View File

@@ -425,7 +425,7 @@ class TaskPositionTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1'))); $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $s->create(1, 'test 1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 1))); $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 1))); $this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'column_id' => 1)));
@@ -532,7 +532,7 @@ class TaskPositionTest extends Base
$s = new Swimlane($this->container); $s = new Swimlane($this->container);
$this->assertEquals(1, $p->create(array('name' => 'Project #1'))); $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $s->create(1, 'test 1')); $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'test 1')));
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1))); $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'column_id' => 1)));
$this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 2))); $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'column_id' => 2)));