Add pagination and sorting to the dashboard

This commit is contained in:
Frédéric Guillot
2014-11-15 21:49:06 -05:00
parent af93754ec9
commit aa6fffb05a
21 changed files with 582 additions and 300 deletions

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
require __DIR__.'/../app/common.php';
use Model\Project;
use Model\ProjectPermission;
$projectModel = new Project($container);
$permissionModel = new ProjectPermission($container);
for ($i = 0; $i < 100; $i++) {
$id = $projectModel->create(array(
'name' => 'Project #'.$i
));
$permissionModel->allowUser($id, 1);
}

View File

@@ -4,9 +4,35 @@
require __DIR__.'/../app/common.php';
use Model\Task;
use Model\SubTask;
use Model\Project;
use Model\ProjectPermission;
use Model\User;
$task_per_column = 250;
$taskModel = new Task($registry);
$task_per_column = 50;
$userModel = new User($container);
$projectModel = new Project($container);
$permissionModel = new ProjectPermission($container);
$taskModel = new Task($container);
$subtaskModel = new SubTask($container);
for ($i = 0; $i <= 100; $i++) {
$id = $projectModel->create(array(
'name' => 'Project #'.$i
));
$permissionModel->allowUser($id, 1);
}
for ($i = 0; $i <= 500; $i++) {
$userModel->create(array(
'username' => 'user'.$i,
'password' => 'password'.$i,
'name' => 'User #'.$i,
'email' => 'user'.$i.'@localhost',
));
}
foreach (array(1, 2, 3, 4) as $column_id) {
@@ -14,14 +40,21 @@ foreach (array(1, 2, 3, 4) as $column_id) {
$task = array(
'title' => 'Task #'.$i.'-'.$column_id,
'project_id' => 1,
'project_id' => mt_rand(1, 100),
'column_id' => $column_id,
'owner_id' => rand(0, 1),
'color_id' => rand(0, 1) === 0 ? 'green' : 'purple',
'score' => rand(0, 21),
'is_active' => rand(0, 1),
'owner_id' => 1,
'color_id' => mt_rand(0, 1) === 0 ? 'green' : 'purple',
'score' => mt_rand(0, 21),
'is_active' => mt_rand(0, 1),
);
$taskModel->create($task);
$id = $taskModel->create($task);
$subtaskModel->create(array(
'title' => 'Subtask of task #'.$id,
'user_id' => 1,
'status' => mt_rand(0, 2),
'task_id' => $id,
));
}
}

View File

@@ -5,7 +5,7 @@ require __DIR__.'/../app/common.php';
use Model\User;
$userModel = new User($registry);
$userModel = new User($container);
for ($i = 0; $i < 500; $i++) {
$userModel->create(array(