Add project calendars (merge/refactoring of #490)

This commit is contained in:
Frederic Guillot
2015-01-17 17:11:51 -05:00
parent 4b45b2aa35
commit 84b0f0df90
50 changed files with 1438 additions and 173 deletions

View File

@@ -17,6 +17,7 @@
<?php if ($this->isManager($project['id'])): ?>
<?= $this->a('<i class="fa fa-cog"></i>', 'project', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Settings')) ?>&nbsp;
<?php endif ?>
<?= $this->a('<i class="fa fa-calendar"></i>', 'calendar', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>&nbsp;
<?= $this->a($this->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
</td>
<td class="dashboard-project-stats">

View File

@@ -11,7 +11,7 @@
</tr>
<?php foreach ($subtasks as $subtask): ?>
<tr>
<td class="task-table task-<?= $subtask['color_id'] ?>">
<td class="task-table color-<?= $subtask['color_id'] ?>">
<?= $this->a('#'.$subtask['task_id'], 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>
</td>
<td>

View File

@@ -11,7 +11,7 @@
</tr>
<?php foreach ($tasks as $task): ?>
<tr>
<td class="task-table task-<?= $task['color_id'] ?>">
<td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</td>
<td>

View File

@@ -23,13 +23,19 @@
<i class="fa fa-dashboard fa-fw"></i>
<?= $this->a(t('Activity'), 'project', 'activity', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->a(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->acl->isManagerActionAllowed($project['id'])): ?>
<li>
<i class="fa fa-line-chart fa-fw"></i>
<?= $this->a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
</li>
<li><i class="fa fa-cog fa-fw"></i>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->a(t('Configure'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
</ul>
</div>

View File

@@ -1,6 +1,6 @@
<?php if ($not_editable): ?>
<div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
<div class="task-board color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
<?= $this->a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
@@ -30,7 +30,7 @@
<?php else: ?>
<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
<div class="task-board draggable-item color-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"

View File

@@ -0,0 +1,29 @@
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= $this->a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<section class="sidebar-container">
<?= $this->render('calendar/sidebar', array(
'project' => $project,
'users_list' => $users_list,
'categories_list' => $categories_list,
'columns_list' => $columns_list,
'swimlanes_list' => $swimlanes_list,
'colors_list' => $colors_list,
'status_list' => $status_list
)) ?>
<div class="sidebar-content">
<div id="calendar"
data-save-url="<?= $this->u('calendar', 'save', array('project_id' => $project['id'])) ?>"
data-check-url="<?= $this->u('calendar', 'events', array('project_id' => $project['id'])) ?>"
data-check-interval="<?= $check_interval ?>"
data-translations='<?= $this->getCalendarTranslations() ?>'
>
</div>
</div>
</section>
</section>

View File

@@ -0,0 +1,40 @@
<div class="sidebar">
<ul class="no-bullet">
<li>
<?= t('Filter by user') ?>
</li>
<li>
<?= $this->formSelect('owner_id', $users_list, array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by category') ?>
</li>
<li>
<?= $this->formSelect('category_id', $categories_list, array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by column') ?>
</li>
<li>
<?= $this->formSelect('column_id', $columns_list, array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by swimlane') ?>
</li>
<li>
<?= $this->formSelect('swimlane_id', $swimlanes_list, array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by color') ?>
</li>
<li>
<?= $this->formSelect('color_id', $colors_list, array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by status') ?>
</li>
<li>
<?= $this->formSelect('is_active', $status_list, array(), array(), 'calendar-filter') ?>
</li>
</ul>
</div>

View File

@@ -14,6 +14,7 @@
<?= $this->js('assets/js/app.js') ?>
<?php endif ?>
<?= $this->css($this->u('app', 'colors'), false) ?>
<?= $this->css('assets/css/app.css') ?>
<link rel="icon" type="image/png" href="assets/img/favicon.png">

View File

@@ -1,4 +1,4 @@
<div class="task-<?= $task['color_id'] ?> task-show-details">
<div class="color-<?= $task['color_id'] ?> task-show-details">
<h2><?= $this->e('#'.$task['id'].' '.$task['title']) ?></h2>
<?php if ($task['score']): ?>
<span class="task-score"><?= $this->e($task['score']) ?></span>

View File

@@ -12,7 +12,7 @@
</tr>
<?php foreach ($tasks as $task): ?>
<tr>
<td class="task-table task-<?= $task['color_id'] ?>">
<td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->a('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>